Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions frontend/src/pages/status/StatusPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ function StatusContent({ status }: { status: StatusResponse }) {
const release = status.release ?? {};
const legacy = status.legacy ?? {};
const legacyDocker = asRecord(legacy.docker);
const runtimeToolRecords = withRuntimeToolPurposes(asRecordArray(legacy.software));
const releaseLabel = formatValue(release.releaseTag) || shortCommit(status.build?.sourceCommit) || "unknown";
const releaseDetail = shortCommit(release.sourceCommit) || shortCommit(status.build?.sourceCommit) || formatValue(status.build?.sourceRefName);
const compilerState = formatValue(status.umplesync?.alive) === "true" ? "Running" : "Not running";
Expand Down Expand Up @@ -180,28 +181,28 @@ function StatusContent({ status }: { status: StatusResponse }) {

<StatusSection
title="Diagnostics"
description="Counters and legacy status probes retained from the full status payload"
description="Counters and operational probes for runtime tools, compiler listener, containers, and execution settings"
testId="status-diagnostics"
>
<div className="grid gap-4 xl:grid-cols-2">
<SectionBlock title="Counters">
<KeyValueTable data={status.counters} compact />
</SectionBlock>
<SectionBlock title="Legacy visits">
<SectionBlock title="Visit counter">
<KeyValueTable data={asRecord(legacy.visits)} compact />
</SectionBlock>
<SectionBlock title="Legacy software">
<RecordsTable records={asRecordArray(legacy.software)} primary="name" />
<SectionBlock title="Runtime tools">
<RecordsTable records={runtimeToolRecords} primary="name" />
</SectionBlock>
<SectionBlock title="Legacy listener">
<SectionBlock title="Compiler listener">
<KeyValueTable data={asRecord(legacy.listener)} compact />
</SectionBlock>
<SectionBlock title="Legacy Docker" className="xl:col-span-2">
<SectionBlock title="Container stats" className="xl:col-span-2">
<KeyValueTable data={withoutKeys(legacyDocker, ["stats"])} compact />
<Separator className="my-3" />
<RecordsTable records={asRecordArray(legacyDocker.stats)} primary="name" />
</SectionBlock>
<SectionBlock title="Legacy execution" className="xl:col-span-2">
<SectionBlock title="Code execution settings" className="xl:col-span-2">
<KeyValueTable data={asRecord(legacy.execution)} compact />
</SectionBlock>
</div>
Expand Down Expand Up @@ -297,6 +298,31 @@ function buildHealthRecords(status: StatusResponse): HealthRecord[] {
return [...services, ...checks, ...dependencies];
}

function withRuntimeToolPurposes(records: Array<Record<string, unknown>>): Array<Record<string, unknown>> {
return records.map((record) => ({
name: record.name,
purpose: runtimeToolPurpose(formatValue(record.name)),
...withoutKeys(record, ["name"]),
}));
}

function runtimeToolPurpose(name: string): string {
switch (name) {
case "php":
return "Old UmpleOnline PHP runtime probe; not required by the new app";
case "java":
return "Runs umplesync.jar, the Umple compiler service";
case "dot":
return "Graphviz renderer for diagram layout output";
case "gcc":
return "Native C/C++ compiler used by generated-code workflows";
case "docker":
return "Container runtime used for services and isolated code execution";
default:
return "Runtime command reported by the status endpoint";
}
}

function HealthTable({ records }: { records: HealthRecord[] }) {
if (records.length === 0) {
return <p className="text-sm text-muted-foreground">No health records reported.</p>;
Expand Down
3 changes: 2 additions & 1 deletion frontend/tests/e2e/status.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ test.describe('Status dashboard', () => {
await expect(page.getByTestId('status-release-runtime')).toContainText('e3cdcad2cf7de3b9e510efc58856086406004718')
await expect(page.getByTestId('status-release-runtime')).toContainText('http://code-exec:3000')
await expect(page.getByTestId('status-umplesync')).toContainText('Umple compiler listener ready')
await expect(page.getByTestId('status-diagnostics')).toContainText('Legacy software')
await expect(page.getByTestId('status-diagnostics')).toContainText('Runtime tools')
await expect(page.getByTestId('status-diagnostics')).toContainText('Runs umplesync.jar')
await expect(page.getByTestId('status-diagnostics')).toContainText('umpleonline-backend')
await expect(page.locator('.react-resizable-handle')).toHaveCount(0)
await expect(page.locator('.status-widget-drag-handle')).toHaveCount(0)
Expand Down
Loading