refine Semi UI operations workspace

This commit is contained in:
lingniu
2026-07-18 07:32:32 +08:00
parent 0c6a3e4ef1
commit ffb1283807
3 changed files with 253 additions and 15 deletions

View File

@@ -339,6 +339,15 @@ export default function OperationsPage() {
const capacityIssueCount = data?.capacityFindings.length ?? 0;
const healthIssueCount = linkIssueCount + runtimeIssueCount + capacityIssueCount + Number((data?.kafkaLag ?? 0) > 0);
const overallStatus = !data ? 'unknown' : healthIssueCount > 0 ? 'warning' : 'ok';
const workspaceContext = workspace === 'reconciliation'
? { description: '每日自动对账', status: '证据处置', color: 'blue' as const }
: workspace === 'diagnostic'
? { description: '按需读取单车来源', status: '精确诊断', color: 'cyan' as const }
: {
description: '15 秒刷新运行证据',
status: !data ? '读取中' : healthIssueCount > 0 ? `${healthIssueCount} 项关注` : '运行正常',
color: !data ? 'grey' as const : healthIssueCount > 0 ? 'orange' as const : 'green' as const
};
return <div className={`v2-ops-page is-${workspace}`}>
<WorkspaceCommandBar
className="v2-ops-command-bar"
@@ -350,19 +359,25 @@ export default function OperationsPage() {
meta={<Typography.Text type="tertiary">{data?.runtime.platformRelease ? `版本 ${data.runtime.platformRelease}` : '正在读取运行版本'}</Typography.Text>}
actions={<Button theme="light" icon={<IconRefresh />} loading={health.isFetching || readiness.isFetching} onClick={refresh}></Button>}
/>
<SegmentedTabs
className="v2-ops-tabs"
variant="filled"
ariaLabel="运维质量工作区"
value={workspace}
onChange={setWorkspace}
items={[
{ key: 'reconciliation', label: '差异处置' },
{ key: 'diagnostic', label: '单车诊断' },
{ key: 'health', label: '全局健康' }
]}
/>
<section className={`v2-ops-workspace is-${workspace}`} role="tabpanel" aria-label={workspace === 'reconciliation' ? '差异处置' : workspace === 'diagnostic' ? '单车诊断' : '全局健康'}>
<nav className="v2-ops-navigation" aria-label="运维质量视图">
<SegmentedTabs
className="v2-ops-tabs"
variant="filled"
ariaLabel="运维质量工作区"
value={workspace}
onChange={setWorkspace}
items={[
{ key: 'reconciliation', label: '差异处置' },
{ key: 'diagnostic', label: '单车诊断' },
{ key: 'health', label: '全局健康' }
]}
/>
<div className="v2-ops-navigation-meta" aria-live="polite">
<Typography.Text type="tertiary">{workspaceContext.description}</Typography.Text>
<Tag color={workspaceContext.color} type="light" size="small">{workspaceContext.status}</Tag>
</div>
</nav>
<section className={`v2-ops-workspace is-${workspace}`} role="tabpanel" tabIndex={0} aria-label={workspace === 'reconciliation' ? '差异处置' : workspace === 'diagnostic' ? '单车诊断' : '全局健康'}>
{workspace === 'reconciliation' ? <ReconciliationCenter /> : null}
{workspace === 'diagnostic' ? <SourceDiagnosticWorkspace /> : null}
{workspace === 'health' ? <>