From 966d2afe695b501c143a32b7e1b218857eac119f Mon Sep 17 00:00:00 2001 From: Lorinc936 Date: Thu, 26 Mar 2026 21:36:54 +0100 Subject: [PATCH 001/182] Feat: backup download frontend and locales --- .../src/translations/ar/translation.json | 3 ++- .../src/translations/en/translation.json | 3 ++- .../src/translations/es/translation.json | 3 ++- .../widgets/type_widgets/options/backup.tsx | 24 ++++++++++++------- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/apps/client/src/translations/ar/translation.json b/apps/client/src/translations/ar/translation.json index 70c3c2f737..1e78b26f02 100644 --- a/apps/client/src/translations/ar/translation.json +++ b/apps/client/src/translations/ar/translation.json @@ -626,7 +626,8 @@ "date-and-time": "التاريخ والوقت", "no_backup_yet": "لايوجد نسخة احتياطية لحد الان", "enable_daily_backup": "تمكين النسخ الاحتياطي اليومي", - "backup_database_now": "نسخ اختياطي لقاعدة البيانات الان" + "backup_database_now": "نسخ اختياطي لقاعدة البيانات الان", + "download": "تنزيل" }, "etapi": { "created": "تم الأنشاء", diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index 27891a02ab..9aeddac20a 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -1381,7 +1381,8 @@ "date-and-time": "Date & time", "path": "Path", "database_backed_up_to": "Database has been backed up to {{backupFilePath}}", - "no_backup_yet": "no backup yet" + "no_backup_yet": "no backup yet", + "download": "Download" }, "etapi": { "title": "ETAPI", diff --git a/apps/client/src/translations/es/translation.json b/apps/client/src/translations/es/translation.json index 3756ba8590..800d71d32c 100644 --- a/apps/client/src/translations/es/translation.json +++ b/apps/client/src/translations/es/translation.json @@ -1332,7 +1332,8 @@ "date-and-time": "Fecha y hora", "path": "Ruta", "database_backed_up_to": "Se ha realizado una copia de seguridad de la base de datos en {{backupFilePath}}", - "no_backup_yet": "no hay copia de seguridad todavía" + "no_backup_yet": "no hay copia de seguridad todavía", + "download": "Descargar" }, "etapi": { "title": "ETAPI", diff --git a/apps/client/src/widgets/type_widgets/options/backup.tsx b/apps/client/src/widgets/type_widgets/options/backup.tsx index 2f1a2d63ba..5d5a89d072 100644 --- a/apps/client/src/widgets/type_widgets/options/backup.tsx +++ b/apps/client/src/widgets/type_widgets/options/backup.tsx @@ -1,15 +1,16 @@ import { BackupDatabaseNowResponse, DatabaseBackup } from "@triliumnext/commons"; +import { useCallback, useEffect, useState } from "preact/hooks"; + import { t } from "../../../services/i18n"; import server from "../../../services/server"; import toast from "../../../services/toast"; +import { formatDateTime } from "../../../utils/formatters"; import Button from "../../react/Button"; import FormCheckbox from "../../react/FormCheckbox"; import { FormMultiGroup } from "../../react/FormGroup"; import FormText from "../../react/FormText"; import { useTriliumOptionBool } from "../../react/hooks"; import OptionsSection from "./components/OptionsSection"; -import { useCallback, useEffect, useState } from "preact/hooks"; -import { formatDateTime } from "../../../utils/formatters"; export default function BackupSettings() { const [ backups, setBackups ] = useState([]); @@ -35,7 +36,7 @@ export default function BackupSettings() { - ) + ); } export function AutomaticBackup() { @@ -67,7 +68,7 @@ export function AutomaticBackup() { {t("backup.backup_recommendation")} - ) + ); } export function BackupNow({ refreshCallback }: { refreshCallback: () => void }) { @@ -82,7 +83,7 @@ export function BackupNow({ refreshCallback }: { refreshCallback: () => void }) }} /> - ) + ); } export function BackupList({ backups }: { backups: DatabaseBackup[] }) { @@ -92,11 +93,13 @@ export function BackupList({ backups }: { backups: DatabaseBackup[] }) { + {t("backup.date-and-time")} {t("backup.path")} + @@ -105,15 +108,20 @@ export function BackupList({ backups }: { backups: DatabaseBackup[] }) { {mtime ? formatDateTime(mtime) : "-"} {filePath} + + +