mirror of
https://github.com/Nystik-gh/ignis.git
synced 2026-06-17 04:35:53 +00:00
fix issues with dialogs, and issue with vault rename
This commit is contained in:
63
ui/bootstrap.js
vendored
63
ui/bootstrap.js
vendored
@@ -9,3 +9,66 @@ export function showVaultManager() {
|
||||
props: { vaultService },
|
||||
});
|
||||
}
|
||||
|
||||
export function showMessageDialog(title, message) {
|
||||
return new Promise((resolve) => {
|
||||
const dialog = new window.IgnisUI.MessageDialog({
|
||||
target: document.body,
|
||||
props: { title, message },
|
||||
});
|
||||
|
||||
dialog.$on("confirm", () => {
|
||||
dialog.$destroy();
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function showConfirmDialog(
|
||||
title,
|
||||
message,
|
||||
description,
|
||||
confirmText = "OK",
|
||||
) {
|
||||
return new Promise((resolve) => {
|
||||
const dialog = new window.IgnisUI.ConfirmDialog({
|
||||
target: document.body,
|
||||
props: { title, message, description, confirmText },
|
||||
});
|
||||
|
||||
dialog.$on("confirm", () => {
|
||||
dialog.$destroy();
|
||||
resolve(true);
|
||||
});
|
||||
|
||||
dialog.$on("cancel", () => {
|
||||
dialog.$destroy();
|
||||
resolve(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function showPromptDialog(
|
||||
title,
|
||||
label,
|
||||
placeholder = "",
|
||||
value = "",
|
||||
confirmText = "OK",
|
||||
) {
|
||||
return new Promise((resolve) => {
|
||||
const dialog = new window.IgnisUI.PromptDialog({
|
||||
target: document.body,
|
||||
props: { title, label, placeholder, value, confirmText },
|
||||
});
|
||||
|
||||
dialog.$on("confirm", (event) => {
|
||||
dialog.$destroy();
|
||||
resolve(event.detail);
|
||||
});
|
||||
|
||||
dialog.$on("cancel", () => {
|
||||
dialog.$destroy();
|
||||
resolve(null);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user