summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormorpheus65535 <[email protected]>2022-08-21 23:14:06 -0400
committermorpheus65535 <[email protected]>2022-08-21 23:14:06 -0400
commita36b3ce2ba9f8e9810fcfa6b0720c5e4baf5f818 (patch)
tree80fd7999c0261adcd2f77627976b17948348a40e
parent8387a57148871ac9a12d7ae333d5358187138003 (diff)
downloadbazarr-a36b3ce2ba9f8e9810fcfa6b0720c5e4baf5f818.tar.gz
bazarr-a36b3ce2ba9f8e9810fcfa6b0720c5e4baf5f818.zip
Added download link for backup archives.v1.1.1-beta.17
-rw-r--r--bazarr/app/ui.py6
-rw-r--r--frontend/src/pages/System/Backups/table.tsx12
2 files changed, 15 insertions, 3 deletions
diff --git a/bazarr/app/ui.py b/bazarr/app/ui.py
index 7551ab115..dd1da3592 100644
--- a/bazarr/app/ui.py
+++ b/bazarr/app/ui.py
@@ -131,6 +131,12 @@ def movies_images(url):
return Response(stream_with_context(req.iter_content(2048)), content_type=req.headers['content-type'])
+@check_login
+@ui_bp.route('/system/backup/download/<path:filename>', methods=['GET'])
+def backup_download(filename):
+ return send_file(os.path.join(settings.backup.folder, filename), cache_timeout=0, as_attachment=True)
+
+
def configured():
System.update({System.configured: '1'}).execute()
diff --git a/frontend/src/pages/System/Backups/table.tsx b/frontend/src/pages/System/Backups/table.tsx
index ca2c04e46..1a2801b85 100644
--- a/frontend/src/pages/System/Backups/table.tsx
+++ b/frontend/src/pages/System/Backups/table.tsx
@@ -2,9 +2,10 @@ import { useDeleteBackups, useRestoreBackups } from "@/apis/hooks";
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 { Group, Text } from "@mantine/core";
+import { Anchor, Group, Text } from "@mantine/core";
import { FunctionComponent, useMemo } from "react";
import { Column } from "react-table";
@@ -23,8 +24,13 @@ const Table: FunctionComponent<Props> = ({ backups }) => {
Header: "Name",
accessor: "filename",
Cell: ({ value }) => {
- const { classes } = useTableStyles();
- return <Text className={classes.primary}>{value}</Text>;
+ return (
+ <Anchor
+ href={`${Environment.baseUrl}/system/backup/download/${value}`}
+ >
+ {value}
+ </Anchor>
+ );
},
},
{