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: Display a confirmation prompt when inserting large assets 256MB https://github.com/siyuan-note/siyuan/issues/16685
Daniel8801b7e93367
diff --git a/app/src/asset/anno.ts b/app/src/asset/anno.tsindex aec90b2246..a91098ded7 100644--- a/app/src/asset/anno.ts+++ b/app/src/asset/anno.ts@@ -743,7 +743,7 @@ const copyAnno = (idPath: string, fileName: string, pdf: any) => {const imageName = content + ".png";let msg = "";if (Constants.SIZE_UPLOAD_TIP_SIZE <= blob.size) {- msg = window.siyuan.languages.uploadFileTooLarge.replace("${x}", imageName).replace("${y}", filesize(blob.size, {standard: "jedec"}));+ msg = window.siyuan.languages.uploadFileTooLarge.replace("${x}", imageName).replace("${y}", filesize(blob.size, {standard: "iec"}));}confirmDialog(msg ? window.siyuan.languages.upload : "", msg, () => {const formData = new FormData();diff --git a/app/src/protyle/render/av/asset.ts b/app/src/protyle/render/av/asset.tsindex 7a2af2f19a..3a8169f0be 100644--- a/app/src/protyle/render/av/asset.ts+++ b/app/src/protyle/render/av/asset.ts@@ -427,7 +427,7 @@ export const dragUpload = (files: ILocalFiles[], protyle: IProtyle, cellElement:const assetPaths: string[] = [];files.forEach(item => {if (item.size && Constants.SIZE_UPLOAD_TIP_SIZE <= item.size) {- msg += window.siyuan.languages.uploadFileTooLarge.replace("${x}", item.path).replace("${y}", filesize(item.size, {standard: "jedec"})) + "<br>";+ msg += window.siyuan.languages.uploadFileTooLarge.replace("${x}", item.path).replace("${y}", filesize(item.size, {standard: "iec"})) + "<br>";}assetPaths.push(item.path);});diff --git a/app/src/protyle/upload/index.ts b/app/src/protyle/upload/index.tsindex 0947dae473..3a736c1edb 100644--- a/app/src/protyle/upload/index.ts+++ b/app/src/protyle/upload/index.ts@@ -220,7 +220,7 @@ export const uploadLocalFiles = (files: ILocalFiles[], protyle: IProtyle, isUploconst assetPaths: string[] = [];files.forEach(item => {if (item.size && Constants.SIZE_UPLOAD_TIP_SIZE <= item.size) {- msg += window.siyuan.languages.uploadFileTooLarge.replace("${x}", item.path).replace("${y}", filesize(item.size, {standard: "jedec"})) + "<br>";+ msg += window.siyuan.languages.uploadFileTooLarge.replace("${x}", item.path).replace("${y}", filesize(item.size, {standard: "iec"})) + "<br>";}assetPaths.push(item.path);});@@ -311,7 +311,7 @@ export const uploadFiles = (protyle: IProtyle, files: FileList | DataTransferItefor (let i = 0, iMax = validateResult.files.length; i < iMax; i++) {formData.append(protyle.options.upload.fieldName, validateResult.files[i]);if (Constants.SIZE_UPLOAD_TIP_SIZE <= validateResult.files[i].size) {- msg += window.siyuan.languages.uploadFileTooLarge.replace("${x}", validateResult.files[i].name).replace("${y}", filesize(validateResult.files[i].size, {standard: "jedec"})) + "<br>";+ msg += window.siyuan.languages.uploadFileTooLarge.replace("${x}", validateResult.files[i].name).replace("${y}", filesize(validateResult.files[i].size, {standard: "iec"})) + "<br>";}}