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: Improve rollback data text https://github.com/siyuan-note/siyuan/issues/12486
Danielb80b063dbb30
diff --git a/app/appearance/langs/de_DE.json b/app/appearance/langs/de_DE.jsonindex 52772df657..126acd2b79 100644--- a/app/appearance/langs/de_DE.json+++ b/app/appearance/langs/de_DE.json@@ -1,4 +1,5 @@{+ "workspaceData": "Arbeitsbereichsdaten","confirmRemoveRelationField": "Sind Sie sicher, dass Sie das Feld, das mit <b>${x}</b> verknüpft ist, löschen möchten?","removeButKeepRelationField": "Entfernen, aber verknüpftes Feld behalten","exportPDFLowMemory": "Nicht genügend verfügbarer Speicher, um dieses PDF zu exportieren, bitte reduzieren Sie den Inhalt oder erhöhen Sie den verfügbaren Speicher und versuchen Sie es erneut",@@ -855,7 +856,7 @@"moveToBottomRight": "In die untere rechte Ecke verschieben","accountDisplayTitle": "Das Titelsymbol anzeigen","accountDisplayVIP": "Das VIP-Symbol anzeigen",- "rollbackConfirm": "Rollback-Operation kann nicht rückgängig gemacht werden, sind Sie sicher, dass Sie <b>${date}</b> zurückrollen möchten?",+ "rollbackConfirm": "Der Rollback-Vorgang kann nicht rückgängig gemacht werden, bitte gehen Sie vorsichtig vor. Sind Sie sicher, dass Sie <b>${name}</b> auf <b>${time}</b> zurücksetzen möchten?","pdfTip": "PDF-Export unterstützt kein Dunkelthema","pdfConfirm": "Möchten Sie mit dem ausgewählten Lichtthema weiter exportieren?","import": "Importieren",diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.jsonindex 7d8ffaa71c..c35ab123e7 100644--- a/app/appearance/langs/en_US.json+++ b/app/appearance/langs/en_US.json@@ -1,4 +1,5 @@{+ "workspaceData": "Workspace data","confirmRemoveRelationField": "Are you sure you want to delete the field associated with <b>${x}</b>?","removeButKeepRelationField": "Remove, but keep related field","exportPDFLowMemory": "Insufficient available memory to export this PDF, please reduce the content or increase available memory and try exporting again",@@ -855,7 +856,7 @@"moveToBottomRight": "Move to the Bottom Right","accountDisplayTitle": "Display the title icon","accountDisplayVIP": "Display the VIP icon",- "rollbackConfirm": "Rollback operation cannot be undone, are you sure you want to rollback <b>${date}</b> ?",+ "rollbackConfirm": "The rollback operation cannot be undone, please proceed with caution. Are you sure you want to roll back <b>${name}</b> to <b>${time}</b>?","pdfTip": "PDF export does not support Dark theme","pdfConfirm": "Do you want to continue exporting with the selected Light theme?","import": "Import",diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.jsonindex d38cde7f21..56308f6d6d 100644--- a/app/appearance/langs/es_ES.json+++ b/app/appearance/langs/es_ES.json@@ -1,4 +1,5 @@{+ "workspaceData": "Datos del espacio de trabajo","confirmRemoveRelationField": "¿Está seguro de que desea eliminar el campo asociado a <b>${x}</b>?","removeButKeepRelationField": "Eliminar, pero mantener el campo relacionado","exportPDFLowMemory": "Memoria disponible insuficiente para exportar este PDF, por favor reduzca el contenido o aumente la memoria disponible y vuelva a intentar exportar",@@ -855,7 +856,7 @@"moveToBottomRight": "Mover a la parte inferior derecha","accountDisplayTitle": "Mostrar el icono del título","accountDisplayVIP": "Mostrar el icono VIP",- "rollbackConfirm": "La operación de retroceso no se puede deshacer, ¿estás seguro de que quieres revertir <b>${date}</b> ?",+ "rollbackConfirm": "La operación de reversión no se puede deshacer, por favor proceda con precaución. ¿Está seguro de que desea revertir <b>${name}</b> a <b>${time}</b>?","pdfTip": "La exportación de PDF no es compatible con el tema oscuro","pdfConfirm": "¿Desea seguir exportando con el tema Claro seleccionado?","import": "Importar",diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.jsonindex 154d7af331..9339c05d4b 100644--- a/app/appearance/langs/fr_FR.json+++ b/app/appearance/langs/fr_FR.json@@ -1,4 +1,5 @@{+ "workspaceData": "Données de l'espace de travail","confirmRemoveRelationField": "Êtes-vous sûr de vouloir supprimer le champ associé à <b>${x}</b>?","removeButKeepRelationField": "Supprimer, mais conserver le champ associé","exportPDFLowMemory": "Mémoire disponible insuffisante pour exporter ce PDF, veuillez réduire le contenu ou augmenter la mémoire disponible et réessayer d'exporter",@@ -855,7 +856,7 @@"moveToBottomRight": "Déplacer vers la Bas à Droit","accountDisplayTitle": "Afficher l'icône du titre","accountDisplayVIP": "Afficher l'icône VIP",- "rollbackConfirm": "L'opération de retour en arrière est irréversible. Êtes-vous sûr de vouloir revenir en arrière à la date <b>${date}</b> ?",+ "rollbackConfirm": "L'opération de restauration ne peut pas être annulée, veuillez procéder avec prudence. Êtes-vous sûr de vouloir restaurer <b>${name}</b> à <b>${time}</b>?","pdfTip": "L'exportation de PDF ne supporte pas le thème Dark","pdfConfirm": "Voulez-vous continuer à exporter avec le thème clear sélectionné ?","import": "Importer",diff --git a/app/appearance/langs/he_IL.json b/app/appearance/langs/he_IL.jsonindex cbbb78a393..059d378024 100644--- a/app/appearance/langs/he_IL.json+++ b/app/appearance/langs/he_IL.json@@ -1,4 +1,5 @@{+ "workspaceData": "נתוני סביבת עבודה","confirmRemoveRelationField": "האם אתה בטוח שברצונך למחוק את השדה המשויך ל-<b>${x}</b>?","removeButKeepRelationField": "מחק, אך שמור על שדה הקשר","exportPDFLowMemory": "אין מספיק זיכרון זמין במערכת כדי לייצא את ה-PDF הזה, נא לצמצם את התוכן או להגדיל את הזיכרון הזמין ולנסות שוב לייצא",@@ -855,7 +856,7 @@"moveToBottomRight": "העבר לפינה התחתונה הימנית","accountDisplayTitle": "הצג את האייקון בכותרת","accountDisplayVIP": "הצג את אייקון ה-VIP",- "rollbackConfirm": "פעולת החזרה לא ניתנת לביטול, האם אתה בטוח שברצונך לחזור ל<b>${date}</b>?",+ "rollbackConfirm": "לא ניתן לבטל את פעולת השחזור, אנא היזהר בהחלטתך. האם אתה בטוח שברצונך לשחזר את <b>${name}</b> ל-<b>${time}</b>?","pdfTip": "ייצוא PDF אינו תומך בנושא כהה","pdfConfirm": "האם תרצה להמשיך לייצא עם הנושא הנבחר האור?","import": "ייבוא",diff --git a/app/appearance/langs/it_IT.json b/app/appearance/langs/it_IT.jsonindex e799bbe5a0..6727a49081 100644--- a/app/appearance/langs/it_IT.json+++ b/app/appearance/langs/it_IT.json@@ -1,4 +1,5 @@{+ "workspaceData": "Dati dello spazio di lavoro","confirmRemoveRelationField": "Sei sicuro di voler eliminare il campo associato a <b>${x}</b>?","removeButKeepRelationField": "Rimuovi, ma mantieni il campo correlato","exportPDFLowMemory": "Memoria disponibile insufficiente per esportare questo PDF, riduci il contenuto o aumenta la memoria disponibile e riprova a esportare",@@ -855,7 +856,7 @@"moveToBottomRight": "Sposta in basso a destra","accountDisplayTitle": "Mostra l'icona del titolo","accountDisplayVIP": "Mostra l'icona VIP",- "rollbackConfirm": "L'operazione di rollback non può essere annullata, sei sicuro di voler ripristinare a <b>${date}</b>?",+ "rollbackConfirm": "L'operazione di rollback non può essere annullata, si prega di procedere con cautela. Sei sicuro di voler ripristinare <b>${name}</b> a <b>${time}</b>?","pdfTip": "L'esportazione PDF non supporta il tema scuro","pdfConfirm": "Vuoi continuare l'esportazione con il tema chiaro selezionato?","import": "Importa",diff --git a/app/appearance/langs/ja_JP.json b/app/appearance/langs/ja_JP.jsonindex f8ecf62c99..deb45f6163 100644--- a/app/appearance/langs/ja_JP.json+++ b/app/appearance/langs/ja_JP.json@@ -1,4 +1,5 @@{+ "workspaceData": "ワークスペースデータ","confirmRemoveRelationField": "<b>${x}</b> に関連するフィールドを同時に削除してもよろしいですか?","removeButKeepRelationField": "削除して関連フィールドを保持","exportPDFLowMemory": "システムの利用可能なメモリが不足しているため、この PDF をエクスポートできません。内容を減らすか、利用可能なメモリを増やしてから再試行してください",@@ -855,7 +856,7 @@"moveToBottomRight": "右底","accountDisplayTitle": "タイトルアイコンを表示","accountDisplayVIP": "VIP アイコンを表示",- "rollbackConfirm": "ロールバック操作を取り消すことはできません。本当に <b>${date}</b> をロールバックしてもよろしいですか?",+ "rollbackConfirm": "ロールバック操作は元に戻せません。慎重に決定してください。<b>${name}</b> を <b>${time}</b> にロールバックしてもよろしいですか?","pdfTip": "PDF エクスポートはダークテーマに対応していません","pdfConfirm": "選択したライトテーマでエクスポートを続行しますか?","import": "インポート",diff --git a/app/appearance/langs/pl_PL.json b/app/appearance/langs/pl_PL.jsonindex 2610609783..34d340c596 100644--- a/app/appearance/langs/pl_PL.json+++ b/app/appearance/langs/pl_PL.json@@ -1,4 +1,5 @@{+ "workspaceData": "Dane przestrzeni roboczej","confirmRemoveRelationField": "Czy na pewno chcesz usunąć pole powiązane z <b>${x}</b>?","removeButKeepRelationField": "Usuń, ale zachowaj powiązane pole","exportPDFLowMemory": "Za mało dostępnej pamięci, aby wyeksportować ten PDF, proszę zmniejszyć zawartość lub zwiększyć dostępną pamięć i spróbować ponownie",@@ -855,7 +856,7 @@"moveToBottomRight": "Przenieś do dolnego prawego rogu","accountDisplayTitle": "Wyświetl ikonę tytułu","accountDisplayVIP": "Wyświetl ikonę VIP",- "rollbackConfirm": "Operacja wycofania nie może być cofnieta, czy na pewno chcesz cofnąć <b>${date}</b>?",+ "rollbackConfirm": "Operacja cofania nie może zostać anulowana, proszę zachować ostrożność. Czy na pewno chcesz cofnąć <b>${name}</b> do <b>${time}</b>?","pdfTip": "Eksport PDF nie wspiera ciemnego motywu","pdfConfirm": "Czy chcesz kontynuować eksport z wybranym jasnym motywem?","import": "Importuj",diff --git a/app/appearance/langs/ru_RU.json b/app/appearance/langs/ru_RU.jsonindex 4546cbe8dd..483f65f6cf 100644--- a/app/appearance/langs/ru_RU.json+++ b/app/appearance/langs/ru_RU.json@@ -1,4 +1,5 @@{+ "workspaceData": "Данные рабочей области","confirmRemoveRelationField": "Вы уверены, что хотите удалить поле, связанное с <b>${x}</b>?","removeButKeepRelationField": "Удалить, но сохранить связанное поле","exportPDFLowMemory": "Недостаточно доступной памяти для экспорта этого PDF, пожалуйста, уменьшите содержимое или увеличьте доступную память и повторите попытку экспорта",@@ -855,7 +856,7 @@"moveToBottomRight": "Переместить в нижний правый угол","accountDisplayTitle": "Отобразить значок заголовка","accountDisplayVIP": "Отобразить VIP-значок",- "rollbackConfirm": "Операция отката не может быть отменена, вы уверены, что хотите откатить <b>${date}</b>?",+ "rollbackConfirm": "Операция отката не может быть отменена, пожалуйста, будьте осторожны. Вы уверены, что хотите откатить <b>${name}</b> к <b>${time}</b>?","pdfTip": "Экспорт PDF не поддерживает темную тему","pdfConfirm": "Вы хотите продолжить экспорт с выбранной светлой темой?","import": "Импортировать",diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.jsonindex c6c9160721..7edbc7e080 100644--- a/app/appearance/langs/zh_CHT.json+++ b/app/appearance/langs/zh_CHT.json@@ -1,4 +1,5 @@{+ "workspaceData": "工作空間數據","confirmRemoveRelationField": "確定同時刪除關聯至 <b>${x}</b> 中的字段嗎?","removeButKeepRelationField": "刪除,但保留關聯字段","exportPDFLowMemory": "系統可用記憶體不足,無法導出該 PDF,請減少內容或者增加可用記憶體後再嘗試導出",@@ -855,7 +856,7 @@"moveToBottomRight": "移動到下側右方","accountDisplayTitle": "首欄顯示頭銜","accountDisplayVIP": "首欄顯示 VIP",- "rollbackConfirm": "回復操作無法撤銷,確定要將 <b>${date}</b> 回復嗎?",+ "rollbackConfirm": "回滾操作無法撤銷,請謹慎決定。確定要將 <b>${name}</b> 回滾到 <b>${time}</b> 嗎?","pdfTip": "PDF 匯出不支援深色主題","pdfConfirm": "是否使用已選擇的淺色主題繼續匯出?","import": "導入",diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.jsonindex eeecea70e2..99a546c060 100644--- a/app/appearance/langs/zh_CN.json+++ b/app/appearance/langs/zh_CN.json@@ -1,4 +1,5 @@{+ "workspaceData": "工作空间数据","confirmRemoveRelationField": "确定同时删除关联至 <b>${x}</b> 中的字段吗?","removeButKeepRelationField": "删除,但保留关联字段","exportPDFLowMemory": "系统可用内存不足,无法导出该 PDF,请减少内容或者增加可用内存后再尝试导出",@@ -855,7 +856,7 @@"moveToBottomRight": "移动到下侧右方","accountDisplayTitle": "顶栏显示头衔","accountDisplayVIP": "顶栏显示 VIP",- "rollbackConfirm": "回滚操作无法撤销,确定要将 <b>${date}</b> 回滚吗?",+ "rollbackConfirm": "回滚操作无法撤销,请谨慎决定。确定要将 <b>${name}</b> 回滚到 <b>${time}</b> 吗?","pdfTip": "PDF 导出不支持深色主题","pdfConfirm": "是否使用已选择的浅色主题继续导出?","import": "导入",diff --git a/app/src/history/doc.ts b/app/src/history/doc.tsindex 0df93c9220..4c3be571d3 100644--- a/app/src/history/doc.ts+++ b/app/src/history/doc.ts@@ -130,9 +130,12 @@ export const openDocHistory = (options: {if (type === "close") {dialog.destroy();} else if (type === "rollback" && !isLoading) {- getHistoryPath(target.parentElement, opElement.value, options.id, (dataPath) => {+ getHistoryPath(target.parentElement, opElement.value, options.id, (item) => {+ let dataPath = item.path;isLoading = false;- confirmDialog("⚠️ " + window.siyuan.languages.rollback, `${window.siyuan.languages.rollbackConfirm.replace("${date}", target.parentElement.textContent.trim())}`, () => {+ let confirmTip = window.siyuan.languages.rollbackConfirm.replace("${name}", item.title)+ .replace("${time}", target.previousElementSibling.previousElementSibling.textContent.trim());+ confirmDialog("⚠️ " + window.siyuan.languages.rollback, confirmTip, () => {fetchPost("/api/history/rollbackDocHistory", {notebook: options.notebookId,historyPath: dataPath@@ -143,7 +146,8 @@ export const openDocHistory = (options: {event.preventDefault();break;} else if (target.classList.contains("b3-list-item") && !isLoading) {- getHistoryPath(target, opElement.value, options.id, (dataPath) => {+ getHistoryPath(target, opElement.value, options.id, (item) => {+ let dataPath = item.path;fetchPost("/api/history/getDocHistoryContent", {historyPath: dataPath,}, (response) => {@@ -180,7 +184,7 @@ export const openDocHistory = (options: {});};-const getHistoryPath = (target: Element, op: string, id: string, cb: (path: string) => void) => {+const getHistoryPath = (target: Element, op: string, id: string, cb: (item: any) => void) => {isLoading = true;const path = target.getAttribute("data-path");if (path) {@@ -194,6 +198,6 @@ const getHistoryPath = (target: Element, op: string, id: string, cb: (path: stritype: 3,created}, (response) => {- cb(response.data.items[0].path);+ cb(response.data.items[0]);});};diff --git a/app/src/history/history.ts b/app/src/history/history.tsindex 3e40e1535c..25c25f7b23 100644--- a/app/src/history/history.ts+++ b/app/src/history/history.ts@@ -1,19 +1,19 @@-import { Dialog } from "../dialog";-import { confirmDialog } from "../dialog/confirmDialog";-import { Constants } from "../constants";-import { hasClosestByClassName } from "../protyle/util/hasClosest";-import { renderAssetsPreview } from "../asset/renderAssets";-import { Protyle } from "../protyle";-import { disabledProtyle, onGet } from "../protyle/util/onGet";+import {Dialog} from "../dialog";+import {confirmDialog} from "../dialog/confirmDialog";+import {Constants} from "../constants";+import {hasClosestByClassName} from "../protyle/util/hasClosest";+import {renderAssetsPreview} from "../asset/renderAssets";+import {Protyle} from "../protyle";+import {disabledProtyle, onGet} from "../protyle/util/onGet";import * as dayjs from "dayjs";-import { fetchPost } from "../util/fetch";-import { escapeAttr, escapeHtml } from "../util/escape";-import { isMobile } from "../util/functions";-import { showDiff } from "./diff";-import { setStorageVal } from "../protyle/util/compatibility";-import { openModel } from "../mobile/menu/model";-import { closeModel } from "../mobile/util/closePanel";-import { App } from "../index";+import {fetchPost} from "../util/fetch";+import {escapeAttr, escapeHtml} from "../util/escape";+import {isMobile} from "../util/functions";+import {showDiff} from "./diff";+import {setStorageVal} from "../protyle/util/compatibility";+import {openModel} from "../mobile/menu/model";+import {closeModel} from "../mobile/util/closePanel";+import {App} from "../index";let historyEditor: Protyle;@@ -530,8 +530,18 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {event.preventDefault();break;} else if (target.classList.contains("b3-list-item__action") && type === "rollback" && !window.siyuan.config.readonly) {- confirmDialog("⚠️ " + window.siyuan.languages.rollback, `${window.siyuan.languages.rollbackConfirm.replace("${date}", target.parentElement.textContent.trim())}`, () => {- const dataType = target.parentElement.getAttribute("data-type");+ const dataType = target.parentElement.getAttribute("data-type");+ let name = target.previousElementSibling.previousElementSibling.textContent.trim();+ let time = dayjs(parseInt(target.parentElement.getAttribute("data-created")) * 1000).format("YYYY-MM-DD HH:mm:ss");+ if (dataType === "notebook") {+ time = target.parentElement.parentElement.previousElementSibling.textContent.trim();+ } else if (dataType === "repoitem") {+ name = window.siyuan.languages.workspaceData;+ time = target.parentElement.querySelector("span[data-type='hCreated']").textContent.trim();+ }+ let 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")