@arkxos/arkos-app-gateway-manage 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/ark_dist/ark-meta.json +75 -0
- package/ark_dist/ark_userChunk_1.js +5 -0
- package/ark_dist/ark_userChunk_2.js +49 -0
- package/ark_dist/css/views/views-CreateGateway.41b2bde6.css +297 -0
- package/ark_dist/favicon.ico +0 -0
- package/ark_dist/img/404.png +0 -0
- package/ark_dist/img/auth_banner.jpg +0 -0
- package/ark_dist/img/avatar.jpg +0 -0
- package/ark_dist/img/avatar2.gif +0 -0
- package/ark_dist/img/avatar3.gif +0 -0
- package/ark_dist/img/loginbg.svg +1 -0
- package/ark_dist/img/logo-r.png +0 -0
- package/ark_dist/img/logo.png +0 -0
- package/ark_dist/img/no-widgets.svg +57 -0
- package/ark_dist/img/tasks-example.png +0 -0
- package/ark_dist/img/ver.svg +236 -0
- package/ark_dist/index.html +132 -0
- package/ark_dist/js/app.e014b7a5.js +1 -0
- package/ark_dist/js/views/views-CreateGateway.7db295a9.js +3 -0
- package/ark_dist/js/views/views-CreateGateway.7db295a9.js.LICENSE.txt +1 -0
- package/ark_dist/js/views/views-CreateGateway.7db295a9.js.map +1 -0
- package/ark_proxy/entry.js +30 -0
- package/ark_proxy_es/entry.js +18 -0
- package/package.json +156 -0
- package/scripts/check.js +13 -0
- package/scripts/meta.js +21 -0
- package/scripts/prepublishOnly.js +28 -0
- package/src/api/apidoc_api.js +35 -0
- package/src/api/authority.js +161 -0
- package/src/api/balanced_api.js +101 -0
- package/src/api/client_api.js +68 -0
- package/src/api/count_api.js +62 -0
- package/src/api/gateway-manage/client_api.js +68 -0
- package/src/api/gateway-manage/open_client.js +188 -0
- package/src/api/gateway_api.js +81 -0
- package/src/api/global_function.js +278 -0
- package/src/api/global_variable.js +35 -0
- package/src/api/groovyscript_api.js +130 -0
- package/src/api/ip_api.js +47 -0
- package/src/api/monitor_api.js +24 -0
- package/src/api/regserver_api.js +224 -0
- package/src/api/request.js +107 -0
- package/src/assets/font_1930435_u2cpsigmd9d.js +38 -0
- package/src/assets/font_ma6wg7gw3td/demo.css +539 -0
- package/src/assets/font_ma6wg7gw3td/demo_index.html +674 -0
- package/src/assets/font_ma6wg7gw3td/iconfont.css +105 -0
- package/src/assets/font_ma6wg7gw3td/iconfont.eot +0 -0
- package/src/assets/font_ma6wg7gw3td/iconfont.js +1 -0
- package/src/assets/font_ma6wg7gw3td/iconfont.json +163 -0
- package/src/assets/font_ma6wg7gw3td/iconfont.svg +92 -0
- package/src/assets/font_ma6wg7gw3td/iconfont.ttf +0 -0
- package/src/assets/font_ma6wg7gw3td/iconfont.woff +0 -0
- package/src/assets/font_ma6wg7gw3td/iconfont.woff2 +0 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/particles.json +110 -0
- package/src/auto-imports.d.ts +307 -0
- package/src/component/BoxCard.vue +156 -0
- package/src/component/ClientInfo.vue +82 -0
- package/src/component/GroovyScriptTable.vue +74 -0
- package/src/component/PanThumb/index.vue +149 -0
- package/src/component/RouteAccessChart.vue +85 -0
- package/src/component/RouteInfo.vue +146 -0
- package/src/component/RouteRequestCount.vue +126 -0
- package/src/component/TextHoverEffect/Mallki.vue +120 -0
- package/src/configs/subApp.ts +9 -0
- package/src/entrance/libProperties.ts +30 -0
- package/src/entrance/libTypes.ts +27 -0
- package/src/main.ts +13 -0
- package/src/plugins/index.ts +11 -0
- package/src/router/constantRoutes.js +155 -0
- package/src/router/loadComponent.js +29 -0
- package/src/views/AddClientGateway.vue +253 -0
- package/src/views/AddGatewayClient.vue +360 -0
- package/src/views/AddGroovyScript.vue +337 -0
- package/src/views/ApiCount.vue +291 -0
- package/src/views/ApiDoc.vue +293 -0
- package/src/views/ApiMonitor.vue +292 -0
- package/src/views/ClientList.vue +217 -0
- package/src/views/CreateBalanced.vue +341 -0
- package/src/views/CreateClient.vue +171 -0
- package/src/views/CreateGateway.vue +836 -0
- package/src/views/GatewayList.vue +322 -0
- package/src/views/GatewayTopology.vue +245 -0
- package/src/views/IpList.vue +218 -0
- package/src/views/LoadBalanced.vue +389 -0
- package/src/views/Main.vue +98 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|--------------------------------------------------------------------------
|
|
3
|
+
|
|
|
4
|
+
| 组件类型导出文件,同时也作为 rollup 的打包入口文件,因只提供类型,rollup 打包后是一个
|
|
5
|
+
| 仅包含 hel-lib-proxy 的空壳文件,对模块使用方的包体构建大小无影响
|
|
6
|
+
| 模块使用方 通过 npm i xxx-lib 后,只要在头文件处执行过 preFetchLib
|
|
7
|
+
| 则整个项目项使用本地模块一样载入提供方的组件,并可以点击到 node_modules 查看源码
|
|
8
|
+
|
|
|
9
|
+
|--------------------------------------------------------------------------
|
|
10
|
+
*/
|
|
11
|
+
import type { LibProperties } from './libProperties';
|
|
12
|
+
import { exposeLib } from '@arkxio/ark-lib-proxy';
|
|
13
|
+
import { LIB_NAME } from '../configs/subApp';
|
|
14
|
+
|
|
15
|
+
export const lib = exposeLib<LibProperties>(LIB_NAME);
|
|
16
|
+
|
|
17
|
+
// suport writing: import { regs, num, myMod } from 'hel-tpl-remote-lib';
|
|
18
|
+
export const {
|
|
19
|
+
staticRoutes,
|
|
20
|
+
loadComponent,
|
|
21
|
+
// store,
|
|
22
|
+
install,
|
|
23
|
+
} = lib;
|
|
24
|
+
|
|
25
|
+
export type Lib = LibProperties;
|
|
26
|
+
|
|
27
|
+
export default lib;
|
package/src/main.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { libReady } from '@arkxio/ark-lib-proxy'
|
|
2
|
+
import { LIB_NAME } from './configs/subApp'
|
|
3
|
+
import { bindVueRuntime } from '@arkxio/ark-micro'
|
|
4
|
+
import * as Vue from 'vue'
|
|
5
|
+
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
bindVueRuntime({ Vue });
|
|
8
|
+
|
|
9
|
+
(async function () {
|
|
10
|
+
const libProperties = await import('./entrance/libProperties')
|
|
11
|
+
// 注意此处传递的是 default
|
|
12
|
+
libReady(LIB_NAME, libProperties.default)
|
|
13
|
+
}()).catch(console.error)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import { App } from 'vue';
|
|
3
|
+
//引用全局变量文件
|
|
4
|
+
import GLOBAL_VAR from '../api/global_variable.js'
|
|
5
|
+
import GLOBAL_FUN from '../api/global_function.js'
|
|
6
|
+
|
|
7
|
+
export default function installPlugin(app: App) {
|
|
8
|
+
//绑定到vue属性
|
|
9
|
+
app.config.globalProperties.GLOBAL_VAR = GLOBAL_VAR
|
|
10
|
+
app.config.globalProperties.GLOBAL_FUN = GLOBAL_FUN
|
|
11
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import Main from '../views/Main.vue'
|
|
2
|
+
import GatewayList from '../views/GatewayList.vue'
|
|
3
|
+
// import CreateGateway from '../views/CreateGateway.vue'
|
|
4
|
+
import AddGroovyScript from '../views/AddGroovyScript'
|
|
5
|
+
import ClientList from '../views/ClientList.vue'
|
|
6
|
+
import CreateClient from '../views/CreateClient.vue'
|
|
7
|
+
import IpList from '../views/IpList.vue'
|
|
8
|
+
import AddGatewayClient from '../views/AddGatewayClient.vue'
|
|
9
|
+
import AddClientGateway from '../views/AddClientGateway.vue'
|
|
10
|
+
// import GatewayTopology from '../views/GatewayTopology.vue'
|
|
11
|
+
import LoadBalanced from '../views/LoadBalanced.vue'
|
|
12
|
+
import CreateBalanced from '../views/CreateBalanced.vue'
|
|
13
|
+
import ApiDoc from '../views/ApiDoc.vue'
|
|
14
|
+
import ApiCount from '../views/ApiCount.vue'
|
|
15
|
+
import ApiMonitor from '../views/ApiMonitor.vue'
|
|
16
|
+
|
|
17
|
+
let constantRoutes = [
|
|
18
|
+
// {
|
|
19
|
+
// path: '/',
|
|
20
|
+
// redirect: to => { //重定向
|
|
21
|
+
// return '/main'
|
|
22
|
+
// }
|
|
23
|
+
// },
|
|
24
|
+
// {
|
|
25
|
+
// path: '/main',
|
|
26
|
+
// component: Main,
|
|
27
|
+
// name: '主页',
|
|
28
|
+
// hidden: true,
|
|
29
|
+
// children:[
|
|
30
|
+
// {
|
|
31
|
+
// path: '/loadBalanced',
|
|
32
|
+
// name: '负载均衡管理',
|
|
33
|
+
// hidden: true,
|
|
34
|
+
// components: {
|
|
35
|
+
// mainView: LoadBalanced
|
|
36
|
+
// }
|
|
37
|
+
// },
|
|
38
|
+
// {
|
|
39
|
+
// path: '/gatewayList',
|
|
40
|
+
// name: '网关服务管理',
|
|
41
|
+
// hidden: true,
|
|
42
|
+
// components: {
|
|
43
|
+
// mainView: GatewayList
|
|
44
|
+
// }
|
|
45
|
+
// },
|
|
46
|
+
// {
|
|
47
|
+
// path: '/clientList',
|
|
48
|
+
// name: '客户端管理',
|
|
49
|
+
// hidden: true,
|
|
50
|
+
// components: {
|
|
51
|
+
// mainView: ClientList
|
|
52
|
+
// }
|
|
53
|
+
// },
|
|
54
|
+
{
|
|
55
|
+
path: '/createGateway',
|
|
56
|
+
name: '创建网关服务',
|
|
57
|
+
hidden: true,
|
|
58
|
+
meta: {
|
|
59
|
+
title: '创建网关服务'
|
|
60
|
+
},
|
|
61
|
+
// mainView: CreateGateway
|
|
62
|
+
component: () => import('../views/CreateGateway.vue')
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
path: '/gatewayTopology',
|
|
66
|
+
name: '网关路由拓扑结构',
|
|
67
|
+
hidden: true,
|
|
68
|
+
meta: {
|
|
69
|
+
title: '网关路由拓扑结构'
|
|
70
|
+
},
|
|
71
|
+
component: () => import('../views/GatewayTopology.vue')
|
|
72
|
+
},
|
|
73
|
+
// {
|
|
74
|
+
// path: '/ipList',
|
|
75
|
+
// name: 'IP名单管理',
|
|
76
|
+
// hidden: true,
|
|
77
|
+
// components: {
|
|
78
|
+
// mainView: IpList
|
|
79
|
+
// }
|
|
80
|
+
// },
|
|
81
|
+
{
|
|
82
|
+
path: '/createClient',
|
|
83
|
+
name: '创建客户端',
|
|
84
|
+
hidden: true,
|
|
85
|
+
meta: {
|
|
86
|
+
title: '创建客户端'
|
|
87
|
+
},
|
|
88
|
+
component: () => import('../views/CreateClient.vue')
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
path: '/addGatewayClient',
|
|
92
|
+
name: '添加网关客户端',
|
|
93
|
+
hidden: true,
|
|
94
|
+
meta: {
|
|
95
|
+
title: '添加网关客户端'
|
|
96
|
+
},
|
|
97
|
+
component: () => import('../views/AddGatewayClient.vue')
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
path: '/addClientGateway',
|
|
101
|
+
name: '添加客户端网关',
|
|
102
|
+
hidden: true,
|
|
103
|
+
meta: {
|
|
104
|
+
title: '添加客户端网关'
|
|
105
|
+
},
|
|
106
|
+
component: () => import('../views/AddClientGateway.vue')
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
path: '/addGroovyScript',
|
|
110
|
+
name: '添加规则组件',
|
|
111
|
+
hidden: true,
|
|
112
|
+
meta: {
|
|
113
|
+
title: '添加规则组件'
|
|
114
|
+
},
|
|
115
|
+
component: () => import('../views/AddGroovyScript.vue')
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
path: '/createBalanced',
|
|
119
|
+
name: '创建负载均衡',
|
|
120
|
+
hidden: true,
|
|
121
|
+
meta: {
|
|
122
|
+
title: '创建负载均衡'
|
|
123
|
+
},
|
|
124
|
+
component: () => import('../views/CreateBalanced.vue')
|
|
125
|
+
},
|
|
126
|
+
// {
|
|
127
|
+
// path: '/apiDoc',
|
|
128
|
+
// name: '接口文档',
|
|
129
|
+
// hidden: true,
|
|
130
|
+
// components: {
|
|
131
|
+
// mainView: ApiDoc
|
|
132
|
+
// }
|
|
133
|
+
// },
|
|
134
|
+
// {
|
|
135
|
+
// path: '/apiCount',
|
|
136
|
+
// name: '接口统计',
|
|
137
|
+
// hidden: true,
|
|
138
|
+
// components: {
|
|
139
|
+
// mainView: ApiCount
|
|
140
|
+
// }
|
|
141
|
+
// },
|
|
142
|
+
// {
|
|
143
|
+
// path: '/apiMonitor',
|
|
144
|
+
// name: '接口监控',
|
|
145
|
+
// hidden: true,
|
|
146
|
+
// components: {
|
|
147
|
+
// mainView: ApiMonitor
|
|
148
|
+
// }
|
|
149
|
+
// }
|
|
150
|
+
// ]
|
|
151
|
+
// },
|
|
152
|
+
|
|
153
|
+
];
|
|
154
|
+
|
|
155
|
+
export default constantRoutes;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export default function(item, puzzleCode) {
|
|
2
|
+
// const routers = [];
|
|
3
|
+
//
|
|
4
|
+
// // 动态路由
|
|
5
|
+
// for (const item of menusRoutes) {
|
|
6
|
+
// routers.push({
|
|
7
|
+
// name: item.id,
|
|
8
|
+
// path: item.path,
|
|
9
|
+
// component: () =>
|
|
10
|
+
// import(
|
|
11
|
+
// /* webpackChunkName: "views/[request]" */
|
|
12
|
+
// `../views/${item.component}`
|
|
13
|
+
// ),
|
|
14
|
+
// meta: {
|
|
15
|
+
// puzzleCode: puzzleCode,
|
|
16
|
+
// name: item.name,
|
|
17
|
+
// resource: item.resource ? item.resource : [],
|
|
18
|
+
// title: item.meta?.title
|
|
19
|
+
// }
|
|
20
|
+
// });
|
|
21
|
+
// }
|
|
22
|
+
//
|
|
23
|
+
// return routers;
|
|
24
|
+
console.log('pre load component: ', item)
|
|
25
|
+
return () => import(
|
|
26
|
+
/* webpackChunkName: "views/[request]" */
|
|
27
|
+
`../views${item.component}`
|
|
28
|
+
)
|
|
29
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-page-header @back="goBack" content="已注册服务端管理"></el-page-header>
|
|
4
|
+
<el-dialog title="添加服务端" v-model="dialogFormVisible" width="40%" :close-on-click-modal="false">
|
|
5
|
+
<el-table size="mini" :data="routeTableData" style="width: 100%">
|
|
6
|
+
<el-table-column label="服务ID" prop="id"></el-table-column>
|
|
7
|
+
<el-table-column label="服务名称" prop="name"></el-table-column>
|
|
8
|
+
<el-table-column label="服务地址" prop="uri"></el-table-column>
|
|
9
|
+
<el-table-column label="操作" width="60">
|
|
10
|
+
<template #default="{ row }">
|
|
11
|
+
<el-button size="mini" circle icon="el-icon-plus" type="success" title="添加" @click="handleAddRegServer(scope.row)"></el-button>
|
|
12
|
+
</template>
|
|
13
|
+
</el-table-column>
|
|
14
|
+
</el-table>
|
|
15
|
+
<div class="block" style="margin-top: 20px;">
|
|
16
|
+
<el-pagination
|
|
17
|
+
@size-change="handleRouteSizeChange"
|
|
18
|
+
@current-change="handleRouteCurrentChange"
|
|
19
|
+
:current-page="routeCurrentPage"
|
|
20
|
+
:page-sizes="[10, 30, 50]"
|
|
21
|
+
:page-size="routePageSize"
|
|
22
|
+
layout="total, sizes, prev, pager, next, jumper"
|
|
23
|
+
:total="routeTotalNum">
|
|
24
|
+
</el-pagination>
|
|
25
|
+
</div>
|
|
26
|
+
<div slot="footer" class="dialog-footer">
|
|
27
|
+
<el-button @click="dialogFormVisible = false" size="small">关 闭</el-button>
|
|
28
|
+
</div>
|
|
29
|
+
</el-dialog>
|
|
30
|
+
|
|
31
|
+
<el-row :gutter="20" style="margin-top: 20px;">
|
|
32
|
+
<el-col>
|
|
33
|
+
<el-card class="box-card">
|
|
34
|
+
<div slot="header" class="clearfix">
|
|
35
|
+
<span>网关服务端</span>
|
|
36
|
+
<el-popover trigger="click" placement="bottom">
|
|
37
|
+
<div style="font-size: 10pt;">
|
|
38
|
+
<span>添加服务端说明:</span><br/>
|
|
39
|
+
<span>1. 开启路由服务ID过滤后,只有请求参数或Header中带有clientId="当前客户端ID(注册KEY)"才能访问指定服务端。</span><br/>
|
|
40
|
+
<span>2. 开启路由服务ID过滤后,此功能主要适用于对第三方开放服务,提供简单认证访问。</span><br/>
|
|
41
|
+
<span>3. 新添加的路由服务端后,默认为禁止访问路由服务,请手动开启允许访问,才能生效。</span><br/>
|
|
42
|
+
</div>
|
|
43
|
+
<el-button slot="reference" style="padding: 3px 0; " icon="el-icon-question" type="text" title="说明"></el-button>
|
|
44
|
+
</el-popover>
|
|
45
|
+
<span style="margin-left: 50px;">
|
|
46
|
+
<i class="el-icon-monitor"></i>
|
|
47
|
+
<span style="font-size: 11pt;">
|
|
48
|
+
<el-tag size="mini" style="font-weight: bold;">{{form.name}}</el-tag> -
|
|
49
|
+
<el-tag size="mini" type="success" style="font-weight: bold;">{{form.ip}}</el-tag>
|
|
50
|
+
</span>
|
|
51
|
+
</span>
|
|
52
|
+
<div style="float: right; margin-left: 10px;">
|
|
53
|
+
<el-button icon="el-icon-circle-plus-outline" size="small" type="success" @click="search" title="查找服务端"> 添加服务 </el-button>
|
|
54
|
+
</div>
|
|
55
|
+
<div style="float: right; margin-left: 10px;">
|
|
56
|
+
<el-button icon="el-icon-s-claim" size="small" type="primary" @click="startAll" title="启用所有客户端通行"> 全部允许 </el-button>
|
|
57
|
+
</div>
|
|
58
|
+
<div style="float: right; margin-left: 10px;">
|
|
59
|
+
<el-button icon="el-icon-circle-close" size="small" type="danger" @click="stopAll" title="禁用所有客户端通行"> 全部禁止 </el-button>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<el-table size="small" :data="tableData" style="width: 100%">
|
|
64
|
+
<el-table-column label="服务ID" prop="id"></el-table-column>
|
|
65
|
+
<el-table-column label="服务名称" prop="name"></el-table-column>
|
|
66
|
+
<el-table-column label="服务地址" prop="uri"></el-table-column>
|
|
67
|
+
<el-table-column label="断言路径" prop="path"></el-table-column>
|
|
68
|
+
<el-table-column label="注册时间" prop="regServerTime" width="200"></el-table-column>
|
|
69
|
+
<el-table-column label="状态" prop="regServerStatus">
|
|
70
|
+
<template #default="{ row }">
|
|
71
|
+
<div v-if="scope.row.regServerStatus==='0'"><i class="el-icon-success" style="color: #409EFF;"></i> <el-tag size="mini">{{'允许通行'}}</el-tag></div>
|
|
72
|
+
<div v-if="scope.row.regServerStatus==='1'"><i class="el-icon-error" style="color: #f00000;"></i> <el-tag size="mini" type="danger">{{'禁止通行'}}</el-tag></div>
|
|
73
|
+
</template>
|
|
74
|
+
</el-table-column>
|
|
75
|
+
<el-table-column label="操作" width="80">
|
|
76
|
+
<template #default="{ row }">
|
|
77
|
+
<el-dropdown trigger="click" @command="handleCommandRegServer">
|
|
78
|
+
<el-button size="mini" circle icon="el-icon-setting" title="设置" style="border: 0px;"></el-button>
|
|
79
|
+
<el-dropdown-menu slot="dropdown">
|
|
80
|
+
<el-dropdown-item :command="{command:'start', row: scope.row}"><i class="el-icon-success" style="color: #409EFF;"></i>允许通行</el-dropdown-item>
|
|
81
|
+
<el-dropdown-item :command="{command:'stop', row: scope.row}"><i class="el-icon-error" style="color: red;"></i>禁止通行</el-dropdown-item>
|
|
82
|
+
<el-dropdown-item :command="{command:'delete', row: scope.row}" divided><i class="el-icon-delete"></i>移除</el-dropdown-item>
|
|
83
|
+
</el-dropdown-menu>
|
|
84
|
+
</el-dropdown>
|
|
85
|
+
</template>
|
|
86
|
+
</el-table-column>
|
|
87
|
+
</el-table>
|
|
88
|
+
<div class="block" style="margin-top: 20px;">
|
|
89
|
+
<el-pagination
|
|
90
|
+
@size-change="handleSizeChange"
|
|
91
|
+
@current-change="handleCurrentChange"
|
|
92
|
+
:current-page="currentPage"
|
|
93
|
+
:page-sizes="[10, 30, 50]"
|
|
94
|
+
:page-size="pageSize"
|
|
95
|
+
layout="total, sizes, prev, pager, next, jumper"
|
|
96
|
+
:total="totalNum"
|
|
97
|
+
></el-pagination>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
</el-card>
|
|
101
|
+
</el-col>
|
|
102
|
+
</el-row>
|
|
103
|
+
|
|
104
|
+
</div>
|
|
105
|
+
</template>
|
|
106
|
+
|
|
107
|
+
<script>
|
|
108
|
+
import {addRegServer,deleteRegServer,stopRegServer,startRegServer,regServerPageList,startAllRegServer,stopAllRegServer,notRegServerPageList} from '../api/regserver_api.js'
|
|
109
|
+
|
|
110
|
+
export default {
|
|
111
|
+
data() {
|
|
112
|
+
return {
|
|
113
|
+
dialogFormVisible: false,
|
|
114
|
+
formLabelWidth: '100px',
|
|
115
|
+
form:{},
|
|
116
|
+
tableData: [],
|
|
117
|
+
currentPage: 1,
|
|
118
|
+
pageSize: 10,
|
|
119
|
+
totalNum: 1,
|
|
120
|
+
routeTableData: [],
|
|
121
|
+
routeCurrentPage: 1,
|
|
122
|
+
routePageSize: 10,
|
|
123
|
+
routeTotalNum: 1,
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
created: function() {
|
|
127
|
+
//在组件创建完毕后加载
|
|
128
|
+
let query = this.$route.query;
|
|
129
|
+
if (query){
|
|
130
|
+
let client = query.client;
|
|
131
|
+
console.log('client', client);
|
|
132
|
+
this.init(client);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
mounted: function() {
|
|
136
|
+
|
|
137
|
+
},
|
|
138
|
+
beforeDestroy: function() {
|
|
139
|
+
|
|
140
|
+
},
|
|
141
|
+
methods:{
|
|
142
|
+
init(client) {
|
|
143
|
+
if (client){
|
|
144
|
+
this.form = client;
|
|
145
|
+
this.regServerList();
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
goBack() {
|
|
149
|
+
console.log('go back');
|
|
150
|
+
this.$router.push({path:'/clientList',query:{}});
|
|
151
|
+
},
|
|
152
|
+
handleSizeChange(val) {
|
|
153
|
+
this.pageSize = val;
|
|
154
|
+
this.regServerList();
|
|
155
|
+
},
|
|
156
|
+
handleCurrentChange(val) {
|
|
157
|
+
this.currentPage = val;
|
|
158
|
+
this.regServerList();
|
|
159
|
+
},
|
|
160
|
+
handleRouteSizeChange(val) {
|
|
161
|
+
this.routePageSize = val;
|
|
162
|
+
this.routeList();
|
|
163
|
+
},
|
|
164
|
+
handleRouteCurrentChange(val) {
|
|
165
|
+
this.routeCurrentPage = val;
|
|
166
|
+
this.routeList();
|
|
167
|
+
},
|
|
168
|
+
handleCommandRegServer(obj){
|
|
169
|
+
console.log("command" , obj);
|
|
170
|
+
let _this = this;
|
|
171
|
+
if (obj.command === 'start'){
|
|
172
|
+
this.$confirm('确认允许当前客户端访问"'+obj.row.name+'"该注册服务?').then(_ => {
|
|
173
|
+
startRegServer({id:obj.row.regServerId}).then(function(result){
|
|
174
|
+
_this.GLOBAL_FUN.successMsg();
|
|
175
|
+
_this.regServerList();
|
|
176
|
+
});
|
|
177
|
+
}).catch(_ => {});
|
|
178
|
+
} else if (obj.command === 'stop'){
|
|
179
|
+
this.$confirm('确认禁止当前客户端访问"'+obj.row.name+'"该注册服务?').then(_ => {
|
|
180
|
+
stopRegServer({id:obj.row.regServerId}).then(function(result){
|
|
181
|
+
_this.GLOBAL_FUN.successMsg();
|
|
182
|
+
_this.regServerList();
|
|
183
|
+
});
|
|
184
|
+
}).catch(_ => {});
|
|
185
|
+
} else if (obj.command === 'delete'){
|
|
186
|
+
this.$confirm('确认删除"'+obj.row.name+'"该注册服务?').then(_ => {
|
|
187
|
+
deleteRegServer({id:obj.row.regServerId}).then(function(result){
|
|
188
|
+
_this.GLOBAL_FUN.successMsg();
|
|
189
|
+
_this.regServerList();
|
|
190
|
+
})
|
|
191
|
+
}).catch(_ => {});
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
handleAddRegServer(row){
|
|
195
|
+
let _this = this;
|
|
196
|
+
addRegServer({clientId: this.form.id, routeId: row.id}).then(function(result){
|
|
197
|
+
_this.GLOBAL_FUN.successMsg();
|
|
198
|
+
_this.regServerList();
|
|
199
|
+
_this.routeList();
|
|
200
|
+
});
|
|
201
|
+
},
|
|
202
|
+
startAll(){
|
|
203
|
+
let _this = this;
|
|
204
|
+
this.$confirm('确认要允许当前客户端访问所有已注册服务?').then(_ => {
|
|
205
|
+
startAllRegServer({clientId: _this.form.id,}).then(function(result){
|
|
206
|
+
_this.GLOBAL_FUN.successMsg();
|
|
207
|
+
_this.regServerList();
|
|
208
|
+
});
|
|
209
|
+
}).catch(_ => {});
|
|
210
|
+
},
|
|
211
|
+
stopAll(){
|
|
212
|
+
let _this = this;
|
|
213
|
+
this.$confirm('确认要禁止当前客户端访问所有已注册服务?').then(_ => {
|
|
214
|
+
stopAllRegServer({clientId: _this.form.id,}).then(function(result){
|
|
215
|
+
_this.GLOBAL_FUN.successMsg();
|
|
216
|
+
_this.regServerList();
|
|
217
|
+
});
|
|
218
|
+
}).catch(_ => {});
|
|
219
|
+
},
|
|
220
|
+
regServerList(){
|
|
221
|
+
let _this = this;
|
|
222
|
+
regServerPageList({clientId: this.form.id, currentPage: this.currentPage, pageSize: this.pageSize}).then(function(result){
|
|
223
|
+
if (result.data){
|
|
224
|
+
_this.tableData = result.data.records;
|
|
225
|
+
_this.totalNum = result.data.total;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
},
|
|
229
|
+
routeList(){
|
|
230
|
+
let _this = this;
|
|
231
|
+
notRegServerPageList({clientId: this.form.id, currentPage: this.routeCurrentPage, pageSize: this.routePageSize}).then(function(result){
|
|
232
|
+
console.log(result);
|
|
233
|
+
if (result.data && result.data.records){
|
|
234
|
+
_this.routeTableData = result.data.records;
|
|
235
|
+
_this.routeTotalNum = result.data.total;
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
},
|
|
239
|
+
search(){
|
|
240
|
+
this.dialogFormVisible = true;
|
|
241
|
+
this.routeList();
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
</script>
|
|
246
|
+
|
|
247
|
+
<style>
|
|
248
|
+
.el-icon-setting:before {
|
|
249
|
+
content: "\E6CA";
|
|
250
|
+
font-size: 12pt;
|
|
251
|
+
}
|
|
252
|
+
</style>
|
|
253
|
+
|