diff --git a/crates/forge-web/src/i18n/accounts.rs b/crates/forge-web/src/i18n/accounts.rs index 437d4a4..9f972eb 100644 --- a/crates/forge-web/src/i18n/accounts.rs +++ b/crates/forge-web/src/i18n/accounts.rs @@ -37,10 +37,8 @@ pub enum A { AccountSuspended, Dismiss, Health, - DataDirectory, BackupDirectory, DatabaseFile, - RepoStorage, Free, CiQueue, QueuedJobs, @@ -50,8 +48,6 @@ pub enum A { Failed, LastBackup, Replication, - Uptime, - Version, NotConfigured, Unavailable, Never, @@ -59,6 +55,10 @@ pub enum A { Error, Lagging, HealthIntro, + Storage, + Services, + Fine, + DiskUsed, } pub fn t(lang: Lang, key: A) -> &'static str { @@ -141,20 +141,16 @@ pub fn t(lang: Lang, key: A) -> &'static str { (Dismiss, Tr) => "Kapat", (Health, En) => "Health", (Health, Tr) => "Sağlık", - (DataDirectory, En) => "Data directory", - (DataDirectory, Tr) => "Veri dizini", (BackupDirectory, En) => "Backup directory", (BackupDirectory, Tr) => "Yedek dizini", (DatabaseFile, En) => "Database file", (DatabaseFile, Tr) => "Veritabanı dosyası", - (RepoStorage, En) => "Repositories on disk", - (RepoStorage, Tr) => "Diskteki depolar", (Free, En) => "free of", (Free, Tr) => "boş, toplam", (CiQueue, En) => "CI queue", (CiQueue, Tr) => "CI kuyruğu", - (QueuedJobs, En) => "queued jobs", - (QueuedJobs, Tr) => "bekleyen iş", + (QueuedJobs, En) => "queued", + (QueuedJobs, Tr) => "bekleyen", (RunnersOnline, En) => "runners online", (RunnersOnline, Tr) => "çalıştırıcı çevrim içi", (MailQueue, En) => "Mail queue", @@ -167,10 +163,6 @@ pub fn t(lang: Lang, key: A) -> &'static str { (LastBackup, Tr) => "Son yedek", (Replication, En) => "Replication", (Replication, Tr) => "Çoğaltma", - (Uptime, En) => "Uptime", - (Uptime, Tr) => "Çalışma süresi", - (Version, En) => "Version", - (Version, Tr) => "Sürüm", (NotConfigured, En) => "Not configured", (NotConfigured, Tr) => "Ayarlanmamış", (Unavailable, En) => "Unavailable", @@ -185,6 +177,14 @@ pub fn t(lang: Lang, key: A) -> &'static str { (Lagging, Tr) => "Geride", (HealthIntro, En) => "Read when the page loads. Reload the page for fresh numbers.", (HealthIntro, Tr) => "Sayfa açılırken okunur. Güncel değerler için sayfayı yenileyin.", + (Storage, En) => "Storage", + (Storage, Tr) => "Depolama", + (Services, En) => "Services", + (Services, Tr) => "Hizmetler", + (Fine, En) => "Everything looks fine", + (Fine, Tr) => "Her şey yolunda", + (DiskUsed, En) => "used", + (DiskUsed, Tr) => "kullanıldı", } } @@ -201,7 +201,32 @@ pub fn suspended_message(lang: Lang, reason: &str) -> String { } } -/// `3d 4h`, `5h 2m` or `7m`, for the uptime tile. +/// The health summary when items need attention: "1 needs attention", "2 need attention". +pub fn needs_attention(lang: Lang, n: usize) -> String { + match lang { + Lang::En if n == 1 => "1 needs attention".to_owned(), + Lang::En => format!("{n} need attention"), + Lang::Tr => format!("{n} öğe dikkat istiyor"), + } +} + +/// A repository tree's size, as "{size} on disk". +pub fn on_disk(lang: Lang, size: &str) -> String { + match lang { + Lang::En => format!("{size} on disk"), + Lang::Tr => format!("{size} diskte"), + } +} + +/// The health page footer: uptime, version, build and build date. +pub fn meta_line(lang: Lang, uptime: &str, version: &str, build: &str, date: &str) -> String { + match lang { + Lang::En => format!("Up {uptime} · Version {version} ({build}, {date})"), + Lang::Tr => format!("Çalışma süresi {uptime} · Sürüm {version} ({build}, {date})"), + } +} + +/// `3d 4h`, `5h 2m` or `7m`, for the uptime. pub fn duration_short(secs: u64) -> String { let (d, h, m) = (secs / 86_400, secs % 86_400 / 3_600, secs % 3_600 / 60); if d > 0 { diff --git a/crates/forge-web/src/pages/admin_health.rs b/crates/forge-web/src/pages/admin_health.rs index 24a8149..27aa61c 100644 --- a/crates/forge-web/src/pages/admin_health.rs +++ b/crates/forge-web/src/pages/admin_health.rs @@ -1,6 +1,7 @@ -//! Page: instance health for admins (`/admin/health`). A compact grid of tiles, read when the page -//! loads. Every number is a cheap query or a short external probe (`df`, `du`), so there is no -//! polling; reloading the page, or opening it again, reads fresh values. Non-admins get 404. +//! Page: instance health for admins (`/admin/health`). A summary line, a storage card with the data +//! disk's usage bar, and a services card. Every number is a cheap query or a short external probe +//! (`df`, `du`), so there is no polling; reloading the page, or opening it again, reads fresh values. +//! Non-admins get 404. use std::path::Path; use std::time::Duration; @@ -17,7 +18,7 @@ use topcoat::router::response::Response; use topcoat::router::{page, route}; use topcoat::view::{View, component, view}; -use crate::i18n::accounts::{A, duration_short, t as at}; +use crate::i18n::accounts::{A, duration_short, meta_line, needs_attention, on_disk, t as at}; use crate::i18n::alerts as alert_text; use crate::i18n::{self, Lang}; use crate::live::{Topic, stream_changes}; @@ -25,30 +26,92 @@ use crate::pages::admin_users::admin_only; use crate::state::AppState; use crate::views::{human_size, now_unix, rel_time, shell}; -/// One cell of the grid. -struct Tile { - title: &'static str, - big: String, - sub: String, - /// A stamp shown after `sub` as a live relative time. - stamp: Option, - /// `""`, `ok` or `bad`. - tone: &'static str, - /// Percent of a meter to fill, for disk tiles. - meter: Option, +/// How a dot or a value is drawn: a bad outcome, a good one, a plain count, or a feature that is +/// not set up. +#[derive(Clone, Copy, PartialEq, Eq)] +enum Dot { + Ok, + Bad, + Neutral, + /// Not configured: a hollow dot, and a muted value. + Off, } -fn tile(title: &'static str, big: impl Into, sub: impl Into) -> Tile { - Tile { - title, - big: big.into(), - sub: sub.into(), - stamp: None, - tone: "", - meter: None, +impl Dot { + fn class(self) -> &'static str { + match self { + Dot::Ok => "ok", + Dot::Bad => "bad", + Dot::Neutral => "neutral", + Dot::Off => "off", + } + } + + /// The class for a value cell: bad values are red, off ones muted. + fn value_class(self) -> &'static str { + match self { + Dot::Bad => "bad", + Dot::Off => "muted", + Dot::Ok | Dot::Neutral => "", + } } } +/// The data directory's disk: the usage bar and its numbers. +struct Usage { + used: String, + /// "{free} free of {total}". + free_of_total: String, + path: String, + /// Percent used, the bar's fill. + pct: u8, + /// At least 90% used. + bad: bool, +} + +/// One fact in the storage card's row of columns. +struct Fact { + label: &'static str, + value: String, + detail: String, + dot: Dot, +} + +/// One row of the services card. +struct Service { + label: &'static str, + dot: Dot, + value: String, + detail: String, + /// A stamp shown after `detail` as a live relative time. + stamp: Option, +} + +/// Everything the page shows, and how many items need attention. +struct Health { + usage: Option, + facts: Vec, + services: Vec, + meta: String, + attention: usize, +} + +/// `(percent used, "{free} free of {total}")` for a disk's `(total, available)` bytes. +fn space(lang: Lang, total: u64, avail: u64) -> (u8, String) { + let used = total.saturating_sub(avail); + let pct = used + .saturating_mul(100) + .checked_div(total) + .map_or(0, |p| u8::try_from(p).unwrap_or(100)); + let text = format!( + "{} {} {}", + human_size(lang, avail), + at(lang, A::Free), + human_size(lang, total) + ); + (pct, text) +} + /// `(total, available)` bytes from `df -Pk ` output. fn parse_df(output: &str) -> Option<(u64, u64)> { let line = output.lines().nth(1)?; @@ -100,32 +163,7 @@ fn uptime_secs() -> Option { Some((system - start_ticks / 100.0).max(0.0) as u64) } -fn disk_tile(lang: Lang, title: &'static str, space: Option<(u64, u64)>, label: &str) -> Tile { - match space { - Some((total, avail)) => { - let used = total.saturating_sub(avail); - let pct = used - .saturating_mul(100) - .checked_div(total) - .map_or(0, |p| u8::try_from(p).unwrap_or(100)); - Tile { - title, - big: human_size(lang, avail), - sub: format!( - "{} {} - {label}", - at(lang, A::Free), - human_size(lang, total) - ), - stamp: None, - tone: if pct >= 90 { "bad" } else { "" }, - meter: Some(pct), - } - } - None => tile(title, at(lang, A::Unavailable), label), - } -} - -async fn tiles(state: &AppState, lang: Lang, tz: &str) -> Result> { +async fn gather(state: &AppState, lang: Lang, tz: &str) -> Result { let live = state.live(); let now = now_unix(); let data_dir = live.data_dir.clone(); @@ -156,136 +194,191 @@ async fn tiles(state: &AppState, lang: Lang, tz: &str) -> Result> { let failed = mail_n(&[MailState::Failed]); let db_bytes = std::fs::metadata(&database).map(|m| m.len()).ok(); - let mut out = Vec::new(); - out.push(disk_tile( - lang, - at(lang, A::DataDirectory), - data_space, - &data_dir.to_string_lossy(), - )); - out.push(if backup_on { - disk_tile( - lang, - at(lang, A::BackupDirectory), - backup_space, - &backup_dir.to_string_lossy(), - ) - } else { - tile(at(lang, A::BackupDirectory), at(lang, A::NotConfigured), "") + let usage = data_space.map(|(total, avail)| { + let (pct, free_of_total) = space(lang, total, avail); + Usage { + used: human_size(lang, total.saturating_sub(avail)), + free_of_total, + path: data_dir.to_string_lossy().into_owned(), + pct, + bad: pct >= 90, + } }); - out.push(tile( - at(lang, A::DatabaseFile), - db_bytes.map_or_else( + + let mut facts = vec![Fact { + label: at(lang, A::DatabaseFile), + value: db_bytes.map_or_else( || at(lang, A::Unavailable).to_owned(), |b| human_size(lang, b), ), - database.to_string_lossy(), - )); - out.push(tile( - at(lang, A::Repositories), - counts.repos.to_string(), - match repo_bytes { - Some(b) => format!("{}: {}", at(lang, A::RepoStorage), human_size(lang, b)), + detail: database.to_string_lossy().into_owned(), + dot: Dot::Neutral, + }]; + facts.push(Fact { + label: at(lang, A::Repositories), + value: counts.repos.to_string(), + detail: match repo_bytes { + Some(b) => on_disk(lang, &human_size(lang, b)), None => at(lang, A::Unavailable).to_owned(), }, - )); - out.push(tile( - at(lang, A::CiQueue), - format!("{} {}", counts.queued_jobs, at(lang, A::QueuedJobs)), - format!( - "{} / {} {}", - counts.runners_online, - counts.runners_total, - at(lang, A::RunnersOnline) - ), - )); - let mut mail_tile = tile( - at(lang, A::MailQueue), - format!("{pending} {}", at(lang, A::Pending)), - format!("{failed} {}", at(lang, A::Failed)), - ); - if failed > 0 { - mail_tile.tone = "bad"; - } - out.push(mail_tile); + dot: Dot::Neutral, + }); + facts.push(if backup_on { + let backup = backup_dir.to_string_lossy().into_owned(); + match backup_space { + Some((total, avail)) => { + let (pct, text) = space(lang, total, avail); + Fact { + label: at(lang, A::BackupDirectory), + value: text, + detail: backup, + dot: if pct >= 90 { Dot::Bad } else { Dot::Neutral }, + } + } + None => Fact { + label: at(lang, A::BackupDirectory), + value: at(lang, A::Unavailable).to_owned(), + detail: backup, + dot: Dot::Neutral, + }, + } + } else { + Fact { + label: at(lang, A::BackupDirectory), + value: at(lang, A::NotConfigured).to_owned(), + detail: String::new(), + dot: Dot::Off, + } + }); + + let mut services = vec![ + Service { + label: at(lang, A::CiQueue), + dot: Dot::Neutral, + value: format!("{} {}", counts.queued_jobs, at(lang, A::QueuedJobs)), + detail: format!( + "{} / {} {}", + counts.runners_online, + counts.runners_total, + at(lang, A::RunnersOnline) + ), + stamp: None, + }, + Service { + label: at(lang, A::MailQueue), + dot: if failed > 0 { Dot::Bad } else { Dot::Neutral }, + value: format!("{pending} {}", at(lang, A::Pending)), + detail: format!("{failed} {}", at(lang, A::Failed)), + stamp: None, + }, + ]; let backup = if backup_on { state.store.last_run(RunKind::Backup).await? } else { None }; - out.push(match backup { + services.push(match backup { Some(run) => { let at_unix = stamp_to_unix(&run.started_at).unwrap_or(0); - let mut t = tile( - at(lang, A::LastBackup), - match run.ok { - Some(true) => at(lang, A::Ok), - Some(false) => at(lang, A::Failed), - None => at(lang, A::Pending), - }, - format_in_tz(at_unix, tz), - ); - t.stamp = Some(run.started_at.clone()); - t.tone = match run.ok { - Some(true) => "ok", - Some(false) => "bad", - None => "", + let (value, dot) = match run.ok { + Some(true) => (at(lang, A::Ok), Dot::Ok), + Some(false) => (at(lang, A::Failed), Dot::Bad), + None => (at(lang, A::Pending), Dot::Neutral), }; - t + Service { + label: at(lang, A::LastBackup), + dot, + value: value.to_owned(), + detail: format_in_tz(at_unix, tz), + stamp: Some(run.started_at.clone()), + } } - None if backup_on => tile(at(lang, A::LastBackup), at(lang, A::Never), ""), - None => tile(at(lang, A::LastBackup), at(lang, A::NotConfigured), ""), + None if backup_on => Service { + label: at(lang, A::LastBackup), + dot: Dot::Neutral, + value: at(lang, A::Never).to_owned(), + detail: String::new(), + stamp: None, + }, + None => Service { + label: at(lang, A::LastBackup), + dot: Dot::Off, + value: at(lang, A::NotConfigured).to_owned(), + detail: String::new(), + stamp: None, + }, }); let replicating = !live.replication.target.trim().is_empty(); - out.push(if replicating { + services.push(if replicating { match state.store.replication_status(DB_SUBJECT).await? { Some(status) => { let ok_unix = status.last_ok_at.as_deref().and_then(stamp_to_unix); let window = live.replication.db_snapshot_minutes.saturating_mul(120); let lagging = ok_unix.is_none_or(|t| (now - t).max(0) as u64 > window); let errored = status.last_error.is_some(); - let mut t = tile( - at(lang, A::Replication), - if errored { - at(lang, A::Error) - } else if lagging { - at(lang, A::Lagging) - } else { - at(lang, A::Ok) - }, - if ok_unix.is_some() { - "" + let (value, dot) = if errored { + (at(lang, A::Error), Dot::Bad) + } else if lagging { + (at(lang, A::Lagging), Dot::Bad) + } else { + (at(lang, A::Ok), Dot::Ok) + }; + Service { + label: at(lang, A::Replication), + dot, + value: value.to_owned(), + detail: if ok_unix.is_some() { + String::new() } else { - at(lang, A::Never) + at(lang, A::Never).to_owned() }, - ); - t.stamp = status.last_ok_at.clone(); - t.tone = if errored || lagging { "bad" } else { "ok" }; - t + stamp: status.last_ok_at.clone(), + } } - None => tile(at(lang, A::Replication), at(lang, A::Never), ""), + None => Service { + label: at(lang, A::Replication), + dot: Dot::Neutral, + value: at(lang, A::Never).to_owned(), + detail: String::new(), + stamp: None, + }, } } else { - tile(at(lang, A::Replication), at(lang, A::NotConfigured), "") + Service { + label: at(lang, A::Replication), + dot: Dot::Off, + value: at(lang, A::NotConfigured).to_owned(), + detail: String::new(), + stamp: None, + } }); - out.push(tile( - at(lang, A::Uptime), - uptime_secs().map_or_else(|| at(lang, A::Unavailable).to_owned(), duration_short), - "", - )); - out.push(tile( - at(lang, A::Version), + + let uptime = uptime_secs().map_or_else(|| at(lang, A::Unavailable).to_owned(), duration_short); + let build = format!( + "{}{}", + forge_ci::build::COMMIT, + if forge_ci::build::DIRTY { "-dirty" } else { "" } + ); + let meta = meta_line( + lang, + &uptime, forge_ci::build::VERSION, - format!( - "{}{}, {}", - forge_ci::build::COMMIT, - if forge_ci::build::DIRTY { "-dirty" } else { "" }, - forge_ci::build::DATE - ), - )); - Ok(out) + &build, + forge_ci::build::DATE, + ); + + let attention = usize::from(usage.as_ref().is_some_and(|u| u.bad)) + + facts.iter().filter(|f| f.dot == Dot::Bad).count() + + services.iter().filter(|s| s.dot == Dot::Bad).count(); + Ok(Health { + usage, + facts, + services, + meta, + attention, + }) } /// One active alert in the banner. @@ -330,13 +423,30 @@ async fn since_line(lang: Lang, date: &str, stamp: &str) -> Result { } #[component] -async fn health_view(lang: Lang, tiles: Vec, alerts: Vec) -> Result { +async fn health_view(lang: Lang, health: Health, alerts: Vec) -> Result { let count = alerts.len(); + let Health { + usage, + facts, + services, + meta, + attention, + } = health; + let summary_dot = if attention > 0 { Dot::Bad } else { Dot::Ok }; + let summary = if attention > 0 { + needs_attention(lang, attention) + } else { + at(lang, A::Fine).to_owned() + }; Ok(view! {

(at(lang, A::Health))

-

(at(lang, A::HealthIntro))

+

+ + (summary) +

+

(at(lang, A::HealthIntro))

if count > 0 { } -
- for t in tiles.into_iter() { -
-

(t.title)

-
(t.big.as_str())
- if !t.sub.is_empty() || t.stamp.is_some() { -
- (t.sub.as_str()) - if let Some(stamp) = t.stamp.as_deref() { - if !t.sub.is_empty() { - " · " - } - rel_time(lang: lang, stamp: stamp) +
+

(at(lang, A::Storage))

+ if let Some(u) = usage { +
+ (u.used.as_str()) " " (at(lang, A::DiskUsed)) + (u.free_of_total.as_str()) +
+ +
(u.path.as_str())
+ } else { +

(at(lang, A::Unavailable))

+ } +
+ for f in facts.into_iter() { +
+
(f.label)
+
(f.value.as_str())
+ if !f.detail.is_empty() { +
(f.detail.as_str())
+ } +
+ } +
+
+
+

(at(lang, A::Services))

+
    + for s in services.into_iter() { +
  • + +
    +
    (s.label)
    + if !s.detail.is_empty() || s.stamp.is_some() { +
    + (s.detail.as_str()) + if let Some(stamp) = s.stamp.as_deref() { + if !s.detail.is_empty() { + " · " + } + rel_time(lang: lang, stamp: stamp) + } +
    }
    - } - if let Some(pct) = t.meter { - - } -
- } -
+
(s.value.as_str())
+ + } + +
+

(meta.as_str())

}) } @@ -386,11 +524,11 @@ async fn health_page(cx: &Cx) -> Result { let viewer = admin_only(cx).await?; let lang = i18n::lang(cx, Some(&viewer.0)); let state = app_context::(cx); - let tiles = tiles(state, lang, &viewer.0.timezone).await?; + let health = gather(state, lang, &viewer.0.timezone).await?; let alerts = alert_rows(state, lang, &viewer.0.timezone).await?; let title = at(lang, A::Health); Ok(view! { - shell(title: title, viewer: Some(&viewer), health_view(lang: lang, tiles: tiles, alerts: alerts)) + shell(title: title, viewer: Some(&viewer), health_view(lang: lang, health: health, alerts: alerts)) }) } diff --git a/crates/forge-web/src/views/mod.rs b/crates/forge-web/src/views/mod.rs index 5d98223..e151ab8 100644 --- a/crates/forge-web/src/views/mod.rs +++ b/crates/forge-web/src/views/mod.rs @@ -1076,8 +1076,15 @@ pub fn human_size(lang: Lang, bytes: u64) -> String { } } else if bytes < 1024 * 1024 { format!("{} KiB", decimal(bytes as f64 / 1024.0)) - } else { + } else if bytes < 1024 * 1024 * 1024 { format!("{} MiB", decimal(bytes as f64 / (1024.0 * 1024.0))) + } else if bytes < 1024 * 1024 * 1024 * 1024 { + format!("{} GiB", decimal(bytes as f64 / (1024.0 * 1024.0 * 1024.0))) + } else { + format!( + "{} TiB", + decimal(bytes as f64 / (1024.0 * 1024.0 * 1024.0 * 1024.0)) + ) } } diff --git a/style/_account_admin.scss b/style/_account_admin.scss index 878c5e4..6698d55 100644 --- a/style/_account_admin.scss +++ b/style/_account_admin.scss @@ -1,4 +1,4 @@ -// Site banner, admin user detail and the health grid. +// Site banner, admin user detail and the health page. .site-banner { display: flex; @@ -95,75 +95,156 @@ user-select: all; } -.health-grid { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr)); - gap: 12px; +.health-summary { + display: flex; + align-items: center; + gap: 8px; + margin: 0 0 4px; + font-weight: 500; +} + +// A status dot: the summary's, and each service row's. +.health-dot { + display: inline-block; + flex: none; + width: 8px; + height: 8px; + border-radius: var(--radius-full); + background: var(--muted); + + &.ok { + background: var(--ok); + } + + &.bad { + background: var(--bad); + } + + &.off { + box-sizing: border-box; + background: transparent; + border: 1.5px solid var(--border-strong); + } +} + +.health-storage, +.health-status { margin-bottom: 16px; - .tile { - background: var(--surface); - border: 1px solid var(--border); - border-radius: var(--radius-lg); - padding: 14px 16px; - min-width: 0; + h2 { + margin: 0 0 12px; + font-size: 0.9375rem; + } +} - h2 { - margin: 0 0 8px; - font-size: 0.8125rem; - font-weight: 600; - color: var(--muted); - text-transform: none; - } +.health-usage-head { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + align-items: baseline; + gap: 4px 16px; + margin-bottom: 8px; +} - .big { - font-size: 1.5rem; - font-weight: 600; - line-height: 1.2; - overflow-wrap: anywhere; - } +// The data directory's usage bar: 8px tall, the fill turns red at 90%. +.health-storage .meter { + display: block; + width: 100%; + height: 8px; + appearance: none; + border: 0; + border-radius: 4px; + background: var(--surface-2); + overflow: hidden; - .sub { - color: var(--muted); - font-size: 0.8125rem; - margin-top: 4px; - overflow-wrap: anywhere; - } + &::-webkit-progress-bar { + background: var(--surface-2); + } - .meter { - display: block; - width: 100%; - height: 6px; - margin-top: 8px; - appearance: none; - border: 0; - border-radius: var(--radius-full); - background: var(--surface-2); - overflow: hidden; - - &::-webkit-progress-bar { - background: var(--surface-2); - } - - &::-webkit-progress-value { - background: var(--accent); - } - - &::-moz-progress-bar { - background: var(--accent); - } - } + &::-webkit-progress-value { + background: var(--accent); + } - &.bad .big { - color: var(--bad); - } + &::-moz-progress-bar { + background: var(--accent); + } - &.ok .big { - color: var(--ok); - } + &.bad::-webkit-progress-value { + background: var(--bad); + } + + &.bad::-moz-progress-bar { + background: var(--bad); + } +} + +.health-path { + margin-top: 4px; + overflow-wrap: anywhere; +} + +.health-facts { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 16px; + margin-top: 16px; + + @media (max-width: 640px) { + grid-template-columns: minmax(0, 1fr); + } +} + +.health-fact-value { + margin-top: 2px; + font-size: 0.9375rem; + font-weight: 600; + overflow-wrap: anywhere; + + &.bad { + color: var(--bad); + } + + &.muted { + font-weight: 400; + } +} + +.health-rows { + list-style: none; + margin: 0; + padding: 0; +} + +.health-row { + display: grid; + grid-template-columns: 16px minmax(0, 1fr) auto; + align-items: center; + gap: 8px; + padding: 10px 0; + + & + .health-row { + border-top: 1px solid var(--border); + } + + .health-dot { + justify-self: center; } } +.health-row-value { + text-align: right; + font-variant-numeric: tabular-nums; + overflow-wrap: anywhere; + + &.muted { + color: var(--muted); + } +} + +.health-meta { + margin: 0 0 16px; +} + .link-row { display: flex; flex-wrap: wrap; @@ -171,7 +252,7 @@ margin: 16px 0 0; } -// Active admin alerts, above the health tiles. +// Active admin alerts, above the health cards. .admin-alerts { background: var(--danger-bg); border: 1px solid var(--danger);