feat(fleet): show instance resource metrics

This commit is contained in:
chick
2026-07-19 00:22:23 +08:00
parent 2411801240
commit 23f18963ef
12 changed files with 312 additions and 30 deletions
@@ -38,6 +38,12 @@ const snapshot: FleetSnapshot = {
capabilities: ['sms'],
freshness: 'stale',
anomalies: ['clock drift'],
resources: {
cpuPercent: 18.4,
memoryPercent: 63.2,
maxTemperatureCelsius: 46.7,
phoneNumbers: ['13800138000'],
},
},
},
],
@@ -125,6 +131,10 @@ describe('React AppShell and Fleet vertical slice', () => {
const card = screen.getByRole('article', { name: 'Bravo 实例概览' });
expect(within(card).getByText('40 ms')).toBeTruthy();
expect(within(card).getByText('2.0')).toBeTruthy();
expect(within(card).getByText('18.4%')).toBeTruthy();
expect(within(card).getByText('63.2%')).toBeTruthy();
expect(within(card).getByText('46.7 °C')).toBeTruthy();
expect(within(card).getByText('13800138000')).toBeTruthy();
expect(within(card).getByRole('link', { name: '管理 Bravo' }).getAttribute('href')).toBe(
'/instances/bravo/overview',
);