refactor(admin): move AdminAggregatePanel inline styles to CSS module tokens
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
This commit is contained in:
1 parent
18a2fb6cbb
commit
5868f045bc
2 files changed
+30
-7
No files matched your search
@@ -0,0 +1,22 @@
|
||||
.section {
|
||||
margin-top: var(--space-6);
|
||||
border-top: 1px solid var(--color-border);
|
||||
padding-top: var(--space-4);
|
||||
}
|
||||
|
||||
.heading {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.subheading {
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.description {
|
||||
color: var(--color-ink-soft);
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
.error {
|
||||
color: var(--color-negative);
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import styles from "./AdminAggregatePanel.module.css";
|
||||
|
||||
export interface MiniappActivitySummary {
|
||||
id: string;
|
||||
@@ -55,9 +56,9 @@ export function AdminAggregatePanel({ endpoint = "/api/admin/aggregate" }: Admin
|
||||
}, [load]);
|
||||
|
||||
return (
|
||||
<section style={{ marginTop: 24, borderTop: "1px solid #ddd", paddingTop: 16 }}>
|
||||
<h2 style={{ fontSize: 16 }}>Backend relay: aggregate monitoring view</h2>
|
||||
<p style={{ color: "#555", fontSize: 13 }}>
|
||||
<section className={styles.section}>
|
||||
<h2 className={styles.heading}>Backend relay: aggregate monitoring view</h2>
|
||||
<p className={styles.description}>
|
||||
Read-only summary of whatever events have reached the backend relay
|
||||
(api/sync) from any device so far - never a placeholder figure.
|
||||
Re-fetches the relay's current state every time it loads.
|
||||
@@ -67,7 +68,7 @@ export function AdminAggregatePanel({ endpoint = "/api/admin/aggregate" }: Admin
|
||||
</button>
|
||||
|
||||
{error && (
|
||||
<p data-testid="aggregate-error" style={{ color: "#b00020" }}>
|
||||
<p data-testid="aggregate-error" className={styles.error}>
|
||||
Could not load aggregate: {error}
|
||||
</p>
|
||||
)}
|
||||
@@ -84,7 +85,7 @@ export function AdminAggregatePanel({ endpoint = "/api/admin/aggregate" }: Admin
|
||||
{summary.population === null ? "not seeded yet" : summary.population}
|
||||
</p>
|
||||
|
||||
<h3 style={{ fontSize: 14 }}>Resource levels</h3>
|
||||
<h3 className={styles.subheading}>Resource levels</h3>
|
||||
<ul data-testid="aggregate-resources">
|
||||
{Object.entries(summary.resources).map(([resource, value]) => (
|
||||
<li key={resource}>
|
||||
@@ -96,7 +97,7 @@ export function AdminAggregatePanel({ endpoint = "/api/admin/aggregate" }: Admin
|
||||
)}
|
||||
</ul>
|
||||
|
||||
<h3 style={{ fontSize: 14 }}>Per-mini-app last activity</h3>
|
||||
<h3 className={styles.subheading}>Per-mini-app last activity</h3>
|
||||
<ul data-testid="aggregate-miniapp-activity">
|
||||
{summary.miniapps.map((m) => (
|
||||
<li key={m.id}>
|
||||
@@ -106,7 +107,7 @@ export function AdminAggregatePanel({ endpoint = "/api/admin/aggregate" }: Admin
|
||||
{summary.miniapps.length === 0 && <li>No mini-app activity relayed yet.</li>}
|
||||
</ul>
|
||||
|
||||
<h3 style={{ fontSize: 14 }}>Error-tagged events</h3>
|
||||
<h3 className={styles.subheading}>Error-tagged events</h3>
|
||||
<ul data-testid="aggregate-error-events">
|
||||
{summary.errorEvents.map((e) => (
|
||||
<li key={`${e.type}-${e.lamportTs}`}>
|
||||
|
||||
Reference in new issue
Block a user