An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: https://github.com/siyuan-note/siyuan/issues/12355
Vanessaa8b99ae997ad
diff --git a/app/src/history/diff.ts b/app/src/history/diff.tsindex 264278c7a8..04644dda32 100644--- a/app/src/history/diff.ts+++ b/app/src/history/diff.ts@@ -11,18 +11,19 @@ import {App} from "../index";import {pathPosix} from "../util/pathName";import {renderAssetsPreview} from "../asset/renderAssets";import {resizeSide} from "./resizeSide";+import {confirmDialog} from "../dialog/confirmDialog";const genItem = (data: [], data2?: { title: string, fileID: string }[], hasUndo = true) => {if (!data || data.length === 0) {return `<li style="padding-left: 40px;" class="b3-list--empty">${window.siyuan.languages.emptyContent}</li>`;}let html = "";- data.forEach((item: { title: string, fileID: string, path: string, hSize: string }, index) => {+ data.forEach((item: { title: string, fileID: string, path: string, hSize: string, updated: number }, index) => {let id2 = "";if (data2) {id2 = `data-id2="${data2[index].fileID}"`;}- html += `<li style="padding-left: 40px;" class="b3-list-item b3-list-item--hide-action" ${id2} data-id="${item.fileID}">+ html += `<li style="padding-left: 40px;" class="b3-list-item b3-list-item--hide-action" ${id2} data-created="${item.updated}" data-id="${item.fileID}"><span class="b3-list-item__text" title="${escapeAttr(item.path)} ${item.hSize}">${escapeHtml(item.title)}</span><span class="fn__space"></span><span class="b3-list-item__action ariaLabel${hasUndo ? "" : " fn__none"}" data-type="rollback" data-position="6south" aria-label="${window.siyuan.languages.rollback}">@@ -208,7 +209,11 @@ export const showDiff = (app: App, data: { id: string, time: string }[]) => {event.stopPropagation();break;} else if (target.getAttribute("data-type") == "rollback") {- fetchPost("/api/repo/rollbackRepoSnapshotFile", {id: target.parentElement.dataset.id});+ confirmDialog("⚠️ " + window.siyuan.languages.rollback,+ window.siyuan.languages.rollbackConfirm.replace("${name}", target.parentElement.textContent).replace("${time}", dayjs(parseInt(target.parentElement.dataset.created)).format("YYYY-MM-DD HH:mm:ss")),+ () => {+ fetchPost("/api/repo/rollbackRepoSnapshotFile", {id: target.parentElement.dataset.id});+ });event.preventDefault();event.stopPropagation();break;diff --git a/app/src/history/history.ts b/app/src/history/history.tsindex 82395b89c1..e0e49615a6 100644--- a/app/src/history/history.ts+++ b/app/src/history/history.ts@@ -572,32 +572,32 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {name = window.siyuan.languages.workspaceData;time = (isMobile() ? target.parentElement.parentElement : target.parentElement).querySelector("span[data-type='hCreated']").textContent.trim();}- const confirmTip = window.siyuan.languages.rollbackConfirm.replace("${name}", name)- .replace("${time}", time);- confirmDialog("⚠️ " + window.siyuan.languages.rollback, confirmTip, () => {- if (dataType === "assets") {- fetchPost("/api/history/rollbackAssetsHistory", {- historyPath: target.parentElement.getAttribute("data-path")- });- } else if (dataType === "doc") {- fetchPost("/api/history/rollbackDocHistory", {- notebook: target.parentElement.getAttribute("data-notebook-id"),- historyPath: target.parentElement.getAttribute("data-path")- });- } else if (dataType === "av") {- fetchPost("/api/history/rollbackAttributeViewHistory", {- historyPath: target.parentElement.getAttribute("data-path")- });- } else if (dataType === "notebook") {- fetchPost("/api/history/rollbackNotebookHistory", {- historyPath: target.parentElement.getAttribute("data-path")- });- } else {- fetchPost("/api/repo/checkoutRepo", {- id: target.parentElement.getAttribute("data-id")- });- }- });+ confirmDialog("⚠️ " + window.siyuan.languages.rollback,+ window.siyuan.languages.rollbackConfirm.replace("${name}", name).replace("${time}", time),+ () => {+ if (dataType === "assets") {+ fetchPost("/api/history/rollbackAssetsHistory", {+ historyPath: target.parentElement.getAttribute("data-path")+ });+ } else if (dataType === "doc") {+ fetchPost("/api/history/rollbackDocHistory", {+ notebook: target.parentElement.getAttribute("data-notebook-id"),+ historyPath: target.parentElement.getAttribute("data-path")+ });+ } else if (dataType === "av") {+ fetchPost("/api/history/rollbackAttributeViewHistory", {+ historyPath: target.parentElement.getAttribute("data-path")+ });+ } else if (dataType === "notebook") {+ fetchPost("/api/history/rollbackNotebookHistory", {+ historyPath: target.parentElement.getAttribute("data-path")+ });+ } else {+ fetchPost("/api/repo/checkoutRepo", {+ id: target.parentElement.getAttribute("data-id")+ });+ }+ });event.stopPropagation();event.preventDefault();break;