A modern, self-hosted backup solution for secure, encrypted backups across local and cloud storage.
fix: resolves buggy interval labels in various places
towfiqia9cd1af26340
diff --git a/frontend/src/components/Plan/PlanStats/PlanStats.tsx b/frontend/src/components/Plan/PlanStats/PlanStats.tsxindex f98d471..5b299df 100644--- a/frontend/src/components/Plan/PlanStats/PlanStats.tsx+++ b/frontend/src/components/Plan/PlanStats/PlanStats.tsx@@ -1,6 +1,6 @@import Icon from '../../common/Icon/Icon';import { Plan } from '../../../@types/plans';-import { formatBytes, formatNumberToK } from '../../../utils/helpers';+import { formatBytes, formatNumberToK, formatIntervalDisplay } from '../../../utils/helpers';import PlanHistory from '../PlanHistory/PlanHistory';import classes from './PlanStats.module.scss';import PlanStorageInfo from '../PlanStorageInfo/PlanStorageInfo';@@ -45,13 +45,7 @@ const PlanStats = ({ plan, isSync, lastBackupItem }: PlanStatsProps) => {<divdata-tooltip-id="htmlToolTip"data-tooltip-place="top"- data-tooltip-html={- isActive- ? isSync- ? `Syncing changes every ${interval.minutes} minutes`- : `Copying changes ${['hours', 'minutes', 'days'].includes(interval.type) ? interval[interval.type as 'hours' | 'minutes' | 'days'] + interval.type : interval.type}`- : 'Plan is Not Active'- }+ data-tooltip-html={isActive ? `${isSync ? 'Syncing' : 'Copying'} changes ${formatIntervalDisplay(interval)}` : 'Plan is Not Active'}><Icon type={isActive ? (isSync ? 'reload' : 'copy') : 'pause'} size={16} /><div className={classes.sourceArrow}>→</div>diff --git a/frontend/src/utils/helpers.ts b/frontend/src/utils/helpers.tsindex 938d4d8..5ee2ce6 100644--- a/frontend/src/utils/helpers.ts+++ b/frontend/src/utils/helpers.ts@@ -1,5 +1,6 @@import { storageOptionField } from '../@types/storages';import { FileItem } from '../@types/system';+import { PlanInterval } from '../@types/plans';export const isMobile = (): boolean => {// Server-side rendering check@@ -472,6 +473,30 @@ export const getAvailableCliApps = (platform?: string) => {}};+export const formatIntervalDisplay = (interval: PlanInterval): string => {+ const time = interval.time ? ` at ${interval.time}` : '';+ switch (interval.type) {+ case 'hourly':+ return 'every hour';+ case 'hours':+ return `every ${interval.hours?.replace('hrs', '')} hours`;+ case 'minutes':+ return `every ${interval.minutes} minutes`;+ case 'daily':+ return `daily${time}`;+ case 'weekly':+ return `weekly on ${interval.days}${time}`;+ case 'days': {+ const dayList = interval.days?.replace(/-$/, '').replace(/-/g, ', ');+ return `every ${dayList}${time}`;+ }+ case 'monthly':+ return `monthly (${interval.days})${time}`;+ default:+ return interval.type;+ }+};+export const secondsToMinutes = (seconds: number) => {if (seconds === 0) {return '';diff --git a/frontend/src/utils/plans.ts b/frontend/src/utils/plans.tsindex dc73f89..1d8d205 100644--- a/frontend/src/utils/plans.ts+++ b/frontend/src/utils/plans.ts@@ -13,11 +13,11 @@ export function planIntervalName(interval: PlanInterval): string {case 'monthly':return 'Every Month';case 'days':- return `Every ${interval.days} days`;+ return `Every ${interval.days}`;case 'hours':- return `Every ${interval.hours} hrs`;+ return `Every ${interval.hours}`;case 'minutes':- return `Every ${interval.minutes} mins`;+ return `Every ${interval.minutes}`;default:return '';}