From 375824f77a63059dd4958a02c3cf33af0d8a2187 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Mon, 8 Jun 2026 14:24:24 +0800 Subject: [PATCH] fix: relocate firewall port whitelist settings (#12949) --- agent/app/api/v2/clam.go | 2 +- frontend/src/api/modules/toolbox.ts | 2 +- .../src/components/complex-table/index.vue | 7 +++++++ .../src/views/host/firewall/port/index.vue | 10 ---------- .../src/views/host/firewall/status/index.vue | 19 +++++++++++++++++++ .../{port => status}/white-list/index.vue | 0 6 files changed, 28 insertions(+), 12 deletions(-) rename frontend/src/views/host/firewall/{port => status}/white-list/index.vue (100%) diff --git a/agent/app/api/v2/clam.go b/agent/app/api/v2/clam.go index 68585d4a0..00144ea22 100644 --- a/agent/app/api/v2/clam.go +++ b/agent/app/api/v2/clam.go @@ -123,7 +123,7 @@ func (b *BaseApi) LoadClamBaseInfo(c *gin.Context) { // @Security ApiKeyAuth // @Security Timestamp // @Router /toolbox/clam/operate [post] -// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] Clam","formatEN":"[operation] FTP"} +// @x-panel-log {"bodyKeys":["operation"],"paramKeys":[],"BeforeFunctions":[],"formatZH":"[operation] Clam","formatEN":"[operation] Clam"} func (b *BaseApi) OperateClam(c *gin.Context) { var req dto.Operate if err := helper.CheckBindAndValidate(&req, c); err != nil { diff --git a/frontend/src/api/modules/toolbox.ts b/frontend/src/api/modules/toolbox.ts index 6d2a638bb..c3346d34a 100644 --- a/frontend/src/api/modules/toolbox.ts +++ b/frontend/src/api/modules/toolbox.ts @@ -122,7 +122,7 @@ export const searchClamBaseInfo = () => { return http.post(`/toolbox/clam/base`); }; export const updateClamBaseInfo = (operate: string) => { - return http.post(`/toolbox/clam/operate`, { Operation: operate }, TimeoutEnum.T_60S); + return http.post(`/toolbox/clam/operate`, { operation: operate }, TimeoutEnum.T_60S); }; export const searchClam = (param: ReqPage) => { return http.post>(`/toolbox/clam/search`, param); diff --git a/frontend/src/components/complex-table/index.vue b/frontend/src/components/complex-table/index.vue index 1d21218d3..778064899 100644 --- a/frontend/src/components/complex-table/index.vue +++ b/frontend/src/components/complex-table/index.vue @@ -378,6 +378,13 @@ function handleRowClick(row: any, column: any, event: any) { if ( target.closest('button') || target.closest('a') || + target.closest('input') || + target.closest('textarea') || + target.closest('[contenteditable="true"]') || + target.closest('.el-input') || + target.closest('.el-textarea') || + target.closest('.el-input-number') || + target.closest('.el-date-editor') || target.closest('.el-switch') || target.closest('.el-select') || target.closest('.table-link') || diff --git a/frontend/src/views/host/firewall/port/index.vue b/frontend/src/views/host/firewall/port/index.vue index 3206ac1d0..77cd1070b 100644 --- a/frontend/src/views/host/firewall/port/index.vue +++ b/frontend/src/views/host/firewall/port/index.vue @@ -46,9 +46,6 @@ {{ $t('commons.button.create') }} - - {{ $t('firewall.portWhiteList') }} - {{ $t('commons.button.delete') }} @@ -161,7 +158,6 @@ - @@ -169,7 +165,6 @@ import FireRouter from '@/views/host/firewall/index.vue'; import OperateDialog from '@/views/host/firewall/port/operate/index.vue'; import ImportDialog from '@/views/host/firewall/port/import/index.vue'; -import WhiteList from '@/views/host/firewall/port/white-list/index.vue'; import FireStatus from '@/views/host/firewall/status/index.vue'; import ProcessDetail from '@/views/host/process/process/detail/index.vue'; import { onMounted, reactive, ref } from 'vue'; @@ -199,7 +194,6 @@ const fireStatusRef = ref(); const opRef = ref(); const dialogImportRef = ref(); const processDetailRef = ref(); -const whiteListRef = ref(); const listeningProcesses = ref([]); @@ -404,10 +398,6 @@ const onImport = () => { dialogImportRef.value.acceptParams(); }; -const onOpenWhiteList = () => { - whiteListRef.value.acceptParams(); -}; - const onExport = () => { ElMessageBox.confirm( i18n.global.t('firewall.exportHelper', [selects.value.length]), diff --git a/frontend/src/views/host/firewall/status/index.vue b/frontend/src/views/host/firewall/status/index.vue index 1489ae498..32f8802f4 100644 --- a/frontend/src/views/host/firewall/status/index.vue +++ b/frontend/src/views/host/firewall/status/index.vue @@ -48,6 +48,14 @@ {{ $t('commons.button.bind') }} + + + {{ $t('firewall.noPing') }} @@ -90,6 +98,7 @@ {{ $t('firewall.' + operation + 'FirewallHelper') }} + @@ -99,6 +108,7 @@ import { loadFireBaseInfo, operateFilterChain, operateFire } from '@/api/modules import i18n from '@/lang'; import NoSuchService from '@/components/layout-content/no-such-service.vue'; import DockerRestart from '@/components/docker-proxy/docker-restart.vue'; +import WhiteList from '@/views/host/firewall/status/white-list/index.vue'; import { MsgSuccess } from '@/utils/message'; import { ElMessageBox } from 'element-plus'; import { ref } from 'vue'; @@ -120,6 +130,7 @@ const baseInfo = ref({ const onPing = ref('Disable'); const oldStatus = ref(); const dockerRef = ref(); +const whiteListRef = ref(); const operation = ref('restart'); const dockerStatus = ref(); const withDockerRestart = ref(false); @@ -169,6 +180,10 @@ const loadDocker = async () => { dockerStatus.value = res.data.isExist; }; +const onOpenWhiteList = () => { + whiteListRef.value.acceptParams(); +}; + const loadInitMsg = () => { switch (props.currentTab) { case 'base': @@ -286,6 +301,10 @@ const onPingOperate = async (operation: string) => { }); }; +const search = () => { + emit('search'); +}; + defineExpose({ acceptParams, }); diff --git a/frontend/src/views/host/firewall/port/white-list/index.vue b/frontend/src/views/host/firewall/status/white-list/index.vue similarity index 100% rename from frontend/src/views/host/firewall/port/white-list/index.vue rename to frontend/src/views/host/firewall/status/white-list/index.vue