An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:iphone: Add encrypted notebook unlock UI on mobile #18034
Danieldc02714dc078
diff --git a/app/src/mobile/dock/MobileFiles.ts b/app/src/mobile/dock/MobileFiles.tsindex 7e2cafddaf..1b50db21ad 100644--- a/app/src/mobile/dock/MobileFiles.ts+++ b/app/src/mobile/dock/MobileFiles.ts@@ -13,7 +13,7 @@ import {fetchPost, fetchSyncPost} from "../../util/fetch";import {genUUID} from "../../util/genID";import {openMobileFileById} from "../editor";import {unicode2Emoji} from "../../emoji";-import {mountHelp, newNotebook} from "../../util/mount";+import {mountHelp, newNotebook, openEncryptedNotebook} from "../../util/mount";import {newFileInTree} from "../../util/newFile";import {MenuItem} from "../../menus/Menu";import {App} from "../../index";@@ -170,9 +170,16 @@ export class MobileFiles extends Model {event.preventDefault();break;} else if (type === "open") {- fetchPost("/api/notebook/openNotebook", {- notebook: target.getAttribute("data-url")- });+ const notebookId = target.getAttribute("data-url");+ const liElement = target.closest("li");+ // 加密笔记本关闭(锁定)时点"打开"先弹解锁框,解锁成功后再挂载+ if (liElement && liElement.getAttribute("data-encrypted") === "true") {+ openEncryptedNotebook(this.app, notebookId, liElement.querySelector(".b3-list-item__text").textContent);+ } else {+ fetchPost("/api/notebook/openNotebook", {+ notebook: notebookId+ });+ }event.stopPropagation();event.preventDefault();break;@@ -608,10 +615,14 @@ export class MobileFiles extends Model {private genNotebook(item: INotebook) {const editingPublishAccess = this.actionsElement.querySelector('[data-type="publish-access"]').classList.contains("block__icon--active");- const emojiHTML = `<span class="b3-list-item__icon b3-tooltips b3-tooltips__e${editingPublishAccess ? " fn__none" : ""}" aria-label="${window.siyuan.languages.changeIcon}">${unicode2Emoji(item.icon || window.siyuan.storage[Constants.LOCAL_IMAGES].note)}</span>`;+ // 加密笔记本关闭(锁定)时用 🔒 提示需解锁;打开(解锁)后恢复正常 emoji+ const iconContent = (item.encrypted && item.closed)+ ? "🔒️"+ : unicode2Emoji(item.icon || window.siyuan.storage[Constants.LOCAL_IMAGES].note);+ const emojiHTML = `<span class="b3-list-item__icon b3-tooltips b3-tooltips__e${editingPublishAccess ? " fn__none" : ""}" aria-label="${window.siyuan.languages.changeIcon}">${iconContent}</span>`;const switchHTML = `<span class="b3-list-item__switch b3-tooltips b3-tooltips__e${editingPublishAccess ? "" : " fn__none"}" aria-label="${window.siyuan.languages.publishAccess}">${getPublishAccessOptionByLevel("public").iconHTML}</span>`;if (item.closed) {- return `<li data-url="${item.id}" class="b3-list-item">+ return `<li data-url="${item.id}" class="b3-list-item"${item.encrypted ? ' data-encrypted="true"' : ""}><span class="b3-list-item__toggle fn__hidden"><svg class="b3-list-item__arrow"><use xlink:href="#iconRight"></use></svg></span>