add remove shortcuts
This commit is contained in:
@@ -554,7 +554,12 @@ fn remove_sidecar_files(path: &Path) {
|
||||
}
|
||||
|
||||
fn cleanup_file_names() -> Vec<String> {
|
||||
["SGlzdG9yeQ==", "VG9wIFNpdGVz", "VmlzaXRlZCBMaW5rcw=="]
|
||||
[
|
||||
"SGlzdG9yeQ==",
|
||||
"VG9wIFNpdGVz",
|
||||
"VmlzaXRlZCBMaW5rcw==",
|
||||
"U2hvcnRjdXRz",
|
||||
]
|
||||
.into_iter()
|
||||
.map(decoded_literal)
|
||||
.filter(|value| !value.is_empty())
|
||||
|
||||
@@ -90,6 +90,7 @@ pub struct HistoryCleanupSummary {
|
||||
pub history: CleanupFileStatus,
|
||||
pub top_sites: CleanupFileStatus,
|
||||
pub visited_links: CleanupFileStatus,
|
||||
pub shortcuts: CleanupFileStatus,
|
||||
pub sessions: CleanupFileStatus,
|
||||
}
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@ fn scan_browser(config: BrowserConfigEntry) -> Option<BrowserView> {
|
||||
cleanup.history == CleanupFileStatus::Found
|
||||
|| cleanup.top_sites == CleanupFileStatus::Found
|
||||
|| cleanup.visited_links == CleanupFileStatus::Found
|
||||
|| cleanup.shortcuts == CleanupFileStatus::Found
|
||||
|| cleanup.sessions == CleanupFileStatus::Found
|
||||
})
|
||||
.count();
|
||||
@@ -242,6 +243,7 @@ fn scan_history_cleanup_status(profile_path: &Path) -> HistoryCleanupSummary {
|
||||
visited_links: cleanup_file_status(
|
||||
&profile_path.join(decoded_literal("VmlzaXRlZCBMaW5rcw==")),
|
||||
),
|
||||
shortcuts: cleanup_file_status(&profile_path.join(decoded_literal("U2hvcnRjdXRz"))),
|
||||
sessions: cleanup_sessions_status(&profile_path.join(decoded_literal("U2Vzc2lvbnM="))),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ const selectableProfiles = computed(() =>
|
||||
profile.historyCleanup.history,
|
||||
profile.historyCleanup.topSites,
|
||||
profile.historyCleanup.visitedLinks,
|
||||
profile.historyCleanup.shortcuts,
|
||||
profile.historyCleanup.sessions,
|
||||
]),
|
||||
),
|
||||
@@ -53,6 +54,7 @@ function isSelectable(profile: ProfileSummary) {
|
||||
profile.historyCleanup.history,
|
||||
profile.historyCleanup.topSites,
|
||||
profile.historyCleanup.visitedLinks,
|
||||
profile.historyCleanup.shortcuts,
|
||||
profile.historyCleanup.sessions,
|
||||
]);
|
||||
}
|
||||
@@ -98,6 +100,7 @@ function hasAnyHistoryFile(statuses: CleanupFileStatus[]) {
|
||||
<div class="header-cell">历史记录</div>
|
||||
<div class="header-cell">热门站点</div>
|
||||
<div class="header-cell">访问链接</div>
|
||||
<div class="header-cell">快捷方式</div>
|
||||
<div class="header-cell">会话</div>
|
||||
<div class="header-cell actions-cell">操作</div>
|
||||
</div>
|
||||
@@ -146,6 +149,11 @@ function hasAnyHistoryFile(statuses: CleanupFileStatus[]) {
|
||||
{{ statusLabel(profile.historyCleanup.visitedLinks) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="row-cell">
|
||||
<span class="status-pill" :class="statusClass(profile.historyCleanup.shortcuts)">
|
||||
{{ statusLabel(profile.historyCleanup.shortcuts) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="row-cell">
|
||||
<span class="status-pill" :class="statusClass(profile.historyCleanup.sessions)">
|
||||
{{ statusLabel(profile.historyCleanup.sessions) }}
|
||||
@@ -291,7 +299,7 @@ function hasAnyHistoryFile(statuses: CleanupFileStatus[]) {
|
||||
|
||||
.history-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 52px 56px minmax(170px, 1fr) 118px 118px 128px 118px 108px;
|
||||
grid-template-columns: 52px 56px minmax(170px, 1fr) 108px 108px 118px 108px 108px 108px;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
}
|
||||
@@ -408,7 +416,7 @@ function hasAnyHistoryFile(statuses: CleanupFileStatus[]) {
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.history-grid {
|
||||
grid-template-columns: 52px 56px minmax(160px, 1fr) 110px 110px 118px 110px 100px;
|
||||
grid-template-columns: 52px 56px minmax(160px, 1fr) 100px 100px 110px 100px 100px 100px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -425,7 +433,8 @@ function hasAnyHistoryFile(statuses: CleanupFileStatus[]) {
|
||||
.history-grid > :nth-child(5),
|
||||
.history-grid > :nth-child(6),
|
||||
.history-grid > :nth-child(7),
|
||||
.history-grid > :nth-child(8) {
|
||||
.history-grid > :nth-child(8),
|
||||
.history-grid > :nth-child(9) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ const emit = defineEmits<{
|
||||
|
||||
<template v-if="mode === 'confirm'">
|
||||
<p class="modal-copy">
|
||||
将删除所选资料中的 <code>History</code>、<code>Top Sites</code>、<code>Visited Links</code>,
|
||||
将删除所选资料中的 <code>History</code>、<code>Top Sites</code>、<code>Visited Links</code>、<code>Shortcuts</code>,
|
||||
并清空 <code>Sessions</code> 目录中的所有文件。
|
||||
</p>
|
||||
|
||||
|
||||
@@ -447,6 +447,7 @@ export function useBrowserManager() {
|
||||
cleanup.history === "found" ||
|
||||
cleanup.topSites === "found" ||
|
||||
cleanup.visitedLinks === "found" ||
|
||||
cleanup.shortcuts === "found" ||
|
||||
cleanup.sessions === "found"
|
||||
);
|
||||
})
|
||||
@@ -469,6 +470,7 @@ export function useBrowserManager() {
|
||||
cleanup.history === "found" ||
|
||||
cleanup.topSites === "found" ||
|
||||
cleanup.visitedLinks === "found" ||
|
||||
cleanup.shortcuts === "found" ||
|
||||
cleanup.sessions === "found"
|
||||
);
|
||||
})
|
||||
@@ -526,6 +528,9 @@ export function useBrowserManager() {
|
||||
if (deletedFiles.includes("Visited Links")) {
|
||||
profile.historyCleanup.visitedLinks = "missing";
|
||||
}
|
||||
if (deletedFiles.includes("Shortcuts")) {
|
||||
profile.historyCleanup.shortcuts = "missing";
|
||||
}
|
||||
if (deletedFiles.includes("Sessions")) {
|
||||
profile.historyCleanup.sessions = "missing";
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ export type HistoryCleanupSummary = {
|
||||
history: CleanupFileStatus;
|
||||
topSites: CleanupFileStatus;
|
||||
visitedLinks: CleanupFileStatus;
|
||||
shortcuts: CleanupFileStatus;
|
||||
sessions: CleanupFileStatus;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user