feat(web): polish zone list and settings layout

Show Zone list as a table, align detail back navigation with proxy
route detail, and move edit/delete actions into the settings tab.
This commit is contained in:
ryan
2026-07-12 16:22:16 +08:00
parent d615d85a26
commit efcf61e32d
4 changed files with 193 additions and 120 deletions
+8 -3
View File
@@ -11,6 +11,10 @@ vi.mock('next/link', () => ({
),
}));
vi.mock('next/navigation', () => ({
useRouter: () => ({push: vi.fn()}),
}));
vi.mock('@/lib/services/openflare', async (importOriginal) => {
const actual = await importOriginal<typeof import('@/lib/services/openflare')>();
return {...actual, ZoneService: {list: vi.fn()}};
@@ -46,9 +50,10 @@ describe('WebsitesPage', () => {
renderPage();
expect(await screen.findByRole('heading', {name: 'arctel.de'})).toBeVisible();
expect(screen.getByText(/3 个域名/)).toBeVisible();
expect(screen.getByText(/0 个域名/)).toBeVisible();
expect(await screen.findByText('arctel.de')).toBeVisible();
expect(screen.getByText('3')).toBeVisible();
expect(screen.getByText('0')).toBeVisible();
expect(screen.getByRole('columnheader', {name: '根域'})).toBeVisible();
fireEvent.change(screen.getByPlaceholderText('搜索 Zone 根域'), {
target: {value: 'arctel'},
+1 -1
View File
@@ -14,7 +14,7 @@ vi.mock('next/link', () => ({
}));
vi.mock('next/navigation', () => ({
useRouter: () => ({replace: replaceMock}),
useRouter: () => ({replace: replaceMock, back: vi.fn()}),
usePathname: () => '/websites/42',
useSearchParams: () => new URLSearchParams(),
}));