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