- );
-}
-
-function ConnectionDetail({ state, actions }: { state: MtmConnectViewState; actions: MtmConnectPanelActions }): ReactElement {
- const record = selectedRecord(state);
- const adapter = selectedAdapter(state, record);
- if (record === undefined || adapter === undefined) return
-
-
-
{record.instance.label}
-
{adapter.label} · {record.instance.fixture ? "测试连接" : "托管连接"}
-
-
-
-
-
目标状态{record.instance.desired === "enabled" ? "启用" : "停用"}
-
连接代次{record.observation.generation}
-
目标{String(root ?? adapter.capabilities[0]?.supportedTargets[0] ?? "测试环境")}
-
-
-
-
-
-
-
-
能力
{adapter.capabilities.length} 项
- {adapter.capabilities.map((capability) =>
)}
-
- );
-}
-
-export function MtmConnectPanel({ state, actions }: { state: MtmConnectViewState; actions: MtmConnectPanelActions }): ReactElement {
- const online = state.snapshot.connections.filter((record) => record.observation.status === "online").length;
- const enabled = state.snapshot.connections.filter((record) => record.instance.desired === "enabled").length;
- return (
-
-
-
- {state.snapshot.connections.length} 个连接
- {enabled} 个已启用
- {online} 个在线
-
- {state.loading ?
正在读取连接状态
: null}
-
-
- 连接
-
- {state.snapshot.connections.length === 0 ?
暂无连接
: state.snapshot.connections.map((record) => (
-
- ))}
-
-
-
-
- {state.notice !== undefined ?
{state.notice}
: null}
-
- );
-}
diff --git a/packages/mtmharness/src/features/connect/client/index.test.ts b/packages/mtmharness/src/features/connect/client/index.test.ts
deleted file mode 100644
index b1668e8..0000000
--- a/packages/mtmharness/src/features/connect/client/index.test.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-// @vitest-environment jsdom
-import { describe, expect, it } from "vitest";
-import { createDemoRegistry } from "../core/registry.ts";
-import { apply } from "./index.ts";
-
-interface Registered {
- readonly options: Record