mirror of https://github.com/Xhofe/alist
chore: replace string with const
parent
ba648fa10c
commit
65fba7936c
|
@ -9,6 +9,7 @@ const (
|
||||||
TypeSelect = "select"
|
TypeSelect = "select"
|
||||||
TypeBool = "bool"
|
TypeBool = "bool"
|
||||||
TypeText = "text"
|
TypeText = "text"
|
||||||
|
TypeNumber = "number"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Item struct {
|
type Item struct {
|
||||||
|
|
|
@ -27,46 +27,46 @@ func registerDriverItems(config Config, addition Additional) {
|
||||||
func getMainItems(config Config) []Item {
|
func getMainItems(config Config) []Item {
|
||||||
items := []Item{{
|
items := []Item{{
|
||||||
Name: "virtual_path",
|
Name: "virtual_path",
|
||||||
Type: "string",
|
Type: TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
Help: "",
|
Help: "",
|
||||||
}, {
|
}, {
|
||||||
Name: "index",
|
Name: "index",
|
||||||
Type: "int",
|
Type: TypeNumber,
|
||||||
Help: "use to sort",
|
Help: "use to sort",
|
||||||
}, {
|
}, {
|
||||||
Name: "down_proxy_url",
|
Name: "down_proxy_url",
|
||||||
Type: "text",
|
Type: TypeText,
|
||||||
}, {
|
}, {
|
||||||
Name: "webdav_direct",
|
Name: "webdav_direct",
|
||||||
Type: "bool",
|
Type: TypeBool,
|
||||||
Help: "Transfer the WebDAV of this account through the native without redirect",
|
Help: "Transfer the WebDAV of this account through the native without redirect",
|
||||||
}}
|
}}
|
||||||
if !config.OnlyProxy && !config.OnlyLocal {
|
if !config.OnlyProxy && !config.OnlyLocal {
|
||||||
items = append(items, []Item{{
|
items = append(items, []Item{{
|
||||||
Name: "web_proxy",
|
Name: "web_proxy",
|
||||||
Type: "bool",
|
Type: TypeBool,
|
||||||
}, {
|
}, {
|
||||||
Name: "webdav_proxy",
|
Name: "webdav_proxy",
|
||||||
Type: "bool",
|
Type: TypeBool,
|
||||||
},
|
},
|
||||||
}...)
|
}...)
|
||||||
}
|
}
|
||||||
if config.LocalSort {
|
if config.LocalSort {
|
||||||
items = append(items, []Item{{
|
items = append(items, []Item{{
|
||||||
Name: "order_by",
|
Name: "order_by",
|
||||||
Type: "select",
|
Type: TypeSelect,
|
||||||
Values: "name,size,updated_at",
|
Values: "name,size,modified",
|
||||||
}, {
|
}, {
|
||||||
Name: "order_direction",
|
Name: "order_direction",
|
||||||
Type: "select",
|
Type: TypeSelect,
|
||||||
Values: "ASC,DESC",
|
Values: "ASC,DESC",
|
||||||
}}...)
|
}}...)
|
||||||
}
|
}
|
||||||
items = append(items, Item{
|
items = append(items, Item{
|
||||||
Name: "extract_folder",
|
Name: "extract_folder",
|
||||||
|
Type: TypeSelect,
|
||||||
Values: "front,back",
|
Values: "front,back",
|
||||||
Type: "select",
|
|
||||||
})
|
})
|
||||||
return items
|
return items
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue