Admin view in the web UI
This commit is contained in:
Vendored
+5
-3
@@ -1,10 +1,12 @@
|
||||
import { h, replace } from "./dom.js";
|
||||
import { activeTasks, findTask, onEach, state } from "./state.js";
|
||||
export function mountNavbar(root, showInbox) {
|
||||
export function mountNavbar(root, show) {
|
||||
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" });
|
||||
const render = () => {
|
||||
@@ -19,7 +21,7 @@ export function mountNavbar(root, showInbox) {
|
||||
replace(me, state.me?.display_name ?? "");
|
||||
};
|
||||
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) => {
|
||||
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
||||
|
||||
Reference in New Issue
Block a user