Say what the last Duplicati report was, so a machine with no jobs explains itself
Each machine's card shows whether the last report was a backup, another operation that was set aside, or one that could not be read (with the reason), and counts of each since it was added. Administrators can see the start of an unreadable report. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
64961b1141
commit
e517de35af
11 files changed
+9248
-9
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { api, type CurrentUser, type DuplicatiBackup, type DuplicatiOverview, type DuplicatiRun } from "../api/client";
|
||||
import { api, type CurrentUser, type DuplicatiBackup, type DuplicatiOverview, type DuplicatiRun, type DuplicatiSource } from "../api/client";
|
||||
import CopyButton from "../components/CopyButton";
|
||||
import DetailDrawer from "../components/DetailDrawer";
|
||||
import EmptyState from "../components/EmptyState";
|
||||
@@ -118,6 +118,43 @@ function History({ backup, onClose }: { backup: DuplicatiBackup; onClose: () =>
|
||||
);
|
||||
}
|
||||
|
||||
/** What the last report on a machine's address was, and — when the machine has no jobs yet — why that may be. */
|
||||
function Activity({ s }: { s: DuplicatiSource }) {
|
||||
const a = s.lastReport;
|
||||
if (!a) return null;
|
||||
const c = a.counts;
|
||||
const total = c.recorded + c.setAside + c.unreadable;
|
||||
let line: string;
|
||||
if (a.outcome === "recorded") line = `was a backup of “${a.job}”: ${a.result}`;
|
||||
else if (a.outcome === "set_aside") line = `was ${a.operation ?? "something else"} — set aside, only a Backup makes a job here`;
|
||||
else line = "could not be read";
|
||||
const quiet = s.backups === 0;
|
||||
return (
|
||||
<div className="small mt-1">
|
||||
<div className={a.outcome === "unreadable" ? "text-red" : "text-secondary"}>The last one {line}.</div>
|
||||
{a.outcome === "unreadable" && a.reason && <div className="text-red">{a.reason}</div>}
|
||||
<div className="text-secondary">
|
||||
{total} so far: {c.recorded} backup{c.recorded === 1 ? "" : "s"}, {c.setAside} set aside, {c.unreadable} unreadable
|
||||
</div>
|
||||
{quiet && c.recorded === 0 && (
|
||||
<div className="text-yellow">
|
||||
{c.unreadable > 0
|
||||
? "No job yet: what it sends could not be read."
|
||||
: "No job yet: only reports of other operations have come. A job appears after its first Backup report — check that --send-http-level=All is set on that machine."}
|
||||
</div>
|
||||
)}
|
||||
{a.sample && (
|
||||
<details>
|
||||
<summary className="text-secondary">What was sent</summary>
|
||||
<pre className="mb-0 small text-break" style={{ whiteSpace: "pre-wrap", maxHeight: 200, overflow: "auto" }}>
|
||||
{a.sample}
|
||||
</pre>
|
||||
</details>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** What to paste into Duplicati, shown once after a machine is added. */
|
||||
function Address({ path, name, onDone }: { path: string; name: string; onDone: () => void }) {
|
||||
const url = `${window.location.origin}${path}`;
|
||||
@@ -307,6 +344,7 @@ export default function Duplicati({ user }: { user: CurrentUser }) {
|
||||
) : null}
|
||||
</div>
|
||||
<div className="small">{s.lastReportAt ? <>last heard <TimeAgo value={s.lastReportAt} /></> : <span className="text-secondary">nothing yet</span>}</div>
|
||||
<Activity s={s} />
|
||||
</div>
|
||||
{isAdmin && (
|
||||
<button className="btn btn-sm btn-outline-danger ms-auto" onClick={() => void removeSource(s.id, s.name)} aria-label={`Remove ${s.name}`}>
|
||||
|
||||
Reference in new issue
Block a user