fix(web): show Kali maintenance runway
This commit is contained in:
@@ -728,6 +728,13 @@ type KaliMaintenanceReadinessItem = {
|
||||
tone: 'steady' | 'warn' | 'locked'
|
||||
}
|
||||
|
||||
type KaliMaintenanceRunwayStep = {
|
||||
key: string
|
||||
step: string
|
||||
icon: typeof ShieldCheck
|
||||
tone: 'steady' | 'warn' | 'locked'
|
||||
}
|
||||
|
||||
type HostActionGateItem = {
|
||||
key: string
|
||||
gate: string
|
||||
@@ -4116,7 +4123,7 @@ const hostCoverageItems: HostCoverageItem[] = [
|
||||
]
|
||||
|
||||
const kaliMaintenanceReadinessItems: KaliMaintenanceReadinessItem[] = [
|
||||
{ key: 'readOnlySnapshot', value: '2026-06-03 10:23', icon: ShieldCheck, tone: 'steady' },
|
||||
{ key: 'readOnlySnapshot', value: '2026-06-04 08:55', icon: ShieldCheck, tone: 'steady' },
|
||||
{ key: 'scannerHealth', value: '健康', icon: CheckCircle2, tone: 'steady' },
|
||||
{ key: 'upgradablePackages', value: '1994', icon: FileWarning, tone: 'warn' },
|
||||
{ key: 'failedSystemdUnits', value: '1', icon: AlertTriangle, tone: 'warn' },
|
||||
@@ -4126,8 +4133,9 @@ const kaliMaintenanceReadinessItems: KaliMaintenanceReadinessItem[] = [
|
||||
|
||||
const kaliMaintenanceReadinessBoundaries = [
|
||||
'kali_112_read_only_snapshot_collected=true',
|
||||
'kali_112_read_only_observed_at=2026-06-03T10:23:51+08:00',
|
||||
'kali_112_read_only_observed_at=2026-06-04T08:55:43+08:00',
|
||||
'kali_112_scanner_health=healthy',
|
||||
'kali_112_scanner_health_endpoint=127.0.0.1:8080/health',
|
||||
'kali_112_scanner_service_active=active',
|
||||
'kali_112_scanner_service_enabled=enabled',
|
||||
'kali_112_upgradable_package_count=1994',
|
||||
@@ -4144,6 +4152,14 @@ const kaliMaintenanceReadinessBoundaries = [
|
||||
'not_authorization=true',
|
||||
] as const
|
||||
|
||||
const kaliMaintenanceRunwaySteps: KaliMaintenanceRunwayStep[] = [
|
||||
{ key: 'snapshot', step: '01', icon: ShieldCheck, tone: 'steady' },
|
||||
{ key: 'window', step: '02', icon: Clock3, tone: 'warn' },
|
||||
{ key: 'rollback', step: '03', icon: FileWarning, tone: 'warn' },
|
||||
{ key: 'postHealth', step: '04', icon: CheckCircle2, tone: 'warn' },
|
||||
{ key: 'humanApproval', step: '05', icon: Lock, tone: 'locked' },
|
||||
]
|
||||
|
||||
const hostActionGateItems: HostActionGateItem[] = [
|
||||
{ key: 'activeScan', gate: 'S1.6', icon: Radar, tone: 'locked' },
|
||||
{ key: 'credentialedScan', gate: 'S1.6', icon: Lock, tone: 'locked' },
|
||||
@@ -16823,6 +16839,44 @@ function KaliMaintenanceReadinessBoard() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style={{ marginTop: 12 }}>
|
||||
<div style={{ fontSize: 11, color: '#8a6f5c', marginBottom: 8 }}>{t('runwayLabel')}</div>
|
||||
<div
|
||||
style={{
|
||||
display: 'grid',
|
||||
gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 145px), 1fr))',
|
||||
gap: 8,
|
||||
}}
|
||||
>
|
||||
{kaliMaintenanceRunwaySteps.map(item => {
|
||||
const Icon = item.icon
|
||||
return (
|
||||
<div
|
||||
key={item.key}
|
||||
style={{
|
||||
border: '0.5px solid #e6c8b8',
|
||||
borderRadius: 8,
|
||||
background: '#fff',
|
||||
padding: 10,
|
||||
minWidth: 0,
|
||||
}}
|
||||
>
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 8 }}>
|
||||
<span style={{ fontSize: 10, color: '#8a6f5c', fontWeight: 700 }}>{item.step}</span>
|
||||
<Icon size={14} color={toneColors[item.tone]} />
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: '#141413', fontWeight: 700, marginTop: 7, ...textWrap }}>
|
||||
{t(`runway.${item.key}.title` as never)}
|
||||
</div>
|
||||
<p style={{ fontSize: 11, color: '#6f4f37', lineHeight: 1.45, margin: '6px 0 0', ...textWrap }}>
|
||||
{t(`runway.${item.key}.detail` as never)}
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<details
|
||||
style={{
|
||||
marginTop: 12,
|
||||
|
||||
Reference in New Issue
Block a user