fix: redirect after setup and remove redundant breadcrumbs
Release / release (push) Canceled after 0s

This commit is contained in:
Qiufeng
2026-08-18 08:01:57 +08:00
parent 7237792424
commit d61bdf9da4
8 changed files with 41 additions and 22 deletions
+1 -7
View File
@@ -260,13 +260,7 @@ for (const route of routes) {
await expect(page.locator('h1.page-title-sr-only')).toHaveCount(1);
await expect(page.locator('h1:not(.page-title-sr-only)')).toHaveCount(0);
}
if (!['PAGE-01', 'PAGE-02', 'PAGE-23'].includes(route.pageId)) {
const breadcrumb = page.locator('.tdesign-breadcrumb');
await expect(breadcrumb).toBeVisible();
for (const label of route.breadcrumb) {
await expect(breadcrumb.getByText(label, { exact: true })).toBeVisible();
}
}
await expect(page.locator('.tdesign-breadcrumb')).toHaveCount(0);
await page.waitForLoadState('networkidle');
if (route.pageId === 'PAGE-09') {
await expect(page.locator('.t-input-number__decrease, .t-input-number__increase')).toHaveCount(0);
+6 -2
View File
@@ -11,7 +11,9 @@ test('first-run wizard tests MySQL, creates the administrator and stays responsi
data: {
required: !completed,
locked: completed,
ready: completed,
// Production status is locked after setup; readiness is not the
// completion signal used by the redirect flow.
ready: false,
supportedDatabaseTypes: ['MYSQL'],
message: completed ? '系统已完成安装' : '请完成安装',
},
@@ -69,6 +71,8 @@ test('first-run wizard tests MySQL, creates the administrator and stays responsi
await expect(page.getByText('安装完成', { exact: true })).toBeVisible();
await expect(page.getByText('安装完成,系统正在切换到正式模式')).toBeVisible();
await expect(page).toHaveURL(/\/login$/, { timeout: 15_000 });
const layout = await page.evaluate(() => ({
clientWidth: document.documentElement.clientWidth,
scrollWidth: document.documentElement.scrollWidth,
@@ -128,8 +132,8 @@ test('confirms completion after the setup response is interrupted by a service r
await page.getByRole('button', { name: '完成安装' }).click();
await page.getByRole('button', { name: '确定', exact: true }).click();
await expect(page.getByText('连接暂时中断,正在确认安装结果。')).toBeVisible();
await expect(page.getByText('安装完成', { exact: true })).toBeVisible();
await expect(page.getByText('安装已完成,系统正在切换到正式模式')).toBeVisible();
await expect(page.getByText('网络请求失败')).toHaveCount(0);
await expect(page).toHaveURL(/\/login$/, { timeout: 15_000 });
});
-1
View File
@@ -1,7 +1,6 @@
export default {
showFooter: false,
isSidebarCompact: false,
showBreadcrumb: true,
menuAutoCollapsed: false,
mode: 'light',
layout: 'side',
@@ -61,7 +61,6 @@
</t-tab-panel>
</t-tabs>
<t-content :class="`${prefix}-content-layout`">
<l-breadcrumb v-if="settingStore.showBreadcrumb" />
<l-content />
</t-content>
<t-footer v-if="settingStore.showFooter" :class="`${prefix}-footer-layout`">
@@ -81,7 +80,6 @@ import { useLocale } from '@/locales/useLocale';
import { useSettingStore, useTabsRouterStore } from '@/store';
import type { TRouterInfo, TTabRemoveOptions } from '@/types/interface';
import LBreadcrumb from './Breadcrumb.vue';
import LContent from './Content.vue';
import LFooter from './Footer.vue';
+2 -2
View File
@@ -355,7 +355,7 @@ async function waitForSetupCompletion() {
if (unmounted) return false;
try {
const status = await getSetupStatus();
if (status.ready) return true;
if (!status.required && (status.ready || status.locked)) return true;
} catch {
// A short connection failure is expected while systemd restarts the service.
}
@@ -387,7 +387,7 @@ async function openLogin() {
window.clearInterval(countdownTimer);
completionMessage.value = '系统正在启动,请稍候。';
if (await waitForSetupCompletion()) {
window.location.assign('/login');
await router.replace('/login');
return;
}
completionMessage.value = '系统启动时间较长,请稍后刷新页面。';
+14 -1
View File
@@ -17,7 +17,20 @@ const isPublic = (to: RouteLocationNormalized) =>
let setupStatusRequest: ReturnType<typeof getSetupStatus> | null = null;
function loadSetupStatus() {
setupStatusRequest ||= getSetupStatus();
if (setupStatusRequest) return setupStatusRequest;
// Share only an in-flight request. Keeping the resolved setup state would
// send the user back to /setup after the installation marker is written.
const request = getSetupStatus();
setupStatusRequest = request;
request.then(
() => {
if (setupStatusRequest === request) setupStatusRequest = null;
},
() => {
if (setupStatusRequest === request) setupStatusRequest = null;
},
);
return setupStatusRequest;
}
+1 -1
View File
@@ -87,7 +87,7 @@
z-index: 100;
}
&-tabs-nav + .@{starter-prefix}-content-layout {
padding-top: var(--td-comp-paddingTB-xxl);
padding-top: var(--td-comp-paddingTB-l);
}
&::-webkit-scrollbar {