mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 10:55:51 +02:00
fix: config list sorter invalid
This commit is contained in:
parent
902aa28746
commit
56e82d9c5a
1 changed files with 3 additions and 3 deletions
|
@ -13,8 +13,8 @@ import (
|
||||||
|
|
||||||
func GetConfigs(c *gin.Context) {
|
func GetConfigs(c *gin.Context) {
|
||||||
name := c.Query("name")
|
name := c.Query("name")
|
||||||
orderBy := c.Query("order_by")
|
sortBy := c.Query("sort_by")
|
||||||
sort := c.DefaultQuery("sort", "desc")
|
order := c.DefaultQuery("order", "desc")
|
||||||
dir := c.DefaultQuery("dir", "/")
|
dir := c.DefaultQuery("dir", "/")
|
||||||
|
|
||||||
configFiles, err := os.ReadDir(nginx.GetConfPath(dir))
|
configFiles, err := os.ReadDir(nginx.GetConfPath(dir))
|
||||||
|
@ -66,7 +66,7 @@ func GetConfigs(c *gin.Context) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
configs = config.Sort(orderBy, sort, configs)
|
configs = config.Sort(sortBy, order, configs)
|
||||||
|
|
||||||
c.JSON(http.StatusOK, gin.H{
|
c.JSON(http.StatusOK, gin.H{
|
||||||
"data": configs,
|
"data": configs,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue