mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-18 04:58:06 +01:00
🎨 Supports cleaning temporary files https://github.com/siyuan-note/siyuan/issues/16745
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
f8e49f4e13
commit
941e153a4b
21 changed files with 176 additions and 16 deletions
|
|
@ -186,6 +186,16 @@ export const about = {
|
|||
<svg><use xlink:href="#iconRefresh"></use></svg>${window.siyuan.languages.rebuildDataIndex}
|
||||
</button>
|
||||
</div>
|
||||
<div class="fn__flex b3-label config__item">
|
||||
<div class="fn__flex-1">
|
||||
${window.siyuan.languages.clearTempFiles}
|
||||
<div class="b3-label__text">${window.siyuan.languages.clearTempFilesTip}</div>
|
||||
</div>
|
||||
<div class="fn__space"></div>
|
||||
<button id="clearTempFiles" class="b3-button b3-button--outline fn__size200 fn__flex-center">
|
||||
<svg><use xlink:href="#iconTrashcan"></use></svg>${window.siyuan.languages.purge}
|
||||
</button>
|
||||
</div>
|
||||
<div class="fn__flex b3-label config__item">
|
||||
<div class="fn__flex-1">
|
||||
${window.siyuan.languages.systemLog}
|
||||
|
|
@ -270,6 +280,9 @@ ${checkUpdateHTML}
|
|||
about.element.querySelector("#rebuildDataIndex").addEventListener("click", () => {
|
||||
fetchPost("/api/system/rebuildDataIndex", {}, () => {});
|
||||
});
|
||||
about.element.querySelector("#clearTempFiles").addEventListener("click", () => {
|
||||
fetchPost("/api/system/clearTempFiles", {}, () => {});
|
||||
});
|
||||
about.element.querySelector("#exportLog").addEventListener("click", () => {
|
||||
fetchPost("/api/system/exportLog", {}, (response) => {
|
||||
openByMobile(response.data.zip);
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ export const initConfigSearch = (element: HTMLElement, app: App) => {
|
|||
"downloadLatestVer", "safeQuit", "directConnection", "siyuanNote", "key", "password", "copied", "resetRepoTip",
|
||||
"autoDownloadUpdatePkg", "autoDownloadUpdatePkgTip", "networkProxy", "keyPlaceholder", "initRepoKeyTip",
|
||||
"dataRepoPurge", "dataRepoPurgeTip", "dataRepoAutoPurgeIndexRetentionDays", "dataRepoAutoPurgeRetentionIndexesDaily",
|
||||
"vacuumDataIndex", "vacuumDataIndexTip", "rebuildDataIndex", "rebuildDataIndexTip"]),
|
||||
"vacuumDataIndex", "vacuumDataIndexTip", "clearTempFiles", "clearTempFilesTip", "rebuildDataIndex", "rebuildDataIndexTip"]),
|
||||
];
|
||||
const inputElement = element.querySelector(".b3-form__icon input") as HTMLInputElement;
|
||||
if (!isPhablet()) {
|
||||
|
|
|
|||
|
|
@ -120,6 +120,14 @@ export const initAbout = () => {
|
|||
</button>
|
||||
<div class="b3-label__text">${window.siyuan.languages.rebuildDataIndexTip}</div>
|
||||
</div>
|
||||
<div class="b3-label">
|
||||
${window.siyuan.languages.clearTempFiles}
|
||||
<div class="fn__hr"></div>
|
||||
<button class="b3-button b3-button--outline fn__block" id="clearTempFiles">
|
||||
<svg><use xlink:href="#iconTrashcan"></use></svg>${window.siyuan.languages.clearTempFiles}
|
||||
</button>
|
||||
<div class="b3-label__text">${window.siyuan.languages.clearTempFilesTip}</div>
|
||||
</div>
|
||||
<div class="b3-label">
|
||||
${window.siyuan.languages.systemLog}
|
||||
<div class="fn__hr"></div>
|
||||
|
|
@ -319,6 +327,11 @@ export const initAbout = () => {
|
|||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
break;
|
||||
} else if (target.id === "clearTempFiles") {
|
||||
fetchPost("/api/system/clearTempFiles", {}, () => {});
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
break;
|
||||
} else if (target.id === "exportLog") {
|
||||
fetchPost("/api/system/exportLog", {}, (response) => {
|
||||
openByMobile(response.data.zip);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue