diff --git a/neutrino-proxy-admin/src/api/securityGroup.js b/neutrino-proxy-admin/src/api/securityGroup.js index f6987719..451539f1 100644 --- a/neutrino-proxy-admin/src/api/securityGroup.js +++ b/neutrino-proxy-admin/src/api/securityGroup.js @@ -58,6 +58,14 @@ export function updateGroupEnableStatus(id, enable) { }) } +export function fetchRulePage(query) { + return request({ + url: '/security/rule/page', + method: 'get', + params: query + }) +} + export function fetchRuleList(query) { return request({ url: '/security/rule/list', @@ -89,16 +97,13 @@ export function deleteRule(query) { }) } -export function enableRule(ruleId) { +export function updateRuleEnableStatus(id, enable) { return request({ - url: `/security/rule/enable?ruleId=${ruleId}`, - method: 'post' - }) -} - -export function disableRule(ruleId) { - return request({ - url: `/security/rule/disable?ruleId=${ruleId}`, - method: 'post' + url: '/security/rule/update/enable-status', + method: 'post', + data: { + id: id, + enable: enable + } }) } diff --git a/neutrino-proxy-admin/src/views/system/securityGroup.vue b/neutrino-proxy-admin/src/views/system/securityGroup.vue index 5afcfed3..0430080c 100644 --- a/neutrino-proxy-admin/src/views/system/securityGroup.vue +++ b/neutrino-proxy-admin/src/views/system/securityGroup.vue @@ -3,11 +3,15 @@
+ + + {{ - $t('table.search') }} + $t('table.search') }} + {{$t('table.add')}}
@@ -31,18 +35,17 @@ @@ -186,6 +189,7 @@ import {fetchGroupPage, createGroup, updateGroup, deleteGroup, updateGroupEnableStatus} from '@/api/securityGroup' import { fetchList as fetchPortMappingList, portMappingBindSecurityGroup, portMappingUnbindSecurityGroup} from '@/api/portMapping' import waves from '@/directive/waves' // 水波纹指令 +import { parseTime } from '@/utils' import LinkPopover from '../../components/Link/linkPopover' export default { @@ -206,6 +210,7 @@ import LinkPopover from '../../components/Link/linkPopover' size: 10, name: undefined, description: undefined, + defaultPassType: undefined, enable: undefined }, listLoading: true, @@ -217,7 +222,9 @@ import LinkPopover from '../../components/Link/linkPopover' }, selectObj: { statusOptions: [{ label: '启用', value: 1 }, { label: '禁用', value: 2 }], - onlineOptions: [{ label: '在线', value: 1 }, { label: '离线', value: 2 }] + onlineOptions: [{ label: '在线', value: 1 }, { label: '离线', value: 2 }], + passType: [{ label: '允许', value: 1 }, { label: '拒绝', value: 2 }] + }, dialogFormVisible: false, dialogStatus: '', @@ -255,6 +262,13 @@ import LinkPopover from '../../components/Link/linkPopover' } }, filters: { + passTypeName(type) { + const statusMap = { + 1: '允许', + 2: '拒绝' + } + return statusMap[type] + }, statusName(status) { const statusMap = { 1: '启用', @@ -355,8 +369,7 @@ import LinkPopover from '../../components/Link/linkPopover' }, handleUpdate(row) { this.temp = Object.assign({}, row) // copy obj - this.temp.defaultPassType = row.defaultPassType == 'allow' ? 1 : 0 - this.temp.timestamp = new Date(this.temp.timestamp) + // this.temp.timestamp = new Date(this.temp.timestamp) this.dialogStatus = 'update' this.dialogFormVisible = true this.$nextTick(() => { @@ -396,7 +409,9 @@ import LinkPopover from '../../components/Link/linkPopover' }) }, handleGoRulePage (row) { - this.$router.push(`/system/securityRule?groupId=${row.id}`) + this.$router.push({ path: '/system/securityRule', query: { groupId: row.id }}) + + // this.$router.push(`/system/securityRule?groupId=${row.id}`) }, handlePortMapping(row) { this.dialogBindPortMappingVisible = true diff --git a/neutrino-proxy-admin/src/views/system/securityRule.vue b/neutrino-proxy-admin/src/views/system/securityRule.vue index cf700692..02e14026 100644 --- a/neutrino-proxy-admin/src/views/system/securityRule.vue +++ b/neutrino-proxy-admin/src/views/system/securityRule.vue @@ -6,7 +6,18 @@
{{group.description}}
-
+
+ + + + + + + + + {{ + $t('table.search') }} + {{$t('table.add')}}
@@ -35,8 +46,7 @@ @@ -46,12 +56,12 @@ @@ -62,13 +72,20 @@ +
+ + +
+ @@ -131,7 +148,7 @@