|
|
|
@ -3,9 +3,8 @@ import { Action, PageTable } from "@/components";
|
|
|
|
|
import { useModals } from "@/modules/modals";
|
|
|
|
|
import { useTableStyles } from "@/styles";
|
|
|
|
|
import { Environment } from "@/utilities";
|
|
|
|
|
import { faClock, faHistory, faTrash } from "@fortawesome/free-solid-svg-icons";
|
|
|
|
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
|
|
|
import { Anchor, Group, Text } from "@mantine/core";
|
|
|
|
|
import { faHistory, faTrash } from "@fortawesome/free-solid-svg-icons";
|
|
|
|
|
import { Anchor, Text } from "@mantine/core";
|
|
|
|
|
import { FunctionComponent, useMemo } from "react";
|
|
|
|
|
import { Column } from "react-table";
|
|
|
|
|
|
|
|
|
@ -16,10 +15,6 @@ interface Props {
|
|
|
|
|
const Table: FunctionComponent<Props> = ({ backups }) => {
|
|
|
|
|
const columns: Column<System.Backups>[] = useMemo<Column<System.Backups>[]>(
|
|
|
|
|
() => [
|
|
|
|
|
{
|
|
|
|
|
accessor: "type",
|
|
|
|
|
Cell: <FontAwesomeIcon icon={faClock}></FontAwesomeIcon>,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
Header: "Name",
|
|
|
|
|
accessor: "filename",
|
|
|
|
@ -50,14 +45,13 @@ const Table: FunctionComponent<Props> = ({ backups }) => {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "actions",
|
|
|
|
|
id: "restore",
|
|
|
|
|
Header: "Restore",
|
|
|
|
|
accessor: "filename",
|
|
|
|
|
Cell: ({ value }) => {
|
|
|
|
|
const modals = useModals();
|
|
|
|
|
const restore = useRestoreBackups();
|
|
|
|
|
const remove = useDeleteBackups();
|
|
|
|
|
return (
|
|
|
|
|
<Group spacing="xs" noWrap>
|
|
|
|
|
<Action
|
|
|
|
|
label="Restore"
|
|
|
|
|
onClick={() =>
|
|
|
|
@ -66,8 +60,8 @@ const Table: FunctionComponent<Props> = ({ backups }) => {
|
|
|
|
|
children: (
|
|
|
|
|
<Text size="sm">
|
|
|
|
|
Are you sure you want to restore the backup ({value})?
|
|
|
|
|
Bazarr will automatically restart and reload the UI
|
|
|
|
|
during the restore process.
|
|
|
|
|
Bazarr will automatically restart and reload the UI during
|
|
|
|
|
the restore process.
|
|
|
|
|
</Text>
|
|
|
|
|
),
|
|
|
|
|
labels: { confirm: "Restore", cancel: "Cancel" },
|
|
|
|
@ -77,6 +71,17 @@ const Table: FunctionComponent<Props> = ({ backups }) => {
|
|
|
|
|
}
|
|
|
|
|
icon={faHistory}
|
|
|
|
|
></Action>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "delet4",
|
|
|
|
|
Header: "Delete",
|
|
|
|
|
accessor: "filename",
|
|
|
|
|
Cell: ({ value }) => {
|
|
|
|
|
const modals = useModals();
|
|
|
|
|
const remove = useDeleteBackups();
|
|
|
|
|
return (
|
|
|
|
|
<Action
|
|
|
|
|
label="Delete"
|
|
|
|
|
color="red"
|
|
|
|
@ -95,7 +100,6 @@ const Table: FunctionComponent<Props> = ({ backups }) => {
|
|
|
|
|
}
|
|
|
|
|
icon={faTrash}
|
|
|
|
|
></Action>
|
|
|
|
|
</Group>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|