Server lines: add the fullest disk over a week, and lines in the admin table
Each server card shows its fullest disk over the last week under the load and memory lines (a disk moves too slowly to show in a day), and the Manage servers table has a Load and disk column with all three side by side. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4f077d4f4a
commit
168d01dc7b
7 files changed
+103
-25
No files matched your search
@@ -28,8 +28,8 @@ import { RunsOnBulkDrawer, SilenceBulkDrawer, TagBulkDrawer } from "../component
|
||||
import { doBulk, plural } from "../utils/bulk";
|
||||
import { BrandTag } from "../components/BrandIcon";
|
||||
import { t } from "../i18n";
|
||||
import Sparkline, { useSparklines } from "../components/Sparkline";
|
||||
import { sparkWords } from "../utils/sparkline";
|
||||
import { useSparklines } from "../components/Sparkline";
|
||||
import ServerSparks from "../components/ServerSparks";
|
||||
|
||||
|
||||
export default function Servers({ user }: { user: CurrentUser }) {
|
||||
@@ -255,22 +255,7 @@ export default function Servers({ user }: { user: CurrentUser }) {
|
||||
<div className="text-secondary small mt-2">
|
||||
{s.lastSeenAt ? <>{t("Last seen")} <TimeAgo value={s.lastSeenAt} /></> : t("Never reported")}
|
||||
</div>
|
||||
{(sparks?.servers[s.id]?.cpu || sparks?.servers[s.id]?.mem) && (
|
||||
<div className="mt-2 small text-secondary">
|
||||
{([["cpu", t("CPU load")], ["mem", t("Memory")]] as const).map(([metric, name]) => {
|
||||
const line = sparks?.servers[s.id]?.[metric];
|
||||
return line ? (
|
||||
<div key={metric} className="mb-1">
|
||||
<div className="d-flex justify-content-between">
|
||||
{name}
|
||||
<span className="text-body">{line.latest === null ? "—" : `${Math.round(line.latest)}%`}</span>
|
||||
</div>
|
||||
<Sparkline values={line.values} min={0} max={100} width={140} height={22} tone={line.latest !== null && line.latest >= 90 ? "red" : line.latest !== null && line.latest >= 75 ? "orange" : "primary"} label={sparkWords(name, t("last 24 hours"), line.latest, line.low, line.high, (v) => `${Math.round(v)}%`)} />
|
||||
</div>
|
||||
) : null;
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
<ServerSparks lines={sparks?.servers[s.id]} />
|
||||
<div className="mt-2">
|
||||
<UptimeRibbon kind="servers" id={s.id} name={s.name} />
|
||||
</div>
|
||||
@@ -465,6 +450,7 @@ export default function Servers({ user }: { user: CurrentUser }) {
|
||||
direction={sortDir}
|
||||
onSort={requestSort}
|
||||
/>
|
||||
<th>{t("Load and disk")}</th>
|
||||
<th>{t("Last 30 days")}</th>
|
||||
<th className="w-1">{t("Actions")}</th>
|
||||
</tr>
|
||||
@@ -488,6 +474,9 @@ export default function Servers({ user }: { user: CurrentUser }) {
|
||||
</td>
|
||||
<td className="text-secondary">{s.apiTokenPrefix}…</td>
|
||||
<td>{s.lastSeenAt ? <TimeAgo value={s.lastSeenAt} /> : "never"}</td>
|
||||
<td>
|
||||
<ServerSparks lines={sparks?.servers[s.id]} compact />
|
||||
</td>
|
||||
<td>
|
||||
<UptimeRibbon kind="servers" id={s.id} name={s.name} />
|
||||
</td>
|
||||
@@ -506,9 +495,9 @@ export default function Servers({ user }: { user: CurrentUser }) {
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
{!loaded && <LoadingRow colSpan={7} />}
|
||||
{!loaded && <LoadingRow colSpan={8} />}
|
||||
{loaded && sortedServers?.length === 0 && (
|
||||
<EmptyRow colSpan={7} title={t("No servers yet")} hint={t("Add a server with the form above and install its agent: it then reports its tasks, disks, memory, open ports and waiting updates.")} filtered={tableSearch.active ? () => tableSearch.setQuery("") : undefined} />
|
||||
<EmptyRow colSpan={8} title={t("No servers yet")} hint={t("Add a server with the form above and install its agent: it then reports its tasks, disks, memory, open ports and waiting updates.")} filtered={tableSearch.active ? () => tableSearch.setQuery("") : undefined} />
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in new issue
Block a user