@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,218 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="layout-padding">
|
|
3
|
+
<div class="layout-padding-auto layout-padding-view">
|
|
4
|
+
<div class="box-flex-between">
|
|
5
|
+
<el-button icon="el-icon-folder-add" type="primary" style="margin-left: 5px;" @click="handleCreateIp"></el-button>
|
|
6
|
+
|
|
7
|
+
<el-input placeholder="请输入IP" v-model="ip" :maxlength="15" class="input-with-select" style="width: 520px;" clearable>
|
|
8
|
+
<template #prepend>
|
|
9
|
+
<el-select v-model="status" placeholder="请选择" style="width: 120px;">
|
|
10
|
+
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
|
11
|
+
</el-select>
|
|
12
|
+
</template>
|
|
13
|
+
<template #append>
|
|
14
|
+
<el-button icon="el-icon-search" @click="search"></el-button>
|
|
15
|
+
</template>
|
|
16
|
+
</el-input>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<el-table size="small" :data="tableData" height="100%">
|
|
20
|
+
<el-table-column label="IP地址" prop="ip">
|
|
21
|
+
<template #default="{ row }">
|
|
22
|
+
<el-tag size="small" type="success" style="font-weight: bold;">{{row.ip}}</el-tag>
|
|
23
|
+
</template>
|
|
24
|
+
</el-table-column>
|
|
25
|
+
<el-table-column label="状态" prop="status">
|
|
26
|
+
<template #default="{ row }">
|
|
27
|
+
<el-tag effect="dark" size="small" v-if="row.status === '0'" type="">允许通行</el-tag>
|
|
28
|
+
<el-tag effect="dark" size="small" v-if="row.status === '1'" type="danger">禁止通行</el-tag>
|
|
29
|
+
</template>
|
|
30
|
+
</el-table-column>
|
|
31
|
+
<el-table-column label="创建时间" prop="createTime"></el-table-column>
|
|
32
|
+
<el-table-column label="备注" prop="remarks"></el-table-column>
|
|
33
|
+
<el-table-column label="操作" width="160">
|
|
34
|
+
<template #default="{ row }">
|
|
35
|
+
<el-dropdown trigger="click" @command="handleCommandClient">
|
|
36
|
+
<el-button size="small" type="warning">管理<el-icon><ArrowDown /></el-icon></el-button>
|
|
37
|
+
<template #dropdown>
|
|
38
|
+
<el-dropdown-menu>
|
|
39
|
+
<el-dropdown-item :command="{command:'start', row: row}" divided><el-icon color="#409EFF"><CircleCheckFilled /></el-icon>允许通行</el-dropdown-item>
|
|
40
|
+
<el-dropdown-item :command="{command:'stop', row: row}"><el-icon color="#ff0000"><CircleCloseFilled /></el-icon>禁止通行</el-dropdown-item>
|
|
41
|
+
<el-dropdown-item icon="el-icon-delete-filled" :command="{command:'delete', row: row}" divided>删除</el-dropdown-item>
|
|
42
|
+
</el-dropdown-menu>
|
|
43
|
+
</template>
|
|
44
|
+
</el-dropdown>
|
|
45
|
+
</template>
|
|
46
|
+
</el-table-column>
|
|
47
|
+
</el-table>
|
|
48
|
+
<div class="block">
|
|
49
|
+
<el-pagination
|
|
50
|
+
@size-change="handleSizeChange"
|
|
51
|
+
@current-change="handleCurrentChange"
|
|
52
|
+
:current-page="currentPage"
|
|
53
|
+
:page-sizes="[10, 30, 50]"
|
|
54
|
+
:page-size="pageSize"
|
|
55
|
+
layout="total, sizes, prev, pager, next, jumper"
|
|
56
|
+
:total="totalNum"
|
|
57
|
+
></el-pagination>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<el-dialog title="IP管理" v-model="dialogFormVisible" width="30%" :close-on-click-modal="false">
|
|
62
|
+
<el-form :model="form" ref="form" :label-width="formLabelWidth" :rules="rules">
|
|
63
|
+
<el-form-item label="IP" size="mini" prop="ip">
|
|
64
|
+
<el-input v-model="form.ip" autocomplete="off" :maxlength="15" style="width: 240px;"></el-input>
|
|
65
|
+
</el-form-item>
|
|
66
|
+
<el-form-item label="状态" size="mini" prop="status">
|
|
67
|
+
<el-radio v-model="form.status" label="0">允许通行</el-radio>
|
|
68
|
+
<el-radio v-model="form.status" label="1">禁止通行</el-radio>
|
|
69
|
+
</el-form-item>
|
|
70
|
+
<el-form-item label="备注" size="mini" prop="remarks">
|
|
71
|
+
<el-input type="textarea" :rows="3" v-model="form.remarks" :maxlength="200" autocomplete="off"></el-input>
|
|
72
|
+
</el-form-item>
|
|
73
|
+
</el-form>
|
|
74
|
+
<template #footer>
|
|
75
|
+
<div class="dialog-footer">
|
|
76
|
+
<el-button size="mini" type="success" @click="submit">提 交</el-button>
|
|
77
|
+
<el-button size="mini" type="warning" @click="dialogFormVisible = false">关 闭</el-button>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
</el-dialog>
|
|
81
|
+
|
|
82
|
+
</div>
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<script setup>
|
|
86
|
+
import { CircleCheckFilled, CircleCloseFilled, ArrowDown } from '@element-plus/icons-vue'
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<script>
|
|
90
|
+
import { addIp, updateIp, deleteIp, ipPageList } from '../api/ip_api.js';
|
|
91
|
+
|
|
92
|
+
var is_ip=function(strIP){if(!strIP && strIP!==0 && typeof strIP!=="boolean"){return false}var re=/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g;if(re.test(strIP)){if(RegExp.$1<256&&RegExp.$2<256&&RegExp.$3<256&&RegExp.$4<256){return true}}return false};
|
|
93
|
+
|
|
94
|
+
export default {
|
|
95
|
+
data() {
|
|
96
|
+
return {
|
|
97
|
+
dialogFormVisible: false,
|
|
98
|
+
formLabelWidth: '60px',
|
|
99
|
+
status: null,
|
|
100
|
+
ip: '',
|
|
101
|
+
form: {
|
|
102
|
+
ip: '',
|
|
103
|
+
status: '0',
|
|
104
|
+
remarks: ''
|
|
105
|
+
},
|
|
106
|
+
tableData: [],
|
|
107
|
+
currentPage: 1,
|
|
108
|
+
pageSize: 10,
|
|
109
|
+
totalNum: 0,
|
|
110
|
+
options: [{ value: '', label: '所有' }, { value: '0', label: '允许通行' }, { value: '1', label: '禁止通行' }],
|
|
111
|
+
rules: {
|
|
112
|
+
ip: [
|
|
113
|
+
{ required: true, message: '请输入IP地址', trigger: 'blur' },
|
|
114
|
+
{ min: 4, max: 15, message: '长度在 4 到 15 个字符', trigger: 'blur' },
|
|
115
|
+
],
|
|
116
|
+
status: [
|
|
117
|
+
{ required: true, message: '请选状态', trigger: 'change' },
|
|
118
|
+
],
|
|
119
|
+
remarks: [
|
|
120
|
+
{ required: false },
|
|
121
|
+
{ min: 1, max: 200, message: '长度在 1 到 200 个字符', trigger: 'blur' },
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
created: function() {
|
|
127
|
+
this.init();
|
|
128
|
+
},
|
|
129
|
+
mounted: function() {},
|
|
130
|
+
beforeDestroy: function() {},
|
|
131
|
+
methods: {
|
|
132
|
+
init() {
|
|
133
|
+
this.search();
|
|
134
|
+
console.log(JSON.stringify(this.tableData));
|
|
135
|
+
},
|
|
136
|
+
handleSizeChange(val) {
|
|
137
|
+
this.pageSize = val;
|
|
138
|
+
},
|
|
139
|
+
handleCurrentChange(val) {
|
|
140
|
+
this.currentPage = val;
|
|
141
|
+
},
|
|
142
|
+
handleCommandClient(obj){
|
|
143
|
+
console.log("command" , obj);
|
|
144
|
+
let _this = this;
|
|
145
|
+
if (obj.command === 'start'){
|
|
146
|
+
if (obj.row.status === '1'){
|
|
147
|
+
obj.row.status='0';
|
|
148
|
+
updateIp(obj.row).then(function(result){
|
|
149
|
+
_this.GLOBAL_FUN.successMsg();
|
|
150
|
+
_this.search();
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
} else if (obj.command === 'stop'){
|
|
154
|
+
if (obj.row.status === '0'){
|
|
155
|
+
obj.row.status='1';
|
|
156
|
+
updateIp(obj.row).then(function(result){
|
|
157
|
+
_this.GLOBAL_FUN.successMsg();
|
|
158
|
+
_this.search();
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
} else if (obj.command === 'delete'){
|
|
162
|
+
this.$confirm('确认删除IP:"'+obj.row.ip+'"?').then(_ => {
|
|
163
|
+
deleteIp({ip:obj.row.ip}).then(function(result){
|
|
164
|
+
_this.GLOBAL_FUN.successMsg();
|
|
165
|
+
_this.search();
|
|
166
|
+
})
|
|
167
|
+
}).catch(_ => {});
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
handleCreateIp() {
|
|
171
|
+
this.dialogFormVisible = true;
|
|
172
|
+
this.form = {
|
|
173
|
+
ip: '',
|
|
174
|
+
status: '0',
|
|
175
|
+
remarks: ''
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
submit() {
|
|
179
|
+
let _this = this;
|
|
180
|
+
this.$refs['form'].validate(valid => {
|
|
181
|
+
if (valid) {
|
|
182
|
+
if (!is_ip(this.form.ip)){
|
|
183
|
+
this.GLOBAL_FUN.errorMsg('IP格式错误!');
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
addIp(this.form).then(function(result) {
|
|
187
|
+
_this.dialogFormVisible = false;
|
|
188
|
+
_this.GLOBAL_FUN.successMsg();
|
|
189
|
+
_this.search();
|
|
190
|
+
});
|
|
191
|
+
} else {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
},
|
|
196
|
+
search() {
|
|
197
|
+
let _this = this;
|
|
198
|
+
ipPageList({ ip: this.ip, status: this.status, currentPage: this.currentPage, pageSize: this.pageSize }).then(function(result) {
|
|
199
|
+
if (result.data) {
|
|
200
|
+
_this.tableData = result.data.records;
|
|
201
|
+
_this.totalNum = result.data.total;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
</script>
|
|
208
|
+
|
|
209
|
+
<style lang="scss" scoped>
|
|
210
|
+
.box-flex-between {
|
|
211
|
+
padding-bottom: 18px;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.block {
|
|
215
|
+
padding: 0 20px;
|
|
216
|
+
}
|
|
217
|
+
</style>
|
|
218
|
+
|
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="layout-padding">
|
|
3
|
+
<div class="layout-padding-auto layout-padding-view">
|
|
4
|
+
<el-card>
|
|
5
|
+
<div class="box-flex-between">
|
|
6
|
+
<el-button icon="el-icon-folder-add" style="margin-left:5px" type="primary" @click="handleCreateBalanced" title="创建负载服务"></el-button>
|
|
7
|
+
|
|
8
|
+
<el-input placeholder="请输入网关服务名称" v-model="form.name" class="input-with-select" style="width: 620px;" clearable>
|
|
9
|
+
<template #prepend>
|
|
10
|
+
<el-select v-model="form.groupCode" placeholder="请选择分组" style="width: 140px; margin-right: 10px;">
|
|
11
|
+
<el-option label="所有" value=""/>
|
|
12
|
+
<el-option v-for="item in groupOptions" :key="item.value" :label="item.label" :value="item.value"/>
|
|
13
|
+
</el-select>
|
|
14
|
+
<el-popover placement="bottom" trigger="click">
|
|
15
|
+
<el-radio v-model="form.status" v-for="item in statusOptions" :key="item.value" :label="item.value">{{item.label}}</el-radio>
|
|
16
|
+
<template #reference>
|
|
17
|
+
<el-button>
|
|
18
|
+
服务状态:{{form.status === '0' ? '启用': form.status === '1' ? '禁用' : '所有'}}<i class="el-icon-caret-bottom el-icon--right"></i>
|
|
19
|
+
</el-button>
|
|
20
|
+
</template>
|
|
21
|
+
</el-popover>
|
|
22
|
+
</template>
|
|
23
|
+
<template #append>
|
|
24
|
+
<el-button icon="el-icon-search" @click="search" title="查询网关服务"></el-button>
|
|
25
|
+
</template>
|
|
26
|
+
</el-input>
|
|
27
|
+
</div>
|
|
28
|
+
</el-card>
|
|
29
|
+
|
|
30
|
+
<div class="part-bottom">
|
|
31
|
+
<div class="part-one">
|
|
32
|
+
<el-card class="box-card">
|
|
33
|
+
<el-table size="small" :data="tableData" height="calc(100% - 50px)">
|
|
34
|
+
<el-table-column label="服务名称">
|
|
35
|
+
<template #default="{ row }">
|
|
36
|
+
<el-tooltip effect="dark" :content="row.name" placement="top-start">
|
|
37
|
+
<el-tag size="small" type="warning" style="font-weight: bold;">{{row.name}}</el-tag>
|
|
38
|
+
</el-tooltip>
|
|
39
|
+
</template>
|
|
40
|
+
</el-table-column>
|
|
41
|
+
|
|
42
|
+
<el-table-column label="分组" width="90">
|
|
43
|
+
<template #default="{ row }">
|
|
44
|
+
<el-tag v-for="group in groupOptions" :key="group.value" v-show="(group.value === row.groupCode)" size="small" type="">{{group.label}}</el-tag>
|
|
45
|
+
</template>
|
|
46
|
+
</el-table-column>
|
|
47
|
+
<el-table-column label="断言地址" width="180">
|
|
48
|
+
<template #default="{ row }">
|
|
49
|
+
{{parent}}{{row.loadUri}}
|
|
50
|
+
<el-popover
|
|
51
|
+
placement="bottom"
|
|
52
|
+
:width="240"
|
|
53
|
+
trigger="click"
|
|
54
|
+
>
|
|
55
|
+
<template #reference>
|
|
56
|
+
<el-icon color="#409eff"><DataAnalysis /></el-icon>
|
|
57
|
+
</template>
|
|
58
|
+
<template #default>
|
|
59
|
+
<div style="margin-bottom: 8px;">
|
|
60
|
+
<i class="el-icon-dataAnalysis" style="font-size: 16pt; color: #90A0A5;"></i>
|
|
61
|
+
<span class="route-title">网关代理地址</span>
|
|
62
|
+
</div>
|
|
63
|
+
<div style="display:flex;align-items: center;">
|
|
64
|
+
<el-tag size="small" type="success" style="font-weight: bold;">{{GLOBAL_VAR.gatewayRoutesURL}}{{parent}}{{row.loadUri}}</el-tag>
|
|
65
|
+
<el-button style="padding: 3px 0; " icon="el-icon-document-copy" type="text" @click="handleCopy(row.loadUri)" title="复制"></el-button>
|
|
66
|
+
</div>
|
|
67
|
+
<br/>
|
|
68
|
+
<el-button style="padding: 3px 0; " type="text" title="网关代理地址"></el-button>
|
|
69
|
+
</template>
|
|
70
|
+
</el-popover>
|
|
71
|
+
</template>
|
|
72
|
+
</el-table-column>
|
|
73
|
+
<el-table-column label="创建时间" width="135" prop="createTime"></el-table-column>
|
|
74
|
+
<el-table-column label="状态" width="65" prop="status" :formatter="formatterStatus">
|
|
75
|
+
<template #default="{ row }">
|
|
76
|
+
<el-tag effect="dark" size="small" v-if="row.status === '0'" type="">启用</el-tag>
|
|
77
|
+
<el-tag effect="dark" size="small" v-if="row.status === '1'" type="danger">禁用</el-tag>
|
|
78
|
+
</template>
|
|
79
|
+
</el-table-column>
|
|
80
|
+
<el-table-column label="操作" width="80" fixed="right">
|
|
81
|
+
<template #default="{ row }">
|
|
82
|
+
<el-dropdown trigger="click" @command="handleCommandGateway">
|
|
83
|
+
<el-button size="small" type="warning">
|
|
84
|
+
管理
|
|
85
|
+
<el-icon><ArrowDown /></el-icon>
|
|
86
|
+
</el-button>
|
|
87
|
+
<template #dropdown>
|
|
88
|
+
<el-dropdown-menu>
|
|
89
|
+
<el-dropdown-item icon="el-icon-edit" :command="{command:'edit', row: row}">编辑</el-dropdown-item>
|
|
90
|
+
<el-dropdown-item :command="{command:'start', row: row}" divided>
|
|
91
|
+
<el-icon color="#409EFF"><CircleCheckFilled /></el-icon>启用
|
|
92
|
+
</el-dropdown-item>
|
|
93
|
+
<el-dropdown-item :command="{command:'stop', row: row}">
|
|
94
|
+
<el-icon color="#ff0000"><CircleCloseFilled /></el-icon>禁用
|
|
95
|
+
</el-dropdown-item>
|
|
96
|
+
<el-dropdown-item icon="el-icon-delete" :command="{command:'delete', row: row}" divided>删除</el-dropdown-item>
|
|
97
|
+
</el-dropdown-menu>
|
|
98
|
+
</template>
|
|
99
|
+
</el-dropdown>
|
|
100
|
+
</template>
|
|
101
|
+
</el-table-column>
|
|
102
|
+
<el-table-column label="查看" width="58" fixed="right">
|
|
103
|
+
<template #default="{ row }">
|
|
104
|
+
<el-button size="small" @click="handleClickBalanced(row)" :icon="selectedId === row.id ? ArrowRight : ArrowDown" circle title="请点击选中查看"
|
|
105
|
+
:class="(selectedId === row.id)?'breathe-keyframes btn-select':'btn-not-select'">
|
|
106
|
+
</el-button>
|
|
107
|
+
</template>
|
|
108
|
+
</el-table-column>
|
|
109
|
+
</el-table>
|
|
110
|
+
<div class="block" style="margin-top: 20px;">
|
|
111
|
+
<el-pagination
|
|
112
|
+
@size-change="handleSizeChange"
|
|
113
|
+
@current-change="handleCurrentChange"
|
|
114
|
+
:current-page="currentPage"
|
|
115
|
+
:page-sizes="[10, 30, 50]"
|
|
116
|
+
:page-size="pageSize"
|
|
117
|
+
layout="total, sizes, prev, pager, next, jumper"
|
|
118
|
+
:total="totalNum"
|
|
119
|
+
></el-pagination>
|
|
120
|
+
</div>
|
|
121
|
+
</el-card>
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
<div class="part-two">
|
|
125
|
+
<el-card class="box-card">
|
|
126
|
+
<div class="two-icon" style="margin-bottom: 14px;">
|
|
127
|
+
<el-icon size="20" color="#90A0A5"><Guide /></el-icon>
|
|
128
|
+
<span class="route-title">转发路由</span>
|
|
129
|
+
</div>
|
|
130
|
+
<el-collapse v-model="activeName">
|
|
131
|
+
<el-collapse-item v-for="(item, index) in routeTable" :key="index" :name='(index + 1)'>
|
|
132
|
+
<template #title>
|
|
133
|
+
<div>
|
|
134
|
+
<el-tag size="" type="success" style="font-weight: bold; background-color: #FFFFFF; color: #303133;">{{item.name}}
|
|
135
|
+
<i class="el-icon-circle-check" v-if="item.status === '0'" style="font-size: 12pt; font-weight: bold; color: #409EFF;" title="服务已启用"></i>
|
|
136
|
+
<i class="el-icon-circle-close" v-if="item.status === '1'" style="font-size: 12pt; font-weight: bold; color: #F56C6C;" title="服务已禁用"></i>
|
|
137
|
+
</el-tag>
|
|
138
|
+
</div>
|
|
139
|
+
</template>
|
|
140
|
+
<div style="line-height: 28px;color: #727CF5; font-weight: bold;"><i class="el-icon-s-promotion" style="font-size: 12pt; font-weight: bold;"></i> {{item.routeId}}</div>
|
|
141
|
+
<div style="line-height: 28px;color: #1890FF; font-weight: bold;"><i class="el-icon-connection" style="font-size: 12pt; font-weight: bold;"></i> {{item.uri}}</div>
|
|
142
|
+
</el-collapse-item>
|
|
143
|
+
</el-collapse>
|
|
144
|
+
</el-card>
|
|
145
|
+
</div>
|
|
146
|
+
<div class="part-three">
|
|
147
|
+
<boxCardComponent ref="boxCard" :balanced-name="balancedName" :route-table="routeTable"></boxCardComponent>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
</template>
|
|
153
|
+
|
|
154
|
+
<script setup>
|
|
155
|
+
import { ArrowRight, ArrowDown, Guide, DataAnalysis, CircleCheckFilled, CircleCloseFilled } from '@element-plus/icons-vue'
|
|
156
|
+
</script>
|
|
157
|
+
|
|
158
|
+
<script>
|
|
159
|
+
import boxCardComponent from '../component/BoxCard.vue'
|
|
160
|
+
import {balancedPageList,deleteBalanced,startBalanced,stopBalanced} from '../api/balanced_api.js'
|
|
161
|
+
import { loadServerRegList } from '../api/balanced_api.js'
|
|
162
|
+
import axios from "axios";
|
|
163
|
+
|
|
164
|
+
export default {
|
|
165
|
+
data() {
|
|
166
|
+
return {
|
|
167
|
+
form:{
|
|
168
|
+
name: null,
|
|
169
|
+
groupCode: null,
|
|
170
|
+
status: null
|
|
171
|
+
},
|
|
172
|
+
parent: '/parent/',
|
|
173
|
+
activeName: 1,
|
|
174
|
+
formLabelWidth: '140px',
|
|
175
|
+
gatewayServer:'',
|
|
176
|
+
tableData: [],
|
|
177
|
+
currentPage: 1,
|
|
178
|
+
pageSize: 10,
|
|
179
|
+
totalNum: 1,
|
|
180
|
+
selectedId:0,
|
|
181
|
+
pickerOptions: {
|
|
182
|
+
disabledDate(time) {
|
|
183
|
+
return time.getTime() > Date.now();
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
statusOptions: [
|
|
187
|
+
{value: null, label: '所有'},
|
|
188
|
+
{value: '0',label: '启用'},
|
|
189
|
+
{value: '1',label: '禁用'},
|
|
190
|
+
],
|
|
191
|
+
groupOptions: this.GLOBAL_VAR.groups,
|
|
192
|
+
balancedName: null,
|
|
193
|
+
routeTable:[]
|
|
194
|
+
};
|
|
195
|
+
},
|
|
196
|
+
components:{
|
|
197
|
+
boxCardComponent
|
|
198
|
+
},
|
|
199
|
+
created: function() {
|
|
200
|
+
this.init();
|
|
201
|
+
},
|
|
202
|
+
mounted: function() {
|
|
203
|
+
},
|
|
204
|
+
beforeDestroy: function() {
|
|
205
|
+
},
|
|
206
|
+
methods:{
|
|
207
|
+
init() {
|
|
208
|
+
this.search();
|
|
209
|
+
},
|
|
210
|
+
handleSizeChange(val) {
|
|
211
|
+
this.pageSize = val;
|
|
212
|
+
this.search();
|
|
213
|
+
},
|
|
214
|
+
handleCurrentChange(val) {
|
|
215
|
+
this.currentPage = val;
|
|
216
|
+
this.search();
|
|
217
|
+
},
|
|
218
|
+
formatterStatus(row, index){
|
|
219
|
+
return row.status === '0'?'启用':'禁用';
|
|
220
|
+
},
|
|
221
|
+
handleClickBalanced(row){
|
|
222
|
+
let _this = this;
|
|
223
|
+
this.selectedId = row.id;
|
|
224
|
+
this.balancedName = row.name;
|
|
225
|
+
loadServerRegList({balancedId: row.id}).then(function(result){
|
|
226
|
+
if (result && result.data){
|
|
227
|
+
_this.routeTable = result.data;
|
|
228
|
+
console.log(_this.$refs.boxCard);
|
|
229
|
+
_this.$refs.boxCard.loadCard(_this.selectedId, result.data);
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
},
|
|
233
|
+
handleCreateBalanced(){
|
|
234
|
+
this.$router.push({path:'/createBalanced',query:{handleType:'add'}});
|
|
235
|
+
},
|
|
236
|
+
handleCommandGateway(obj){
|
|
237
|
+
let _this = this;
|
|
238
|
+
if (obj.command === 'edit'){
|
|
239
|
+
this.$router.push({path:'/createBalanced',query:{handleType:'edit',balanced: obj.row}});
|
|
240
|
+
} else if (obj.command === 'start'){
|
|
241
|
+
startBalanced({id:obj.row.id}).then(function(result){
|
|
242
|
+
_this.GLOBAL_FUN.successMsg();
|
|
243
|
+
_this.search();
|
|
244
|
+
});
|
|
245
|
+
} else if (obj.command === 'stop'){
|
|
246
|
+
stopBalanced({id:obj.row.id}).then(function(result){
|
|
247
|
+
_this.GLOBAL_FUN.successMsg();
|
|
248
|
+
_this.search();
|
|
249
|
+
});
|
|
250
|
+
} else if (obj.command === 'delete'){
|
|
251
|
+
this.$confirm('确认删除"'+obj.row.name+'"网关路由?').then(_ => {
|
|
252
|
+
deleteBalanced({id:obj.row.id}).then(function(result){
|
|
253
|
+
_this.GLOBAL_FUN.successMsg();
|
|
254
|
+
_this.search();
|
|
255
|
+
})
|
|
256
|
+
}).catch(_ => {});
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
handleClose(done) {
|
|
260
|
+
// this.$confirm('确认关闭?').then(_ => {
|
|
261
|
+
done();
|
|
262
|
+
// }).catch(_ => {});
|
|
263
|
+
},
|
|
264
|
+
handleCopy(val){
|
|
265
|
+
let value = this.GLOBAL_VAR.gatewayRoutesURL + this.parent + val;
|
|
266
|
+
this.GLOBAL_FUN.copy(value);
|
|
267
|
+
},
|
|
268
|
+
search(){
|
|
269
|
+
let _this = this;
|
|
270
|
+
balancedPageList({name: this.form.name, groupCode: this.form.groupCode, status: this.form.status, currentPage: this.currentPage, pageSize: this.pageSize}).then(function(result){
|
|
271
|
+
if (result.data && result.data.records){
|
|
272
|
+
_this.tableData = result.data.records;
|
|
273
|
+
_this.totalNum = result.data.total;
|
|
274
|
+
if (_this.tableData.length > 0){
|
|
275
|
+
_this.handleClickBalanced(_this.tableData[0]);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
</script>
|
|
283
|
+
|
|
284
|
+
<style lang="scss" scoped>
|
|
285
|
+
|
|
286
|
+
.input-with-select .el-input-group__prepend {
|
|
287
|
+
background-color: #fff;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.breathe-keyframes {
|
|
291
|
+
-webkit-animation-timing-function: ease-in-out;
|
|
292
|
+
-webkit-animation-name: breathe;
|
|
293
|
+
-webkit-animation-duration: 700ms;
|
|
294
|
+
-webkit-animation-iteration-count: infinite;
|
|
295
|
+
-webkit-animation-direction: alternate;
|
|
296
|
+
}
|
|
297
|
+
/* vue中@-webkit-keyframes改成@keyframes */
|
|
298
|
+
@keyframes breathe {
|
|
299
|
+
0% {
|
|
300
|
+
margin-left: 10px;
|
|
301
|
+
opacity: 0.75;
|
|
302
|
+
/* box-shadow: 0 1px 2px rgba(24, 144, 255, 0.3); */
|
|
303
|
+
}
|
|
304
|
+
30% {
|
|
305
|
+
margin-left: 7px;
|
|
306
|
+
opacity: 0.85;
|
|
307
|
+
/* box-shadow: 0 1px 2px rgba(24, 144, 255, 0.3); */
|
|
308
|
+
}
|
|
309
|
+
66% {
|
|
310
|
+
margin-left: 4px;
|
|
311
|
+
opacity: 0.95;
|
|
312
|
+
/* box-shadow: 0 1px 2px rgba(24, 144, 255, 0.3); */
|
|
313
|
+
}
|
|
314
|
+
100% {
|
|
315
|
+
margin-left: 0px;
|
|
316
|
+
opacity: 1;
|
|
317
|
+
/* border: 1px solid rgba(24, 144, 255, 1); */
|
|
318
|
+
/* box-shadow: 0 1px 10px rgba(24, 144, 255, 1); */
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.btn-select {
|
|
323
|
+
border: 1px solid rgb(64, 158, 255);
|
|
324
|
+
font-size: 12pt;
|
|
325
|
+
color: #409eff;
|
|
326
|
+
font-weight: 900;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.btn-not-select {
|
|
330
|
+
border: 1px solid rgb(237, 237, 237);
|
|
331
|
+
margin-left: 2px;
|
|
332
|
+
margin-left: 5px;
|
|
333
|
+
font-size: 12pt;
|
|
334
|
+
color: rgb(237, 237, 237);
|
|
335
|
+
}
|
|
336
|
+
.route-title {
|
|
337
|
+
font-size: 14pt;
|
|
338
|
+
color: #90a0a5;
|
|
339
|
+
font-weight: bold;
|
|
340
|
+
margin-left: 6px;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.loadBalanced {
|
|
344
|
+
height: calc(100% - 95px);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.part-bottom {
|
|
348
|
+
height: 100%;
|
|
349
|
+
display: flex;
|
|
350
|
+
justify-content: space-between;
|
|
351
|
+
margin-top: 20px;
|
|
352
|
+
|
|
353
|
+
.part-one {
|
|
354
|
+
width: 45%;
|
|
355
|
+
}
|
|
356
|
+
.part-two {
|
|
357
|
+
width: 20%;
|
|
358
|
+
|
|
359
|
+
.two-icon {
|
|
360
|
+
display: flex;
|
|
361
|
+
align-items: center;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
.part-three {
|
|
365
|
+
width: 32%;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
:deep(.el-card__body) {
|
|
369
|
+
height: 100%;
|
|
370
|
+
}
|
|
371
|
+
.box-card-component,
|
|
372
|
+
.box-card {
|
|
373
|
+
height: 100%;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
</style>
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
<style>
|
|
380
|
+
.box-flex-between {
|
|
381
|
+
display: flex;
|
|
382
|
+
justify-content: space-between;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.el-dropdown-menu .el-dropdown-menu__item {
|
|
386
|
+
flex-direction: row !important;
|
|
387
|
+
align-items: center;
|
|
388
|
+
}
|
|
389
|
+
</style>
|