diff --git a/frontend/src/components/backups/BackupStorageNotice.jsx b/frontend/src/components/backups/BackupStorageNotice.jsx new file mode 100644 index 00000000..c2b90754 --- /dev/null +++ b/frontend/src/components/backups/BackupStorageNotice.jsx @@ -0,0 +1,24 @@ +import { HardDrive, ArrowRight } from 'lucide-react'; +import { useTranslation } from 'react-i18next'; +import { Button } from '@/components/ui/button'; +import InfoTip from '../InfoTip'; + +// Persistent, non-dismissable: the backup directory is unusable until fixed. +export default function BackupStorageNotice({ onStorage }) { + const { t } = useTranslation(); + return ( +
+ +
+ {t('app.backups.storageUnavailable', 'Backup storage unavailable')} + {t('app.backups.storageUnavailableHelp', 'ServerKit can\'t create or read its backup directory, so backups can\'t run or be listed. Check the directory\'s ownership and permissions on the server, or add a remote destination under Storage.')} + {t('app.backups.storageUnavailableSub', 'Backups can\'t run')} +
+ {onStorage && ( + + )} +
+ ); +} diff --git a/frontend/src/components/backups/BackupsOverview.jsx b/frontend/src/components/backups/BackupsOverview.jsx index 4a24e119..e169ae5a 100644 --- a/frontend/src/components/backups/BackupsOverview.jsx +++ b/frontend/src/components/backups/BackupsOverview.jsx @@ -101,7 +101,7 @@ const LATEST_COLUMNS = [ // The archive table lives on its own Snapshots section — this page answers // "is my data safe?", not "show me every file". export default function BackupsOverview({ - stats, storageConfig, costSummary, schedules = [], backups = [], onGo, + stats, storageConfig, costSummary, schedules = [], backups = [], onGo, storageWarning = false, }) { const { t } = useTranslation(); const now = new Date(); @@ -396,6 +396,9 @@ export default function BackupsOverview({ {row.name} {row.primary && {t('app.backups.primary', 'Primary')}} {row.sub} + {storageWarning && row.tone === 'local' && ( + {t('app.backups.unavailable', 'Unavailable')} + )} {formatBytes(row.bytes, { defaultValue: '0 B' })} diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index 56f7ae2e..c24af8df 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -735,15 +735,20 @@ "serverkitIsFreeTheseAreYour": "ServerKit is free. These are your own storage costs. Local is your server disk (leave at 0 if you don't track it). S3/B2 are your cloud provider's $/GB/month.", "settingsSaved": "Settings saved", "siteService": "Site/Service", + "storage": "Storage", "storageConfigurationSaved": "Storage settings saved", "storageCostRates": "Storage cost rates", "storageCostRatesSaved": "Storage cost rates saved", "storageCostsShort": "Your own storage costs.", "storageManagedByCloud": "This destination is managed by ServerKit Cloud. Change it under Backups in Cloud, or unassign it there to edit it here.", "storageProvider": "Storage provider", + "storageUnavailable": "Backup storage unavailable", + "storageUnavailableHelp": "ServerKit can't create or read its backup directory, so backups can't run or be listed. Check the directory's ownership and permissions on the server, or add a remote destination under Storage.", + "storageUnavailableSub": "Backups can't run", "testConnection": "Test connection", "testing": "Testing…", "thisWillDeleteBackupsOlderThan": "This will delete backups older than {{retentiondays}} days. Continue?", + "unavailable": "Unavailable", "uploadToRemoteStorage": "Upload {{name}} to remote storage", "uploadToRemoteStorageAfterBackup": "Upload to remote storage after backup", "warning": "Warning:", diff --git a/frontend/src/pages/Backups.jsx b/frontend/src/pages/Backups.jsx index 6777d799..66e9d8a1 100644 --- a/frontend/src/pages/Backups.jsx +++ b/frontend/src/pages/Backups.jsx @@ -21,6 +21,7 @@ import { useTableChrome, GridViewPicker, GridChips, GridFilterButton, GridToolsMenu, GridFilterDrawer, } from '@/components/ds/grid'; +import BackupStorageNotice from '../components/backups/BackupStorageNotice'; import BackupsOverview from '../components/backups/BackupsOverview'; import SchedulesTable from '../components/backups/SchedulesTable'; import AddScheduleModal from '../components/backups/AddScheduleModal'; @@ -149,6 +150,7 @@ const Backups = () => { const [apps, setApps] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); + const [storageWarning, setStorageWarning] = useState(false); const [rawTab, setActiveTab] = useTabParam('/backups', VALID_TABS); const activeTab = TAB_ALIASES[rawTab] || rawTab; const [search, setSearch] = useState(''); @@ -217,7 +219,7 @@ const Backups = () => { ]); setBackups(backupsRes.backups || []); - if (backupsRes.warning) setError(backupsRes.warning); + setStorageWarning(Boolean(backupsRes.warning || statsRes?.warning)); setStats(statsRes); setConfig(configRes); if (refreshSchedules) await reloadSchedules(); @@ -737,6 +739,10 @@ const Backups = () => { )} + {storageWarning && ( + setActiveTab('storage')} /> + )} + {/* Overview answers "is my data safe?" — the KPI band, the activity heatmap, the destinations and the recent feed. The archive table it used to sit on top of is now its own section. */} @@ -748,6 +754,7 @@ const Backups = () => { schedules={schedules} backups={backups} onGo={setActiveTab} + storageWarning={storageWarning} /> )} diff --git a/frontend/src/styles/pages/_backups.scss b/frontend/src/styles/pages/_backups.scss index f3ce642c..711aa86a 100644 --- a/frontend/src/styles/pages/_backups.scss +++ b/frontend/src/styles/pages/_backups.scss @@ -1094,3 +1094,35 @@ .bk-storage-fieldset:disabled { opacity: 0.65; } + +// ---------- Storage-unavailable notice ---------- +// Calm single row: amber tint, not a red alert. Persistent, so no close button. +.backup-storage-notice { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: $space-2 $space-3; + padding: $space-2 $space-3; + border: 1px solid $warning-border; + border-radius: $radius-card; + background: $warning-bg; + + &__icon { + flex-shrink: 0; + color: $warning; + } + + &__text { + display: flex; + flex: 1 1 12rem; + flex-wrap: wrap; + align-items: center; + gap: 0 $space-2; + min-inline-size: 0; + font-size: $text-sm; + + strong { font-weight: $font-weight-semibold; } + } + + &__sub { color: var(--text-faint); } +}