1、jdk版本改为21,对应的打包脚本调整
2、安全组相关代码优化
This commit is contained in:
@@ -1,24 +1,31 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
const baseUri = '/security';
|
||||
export function fetchGroupPage(query) {
|
||||
return request({
|
||||
url: '/security/group/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchGroupList() {
|
||||
return request({
|
||||
url: `${baseUri}/group/list`,
|
||||
url: '/security/group/list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchGroupOne(groupId) {
|
||||
export function fetchGroupDetail(query) {
|
||||
return request({
|
||||
url: `${baseUri}/group/detail?groupId=${groupId}`,
|
||||
method: 'get'
|
||||
url: '/security/group/detail',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function createGroup(data) {
|
||||
return request({
|
||||
url: `${baseUri}/group/create`,
|
||||
url: `/security/group/create`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
@@ -26,43 +33,58 @@ export function createGroup(data) {
|
||||
|
||||
export function updateGroup(data) {
|
||||
return request({
|
||||
url: `${baseUri}/group/update`,
|
||||
url: `/security/group/update`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteGroup(groupId) {
|
||||
export function deleteGroup(data) {
|
||||
return request({
|
||||
url: `${baseUri}/group/delete?groupId=${groupId}`,
|
||||
method: 'post'
|
||||
url: '/security/group/delete',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function enableGroup(groupId) {
|
||||
export function updateGroupEnableStatus(id, enable) {
|
||||
return request({
|
||||
url: `${baseUri}/group/enable?groupId=${groupId}`,
|
||||
method: 'post'
|
||||
url: '/security/group/update/enable-status',
|
||||
method: 'post',
|
||||
data: {
|
||||
id: id,
|
||||
enable: enable
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function disableGroup(groupId) {
|
||||
export function enableGroup(query) {
|
||||
return request({
|
||||
url: `${baseUri}/group/disable?groupId=${groupId}`,
|
||||
method: 'post'
|
||||
url: '/security/group/enable',
|
||||
method: 'post',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchRuleList(groupId) {
|
||||
export function disableGroup(query) {
|
||||
return request({
|
||||
url: `${baseUri}/rule/list?groupId=${groupId}`,
|
||||
method: 'get'
|
||||
url: '/security/group/disable',
|
||||
method: 'post',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchRuleList(query) {
|
||||
return request({
|
||||
url: '/security/rule/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function createRule(data) {
|
||||
return request({
|
||||
url: `${baseUri}/rule/create`,
|
||||
url: `/security/rule/create`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
@@ -70,28 +92,29 @@ export function createRule(data) {
|
||||
|
||||
export function updateRule(data) {
|
||||
return request({
|
||||
url: `${baseUri}/rule/update`,
|
||||
url: `/security/rule/update`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function deleteRule(ruleId) {
|
||||
export function deleteRule(query) {
|
||||
return request({
|
||||
url: `${baseUri}/rule/delete?ruleId=${ruleId}`,
|
||||
method: 'post'
|
||||
url: '/security/rule/delete',
|
||||
method: 'post',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function enableRule(ruleId) {
|
||||
return request({
|
||||
url: `${baseUri}/rule/enable?ruleId=${ruleId}`,
|
||||
url: `/security/rule/enable?ruleId=${ruleId}`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function disableRule(ruleId) {
|
||||
return request({
|
||||
url: `${baseUri}/rule/disable?ruleId=${ruleId}`,
|
||||
url: `/security/rule/disable?ruleId=${ruleId}`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -99,8 +99,7 @@
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" @click="handleUpdate(scope.row)">{{ $t('table.edit') }}</el-button>
|
||||
<el-button v-if="scope.row.enable == '1'" size="mini" type="danger" @click="handleModifyStatus(scope.row, 2)">{{$t('table.disable')}}</el-button>
|
||||
<el-button v-if="scope.row.enable == '2'" size="mini" type="success"
|
||||
@click="handleModifyStatus(scope.row, 1)">{{ $t('table.enable') }}</el-button>
|
||||
<el-button v-if="scope.row.enable == '2'" size="mini" type="success" @click="handleModifyStatus(scope.row, 1)">{{ $t('table.enable') }}</el-button>
|
||||
<!-- <el-button size="mini" type="danger" @click="handleDelete(scope.row,'deleted')">{{$t('table.delete')}}</el-button>-->
|
||||
<ButtonPopover @handleCommitClick="handleDelete2(scope.row)" style="margin-left: 10px" />
|
||||
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
<template>
|
||||
<div class="app-container calendar-list-container">
|
||||
<div class="filter-container">
|
||||
<el-input v-model="listQuery.name" style="width:145px;margin-right:10px" placeholder="请输入名称" />
|
||||
<el-select v-model="listQuery.enable" placeholder="请选择启用状态" clearable style="width:145px;margin-right:10px">
|
||||
<el-option v-for="item in selectObj.statusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">{{
|
||||
$t('table.search') }}</el-button>
|
||||
<el-button class="filter-item" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="el-icon-edit">{{$t('table.add')}}</el-button>
|
||||
</div>
|
||||
|
||||
@@ -40,8 +46,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column class-name="status-col" :label="$t('table.enableStatus')">
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="success" v-if="scope.row.enable == '启用'">{{scope.row.enable}}</el-tag>
|
||||
<el-tag type="danger" v-if="scope.row.enable == '禁用'">{{scope.row.enable}}</el-tag>
|
||||
<el-tag :type="scope.row.enable | statusFilter">{{ scope.row.enable | statusName }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" :label="$t('table.actions')" class-name="small-padding fixed-width" style="display:flex;justify-content:center">
|
||||
@@ -49,8 +54,8 @@
|
||||
<div >
|
||||
<el-link :underline="false" type="primary" size="mini" @click="handleGoRulePage(scope.row)" style="font-size: 12px">{{$t('table.ruleConfig')}}</el-link>
|
||||
<el-link :underline="false" type="primary" size="mini" @click="handleUpdate(scope.row)" style="font-size: 12px">{{$t('table.edit')}}</el-link>
|
||||
<el-link :underline="false" v-if="scope.row.enable =='启用'" size="mini" type="warning" @click="handleDisableStatus(scope.row)" style="font-size: 12px">{{$t('table.disable')}}</el-link>
|
||||
<el-link :underline="false" v-if="scope.row.enable =='禁用'" size="mini" type="success" @click="handleEnableStatus(scope.row)" style="font-size: 12px">{{$t('table.enable')}}</el-link>
|
||||
<el-link :underline="false" v-if="scope.row.enable =='1'" size="mini" type="warning" @click="handleModifyStatus(scope.row, 2)" style="font-size: 12px">{{$t('table.disable')}}</el-link>
|
||||
<el-link :underline="false" v-if="scope.row.enable =='2'" size="mini" type="success" @click="handleModifyStatus(scope.row, 1)" style="font-size: 12px">{{$t('table.enable')}}</el-link>
|
||||
</div>
|
||||
<el-dropdown>
|
||||
<span class="el-dropdown-link" style="font-size: 12px">
|
||||
@@ -69,6 +74,13 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="pagination-container">
|
||||
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
||||
:current-pageInfo.sync="listQuery.current" :pageInfo-sizes="[10, 20, 30, 50]" :pageInfo-size="listQuery.size"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
<el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
|
||||
<el-form :rules="rules" ref="dataForm" :model="temp" label-position="right" label-width="120px" style='width: 500px; margin-left:10px;'>
|
||||
<el-form-item :label="$t('table.name')" prop="name">
|
||||
@@ -170,10 +182,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {fetchGroupList, createGroup, updateGroup, deleteGroup, enableGroup, disableGroup} from '@/api/securityGroup'
|
||||
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 {
|
||||
@@ -188,6 +199,13 @@ import LinkPopover from '../../components/Link/linkPopover'
|
||||
return {
|
||||
tableKey: 0,
|
||||
list: [],
|
||||
total: null,
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
name: undefined,
|
||||
enable: undefined
|
||||
},
|
||||
listLoading: true,
|
||||
temp: {
|
||||
id: undefined,
|
||||
@@ -195,6 +213,10 @@ import LinkPopover from '../../components/Link/linkPopover'
|
||||
description: '',
|
||||
defaultPassType: undefined
|
||||
},
|
||||
selectObj: {
|
||||
statusOptions: [{ label: '启用', value: 1 }, { label: '禁用', value: 2 }],
|
||||
onlineOptions: [{ label: '在线', value: 1 }, { label: '离线', value: 2 }]
|
||||
},
|
||||
dialogFormVisible: false,
|
||||
dialogStatus: '',
|
||||
textMap: {
|
||||
@@ -257,11 +279,24 @@ import LinkPopover from '../../components/Link/linkPopover'
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
fetchGroupList().then(response => {
|
||||
this.list = response.data.data
|
||||
fetchGroupPage(this.listQuery).then(response => {
|
||||
this.list = response.data.data.records
|
||||
this.total = response.data.data.total
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleFilter() {
|
||||
this.listQuery.current = 1
|
||||
this.getList()
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.size = val
|
||||
this.getList()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.current = val
|
||||
this.getList()
|
||||
},
|
||||
getPortMappingList() {
|
||||
this.portMappingListLoading = true
|
||||
fetchPortMappingList(this.portMappingListQuery).then(response => {
|
||||
@@ -270,27 +305,16 @@ import LinkPopover from '../../components/Link/linkPopover'
|
||||
this.portMappingListQuery.current = response.data.data.current
|
||||
this.portMappingListLoading = false
|
||||
})
|
||||
},
|
||||
handleEnableStatus(row) {
|
||||
enableGroup(row.id).then(response => {
|
||||
if (response.data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
},
|
||||
handleDisableStatus(row) {
|
||||
disableGroup(row.id).then(response => {
|
||||
if (response.data.code === 0) {
|
||||
handleModifyStatus(row, enable) {
|
||||
updateGroupEnableStatus(row.id, enable).then(response => {
|
||||
if (response.data.data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success'
|
||||
})
|
||||
this.getList()
|
||||
}
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
resetTemp() {
|
||||
@@ -413,8 +437,3 @@ import LinkPopover from '../../components/Link/linkPopover'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.filter-container {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
@@ -39,11 +39,11 @@
|
||||
<el-tag type="info" v-if="scope.row.passType == 'deny'" effect="dark">拒绝</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" :label="$t('table.priority')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.priority}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column align="center" :label="$t('table.priority')">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{{scope.row.priority}}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column align="center" :label="$t('table.createTime')">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.createTime}}</span>
|
||||
@@ -56,15 +56,14 @@
|
||||
</el-table-column>
|
||||
<el-table-column class-name="status-col" :label="$t('table.enableStatus')" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="success" v-if="scope.row.enable == '启用'">{{scope.row.enable}}</el-tag>
|
||||
<el-tag type="warning" v-if="scope.row.enable == '禁用'">{{scope.row.enable}}</el-tag>
|
||||
<el-tag :type="scope.row.enable | statusFilter">{{ scope.row.enable | statusName }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" :label="$t('table.actions')" width="250" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="primary" :underline="false" size="mini" @click="handleUpdate(scope.row)" style="font-size:12px">{{$t('table.edit')}}</el-link>
|
||||
<el-link :underline="false" v-if="scope.row.enable =='启用'" size="mini" type="warning" @click="handleDisableStatus(scope.row)" style="font-size:12px">{{$t('table.disable')}}</el-link>
|
||||
<el-link :underline="false" v-if="scope.row.enable =='禁用'" size="mini" type="success" @click="handleEnableStatus(scope.row)" style="font-size:12px">{{$t('table.enable')}}</el-link>
|
||||
<el-link :underline="false" v-if="scope.row.enable =='1'" size="mini" type="warning" @click="handleDisableStatus(scope.row)" style="font-size:12px">{{$t('table.disable')}}</el-link>
|
||||
<el-link :underline="false" v-if="scope.row.enable =='2'" size="mini" type="success" @click="handleEnableStatus(scope.row)" style="font-size:12px">{{$t('table.enable')}}</el-link>
|
||||
<LinkPopover @handleCommitClick="handleDelete(scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -93,7 +92,7 @@
|
||||
<div>每个类型中间以英文逗号分隔,形如 192.168.1.1,192.168.3.0/24 是正确的 </div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
<el-form-item :label="$t('table.passType')" prop="passType">
|
||||
<el-tooltip class="item" effect="dark" :content="temp.passTypeTooltip" placement="right">
|
||||
@@ -103,7 +102,7 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-tooltip>
|
||||
|
||||
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item :label="$t('table.priority')" prop="priority">
|
||||
@@ -132,7 +131,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {fetchGroupOne, fetchRuleList, createRule, updateRule, deleteRule, enableRule, disableRule} from '@/api/securityGroup'
|
||||
import {fetchGroupDetail, fetchRuleList, createRule, updateRule, deleteRule, enableRule, disableRule} from '@/api/securityGroup'
|
||||
import waves from '@/directive/waves' // 水波纹指令
|
||||
import { parseTime } from '@/utils'
|
||||
import LinkPopover from '../../components/Link/linkPopover'
|
||||
@@ -206,7 +205,7 @@ import LinkPopover from '../../components/Link/linkPopover'
|
||||
if (queryParam && typeof queryParam === 'object' && queryParam.groupId) {
|
||||
this.groupId = queryParam.groupId
|
||||
localStorage.setItem('groupId', this.groupId)
|
||||
this.getGroupOne()
|
||||
this.getGroupDetail()
|
||||
this.getList()
|
||||
return
|
||||
}
|
||||
@@ -214,11 +213,11 @@ import LinkPopover from '../../components/Link/linkPopover'
|
||||
const groupId = localStorage.getItem('groupId')
|
||||
if (groupId) {
|
||||
this.groupId = parseInt(groupId)
|
||||
this.getGroupOne()
|
||||
this.getGroupDetail()
|
||||
this.getList()
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.$notify({
|
||||
title: '错误',
|
||||
message: '没有获取到安全组信息',
|
||||
@@ -228,8 +227,8 @@ import LinkPopover from '../../components/Link/linkPopover'
|
||||
this.$router.push(`/system/securityGroup`)
|
||||
},
|
||||
methods: {
|
||||
getGroupOne () {
|
||||
fetchGroupOne(this.groupId).then(response => {
|
||||
getGroupDetail () {
|
||||
fetchGroupDetail({id: this.groupId}).then(response => {
|
||||
this.group = response.data.data
|
||||
})
|
||||
},
|
||||
@@ -244,7 +243,7 @@ import LinkPopover from '../../components/Link/linkPopover'
|
||||
return
|
||||
}
|
||||
this.listLoading = true
|
||||
fetchRuleList(this.groupId).then(response => {
|
||||
fetchRuleList({groupId: this.groupId}).then(response => {
|
||||
this.list = response.data.data
|
||||
this.listLoading = false
|
||||
})
|
||||
@@ -342,7 +341,7 @@ import LinkPopover from '../../components/Link/linkPopover'
|
||||
})
|
||||
},
|
||||
handleDelete(row) {
|
||||
deleteRule(row.id).then(response => {
|
||||
deleteRule({ruleId: row.id}).then(response => {
|
||||
if (response.data.code === 0) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
|
||||
Reference in New Issue
Block a user