improve vault manager, refactor vault operations into shared service.

This commit is contained in:
Nystik
2026-03-18 18:52:38 +01:00
parent 408eb7fb54
commit e1d484fd28
5 changed files with 159 additions and 68 deletions

View File

@@ -15,6 +15,7 @@ import * as eventsShim from "./node/events.js";
import * as osShim from "./node/os.js";
import * as netShim from "./node/net.js";
import * as httpShim from "./node/http.js";
import { vaultService } from "../services/vault-service.js";
const DEBUG = true;
const _accessLog = new Map(); // "module.property" -> count
@@ -217,14 +218,7 @@ window.__currentVaultId = _urlParams.get("vault") || "";
(function initVaultList() {
try {
const xhr = new XMLHttpRequest();
xhr.open("GET", "/api/vault/list", false);
xhr.send();
if (xhr.status === 200) {
window.__vaultList = JSON.parse(xhr.responseText);
}
vaultService.listVaultsSync();
} catch (e) {
window.__vaultList = [];
}