refactor(platform): bound lab canon and contour identity
This commit is contained in:
@@ -478,7 +478,7 @@ export function ComputeContourSettingsWindow({
|
||||
<dd>{network?.broker.bind_address ?? "—"}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Worker 006</dt>
|
||||
<dt>{contour?.display_name ?? "Worker"}</dt>
|
||||
<dd>{network?.worker.reachable
|
||||
? `${network.worker.mqtt_host ?? "—"}:${network.worker.mqtt_port ?? "—"}`
|
||||
: "Недоступен"}</dd>
|
||||
|
||||
@@ -28,7 +28,7 @@ export function useComputeContourSettings(): ComputeContourSettingsController {
|
||||
{
|
||||
label: "Обновить телеметрию выбранного контура",
|
||||
icon: "refresh",
|
||||
disabled: contours.selectedContour?.contour_id !== "worker-006",
|
||||
disabled: contours.selectedContour === null,
|
||||
onClick: contours.refreshTelemetry,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -48,7 +48,11 @@ export function useWorkerTelemetry(
|
||||
setError(null);
|
||||
} catch (reason: unknown) {
|
||||
if (controller.signal.aborted) return;
|
||||
setError(reason instanceof Error ? reason.message : "Worker 006 не ответил.");
|
||||
setError(
|
||||
reason instanceof Error
|
||||
? reason.message
|
||||
: "Вычислительный контур не ответил.",
|
||||
);
|
||||
} finally {
|
||||
if (!controller.signal.aborted) setLoading(false);
|
||||
}
|
||||
|
||||
@@ -62,8 +62,7 @@ export function ComputeModulesWorkspace() {
|
||||
selectedContour,
|
||||
telemetryRefreshGeneration,
|
||||
} = useComputeContours();
|
||||
const legacyDiagnostic = selectedContour?.contour_id === "worker-006"
|
||||
&& selectedContour.telemetry_mode === "legacy-ssh";
|
||||
const legacyDiagnostic = selectedContour?.telemetry_mode === "legacy-ssh";
|
||||
const { telemetry, error } = useWorkerTelemetry(
|
||||
selectedContour?.contour_id ?? null,
|
||||
(selectedContour?.telemetry_poll_interval_seconds ?? 3) * 1_000,
|
||||
|
||||
@@ -20,8 +20,7 @@ export function NetworkWorkspace() {
|
||||
selectedContour,
|
||||
telemetryRefreshGeneration,
|
||||
} = useComputeContours();
|
||||
const legacyDiagnostic = selectedContour?.contour_id === "worker-006"
|
||||
&& selectedContour.telemetry_mode === "legacy-ssh";
|
||||
const legacyDiagnostic = selectedContour?.telemetry_mode === "legacy-ssh";
|
||||
const { telemetry, error } = useWorkerTelemetry(
|
||||
selectedContour?.contour_id ?? null,
|
||||
(selectedContour?.telemetry_poll_interval_seconds ?? 3) * 1_000,
|
||||
|
||||
@@ -9,7 +9,7 @@ async function read(relativePath) {
|
||||
return readFile(new URL(relativePath, sourceRoot), "utf8");
|
||||
}
|
||||
|
||||
test("Worker 006 telemetry remains a bounded system feature slice", async () => {
|
||||
test("Compute-contour telemetry remains a bounded system feature slice", async () => {
|
||||
const [
|
||||
productModel,
|
||||
workspaceHub,
|
||||
@@ -88,6 +88,18 @@ test("Worker 006 telemetry remains a bounded system feature slice", async () =>
|
||||
assert.match(panelActions, /actions\.push\(\.\.\.systemUtilityActions\)/);
|
||||
assert.match(contourSettingsHook, /icon: "refresh"/);
|
||||
assert.match(contourSettingsHook, /icon: "settings"/);
|
||||
assert.doesNotMatch(contourSettingsHook, /contour_id\s*!==\s*"worker-006"/);
|
||||
assert.doesNotMatch(
|
||||
computeWorkspace,
|
||||
/contour_id\s*===\s*"worker-006"[\s\S]*telemetry_mode/,
|
||||
);
|
||||
assert.doesNotMatch(
|
||||
networkWorkspace,
|
||||
/contour_id\s*===\s*"worker-006"[\s\S]*telemetry_mode/,
|
||||
);
|
||||
assert.doesNotMatch(contourSettings, /<dt>Worker 006<\/dt>/);
|
||||
assert.match(contourSettings, /contour\?\.display_name/);
|
||||
assert.match(telemetryPolling, /Вычислительный контур не ответил\./);
|
||||
assert.match(contourSettings, /FieldFrame label="Операционная система"/);
|
||||
assert.match(contourSettings, /label="Обновление интерфейса"/);
|
||||
assert.match(contourSettings, /label="Интервал MQTT агента"/);
|
||||
|
||||
Reference in New Issue
Block a user