mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-05-12 05:39:39 +08:00
- 新增 JVM 持续监控仪表盘、图表、状态卡和详情面板 - 统一概览、资源浏览、审计页面的 JVM 工作台布局 - Sidebar 和 TabManager 支持监控入口、诊断入口兜底和上下文切换 - 补充前端状态模型、展示文案和组件回归测试
65 lines
1.6 KiB
TypeScript
65 lines
1.6 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import {
|
|
buildJVMDiagnosticActionDescriptor,
|
|
buildJVMMonitoringActionDescriptors,
|
|
} from "./jvmSidebarActions";
|
|
|
|
describe("jvmSidebarActions", () => {
|
|
it("builds direct JVM monitoring entries from probed provider capabilities", () => {
|
|
expect(
|
|
buildJVMMonitoringActionDescriptors("conn-1", [
|
|
{ mode: "jmx" },
|
|
{ mode: "endpoint" },
|
|
{ mode: "jmx" },
|
|
]),
|
|
).toEqual([
|
|
{
|
|
key: "conn-1-jvm-monitoring-jmx",
|
|
title: "持续监控 · JMX",
|
|
providerMode: "jmx",
|
|
},
|
|
{
|
|
key: "conn-1-jvm-monitoring-endpoint",
|
|
title: "持续监控 · Endpoint",
|
|
providerMode: "endpoint",
|
|
},
|
|
]);
|
|
});
|
|
|
|
it("skips providers that cannot be browsed when building monitoring entries", () => {
|
|
expect(
|
|
buildJVMMonitoringActionDescriptors("conn-1", [
|
|
{ mode: "jmx", canBrowse: true },
|
|
{ mode: "agent", canBrowse: false },
|
|
]),
|
|
).toEqual([
|
|
{
|
|
key: "conn-1-jvm-monitoring-jmx",
|
|
title: "持续监控 · JMX",
|
|
providerMode: "jmx",
|
|
},
|
|
]);
|
|
});
|
|
|
|
it("builds diagnostic entry independently from provider probing", () => {
|
|
expect(
|
|
buildJVMDiagnosticActionDescriptor("conn-1", {
|
|
enabled: true,
|
|
transport: "arthas-tunnel",
|
|
}),
|
|
).toEqual({
|
|
key: "conn-1-jvm-diagnostic",
|
|
title: "诊断增强 · Arthas Tunnel",
|
|
transport: "arthas-tunnel",
|
|
});
|
|
|
|
expect(
|
|
buildJVMDiagnosticActionDescriptor("conn-1", {
|
|
enabled: false,
|
|
transport: "agent-bridge",
|
|
}),
|
|
).toBeNull();
|
|
});
|
|
});
|