diff --git a/app/src/assets/scss/business/_history.scss b/app/src/assets/scss/business/_history.scss
index 42081171b..2a15f3b7c 100644
--- a/app/src/assets/scss/business/_history.scss
+++ b/app/src/assets/scss/business/_history.scss
@@ -42,4 +42,10 @@
width: 5px;
margin-left: -2px;
}
+
+ &__panel {
+ .protyle-title__input {
+ margin-top: 8px;
+ }
+ }
}
diff --git a/app/src/history/history.ts b/app/src/history/history.ts
index b087df9d4..5e27837c2 100644
--- a/app/src/history/history.ts
+++ b/app/src/history/history.ts
@@ -170,9 +170,11 @@ const renderRepoItem = (response: IWebSocketData, element: Element, type: string
/// #else
if (type === "getCloudRepoTagSnapshots") {
actionHTML = `
+
`;
} else if (type === "getCloudRepoSnapshots") {
- actionHTML = ``;
+ actionHTML = `
+`;
} else if (type === "getRepoTagSnapshots") {
actionHTML = `
@@ -434,7 +436,7 @@ export const openHistory = (app: App) => {
-
+
- ${window.siyuan.languages.emptyContent}
@@ -787,6 +789,22 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
event.stopPropagation();
event.preventDefault();
break;
+ } else if (type === "downloadRollback" && !window.siyuan.config.readonly) {
+ confirmDialog("⚠️ " + window.siyuan.languages.rollback, window.siyuan.languages.rollbackConfirm.replace("${name}", window.siyuan.languages.workspaceData)
+ .replace("${time}", target.parentElement.querySelector("span[data-type='hCreated']").textContent.trim()), () => {
+ const repoId = target.parentElement.getAttribute("data-id");
+ fetchPost("/api/repo/downloadCloudSnapshot", {
+ tag: target.parentElement.getAttribute("data-tag"),
+ id: repoId
+ }, () => {
+ fetchPost("/api/repo/checkoutRepo", {
+ id: repoId
+ });
+ });
+ });
+ event.stopPropagation();
+ event.preventDefault();
+ break;
} else if (type === "genTag") {
const genTagDialog = new Dialog({
title: window.siyuan.languages.tagSnapshot,