Put Backup coverage and Proxmox Backup Server on one page, in two tabs
Backups → Proxmox backups has a Backup coverage tab and a Proxmox Backup Server tab (?view=pbs), each keeping its own title and buttons. /pbs redirects to the second tab so old links and favourites still work; the sidebar's two entries become one, and the Backup Server's alert and integration links go to the tab. Docs updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4dd7901f1c
commit
07ce2b0305
10 files changed
+41
-16
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { useSearchParams } from "react-router-dom";
|
||||
import type { CurrentUser } from "../api/client";
|
||||
import ViewTabs from "../components/ViewTabs";
|
||||
import Backups from "./Backups";
|
||||
import PbsBackup from "./PbsBackup";
|
||||
|
||||
/**
|
||||
* The Proxmox backups, on one page with a tab for each view: **Backup coverage** (is every guest in a backup job, and when was it last backed up) and **Proxmox Backup Server** (its datastores,
|
||||
* what is stored and whether it verifies). The second is `?view=pbs`; `/pbs` goes there, so a link or a favourite made before they were one page still works.
|
||||
*/
|
||||
export default function BackupsHub({ user }: { user: CurrentUser }) {
|
||||
const [params] = useSearchParams();
|
||||
const view = params.get("view") === "pbs" ? "pbs" : "coverage";
|
||||
const tabs = (
|
||||
<ViewTabs
|
||||
label="Backup view"
|
||||
tabs={[
|
||||
{ to: "/backups", label: "Backup coverage", active: view === "coverage" },
|
||||
{ to: "/backups?view=pbs", label: "Proxmox Backup Server", active: view === "pbs" },
|
||||
]}
|
||||
/>
|
||||
);
|
||||
return view === "pbs" ? <PbsBackup user={user} tabs={tabs} /> : <Backups user={user} tabs={tabs} />;
|
||||
}
|
||||
Reference in new issue
Block a user