local sort for no sort param driver

This commit is contained in:
微凉
2021-12-30 16:15:57 +08:00
parent 0f079827e5
commit 3331462229
8 changed files with 42 additions and 44 deletions

View File

@ -16,6 +16,7 @@ type DriverConfig struct {
ApiProxy bool // 使用API中转的
NoNeedSetLink bool // 不需要设置链接的
NoCors bool // 不可以跨域
LocalSort bool // 本地排序
}
type Args struct {
@ -133,6 +134,24 @@ func GetDrivers() map[string][]Item {
},
}, res[k]...)
}
if v.Config().LocalSort {
res[k] = append(res[k], []Item{
{
Name: "order_by",
Label: "order_by",
Type: TypeSelect,
Values: "name,size,updated_at",
Required: false,
},
{
Name: "order_direction",
Label: "order_direction",
Type: TypeSelect,
Values: "ASC,DESC",
Required: false,
},
}...)
}
}
return res
}