fix issues with dialogs, and issue with vault rename

This commit is contained in:
Nystik
2026-03-18 19:11:13 +01:00
parent e1d484fd28
commit 2418f125f0
6 changed files with 201 additions and 32 deletions

63
ui/bootstrap.js vendored
View File

@@ -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);
});
});
}