fix(web): 修正治理頁 tab 深連結
All checks were successful
Code Review / ai-code-review (push) Successful in 13s
CD Pipeline / tests (push) Successful in 1m51s
CD Pipeline / build-and-deploy (push) Successful in 5m29s
CD Pipeline / post-deploy-checks (push) Successful in 1m52s

This commit is contained in:
Your Name
2026-06-19 01:35:55 +08:00
parent bd1021e75d
commit 5612526b05

View File

@@ -25,7 +25,13 @@ import { QueueTab } from './tabs/queue-tab'
import { AgentMarketTab } from './tabs/agent-market-tab'
import { AutomationInventoryTab } from './tabs/automation-inventory-tab'
export default function GovernancePage({ params }: { params: { locale: string } }) {
export default function GovernancePage({
params,
searchParams,
}: {
params: { locale: string }
searchParams?: { tab?: string | string[] }
}) {
const t = useTranslations('governance')
const tabs: TabConfig[] = [
@@ -35,6 +41,8 @@ export default function GovernancePage({ params }: { params: { locale: string }
{ id: 'agent-market', label: t('tabs.agentMarket'), content: <AgentMarketTab /> },
{ id: 'automation-inventory', label: t('tabs.automationInventory'), content: <AutomationInventoryTab /> },
]
const requestedTab = Array.isArray(searchParams?.tab) ? searchParams?.tab[0] : searchParams?.tab
const defaultTab = tabs.some(tab => tab.id === requestedTab) ? requestedTab : 'slo'
return (
<AppLayout locale={params.locale}>
@@ -50,7 +58,7 @@ export default function GovernancePage({ params }: { params: { locale: string }
<IwoooSReadOnlyBridge />
<PageTabs tabs={tabs} defaultTab="slo" syncWithUrl={true} />
<PageTabs tabs={tabs} defaultTab={defaultTab} syncWithUrl={true} />
</AppLayout>
)
}