Admin view in the web UI

This commit is contained in:
Ian Gulliver
2026-10-14 21:06:30 -07:00
parent b2bd894677
commit 4a2bbe0859
34 changed files with 838 additions and 214 deletions
+7 -3
View File
@@ -1,12 +1,16 @@
import { h, replace } from "./dom.js";
import type { View } from "./panes.js";
import { activeTasks, findTask, onEach, state } from "./state.js";
export function mountNavbar(root: HTMLElement, showInbox: () => void): void {
export function mountNavbar(root: HTMLElement, show: (view: View) => void): void {
const crumb = h("button", { class: "crumb", title: "Switch task (⌘K)" });
crumb.onclick = openSwitcher;
const inbox = h("button", { class: "inbox-count" });
inbox.onclick = showInbox;
inbox.onclick = () => show("inbox");
const admin = h("button", { class: "nav-link" }, "Admin");
admin.onclick = () => show("admin");
const conn = h("span", { class: "connection down", title: "connecting" });
const me = h("span", { class: "me" });
@@ -26,7 +30,7 @@ export function mountNavbar(root: HTMLElement, showInbox: () => void): void {
};
onEach(["me", "projects", "tasks", "inbox", "selection", "connection"], render);
replace(root, h("a", { href: "#/", class: "brand" }, "byre"), crumb, h("span", { class: "spacer" }), inbox, conn, me);
replace(root, h("a", { href: "#/", class: "brand" }, "byre"), crumb, h("span", { class: "spacer" }), inbox, admin, conn, me);
render();
addEventListener("keydown", (e) => {