1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

feat: 防火墙支持删除系统占用端口 (#2116)

This commit is contained in:
ssongliu 2023-08-30 10:30:09 +08:00 committed by wanghe-fit2cloud
parent 9800e7e03d
commit 5e182d84d0

View File

@ -68,7 +68,7 @@
@search="search" @search="search"
:data="data" :data="data"
> >
<el-table-column type="selection" :selectable="selectable" fix /> <el-table-column type="selection" fix />
<el-table-column :label="$t('commons.table.protocol')" :min-width="90" prop="protocol" /> <el-table-column :label="$t('commons.table.protocol')" :min-width="90" prop="protocol" />
<el-table-column :label="$t('commons.table.port')" :min-width="120" prop="port" /> <el-table-column :label="$t('commons.table.port')" :min-width="120" prop="port" />
<el-table-column :label="$t('commons.table.status')" :min-width="120"> <el-table-column :label="$t('commons.table.status')" :min-width="120">
@ -87,7 +87,6 @@
<template #default="{ row }"> <template #default="{ row }">
<el-button <el-button
v-if="row.strategy === 'accept'" v-if="row.strategy === 'accept'"
:disabled="row.appName === '1panel'"
@click="onChangeStatus(row, 'drop')" @click="onChangeStatus(row, 'drop')"
link link
type="success" type="success"
@ -303,28 +302,18 @@ const onDelete = async (row: Host.RuleInfo | null) => {
}); });
}; };
function selectable(row) {
return row.appName !== '1panel';
}
const buttons = [ const buttons = [
{ {
label: i18n.global.t('commons.button.edit'), label: i18n.global.t('commons.button.edit'),
click: (row: Host.RulePort) => { click: (row: Host.RulePort) => {
onOpenDialog('edit', row); onOpenDialog('edit', row);
}, },
disabled: (row: any) => {
return row.appName === '1panel';
},
}, },
{ {
label: i18n.global.t('commons.button.delete'), label: i18n.global.t('commons.button.delete'),
click: (row: Host.RuleInfo) => { click: (row: Host.RuleInfo) => {
onDelete(row); onDelete(row);
}, },
disabled: (row: any) => {
return row.appName === '1panel';
},
}, },
]; ];