mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 10:55:51 +02:00
feat: added name filter for domains list #41
This commit is contained in:
parent
c4f87fb4cc
commit
3d0c40eaac
2 changed files with 11 additions and 3 deletions
|
@ -15,6 +15,7 @@ import (
|
|||
)
|
||||
|
||||
func GetDomains(c *gin.Context) {
|
||||
name := c.Query("name")
|
||||
orderBy := c.Query("order_by")
|
||||
sort := c.DefaultQuery("sort", "desc")
|
||||
|
||||
|
@ -49,6 +50,9 @@ func GetDomains(c *gin.Context) {
|
|||
file := configFiles[i]
|
||||
fileInfo, _ := file.Info()
|
||||
if !file.IsDir() {
|
||||
if name != "" && !strings.Contains(file.Name(), name) {
|
||||
continue
|
||||
}
|
||||
configs = append(configs, gin.H{
|
||||
"name": file.Name(),
|
||||
"size": fileInfo.Size(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue