feat(web): localize and redesign operations console

This commit is contained in:
chick
2026-07-18 22:22:41 +08:00
parent d575ab4d9d
commit abfd07f8a3
34 changed files with 1536 additions and 1058 deletions
+24 -27
View File
@@ -242,19 +242,16 @@ function Page({
if (route.kind === 'settings-system')
return (
<section aria-labelledby="system-settings-title">
<h1 id="system-settings-title">System settings</h1>
<p role="status">
System settings are unavailable because the control plane does not expose a settings
contract.
</p>
<h1 id="system-settings-title"></h1>
<p role="status"></p>
</section>
);
if (route.kind === 'not-found')
return (
<section>
<h1>Page not found</h1>
<p>The requested console page does not exist.</p>
<a href="/fleet">Return to Fleet</a>
<h1></h1>
<p></p>
<a href="/fleet"></a>
</section>
);
if (route.kind.startsWith('instance-')) {
@@ -369,19 +366,19 @@ function Page({
);
}
const labels: Partial<Record<RouteKind, string>> = {
'instance-new': 'Add instance',
jobs: 'Jobs',
'job-detail': 'Job details',
audit: 'Audit',
'audit-detail': 'Audit event',
'settings-instances': 'Instance settings',
'settings-instance-detail': 'Instance settings',
'settings-system': 'System settings',
'instance-new': '添加实例',
jobs: '任务',
'job-detail': '任务详情',
audit: '审计',
'audit-detail': '审计事件',
'settings-instances': '实例设置',
'settings-instance-detail': '实例设置',
'settings-system': '系统设置',
};
return (
<section>
<h1>{labels[route.kind] ?? 'Multi SimAdmin'}</h1>
<p>This route is ready for structured data and actions.</p>
<h1>{labels[route.kind] ?? '多实例 SimAdmin 管理台'}</h1>
<p></p>
</section>
);
}
@@ -429,24 +426,24 @@ export function AppShell({
return (
<div className="app-shell" data-route={route.kind}>
<a className="skip-link" href="#main-content">
Skip to main content
</a>
<header className="app-topbar">
<a className="product-name" href="/fleet">
Multi SimAdmin
SimAdmin
</a>
<span className="connection-status">Console</span>
<span>Version {version}</span>
<span className="connection-status"></span>
<span> {version}</span>
</header>
<div className="app-layout">
<nav className="global-navigation" aria-label="Global navigation">
<nav className="global-navigation" aria-label="全局导航">
<ul>
{(
[
['fleet', '/fleet', 'Fleet'],
['jobs', '/jobs', 'Jobs'],
['audit', '/audit', 'Audit'],
['settings', '/settings/instances', 'Settings'],
['fleet', '/fleet', '实例总览'],
['jobs', '/jobs', '任务'],
['audit', '/audit', '审计'],
['settings', '/settings/instances', '设置'],
] as const
).map(([key, href, label]) => (
<li key={key}>