feat(web): redesign fleet cards and instance workspace

This commit is contained in:
chick
2026-07-19 18:54:26 +08:00
parent f2803896a8
commit 49ee4e6570
9 changed files with 458 additions and 74 deletions
+14 -5
View File
@@ -18,11 +18,9 @@ const snapshot: FleetSnapshot = {
'alpha',
{
instanceId: 'alpha',
connectivity: 'online',
authentication: 'authenticated',
freshness: 'fresh',
capabilities: ['overview', 'messages'],
anomalies: [],
reachable: true,
authenticated: true,
summary: { freshness: 'fresh', resources: { cpuPercent: 24, memoryPercent: 51 } },
},
],
]),
@@ -41,5 +39,16 @@ describe('FleetPage card navigation', () => {
expect(within(card).getByRole('link', { name: '编辑 Alpha modem' })).toBeTruthy();
expect(within(card).getByRole('button', { name: '删除 Alpha modem' })).toBeTruthy();
expect(within(card).queryByRole('link', { name: /查看.*短信/ })).toBeNull();
expect(screen.getByRole('region', { name: '实例状态摘要' }).textContent).toMatch(
/\s*1.*线\s*1.*\s*0/s,
);
expect(within(card).getByRole('meter', { name: 'CPU 使用率' }).getAttribute('value')).toBe(
'24',
);
expect(within(card).getByRole('meter', { name: '内存使用率' }).getAttribute('value')).toBe(
'51',
);
expect(within(card).getByText('进入仪表盘')).toBeTruthy();
expect(within(card).getByRole('group', { name: '实例管理操作' })).toBeTruthy();
});
});