Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Display a confirmation prompt when inserting large assets 256MB https://github.com/siyuan-note/siyuan/issues/16685

Danielbbfe30d62934
diff --git a/kernel/api/clipboard.go b/kernel/api/clipboard.go
index 4a6a589ea8..3f4a643bfb 100644
--- a/kernel/api/clipboard.go
+++ b/kernel/api/clipboard.go
@@ -17,9 +17,12 @@
package api
import (
+ "os"
+
"github.com/88250/clipboard"
"github.com/88250/gulu"
"github.com/gin-gonic/gin"
+ "github.com/siyuan-note/logging"
)
func readFilePaths(c *gin.Context) {
@@ -33,5 +36,21 @@ func readFilePaths(c *gin.Context) {
if 1 > len(paths) {
paths = []string{}
}
- ret.Data = paths
+
+ data := map[string]map[string]any{}
+ for _, path := range paths {
+ fi, err := os.Stat(path)
+ if nil != err {
+ logging.LogErrorf("stat file failed: %s", err)
+ continue
+ }
+
+ data[path] = map[string]any{
+ "name": fi.Name(),
+ "size": fi.Size(),
+ "isDir": fi.IsDir(),
+ "updated": fi.ModTime().UnixMilli(),
+ }
+ }
+ ret.Data = data
}