feat: better breadcrumbs for config list and editor; add filename filter for configurations list.

This commit is contained in:
Jacky 2024-07-25 19:26:07 +08:00
parent 53ae1a1ef9
commit 5dd2c8f931
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
8 changed files with 147 additions and 12 deletions

View file

@ -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] {