mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-10 08:43:34 +08:00
✨ feat(jvm-ui): 完善 JVM 工作台与监控入口
- 新增 JVM 持续监控仪表盘、图表、状态卡和详情面板 - 统一概览、资源浏览、审计页面的 JVM 工作台布局 - Sidebar 和 TabManager 支持监控入口、诊断入口兜底和上下文切换 - 补充前端状态模型、展示文案和组件回归测试
This commit is contained in:
64
frontend/src/utils/jvmSidebarActions.test.ts
Normal file
64
frontend/src/utils/jvmSidebarActions.test.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user