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>
25 lines
1.1 KiB
TypeScript
25 lines
1.1 KiB
TypeScript
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} />;
|
|
}
|