ask user to install bridge plugin for vault copied to server at runtime

This commit is contained in:
Nystik
2026-03-22 16:17:26 +01:00
parent 452fb17541
commit 5b01a9cdad
7 changed files with 255 additions and 2 deletions

36
src/ui/bootstrap.js vendored
View File

@@ -48,6 +48,42 @@ export function showConfirmDialog(
});
}
export function showPluginInstallDialog(vaultId) {
return new Promise((resolve) => {
const dialog = new window.IgnisUI.PluginInstallDialog({
target: document.body,
});
dialog.$on("install", async () => {
try {
await fetch("/api/vault/install-plugin", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ vault: vaultId }),
});
} catch (e) {
console.error("[ignis] Failed to install plugin:", e);
}
dialog.$destroy();
resolve("install");
});
dialog.$on("dismiss", async () => {
try {
await fetch("/api/vault/install-plugin", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ vault: vaultId, dismiss: true }),
});
} catch (e) {
console.error("[ignis] Failed to dismiss plugin prompt:", e);
}
dialog.$destroy();
resolve("dismiss");
});
});
}
export function showPromptDialog(
title,
label,