From 408408c439776888d5ae39525cfb43449e41c674 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Wed, 11 Feb 2026 13:50:45 +0800 Subject: [PATCH] fix: Firewall remove status filtering --- agent/app/service/firewall.go | 18 ++---------------- frontend/src/api/interface/host.ts | 1 - .../host/firewall/forward/import/index.vue | 1 - .../src/views/host/firewall/forward/index.vue | 2 -- .../views/host/firewall/ip/import/index.vue | 1 - frontend/src/views/host/firewall/ip/index.vue | 1 - .../views/host/firewall/port/import/index.vue | 1 - .../src/views/host/firewall/port/index.vue | 8 -------- .../src/views/host/firewall/status/index.vue | 2 +- 9 files changed, 3 insertions(+), 32 deletions(-) diff --git a/agent/app/service/firewall.go b/agent/app/service/firewall.go index f54c3eef2bc7..b06c2d0e135a 100644 --- a/agent/app/service/firewall.go +++ b/agent/app/service/firewall.go @@ -112,29 +112,15 @@ func (u *FirewallService) SearchWithPage(req dto.RuleSearch) (int64, interface{} } } - var datasFilterStatus []fireClient.FireInfo - if len(req.Status) != 0 { - for _, data := range datas { - if req.Status == "free" && len(data.UsedStatus) == 0 { - datasFilterStatus = append(datasFilterStatus, data) - } - if req.Status == "used" && len(data.UsedStatus) != 0 { - datasFilterStatus = append(datasFilterStatus, data) - } - } - } else { - datasFilterStatus = datas - } - var datasFilterStrategy []fireClient.FireInfo if len(req.Strategy) != 0 { - for _, data := range datasFilterStatus { + for _, data := range datas { if req.Strategy == data.Strategy { datasFilterStrategy = append(datasFilterStrategy, data) } } } else { - datasFilterStrategy = datasFilterStatus + datasFilterStrategy = datas } total, start, end := len(datasFilterStrategy), (req.Page-1)*req.PageSize, req.Page*req.PageSize diff --git a/frontend/src/api/interface/host.ts b/frontend/src/api/interface/host.ts index be8fb2520b6a..ded4e3731a08 100644 --- a/frontend/src/api/interface/host.ts +++ b/frontend/src/api/interface/host.ts @@ -74,7 +74,6 @@ export namespace Host { pingStatus: string; } export interface RuleSearch extends ReqPage { - status: string; strategy: string; info: string; type: string; diff --git a/frontend/src/views/host/firewall/forward/import/index.vue b/frontend/src/views/host/firewall/forward/import/index.vue index 4daf320b5c8e..7dcbda62086d 100644 --- a/frontend/src/views/host/firewall/forward/import/index.vue +++ b/frontend/src/views/host/firewall/forward/import/index.vue @@ -109,7 +109,6 @@ const acceptParams = async (fireName: string): Promise => { const loadCurrentData = async (fireName: string) => { const res = await searchFireRule({ type: 'forward', - status: '', strategy: '', info: '', page: 1, diff --git a/frontend/src/views/host/firewall/forward/index.vue b/frontend/src/views/host/firewall/forward/index.vue index f3e850eda5fa..fc141eaa79c1 100644 --- a/frontend/src/views/host/firewall/forward/index.vue +++ b/frontend/src/views/host/firewall/forward/index.vue @@ -111,7 +111,6 @@ const loading = ref(); const activeTag = ref('forward'); const selects = ref([]); const searchName = ref(); -const searchStatus = ref(''); const searchStrategy = ref(''); const maskShow = ref(true); @@ -141,7 +140,6 @@ const search = async () => { } let params = { type: activeTag.value, - status: searchStatus.value, strategy: searchStrategy.value, info: searchName.value, page: paginationConfig.currentPage, diff --git a/frontend/src/views/host/firewall/ip/import/index.vue b/frontend/src/views/host/firewall/ip/import/index.vue index 8f606bd7f061..0fcc23ec4d6a 100644 --- a/frontend/src/views/host/firewall/ip/import/index.vue +++ b/frontend/src/views/host/firewall/ip/import/index.vue @@ -103,7 +103,6 @@ const acceptParams = async (): Promise => { const loadCurrentData = async () => { const res = await searchFireRule({ type: 'address', - status: '', strategy: '', info: '', page: 1, diff --git a/frontend/src/views/host/firewall/ip/index.vue b/frontend/src/views/host/firewall/ip/index.vue index 9688649938b2..b56cabce4cf8 100644 --- a/frontend/src/views/host/firewall/ip/index.vue +++ b/frontend/src/views/host/firewall/ip/index.vue @@ -163,7 +163,6 @@ const search = async () => { } let params = { type: activeTag.value, - status: '', strategy: searchStrategy.value, info: searchName.value, page: paginationConfig.currentPage, diff --git a/frontend/src/views/host/firewall/port/import/index.vue b/frontend/src/views/host/firewall/port/import/index.vue index 0e257015e648..4c38fb759757 100644 --- a/frontend/src/views/host/firewall/port/import/index.vue +++ b/frontend/src/views/host/firewall/port/import/index.vue @@ -106,7 +106,6 @@ const acceptParams = async (): Promise => { const loadCurrentData = async () => { const res = await searchFireRule({ type: 'port', - status: '', strategy: '', info: '', page: 1, diff --git a/frontend/src/views/host/firewall/port/index.vue b/frontend/src/views/host/firewall/port/index.vue index 8b77404b4590..309dbeb5ae94 100644 --- a/frontend/src/views/host/firewall/port/index.vue +++ b/frontend/src/views/host/firewall/port/index.vue @@ -59,12 +59,6 @@