Skip to content

Commit

Permalink
chore: replace string with const
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jun 8, 2022
1 parent ba648fa commit 65fba79
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions internal/driver/addition.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const (
TypeSelect = "select"
TypeBool = "bool"
TypeText = "text"
TypeNumber = "number"
)

type Item struct {
Expand Down
20 changes: 10 additions & 10 deletions internal/driver/manage.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,46 +27,46 @@ func registerDriverItems(config Config, addition Additional) {
func getMainItems(config Config) []Item {
items := []Item{{
Name: "virtual_path",
Type: "string",
Type: TypeString,
Required: true,
Help: "",
}, {
Name: "index",
Type: "int",
Type: TypeNumber,
Help: "use to sort",
}, {
Name: "down_proxy_url",
Type: "text",
Type: TypeText,
}, {
Name: "webdav_direct",
Type: "bool",
Type: TypeBool,
Help: "Transfer the WebDAV of this account through the native without redirect",
}}
if !config.OnlyProxy && !config.OnlyLocal {
items = append(items, []Item{{
Name: "web_proxy",
Type: "bool",
Type: TypeBool,
}, {
Name: "webdav_proxy",
Type: "bool",
Type: TypeBool,
},
}...)
}
if config.LocalSort {
items = append(items, []Item{{
Name: "order_by",
Type: "select",
Values: "name,size,updated_at",
Type: TypeSelect,
Values: "name,size,modified",
}, {
Name: "order_direction",
Type: "select",
Type: TypeSelect,
Values: "ASC,DESC",
}}...)
}
items = append(items, Item{
Name: "extract_folder",
Type: TypeSelect,
Values: "front,back",
Type: "select",
})
return items
}
Expand Down

0 comments on commit 65fba79

Please sign in to comment.