mirror of
https://github.com/Nystik-gh/ignis.git
synced 2026-06-17 04:35:53 +00:00
ask user to install bridge plugin for vault copied to server at runtime
This commit is contained in:
36
src/ui/bootstrap.js
vendored
36
src/ui/bootstrap.js
vendored
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user