refine Semi UI operations workspace
This commit is contained in:
@@ -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' ? <>
|
||||
|
||||
Reference in New Issue
Block a user