Redesign beta Magent UI
This commit is contained in:
@@ -362,8 +362,42 @@ export default function HomePage() {
|
||||
return date.toLocaleString()
|
||||
}
|
||||
|
||||
const serviceItems = servicesStatus?.services ?? []
|
||||
const serviceUpCount = serviceItems.filter((service) => service.status === 'up').length
|
||||
const serviceAttentionCount = serviceItems.filter((service) =>
|
||||
['down', 'degraded', 'not_configured'].includes(service.status)
|
||||
).length
|
||||
const activeRecentCount = recent.filter((item) => {
|
||||
const label = String(item.statusLabel ?? '').toLowerCase()
|
||||
return !label.includes('ready') && !label.includes('available') && !label.includes('declined')
|
||||
}).length
|
||||
|
||||
return (
|
||||
<main className="card">
|
||||
<section className="ops-metric-grid">
|
||||
<div className="ops-metric-card">
|
||||
<span className="section-kicker">Service mesh</span>
|
||||
<strong>
|
||||
{serviceUpCount}/{serviceItems.length || 0}
|
||||
</strong>
|
||||
<p>{servicesLoading ? 'Checking services now.' : 'Configured services online.'}</p>
|
||||
</div>
|
||||
<div className="ops-metric-card">
|
||||
<span className="section-kicker">Attention</span>
|
||||
<strong>{serviceAttentionCount}</strong>
|
||||
<p>Services reporting down, degraded, or not configured.</p>
|
||||
</div>
|
||||
<div className="ops-metric-card">
|
||||
<span className="section-kicker">Loaded requests</span>
|
||||
<strong>{recent.length}</strong>
|
||||
<p>Returned by the live request cache.</p>
|
||||
</div>
|
||||
<div className="ops-metric-card">
|
||||
<span className="section-kicker">Active queue</span>
|
||||
<strong>{activeRecentCount}</strong>
|
||||
<p>Loaded requests still moving through the pipeline.</p>
|
||||
</div>
|
||||
</section>
|
||||
<div className="layout-grid">
|
||||
<section className="recent centerpiece">
|
||||
<div className="system-status">
|
||||
|
||||
Reference in New Issue
Block a user