Add a SIGN button to the management panel.

pull/3924/head
Season Shi 2023-03-23 04:14:11 +08:00
parent 0e2a22ec8c
commit ad7f3e2737
No known key found for this signature in database
GPG Key ID: 024D6B1E861D7FB0
3 changed files with 7 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import (
type Addition struct {
driver.RootPath
Thumbnail bool `json:"thumbnail" required:"true" help:"enable thumbnail"`
Sign bool `json:"sign" default:"false" required:"false" help:"enable sign"`
ShowHidden bool `json:"show_hidden" default:"true" required:"false" help:"show hidden directories and files"`
MkdirPerm string `json:"mkdir_perm" default:"777"`
}

View File

@ -5,14 +5,18 @@ import (
json "github.com/json-iterator/go"
)
type signType struct {
Sign bool `json:"sign"`
}
func IsStorageSigned(rawPath string) bool {
var jsonData signType
storage := op.GetBalancedStorage(rawPath).GetStorage()
var jsonData = map[string]interface{}{}
err := json.Unmarshal([]byte(storage.Addition), &jsonData)
if err != nil {
return false
}
if jsonData["sign"] == "true" {
if jsonData.Sign == true {
return true
}
return false

View File

@ -1 +0,0 @@
## Put dist of frontend here.