mirror of
https://github.com/AlistGo/alist.git
synced 2025-12-22 13:20:07 +08:00
Add a SIGN button to the management panel.
This commit is contained in:
parent
0e2a22ec8c
commit
ad7f3e2737
@ -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"`
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
1
public/dist/README.md
vendored
1
public/dist/README.md
vendored
@ -1 +0,0 @@
|
||||
## Put dist of frontend here.
|
||||
Loading…
Reference in New Issue
Block a user