From ea92857524cc624eb526627d2eb931d84c4c72cf Mon Sep 17 00:00:00 2001 From: lanrenwo Date: Sat, 2 Dec 2023 15:38:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B7=AF=E7=94=B1=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=9A=84=E7=BC=96=E8=BE=91=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/group/List.vue | 71 +++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 6 deletions(-) diff --git a/web/src/pages/group/List.vue b/web/src/pages/group/List.vue index 4f71eb7..562c936 100644 --- a/web/src/pages/group/List.vue +++ b/web/src/pages/group/List.vue @@ -281,11 +281,15 @@ - 输入CIDR格式如: 192.168.1.0/24 - + 输入CIDR格式如: 192.168.1.0/24 + + + + @@ -304,11 +308,15 @@ - 输入CIDR格式如: 192.168.2.0/24 - + 输入CIDR格式如: 192.168.2.0/24 + + + + @@ -365,6 +373,7 @@ +
注意:域名拆分隧道,仅支持AnyConnect的桌面客户端,不支持移动端.
@@ -398,6 +407,25 @@ + + + + + +
AnyConnect最多支持{{ this.maxRouteRows }}条路由,当前共 {{ ipEditForm.ip_list.split("\n").length }} 条
+
+ + 更新 + 取 消 + +
+
@@ -424,6 +452,7 @@ export default { activeTab : "general", readMore: {}, readMinRows : 5, + maxRouteRows : 2500, defAuth : { type:'local', radius:{addr:"", secret:""}, @@ -450,11 +479,17 @@ export default { auth : {}, }, authLoginDialog : false, - authLoginLoading : false, + ipListDialog : false, + authLoginLoading : false, authLoginForm : { name : "", pwd : "", - }, + }, + ipEditForm: { + ip_list: "", + type : "", + }, + ipEditLoading : false, authLoginRules: { name: [ {required: true, message: '请输入账号', trigger: 'blur'}, @@ -644,6 +679,30 @@ export default { }); }); }, + openIpListDialog(type) { + this.ipListDialog = true; + this.ipEditForm.type = type; + this.ipEditForm.ip_list = this.ruleForm[type].map(item => item.val + (item.note ? "," + item.note : "")).join("\n"); + }, + ipEdit() { + this.ipEditLoading = true; + // ip_list不能超过this.maxRouteRows行 + if (this.ipEditForm.ip_list.split("\n").length > this.maxRouteRows) { + this.$message.error("错误:AnyConnect最多支持" + this.maxRouteRows + "条路由."); + this.ipEditLoading = false; + return false; + } + let arr = this.ipEditForm.ip_list.split("\n").map(item => { + let ip = item.split(","); + if (ip.length > 2) { + ip[1] = ip.slice(1).join(","); + } + return {val: ip[0], note: ip[1] ? ip[1] : ""}; + }); + this.ruleForm[this.ipEditForm.type] = arr; + this.ipEditLoading = false; + this.ipListDialog = false; + }, resetForm(formName) { this.$refs[formName].resetFields(); },