Add a weekly digest and report which version of the agent each server runs

- Weekly digest through the notification channels: alerts now, a week of uptime, what happened, disks
  heading for full, expiring secrets and domains, updates waiting, planned maintenance. Off until switched
  on in Settings -> Notifications; Preview and Send it now there. Setting key 'digest'.
- Agents say their version in every report (Linux and Windows scripts are version 2); the server compares
  it with the scripts it serves and marks agents that are behind on the Servers, server and Updates pages.
  servers.agent_version, migration 0026.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-17 19:49:36 +02:00
1 parent 3da5c639b1
commit aa94d84f6c
28 files changed
+3179 -19

No files matched your search

+19 -3
View File
@@ -1,6 +1,6 @@
import { useCallback, useEffect, useState, type CSSProperties } from "react";
import { Link, useSearchParams } from "react-router-dom";
import { api, type CurrentUser, type ServerRecord } from "../api/client";
import { api, type AgentLatest, type CurrentUser, type ServerRecord } from "../api/client";
import CopyButton from "../components/CopyButton";
import { formatDateTime } from "../utils/date";
import TimeAgo from "../components/TimeAgo";
@@ -19,6 +19,7 @@ import { toast } from "../utils/toast";
import { SearchBox } from "../components/TableToolbar";
import { useTableSearch } from "../hooks/useTableSearch";
import SaveViewButton from "../components/SaveViewButton";
import { agentState } from "../utils/agent";
function typeBadgeStyle(colors: Record<string, string>, type: string): CSSProperties {
const color = colors[type];
@@ -31,6 +32,7 @@ export default function Servers({ user }: { user: CurrentUser }) {
const isAdmin = user.role === "admin";
const [servers, setServers] = useState<ServerRecord[]>([]);
const [agentLatest, setAgentLatest] = useState<AgentLatest | null>(null);
const [error, setError] = useState<string | null>(null);
const [managingServers, setManagingServers] = useState(false);
const [integrationColors, setIntegrationColors] = useState<Record<string, string>>({});
@@ -68,7 +70,10 @@ export default function Servers({ user }: { user: CurrentUser }) {
const loadServers = useCallback(() => {
return api.servers
.list()
.then((res) => setServers(res.servers))
.then((res) => {
setServers(res.servers);
setAgentLatest(res.agentLatest);
})
.catch((err) => setError(String(err)));
}, []);
@@ -184,7 +189,13 @@ export default function Servers({ user }: { user: CurrentUser }) {
Proxmox
</span>
) : s.lastSeenAt ? (
<span className="badge bg-green-lt text-green">Agent</span>
agentState(s, agentLatest) === "behind" ? (
<span className="badge bg-yellow-lt text-yellow" title="Its agent is older than the one this Homelab Manager would install now. Run its install command again to update it.">
Agent behind
</span>
) : (
<span className="badge bg-green-lt text-green">Agent</span>
)
) : (
<span className="badge bg-secondary-lt text-secondary">No data</span>
)}
@@ -385,6 +396,11 @@ export default function Servers({ user }: { user: CurrentUser }) {
<tr key={s.id}>
<td>
<Link to={`/servers/${s.id}`}>{s.name}</Link>
{agentState(s, agentLatest) === "behind" && (
<span className="badge bg-yellow-lt text-yellow ms-2" title="Its agent is older than the one this Homelab Manager would install now. Run its install command again to update it.">
agent behind
</span>
)}
</td>
<td>{s.hostname ?? "—"}</td>
<td>