mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-16 21:55:29 +01:00
🎨 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:
parent
2525ce27f7
commit
bbfe30d629
1 changed files with 20 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue