Some checks are pending
build-and-push / image (push) Waiting to run
- Implemented demand pane for managing trend-driven design jobs. - Created diffusion pane for generating images via Stable Diffusion. - Added inbox pane for sweeping and routing artifacts through the CxAI inbox classifier. - Developed items pane for CRUD operations against /api/items. - Introduced lang pane for running language pipelines. - Established mac pane for macOS app distribution information. - Integrated slack pane for sending messages and displaying diagnostics. - Built system pane for process introspection and version information. - Launched tools pane for browsing and invoking MCP tools. - Set up websocket pane for connecting to the /ws/echo service.
41 lines
1.4 KiB
JavaScript
41 lines
1.4 KiB
JavaScript
// panes/system.js — /api/version + /api/system.
|
|
import { registerPane } from '../app.js';
|
|
import { jget, formatUptime } from '../lib/api.js';
|
|
import { fmtJSON } from '../lib/ui.js';
|
|
|
|
const TPL = `
|
|
<div class="pane-head">
|
|
<div><div class="title">System</div><div class="sub">Process introspection.</div></div>
|
|
<div class="grow"></div>
|
|
<button class="btn btn-secondary" id="sys-refresh">Refresh</button>
|
|
</div>
|
|
<div class="grid cols-2">
|
|
<div class="card"><div class="card-title"><h2>Version</h2></div><pre id="sys-v">…</pre></div>
|
|
<div class="card">
|
|
<div class="card-title"><h2>System</h2><span class="muted mono" id="sys-up">—</span></div>
|
|
<pre id="sys-s">…</pre>
|
|
</div>
|
|
</div>
|
|
`;
|
|
|
|
async function load(host) {
|
|
try {
|
|
const [v, s] = await Promise.all([jget('/api/version'), jget('/api/system')]);
|
|
host.querySelector('#sys-v').textContent = fmtJSON(v);
|
|
host.querySelector('#sys-s').textContent = fmtJSON(s);
|
|
if (s.uptime_seconds != null) host.querySelector('#sys-up').textContent = formatUptime(s.uptime_seconds);
|
|
} catch (e) {
|
|
host.querySelector('#sys-v').textContent = 'error: ' + e.message;
|
|
}
|
|
}
|
|
|
|
registerPane('system', {
|
|
label: 'System',
|
|
init(host) {
|
|
host.innerHTML = TPL;
|
|
host.querySelector('#sys-refresh').addEventListener('click', () => load(host));
|
|
load(host);
|
|
},
|
|
refresh: load,
|
|
});
|