add selection buttons

This commit is contained in:
Julian Freeman
2026-03-03 20:01:50 -04:00
parent 5cd6210dd2
commit 91936aab19
2 changed files with 44 additions and 3 deletions

View File

@@ -373,7 +373,12 @@ const BROWSER_CACHE_DIRS: &[&str] = &[
"Code Cache",
"GPUCache",
"Media Cache",
"Service Worker/CacheStorage"
"Service Worker/CacheStorage",
"Service Worker/ScriptCache",
"GrShaderCache",
"DawnCache",
"File System",
"blob_storage"
];
#[derive(Serialize, Clone)]

View File

@@ -212,6 +212,20 @@ async function runAdvancedTask(task: string) {
}
// --- 浏览器清理逻辑 ---
function toggleAllProfiles(enabled: boolean) {
const s = activeTab.value === 'clean-browser-chrome' ? chromeState.value : edgeState.value;
if (s.scanResult) {
s.scanResult.profiles.forEach(p => p.enabled = enabled);
}
}
function invertProfiles() {
const s = activeTab.value === 'clean-browser-chrome' ? chromeState.value : edgeState.value;
if (s.scanResult) {
s.scanResult.profiles.forEach(p => p.enabled = !p.enabled);
}
}
async function startBrowserScan(browser: 'chrome' | 'edge') {
const s = browser === 'chrome' ? chromeState.value : edgeState.value;
s.isScanning = true;
@@ -741,7 +755,14 @@ function splitSize(sizeStr: string | number) {
<!-- 详情列表 -->
<div class="detail-list" v-if="activeTab === 'clean-browser-chrome' ? (chromeState.isScanning || chromeState.scanResult) && !chromeState.isDone : (edgeState.isScanning || edgeState.scanResult) && !edgeState.isDone">
<h3>用户资料列表</h3>
<div class="list-header">
<h3>用户资料列表</h3>
<div class="list-actions">
<button class="btn-text" @click="toggleAllProfiles(true)">全选</button>
<button class="btn-text" @click="toggleAllProfiles(false)">取消</button>
<button class="btn-text" @click="invertProfiles()">反选</button>
</div>
</div>
<div
class="detail-item"
v-for="profile in (activeTab === 'clean-browser-chrome' ? chromeState.scanResult?.profiles : edgeState.scanResult?.profiles) || []"
@@ -1313,7 +1334,22 @@ body {
margin-top: 40px;
border: 1px solid rgba(0,0,0,0.02);
}
.detail-list h3 { font-size: 18px; margin-bottom: 20px; font-weight: 700; color: var(--text-main); }
.list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.list-header h3 { font-size: 18px; margin-bottom: 0; font-weight: 700; color: var(--text-main); }
.list-actions { display: flex; gap: 8px; }
.btn-text {
background: none;
border: none;
color: var(--primary-color);
font-size: 12px;
font-weight: 600;
cursor: pointer;
padding: 6px 10px;
border-radius: 8px;
transition: all 0.2s;
}
.btn-text:hover { background-color: #F0F7FF; }
.detail-item {
display: flex;
justify-content: space-between;