feat(web): localize and redesign operations console
This commit is contained in:
+24
-27
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user