mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-22 08:00:53 +00:00
fix: relocate firewall port whitelist settings (#12949)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -122,7 +122,7 @@ export const searchClamBaseInfo = () => {
|
||||
return http.post<Toolbox.ClamBaseInfo>(`/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<ResPage<Toolbox.ClamInfo>>(`/toolbox/clam/search`, param);
|
||||
|
||||
@@ -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') ||
|
||||
|
||||
@@ -46,9 +46,6 @@
|
||||
<el-button v-permission type="primary" @click="onOpenDialog('create')">
|
||||
{{ $t('commons.button.create') }}
|
||||
</el-button>
|
||||
<el-button v-permission @click="onOpenWhiteList" plain>
|
||||
{{ $t('firewall.portWhiteList') }}
|
||||
</el-button>
|
||||
<el-button v-permission @click="onDelete(null)" plain :disabled="selects.length === 0">
|
||||
{{ $t('commons.button.delete') }}
|
||||
</el-button>
|
||||
@@ -161,7 +158,6 @@
|
||||
<OperateDialog @search="search" ref="dialogRef" />
|
||||
<ImportDialog @search="search" ref="dialogImportRef" />
|
||||
<ProcessDetail ref="processDetailRef" />
|
||||
<WhiteList ref="whiteListRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -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<Process.ListeningProcess[]>([]);
|
||||
|
||||
@@ -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]),
|
||||
|
||||
@@ -48,6 +48,14 @@
|
||||
{{ $t('commons.button.bind') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<template v-if="props.currentTab == 'base'">
|
||||
<el-divider direction="vertical" />
|
||||
<el-button link type="primary" v-permission @click="onOpenWhiteList" plain>
|
||||
{{ $t('firewall.portWhiteList') }}
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<span v-if="onPing !== 'None'">
|
||||
<el-divider direction="vertical" />
|
||||
<el-button type="primary" link>{{ $t('firewall.noPing') }}</el-button>
|
||||
@@ -90,6 +98,7 @@
|
||||
<span>{{ $t('firewall.' + operation + 'FirewallHelper') }}</span>
|
||||
</template>
|
||||
</DockerRestart>
|
||||
<WhiteList ref="whiteListRef" @search="search" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -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<Host.FirewallBase>({
|
||||
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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user