mirror of
https://github.com/morpheus65535/bazarr
synced 2025-02-22 05:51:10 +00:00
Added download link for backup archives.
This commit is contained in:
parent
8387a57148
commit
a36b3ce2ba
2 changed files with 15 additions and 3 deletions
|
@ -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()
|
||||
|
||||
|
|
|
@ -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>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue