feat: introduce initial ObsiGate Single Page Application with Python backend for vault browsing and search.
This commit is contained in:
+9
-9
@@ -3388,7 +3388,7 @@
|
||||
type: "checkbox",
|
||||
id: `hide-hidden-${vault.name}`,
|
||||
"data-vault": vault.name,
|
||||
checked: settings.hideHiddenFiles || false
|
||||
checked: settings.hideHiddenFiles ? "true" : false
|
||||
}),
|
||||
el("span", { class: "config-toggle-slider" })
|
||||
]),
|
||||
@@ -3422,16 +3422,10 @@
|
||||
};
|
||||
|
||||
promises.push(
|
||||
fetch(`/api/vaults/${encodeURIComponent(vaultName)}/settings`, {
|
||||
api(`/api/vaults/${encodeURIComponent(vaultName)}/settings`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(settings)
|
||||
}).then(async response => {
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => ({ detail: response.statusText }));
|
||||
throw new Error(errorData.detail || `HTTP ${response.status}`);
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
);
|
||||
});
|
||||
@@ -4287,7 +4281,13 @@
|
||||
function el(tag, attrs, children) {
|
||||
const e = document.createElement(tag);
|
||||
if (attrs) {
|
||||
Object.entries(attrs).forEach(([k, v]) => e.setAttribute(k, v));
|
||||
Object.entries(attrs).forEach(([k, v]) => {
|
||||
// Skip boolean false for standard HTML boolean attributes to avoid setAttribute("checked", "false") bug
|
||||
if (v === false && (k === "checked" || k === "disabled" || k === "hidden" || k === "required" || k === "readonly")) {
|
||||
return;
|
||||
}
|
||||
e.setAttribute(k, v);
|
||||
});
|
||||
}
|
||||
if (children) {
|
||||
children.forEach((c) => { if (c) e.appendChild(c); });
|
||||
|
||||
Reference in New Issue
Block a user