diff --git a/neutrino-proxy-admin/config/dev.env.js b/neutrino-proxy-admin/config/dev.env.js index f812fea4..f18b5d35 100644 --- a/neutrino-proxy-admin/config/dev.env.js +++ b/neutrino-proxy-admin/config/dev.env.js @@ -1,5 +1,5 @@ module.exports = { NODE_ENV: '"development"', ENV_CONFIG: '"dev"', - BASE_API: '"http://103.163.47.16:8888"' + BASE_API: '"http://127.0.0.1:8888"' } diff --git a/neutrino-proxy-admin/src/api/portGroup.js b/neutrino-proxy-admin/src/api/portGroup.js new file mode 100644 index 00000000..c7d5d81b --- /dev/null +++ b/neutrino-proxy-admin/src/api/portGroup.js @@ -0,0 +1,45 @@ +import request from '@/utils/request' + +export function fetchList(query) { + return request({ + url: '/port-group/page', + method: 'get', + params: query + }) +} + +export function portGroupList() { + return request({ + url: '/port-group/list', + method: 'get' + }) +} + +export function updateEnableStatus(id, enable) { + return request({ + url: '/port-group/update/enable-status', + method: 'post', + data: { + id: id, + enable: enable + } + }) +} + +export function createPortGroup(data) { + return request({ + url: '/port-group/create', + method: 'post', + data + }) +} + +export function deleteGroup(id) { + return request({ + url: '/port-group/delete', + method: 'post', + params: { + id: id + } + }) +} diff --git a/neutrino-proxy-admin/src/api/portPool.js b/neutrino-proxy-admin/src/api/portPool.js index 0d6115c8..7dc48ba3 100644 --- a/neutrino-proxy-admin/src/api/portPool.js +++ b/neutrino-proxy-admin/src/api/portPool.js @@ -14,6 +14,15 @@ export function portPoolList() { method: 'get' }) } +export function availablePortList(licenseId) { + return request({ + url: '/port-pool/get-available-port-list', + method: 'get', + params: { + licenseId: licenseId + } + }) +} export function updateEnableStatus(id, enable) { return request({ diff --git a/neutrino-proxy-admin/src/lang/zh.js b/neutrino-proxy-admin/src/lang/zh.js index e021cbf8..92d042cf 100644 --- a/neutrino-proxy-admin/src/lang/zh.js +++ b/neutrino-proxy-admin/src/lang/zh.js @@ -48,6 +48,7 @@ export default { user: '用户管理', system: '系统管理', portPool: '端口池管理', + portGroup: '端口分组管理', proxy: '代理配置', license: 'License管理', portMapping: '端口映射', @@ -118,6 +119,11 @@ export default { confirm: '确 定', userId: '用户ID', userName: '用户名', + group: '分组', + groupName: '分组名称', + groupPossessor: '分组所属', + possessorType: '所属类', + possessorId: '分组所属', license: 'License', createTime: '创建时间', updateTime: '更新时间', diff --git a/neutrino-proxy-admin/src/router/index.js b/neutrino-proxy-admin/src/router/index.js index 7e44c8d4..020c9374 100644 --- a/neutrino-proxy-admin/src/router/index.js +++ b/neutrino-proxy-admin/src/router/index.js @@ -75,6 +75,7 @@ export const asyncRouterMap = [ }, children: [ { path: 'user', component: _import('system/user'), name: 'user', meta: { title: 'user' }}, + { path: 'portGroup', component: _import('system/portGroup'), name: 'portGroup', meta: { title: 'portGroup' }}, { path: 'portPool', component: _import('system/portPool'), name: 'portPool', meta: { title: 'portPool' }}, { path: 'jobManager', component: _import('system/jobManager'), name: 'jobManager', meta: { title: 'jobManager' }} ] diff --git a/neutrino-proxy-admin/src/views/proxy/portMapping.vue b/neutrino-proxy-admin/src/views/proxy/portMapping.vue index 67e84497..e8623dfe 100644 --- a/neutrino-proxy-admin/src/views/proxy/portMapping.vue +++ b/neutrino-proxy-admin/src/views/proxy/portMapping.vue @@ -79,7 +79,7 @@ - + import { fetchList, createUserPortMapping, updateUserPortMapping, updateEnableStatus, deletePortMapping } from '@/api/portMapping' - import { portPoolList } from '@/api/portPool' + import { portPoolList, availablePortList } from '@/api/portPool' import { licenseList } from '@/api/license' import waves from '@/directive/waves' // 水波纹指令 import { parseTime } from '@/utils' @@ -241,7 +241,7 @@ }, created() { this.getList() - this.getPortPoolList() + // this.getPortPoolList() this.getLicenseList() }, methods: { @@ -258,6 +258,11 @@ this.serverPortList = response.data.data }) }, + getAvailablePortList(licenseId) { + availablePortList(licenseId).then(response => { + this.serverPortList = response.data.data + }) + }, getLicenseList() { licenseList().then(response => { this.licenseList = response.data.data @@ -356,8 +361,12 @@ }) }, selectedFeeItem(row, list) { - this.temp.licenseId = row.id - this.temp.licenseName = row.name + if (this.temp.licenseId !== row.id) { + this.temp.licenseId = row.id + this.temp.licenseName = row.name + this.getAvailablePortList(row.id) + this.temp.serverPort = null + } }, handleDelete(row) { this.$confirm('确定要删除吗?', '提示', { diff --git a/neutrino-proxy-admin/src/views/system/portGroup.vue b/neutrino-proxy-admin/src/views/system/portGroup.vue new file mode 100644 index 00000000..74c7fe62 --- /dev/null +++ b/neutrino-proxy-admin/src/views/system/portGroup.vue @@ -0,0 +1,346 @@ + + + diff --git a/neutrino-proxy-admin/src/views/system/portPool.vue b/neutrino-proxy-admin/src/views/system/portPool.vue index 108cfa35..98dd69ee 100644 --- a/neutrino-proxy-admin/src/views/system/portPool.vue +++ b/neutrino-proxy-admin/src/views/system/portPool.vue @@ -17,6 +17,11 @@ {{scope.row.port}} + + +