diff --git a/ui/index.html b/ui/index.html
index eb5776e..2a37e81 100644
--- a/ui/index.html
+++ b/ui/index.html
@@ -3,6 +3,7 @@
{{ t('status.noIssues') }}
-
-
{{ issue.severity }}
-
{{ issue.code }}
-
{{ issue.path }}
+
{{ issue.severity || 'warning' }}
+
+
+ {{ issue.path }}
+ {{ issue.code }}
+
+
{{ issue.message }}
-
{{ issue.message }}
`
@@ -70,13 +98,19 @@
GnBadge,
GnButton,
GnCard,
+ GnChip,
GnConfirmDialog,
GnDescriptionList,
+ GnDrawer,
GnEmptyState,
GnInput,
GnMetricCard,
+ GnModal,
GnPageHeader,
GnSearchField,
+ GnTable,
+ GnTabs,
+ GnTextarea,
GnToolbar,
GnUserCard,
IssueList
@@ -113,6 +147,9 @@
content: defaultDocTemplate()
});
const proposalRunning = ref(false);
+ const proposalOpen = ref(false);
+ const historyOpen = ref(false);
+ const mobileDocView = ref("list");
const inventoryTypes = ref([]);
const inventoryType = ref("");
@@ -120,6 +157,7 @@
const inventoryFilter = ref("");
const selectedInventoryId = ref("");
const inventoryRaw = ref(false);
+ const inventoryTab = ref("fields");
const inventoryRawText = ref("");
const inventoryLoading = ref(false);
const inventoryError = ref("");
@@ -186,8 +224,7 @@
{ id: "status", label: t("nav.status"), icon: "ph-heartbeat" },
...(authEnabled.value && user.value
? [{ id: "keys", label: t("nav.keys"), icon: "ph-key" }]
- : []),
- { id: "settings", label: t("nav.settings"), icon: "ph-sliders" }
+ : [])
]);
const pageMeta = computed(
@@ -250,6 +287,35 @@
}
]);
+ const docFrontmatterItems = computed(() => {
+ const frontmatter = selectedDoc.value?.frontmatter || {};
+ const priority = [
+ "owner",
+ "status",
+ "last_reviewed",
+ "review_interval",
+ "confidence",
+ "source_of_truth"
+ ];
+ const keys = Object.keys(frontmatter).sort((a, b) => {
+ const ai = priority.indexOf(a);
+ const bi = priority.indexOf(b);
+ if (ai === -1 && bi === -1) return a.localeCompare(b);
+ if (ai === -1) return 1;
+ if (bi === -1) return -1;
+ return ai - bi;
+ });
+ return keys.map(key => ({
+ key,
+ term: readableKey(key),
+ value: displayValue(frontmatter[key])
+ }));
+ });
+
+ const renderedDocBody = computed(() =>
+ renderMarkdown(selectedDoc.value?.body || "")
+ );
+
const filteredInventory = computed(() => {
const query = inventoryFilter.value.trim().toLowerCase();
if (!query) return inventoryRecords.value;
@@ -265,6 +331,22 @@
item => item.id === selectedInventoryId.value
) || null
);
+ const inventoryFieldItems = computed(() =>
+ Object.entries(selectedInventoryRecord.value || {}).map(([key, value]) => ({
+ key,
+ term: readableKey(key),
+ value: displayValue(value)
+ }))
+ );
+ const inventoryColumns = computed(() => [
+ { key: "name", label: t("common.name") },
+ { key: "id", label: t("inventory.recordId") },
+ { key: "host", label: t("inventory.host") }
+ ]);
+ const inventoryTabs = computed(() => [
+ { id: "fields", label: t("common.fields"), icon: "ph-list-dashes" },
+ { id: "json", label: t("common.raw"), icon: "ph-code" }
+ ]);
const inventoryDisplay = computed(() => {
if (inventoryRaw.value) return inventoryRawText.value;
return selectedInventoryRecord.value
@@ -300,6 +382,24 @@
return versionNo === latest;
};
+ const changeDetailItems = computed(() => {
+ const change = selectedChange.value;
+ if (!change) return [];
+ return [
+ { key: "summary", term: t("common.summary"), value: change.summary },
+ { key: "status", term: t("common.status"), value: statusLabel(change.status) },
+ { key: "kind", term: t("common.type"), value: change.kind },
+ { key: "target", term: t("common.target"), value: change.target },
+ { key: "reason", term: t("common.reason"), value: change.reason || "—" },
+ { key: "created", term: t("common.created"), value: formatDate(change.created_at) },
+ {
+ key: "actor",
+ term: t("auth.account"),
+ value: [change.actor_name, change.actor_kind, change.via].filter(Boolean).join(" · ") || "—"
+ }
+ ];
+ });
+
async function request(path, options = {}) {
const response = await fetch(`/api${path}`, {
credentials: "same-origin",
@@ -399,7 +499,7 @@
) {
await loadDoc(selectedDocPath.value);
} else if (docs.value.length) {
- await loadDoc(docs.value[0].path);
+ await loadDoc(docs.value[0].path, false);
}
}
if (inventoryResult.status === "fulfilled") {
@@ -444,10 +544,11 @@
}
}
- async function loadDoc(path) {
+ async function loadDoc(path, openDetail = true) {
if (!path) return;
if (docQuery.value) docQuery.value = "";
selectedDocPath.value = path;
+ if (openDetail) mobileDocView.value = "detail";
selectedDoc.value = null;
docLoading.value = true;
docError.value = "";
@@ -509,6 +610,34 @@
await requestDiff(Math.max(1, latest - 1), latest);
}
+ function openProposal() {
+ if (!selectedDoc.value) return;
+ proposal.target = selectedDocPath.value;
+ proposal.content =
+ selectedDoc.value.raw || selectedDoc.value.body || defaultDocTemplate();
+ proposal.summary = "";
+ proposal.reason = "";
+ proposalOpen.value = true;
+ }
+
+ function openHistory() {
+ historyOpen.value = true;
+ if (selectedDocPath.value && !docHistory.value.length) {
+ loadDoc(selectedDocPath.value);
+ }
+ }
+
+ function backToDocList() {
+ mobileDocView.value = "list";
+ }
+
+ function switchInventoryTab(tab) {
+ inventoryTab.value = tab;
+ if (tab === "json" && !inventoryRawText.value) {
+ refreshInventoryRaw();
+ }
+ }
+
function restoreVersion(versionNo) {
askConfirm({
title: t("docs.restoreConfirm"),
@@ -563,6 +692,7 @@
});
proposal.summary = "";
proposal.reason = "";
+ proposalOpen.value = false;
activePage.value = "changes";
drawerOpen.value = false;
await refreshChanges();
@@ -659,9 +789,10 @@
inventoryLoading.value = true;
inventoryError.value = "";
try {
+ inventoryRawText.value = "";
inventoryRecords.value = (await apiGet(`/inventory/${encodeURIComponent(type)}`)) || [];
selectedInventoryId.value = inventoryRecords.value[0]?.id || "";
- if (inventoryRaw.value) await refreshInventoryRaw();
+ if (inventoryTab.value === "json") await refreshInventoryRaw();
} catch (error) {
inventoryRecords.value = [];
inventoryError.value =
@@ -880,6 +1011,7 @@
function go(page) {
activePage.value = page;
+ if (page === "docs") mobileDocView.value = "list";
drawerOpen.value = false;
if (page === "keys") loadKeys();
if (page === "status") refreshStatus();
@@ -922,9 +1054,11 @@
applyingChange,
applyChange,
authEnabled,
+ backToDocList,
booting,
canWrite,
changeError,
+ changeDetailItems,
changeLoading,
changes,
changeStatusVariant,
@@ -936,6 +1070,7 @@
dismissIssued,
docDiff,
docError,
+ docFrontmatterItems,
docHistory,
docLoading,
docQuery,
@@ -947,12 +1082,17 @@
go,
healthStatus,
historyError,
+ historyOpen,
+ inventoryColumns,
inventoryDisplay,
inventoryError,
+ inventoryFieldItems,
inventoryFilter,
inventoryLoading,
inventoryRaw,
inventoryRecords,
+ inventoryTab,
+ inventoryTabs,
inventoryType,
inventoryTypes,
isAdmin,
@@ -974,14 +1114,19 @@
localeOverride,
login,
logout,
+ mobileDocView,
navItems,
+ openHistory,
+ openProposal,
pageError,
pageSubtitle,
pageTitle,
pretty,
proposal,
+ proposalOpen,
proposalRunning,
refreshAll,
+ renderedDocBody,
restoreVersion,
revokeKey,
rotateKey,
@@ -1000,6 +1145,7 @@
storage,
storageIsDb,
submitProposal,
+ switchInventoryTab,
t,
toast,
toggleAllKeys,
@@ -1063,7 +1209,7 @@
:avatar="{ initials: userInitials }"
compact
/>
-