feat(web): fuse Hub device modules into instance panels with SMS aggregation

- Consolidate cellular, eSIM, network and device module interactions.

- Add aggregate SMS workflows and identity-aware action controls.

- Extend SMSC privacy handling and module action icons.
This commit is contained in:
chick
2026-09-07 00:45:38 +08:00
parent 864e1bd90c
commit 6d251dab7b
17 changed files with 565 additions and 31 deletions
@@ -4,6 +4,7 @@ import userEvent from '@testing-library/user-event';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { AppShell, type InstanceContext } from '../app-shell.js';
import { SensitiveRevealProvider } from '../privacy/sensitive-reveal.js';
import {
OverviewSystemPage,
type OverviewDataSource,
@@ -117,11 +118,14 @@ describe('Phase 6.1 Overview / System read slice', () => {
it('renders the route-owned Fleet resource summary without inventing another endpoint', () => {
render(
<AppShell
pathname="/instances/alpha/overview"
instance={owner}
capabilities={overviewCapabilities}
/>,
<SensitiveRevealProvider>
<AppShell
pathname="/instances/alpha/overview"
instance={owner}
capabilities={overviewCapabilities}
/>
,
</SensitiveRevealProvider>,
);
const operations = screen.getByRole('region', { name: '运行状态与资源' });
expect(within(operations).getByText('在线')).toBeTruthy();
@@ -132,12 +136,30 @@ describe('Phase 6.1 Overview / System read slice', () => {
within(operations).getByRole('meter', { name: '内存使用率' }).getAttribute('value'),
).toBe('63.2');
expect(within(operations).getByText('46.7 °C')).toBeTruthy();
expect(within(operations).getByText('13800138000')).toBeTruthy();
expect(within(operations).getByText('138 •••• 8000')).toBeTruthy();
expect(within(operations).queryByText('13800138000')).toBeNull();
expect(screen.queryByText(/没有可用的安全概览只读数据源/i)).toBeNull();
expect(screen.getByRole('button', { name: '重启服务' })).toBeTruthy();
expect(screen.getByRole('button', { name: '系统重启' })).toBeTruthy();
});
it('reveals the overview phone number through the console-wide switch', async () => {
const user = userEvent.setup();
render(
<AppShell
pathname="/instances/alpha/overview"
instance={owner}
capabilities={overviewCapabilities}
/>,
);
const operations = screen.getByRole('region', { name: '运行状态与资源' });
expect(within(operations).getByText('138 •••• 8000')).toBeTruthy();
await user.click(screen.getByRole('button', { name: '显示敏感标识' }));
expect(within(operations).getByText('13800138000')).toBeTruthy();
expect(within(operations).queryByText('138 •••• 8000')).toBeNull();
});
it('shows authentication-required without loading or leaking prior owner data', async () => {
const load = vi.fn<OverviewDataSource['load']>().mockResolvedValue(snapshot);
const { rerender } = render(<OverviewSystemPage instance={owner} dataSource={{ load }} />);