mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-05 08:17:19 +00:00
fix(dashboard): resolve edge cases in backup restore and settings UI
Backend: - Add atomic restore with mutex to prevent concurrent corruption - Implement rollback on failure for backup restore - Add symlink security validation Frontend: - Add 'backups' tab to URL validation in settings hook - Add error boundary for lazy-loaded settings sections - Clamp progress bar values to prevent visual bugs - Add AbortController cleanup to prevent memory leaks - Fix misleading debug mode description and add actual console logging
This commit is contained in:
@@ -41,8 +41,9 @@ import type { AccountItemProps } from './types';
|
||||
* Get color class based on quota percentage
|
||||
*/
|
||||
function getQuotaColor(percentage: number): string {
|
||||
if (percentage <= 20) return 'bg-destructive';
|
||||
if (percentage <= 50) return 'bg-yellow-500';
|
||||
const clamped = Math.max(0, Math.min(100, percentage));
|
||||
if (clamped <= 20) return 'bg-destructive';
|
||||
if (clamped <= 50) return 'bg-yellow-500';
|
||||
return 'bg-green-500';
|
||||
}
|
||||
|
||||
@@ -257,7 +258,7 @@ export function AccountItem({
|
||||
<TooltipTrigger asChild>
|
||||
<div className="flex items-center gap-2">
|
||||
<Progress
|
||||
value={minQuota}
|
||||
value={Math.max(0, Math.min(100, minQuota))}
|
||||
className="h-2 flex-1"
|
||||
indicatorClassName={getQuotaColor(minQuota)}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user