diff --git a/app/src/assets/scss/_list.scss b/app/src/assets/scss/_list.scss index 9f30cd60b..e14980b21 100644 --- a/app/src/assets/scss/_list.scss +++ b/app/src/assets/scss/_list.scss @@ -30,7 +30,6 @@ border: 0; color: var(--b3-theme-on-background); margin-top: 0 !important; - transition: var(--b3-transition); &[draggable="true"]:active { cursor: grabbing; diff --git a/app/src/util/history.ts b/app/src/util/history.ts index c6c5ab14c..e533c2e20 100644 --- a/app/src/util/history.ts +++ b/app/src/util/history.ts @@ -109,12 +109,16 @@ const renderRepoItem = (response: IWebSocketData, element: Element, type: string element.lastElementChild.innerHTML = `
  • ${window.siyuan.languages.emptyContent}
  • `; return; } - let actionHTML = ` -`; - if (type === "download") { - actionHTML = ``; - } else if (type === "upload") { + let actionHTML = '' + if (type === "cloudTag") { + actionHTML = ` +`; + } else if (type === "localTag") { actionHTML = ` + +`; + } else if (type === "local") { + actionHTML = ` `; } let repoHTML = ""; @@ -139,12 +143,12 @@ const renderRepo = (element: Element, currentPage: number) => { if (currentPage < 0) { if (currentPage === -1) { fetchPost("/api/repo/getRepoTagSnapshots", {}, (response) => { - renderRepoItem(response, element, "upload"); + renderRepoItem(response, element, "localTag"); }); } if (currentPage === -2) { fetchPost("/api/repo/getCloudRepoTagSnapshots", {}, (response) => { - renderRepoItem(response, element, "download"); + renderRepoItem(response, element, "cloudTag"); }); } previousElement.classList.add("fn__none"); @@ -165,7 +169,7 @@ const renderRepo = (element: Element, currentPage: number) => { } else { nextElement.setAttribute("disabled", "disabled"); } - renderRepoItem(response, element, "upload"); + renderRepoItem(response, element, "local"); }); } }; @@ -427,6 +431,16 @@ export const openHistory = () => { genRepoDialog.destroy(); }); break; + } else if (type === "removeRepoTagSnapshot" || type === "removeCloudRepoTagSnapshot") { + fetchPost("/api/repo/" + type, { + tag: target.parentElement.getAttribute("data-tag") + }, () => { + if (target.parentElement.parentElement.childElementCount === 1) { + target.parentElement.parentElement.innerHTML = `
  • ${window.siyuan.languages.emptyContent}
  • ` + } else { + target.parentElement.remove(); + } + }); } else if (type === "uploadSnapshot") { fetchPost("/api/repo/uploadCloudSnapshot", { tag: target.parentElement.getAttribute("data-tag"),