diff --git a/server/internal/handler/config.go b/server/internal/handler/config.go index b3e449a..82b1493 100644 --- a/server/internal/handler/config.go +++ b/server/internal/handler/config.go @@ -29,6 +29,7 @@ type ConfigListRequest struct { Env string `form:"env"` AppId *int `form:"appId"` Deleted bool `form:"deleted"` + Keyword string `form:"keyword"` } func (h *ConfigHandler) List(c *gin.Context) { @@ -59,6 +60,11 @@ func (h *ConfigHandler) List(c *gin.Context) { conditions = append(conditions, "env = ?") args = append(args, req.Env) } + if req.Keyword != "" { + like := "%" + req.Keyword + "%" + conditions = append(conditions, "(name LIKE ? OR contents LIKE ?)") + args = append(args, like, like) + } if req.AppId != nil { if *req.AppId <= 0 { conditions = append(conditions, "(app_id is null OR app_id = 0)") diff --git a/web/src/views/config/AllConfigList.vue b/web/src/views/config/AllConfigList.vue index da3d4ef..534d35b 100644 --- a/web/src/views/config/AllConfigList.vue +++ b/web/src/views/config/AllConfigList.vue @@ -2,6 +2,9 @@