diff --git a/components/settings/CacheSettings.tsx b/components/settings/CacheSettings.tsx index 9850b8a..b6ab473 100644 --- a/components/settings/CacheSettings.tsx +++ b/components/settings/CacheSettings.tsx @@ -1,9 +1,9 @@ 'use client'; import { useEffect, useState } from 'react'; -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; -import { Button } from '@/components/ui/button'; -import { Icons } from '@/components/ui/icons'; +import { Card } from '@/components/ui/Card'; +import { Button } from '@/components/ui/Button'; +import { Icons } from '@/components/ui/Icon'; import { cacheManager, type CacheStats } from '@/lib/utils/cacheManager'; export function CacheSettings() { @@ -17,16 +17,12 @@ export function CacheSettings() { useEffect(() => { loadStats(); - // Refresh stats every 10 seconds const interval = setInterval(loadStats, 10000); return () => clearInterval(interval); }, []); const handleClearAll = async () => { - if (!confirm('确定要清除所有缓存吗?这将删除所有已下载的视频片段。')) { - return; - } - + if (!confirm('确定要清除所有缓存吗?这将删除所有已下载的视频片段。')) return; setLoading(true); try { await cacheManager.clearAllCache(); @@ -53,16 +49,17 @@ export function CacheSettings() { return ( - - - - 缓存管理 - - - 视频片段缓存自动管理,7天后过期,最大1GB - - - +
+
+

+ + 缓存管理 +

+

+ 视频片段缓存自动管理,7天后过期,最大1GB +

+
+ {stats && (
@@ -99,21 +96,11 @@ export function CacheSettings() { )}
- - @@ -124,7 +111,7 @@ export function CacheSettings() {

• 超过1GB时自动清理最旧的30%

• 系统每5分钟自动检查一次

- +
); }