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

Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2026-01-08 11:52:42 +08:00
parent 2525ce27f7
commit bbfe30d629
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -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
}