mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2026-10-21 05:26:51 +00:00
feature (API): file mode - #937
This commit is contained in:
@@ -4,11 +4,11 @@ import (
|
||||
"archive/zip"
|
||||
"context"
|
||||
"crypto/sha1"
|
||||
"hash/crc32"
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"hash"
|
||||
"hash/crc32"
|
||||
"hash/fnv"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -29,6 +29,7 @@ type FileInfo struct {
|
||||
Type string `json:"type"`
|
||||
Size int64 `json:"size"`
|
||||
Time int64 `json:"time"`
|
||||
Mode uint32 `json:"mode,omitempty"`
|
||||
Offline bool `json:"offline,omitempty"`
|
||||
}
|
||||
|
||||
@@ -174,6 +175,9 @@ func FileLs(ctx *App, res http.ResponseWriter, req *http.Request) {
|
||||
}
|
||||
return "directory"
|
||||
}(entries[i].Mode()),
|
||||
Mode: func(mode os.FileMode) uint32 {
|
||||
return uint32(mode)
|
||||
}(entries[i].Mode()),
|
||||
}
|
||||
if f, ok := entries[i].Sys().(File); ok && f.Offline == true {
|
||||
files[i].Offline = true
|
||||
|
||||
Reference in New Issue
Block a user