mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
feat: better breadcrumbs for config list and editor; add filename filter for configurations list.
This commit is contained in:
parent
53ae1a1ef9
commit
5dd2c8f931
8 changed files with 147 additions and 12 deletions
|
@ -8,9 +8,11 @@ import (
|
|||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func GetConfigs(c *gin.Context) {
|
||||
name := c.Query("name")
|
||||
orderBy := c.Query("order_by")
|
||||
sort := c.DefaultQuery("sort", "desc")
|
||||
dir := c.DefaultQuery("dir", "/")
|
||||
|
@ -28,6 +30,10 @@ func GetConfigs(c *gin.Context) {
|
|||
file := configFiles[i]
|
||||
fileInfo, _ := file.Info()
|
||||
|
||||
if name != "" && !strings.Contains(file.Name(), name) {
|
||||
continue
|
||||
}
|
||||
|
||||
switch mode := fileInfo.Mode(); {
|
||||
case mode.IsRegular(): // regular file, not a hidden file
|
||||
if "." == file.Name()[0:1] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue