import { html, PageHeader, Tabs, esc, definePage, renderGuard, modelFetch, getModel } from '/static/hoover/index.js'; const logTabs = [ { key: 'journal', label: 'Journal' }, { key: 'nginx-access', label: 'Nginx Access' }, { key: 'nginx-error', label: 'Nginx Error' }, { key: 'dnsmasq', label: 'Dnsmasq' }, { key: 'app', label: 'App' }, ]; export default definePage({ title: 'Logs - Vacuum Wall', init() { return { logs: getModel('logs'), activeTab: 'journal', }; }, render(state) { const logData = state.logs.data; const stale = logData?.tab !== state.activeTab; const guard = renderGuard(state.logs, 'Logs', 'System and service logs', stale ? undefined : logData?.data); if (guard) return guard; const lines = logData.data || []; const tab = logTabs.find(t => t.key === state.activeTab) || logTabs[0]; const lineVnodes = lines.map((line, i) => html`
${lineVnodes}