mirror of https://github.com/bjdgyc/anylink.git
commit
7329603c47
|
@ -75,6 +75,10 @@ func GroupDetail(w http.ResponseWriter, r *http.Request) {
|
||||||
if len(data.Auth) == 0 {
|
if len(data.Auth) == 0 {
|
||||||
data.Auth["type"] = "local"
|
data.Auth["type"] = "local"
|
||||||
}
|
}
|
||||||
|
// 兼容旧数据
|
||||||
|
if data.SplitDns == nil {
|
||||||
|
data.SplitDns = []dbdata.ValData{}
|
||||||
|
}
|
||||||
RespSucess(w, data)
|
RespSucess(w, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
<RestrictTunnelProtocols>IPSec</RestrictTunnelProtocols>
|
<RestrictTunnelProtocols>IPSec</RestrictTunnelProtocols>
|
||||||
<BypassDownloader>true</BypassDownloader>
|
<BypassDownloader>true</BypassDownloader>
|
||||||
<AutoUpdate UserControllable="false">false</AutoUpdate>
|
<AutoUpdate UserControllable="false">false</AutoUpdate>
|
||||||
|
<LocalLanAccess UserControllable="true">true</LocalLanAccess>
|
||||||
<WindowsVPNEstablishment>AllowRemoteUsers</WindowsVPNEstablishment>
|
<WindowsVPNEstablishment>AllowRemoteUsers</WindowsVPNEstablishment>
|
||||||
<LinuxVPNEstablishment>AllowRemoteUsers</LinuxVPNEstablishment>
|
<LinuxVPNEstablishment>AllowRemoteUsers</LinuxVPNEstablishment>
|
||||||
<CertEnrollmentPin>pinAllowed</CertEnrollmentPin>
|
<CertEnrollmentPin>pinAllowed</CertEnrollmentPin>
|
||||||
|
|
|
@ -215,6 +215,7 @@ func SetGroup(g *Group) error {
|
||||||
// DNS 判断
|
// DNS 判断
|
||||||
clientDns := []ValData{}
|
clientDns := []ValData{}
|
||||||
for _, v := range g.ClientDns {
|
for _, v := range g.ClientDns {
|
||||||
|
v.Val = strings.TrimSpace(v.Val)
|
||||||
if v.Val != "" {
|
if v.Val != "" {
|
||||||
ip := net.ParseIP(v.Val)
|
ip := net.ParseIP(v.Val)
|
||||||
if ip.String() != v.Val {
|
if ip.String() != v.Val {
|
||||||
|
@ -229,6 +230,20 @@ func SetGroup(g *Group) error {
|
||||||
return errors.New("默认路由,必须设置一个DNS")
|
return errors.New("默认路由,必须设置一个DNS")
|
||||||
}
|
}
|
||||||
g.ClientDns = clientDns
|
g.ClientDns = clientDns
|
||||||
|
|
||||||
|
splitDns := []ValData{}
|
||||||
|
for _, v := range g.SplitDns {
|
||||||
|
v.Val = strings.TrimSpace(v.Val)
|
||||||
|
if v.Val != "" {
|
||||||
|
ValidateDomainName(v.Val)
|
||||||
|
if !ValidateDomainName(v.Val) {
|
||||||
|
return errors.New("域名 错误")
|
||||||
|
}
|
||||||
|
splitDns = append(splitDns, v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
g.SplitDns = splitDns
|
||||||
|
|
||||||
// 域名拆分隧道,不能同时填写
|
// 域名拆分隧道,不能同时填写
|
||||||
g.DsIncludeDomains = strings.TrimSpace(g.DsIncludeDomains)
|
g.DsIncludeDomains = strings.TrimSpace(g.DsIncludeDomains)
|
||||||
g.DsExcludeDomains = strings.TrimSpace(g.DsExcludeDomains)
|
g.DsExcludeDomains = strings.TrimSpace(g.DsExcludeDomains)
|
||||||
|
|
|
@ -11,6 +11,7 @@ type Group struct {
|
||||||
Note string `json:"note" xorm:"varchar(255)"`
|
Note string `json:"note" xorm:"varchar(255)"`
|
||||||
AllowLan bool `json:"allow_lan" xorm:"Bool"`
|
AllowLan bool `json:"allow_lan" xorm:"Bool"`
|
||||||
ClientDns []ValData `json:"client_dns" xorm:"Text"`
|
ClientDns []ValData `json:"client_dns" xorm:"Text"`
|
||||||
|
SplitDns []ValData `json:"split_dns" xorm:"Text"`
|
||||||
RouteInclude []ValData `json:"route_include" xorm:"Text"`
|
RouteInclude []ValData `json:"route_include" xorm:"Text"`
|
||||||
RouteExclude []ValData `json:"route_exclude" xorm:"Text"`
|
RouteExclude []ValData `json:"route_exclude" xorm:"Text"`
|
||||||
DsExcludeDomains string `json:"ds_exclude_domains" xorm:"Text"`
|
DsExcludeDomains string `json:"ds_exclude_domains" xorm:"Text"`
|
||||||
|
|
|
@ -86,7 +86,7 @@ func LinkTunnel(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
cSess.CstpDpd = cstpDpd
|
cSess.CstpDpd = cstpDpd
|
||||||
|
|
||||||
dtlsPort := "4433"
|
dtlsPort := "443"
|
||||||
if strings.Contains(base.Cfg.ServerDTLSAddr, ":") {
|
if strings.Contains(base.Cfg.ServerDTLSAddr, ":") {
|
||||||
ss := strings.Split(base.Cfg.ServerDTLSAddr, ":")
|
ss := strings.Split(base.Cfg.ServerDTLSAddr, ":")
|
||||||
dtlsPort = ss[1]
|
dtlsPort = ss[1]
|
||||||
|
@ -131,6 +131,11 @@ func LinkTunnel(w http.ResponseWriter, r *http.Request) {
|
||||||
for _, v := range cSess.Group.ClientDns {
|
for _, v := range cSess.Group.ClientDns {
|
||||||
HttpAddHeader(w, "X-CSTP-DNS", v.Val)
|
HttpAddHeader(w, "X-CSTP-DNS", v.Val)
|
||||||
}
|
}
|
||||||
|
// 分割dns
|
||||||
|
for _, v := range cSess.Group.SplitDns {
|
||||||
|
HttpAddHeader(w, "X-CSTP-Split-DNS", v.Val)
|
||||||
|
}
|
||||||
|
|
||||||
// 允许的路由
|
// 允许的路由
|
||||||
for _, v := range cSess.Group.RouteInclude {
|
for _, v := range cSess.Group.RouteInclude {
|
||||||
if strings.ToLower(v.Val) == dbdata.All {
|
if strings.ToLower(v.Val) == dbdata.All {
|
||||||
|
@ -156,9 +161,9 @@ func LinkTunnel(w http.ResponseWriter, r *http.Request) {
|
||||||
HttpSetHeader(w, "X-CSTP-Keep", "true")
|
HttpSetHeader(w, "X-CSTP-Keep", "true")
|
||||||
HttpSetHeader(w, "X-CSTP-Tunnel-All-DNS", "false")
|
HttpSetHeader(w, "X-CSTP-Tunnel-All-DNS", "false")
|
||||||
|
|
||||||
HttpSetHeader(w, "X-CSTP-Rekey-Time", "43200") // 172800
|
HttpSetHeader(w, "X-CSTP-Rekey-Time", "86400") // 172800
|
||||||
HttpSetHeader(w, "X-CSTP-Rekey-Method", "new-tunnel")
|
HttpSetHeader(w, "X-CSTP-Rekey-Method", "new-tunnel")
|
||||||
HttpSetHeader(w, "X-DTLS-Rekey-Time", "43200")
|
HttpSetHeader(w, "X-DTLS-Rekey-Time", "86400")
|
||||||
HttpSetHeader(w, "X-DTLS-Rekey-Method", "new-tunnel")
|
HttpSetHeader(w, "X-DTLS-Rekey-Method", "new-tunnel")
|
||||||
|
|
||||||
HttpSetHeader(w, "X-CSTP-DPD", fmt.Sprintf("%d", cstpDpd))
|
HttpSetHeader(w, "X-CSTP-DPD", fmt.Sprintf("%d", cstpDpd))
|
||||||
|
@ -180,7 +185,7 @@ func LinkTunnel(w http.ResponseWriter, r *http.Request) {
|
||||||
HttpSetHeader(w, "X-CSTP-Routing-Filtering-Ignore", "false")
|
HttpSetHeader(w, "X-CSTP-Routing-Filtering-Ignore", "false")
|
||||||
HttpSetHeader(w, "X-CSTP-Quarantine", "false")
|
HttpSetHeader(w, "X-CSTP-Quarantine", "false")
|
||||||
HttpSetHeader(w, "X-CSTP-Disable-Always-On-VPN", "false")
|
HttpSetHeader(w, "X-CSTP-Disable-Always-On-VPN", "false")
|
||||||
HttpSetHeader(w, "X-CSTP-Client-Bypass-Protocol", "false")
|
HttpSetHeader(w, "X-CSTP-Client-Bypass-Protocol", "true")
|
||||||
HttpSetHeader(w, "X-CSTP-TCP-Keepalive", "false")
|
HttpSetHeader(w, "X-CSTP-TCP-Keepalive", "false")
|
||||||
// 设置域名拆分隧道(移动端不支持)
|
// 设置域名拆分隧道(移动端不支持)
|
||||||
if mobile != "mobile" {
|
if mobile != "mobile" {
|
||||||
|
|
|
@ -50,7 +50,8 @@
|
||||||
label="带宽限制"
|
label="带宽限制"
|
||||||
width="90">
|
width="90">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-row v-if="scope.row.bandwidth > 0">{{ convertBandwidth(scope.row.bandwidth, 'BYTE', 'Mbps') }} Mbps</el-row>
|
<el-row v-if="scope.row.bandwidth > 0">{{ convertBandwidth(scope.row.bandwidth, 'BYTE', 'Mbps') }} Mbps
|
||||||
|
</el-row>
|
||||||
<el-row v-else>不限</el-row>
|
<el-row v-else>不限</el-row>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -69,12 +70,20 @@
|
||||||
label="路由包含"
|
label="路由包含"
|
||||||
width="180">
|
width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-row v-for="(item,inx) in scope.row.route_include.slice(0, readMinRows)" :key="inx">{{ item.val }}</el-row>
|
<el-row v-for="(item,inx) in scope.row.route_include.slice(0, readMinRows)" :key="inx">{{
|
||||||
|
item.val
|
||||||
|
}}
|
||||||
|
</el-row>
|
||||||
<div v-if="scope.row.route_include.length > readMinRows">
|
<div v-if="scope.row.route_include.length > readMinRows">
|
||||||
<div v-if="readMore[`ri_${ scope.row.id }`]">
|
<div v-if="readMore[`ri_${ scope.row.id }`]">
|
||||||
<el-row v-for="(item,inx) in scope.row.route_include.slice(readMinRows)" :key="inx">{{ item.val }}</el-row>
|
<el-row v-for="(item,inx) in scope.row.route_include.slice(readMinRows)" :key="inx">{{
|
||||||
|
item.val
|
||||||
|
}}
|
||||||
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<el-button size="mini" type="text" @click="toggleMore(`ri_${ scope.row.id }`)">{{ readMore[`ri_${ scope.row.id }`] ? "▲ 收起" : "▼ 更多" }}</el-button>
|
<el-button size="mini" type="text" @click="toggleMore(`ri_${ scope.row.id }`)">
|
||||||
|
{{ readMore[`ri_${scope.row.id}`] ? "▲ 收起" : "▼ 更多" }}
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -84,12 +93,20 @@
|
||||||
label="路由排除"
|
label="路由排除"
|
||||||
width="180">
|
width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-row v-for="(item,inx) in scope.row.route_exclude.slice(0, readMinRows)" :key="inx">{{ item.val }}</el-row>
|
<el-row v-for="(item,inx) in scope.row.route_exclude.slice(0, readMinRows)" :key="inx">{{
|
||||||
|
item.val
|
||||||
|
}}
|
||||||
|
</el-row>
|
||||||
<div v-if="scope.row.route_exclude.length > readMinRows">
|
<div v-if="scope.row.route_exclude.length > readMinRows">
|
||||||
<div v-if="readMore[`re_${ scope.row.id }`]">
|
<div v-if="readMore[`re_${ scope.row.id }`]">
|
||||||
<el-row v-for="(item,inx) in scope.row.route_exclude.slice(readMinRows)" :key="inx">{{ item.val }}</el-row>
|
<el-row v-for="(item,inx) in scope.row.route_exclude.slice(readMinRows)" :key="inx">{{
|
||||||
|
item.val
|
||||||
|
}}
|
||||||
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<el-button size="mini" type="text" @click="toggleMore(`re_${ scope.row.id }`)">{{ readMore[`re_${ scope.row.id }`] ? "▲ 收起" : "▼ 更多" }}</el-button>
|
<el-button size="mini" type="text" @click="toggleMore(`re_${ scope.row.id }`)">
|
||||||
|
{{ readMore[`re_${scope.row.id}`] ? "▲ 收起" : "▼ 更多" }}
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -108,7 +125,9 @@
|
||||||
{{ item.action }} => {{ item.val }} : {{ item.port }}
|
{{ item.action }} => {{ item.val }} : {{ item.port }}
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<el-button size="mini" type="text" @click="toggleMore(`la_${ scope.row.id }`)">{{ readMore[`la_${ scope.row.id }`] ? "▲ 收起" : "▼ 更多" }}</el-button>
|
<el-button size="mini" type="text" @click="toggleMore(`la_${ scope.row.id }`)">
|
||||||
|
{{ readMore[`la_${scope.row.id}`] ? "▲ 收起" : "▼ 更多" }}
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -192,7 +211,8 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="带宽限制" prop="bandwidth_format" style="width:260px;">
|
<el-form-item label="带宽限制" prop="bandwidth_format" style="width:260px;">
|
||||||
<el-input v-model="ruleForm.bandwidth_format" oninput="value= value.match(/\d+(\.\d{0,2})?/) ? value.match(/\d+(\.\d{0,2})?/)[0] : ''">
|
<el-input v-model="ruleForm.bandwidth_format"
|
||||||
|
oninput="value= value.match(/\d+(\.\d{0,2})?/) ? value.match(/\d+(\.\d{0,2})?/)[0] : ''">
|
||||||
<template slot="append">Mbps</template>
|
<template slot="append">Mbps</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -229,6 +249,30 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="分割DNS" prop="split_dns">
|
||||||
|
<el-row class="msg-info">
|
||||||
|
<el-col :span="20">一般留空。如果输入域名,只有配置的域名(包含子域名)走配置的dns</el-col>
|
||||||
|
<el-col :span="4">
|
||||||
|
<el-button size="mini" type="success" icon="el-icon-plus" circle
|
||||||
|
@click.prevent="addDomain(ruleForm.split_dns)"></el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row v-for="(item,index) in ruleForm.split_dns"
|
||||||
|
:key="index" style="margin-bottom: 5px" :gutter="10">
|
||||||
|
<el-col :span="10">
|
||||||
|
<el-input v-model="item.val"></el-input>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-input v-model="item.note" placeholder="备注"></el-input>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="2">
|
||||||
|
<el-button size="mini" type="danger" icon="el-icon-minus" circle
|
||||||
|
@click.prevent="removeDomain(ruleForm.split_dns,index)"></el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-radio-group v-model="ruleForm.status">
|
<el-radio-group v-model="ruleForm.status">
|
||||||
<el-radio :label="1" border>启用</el-radio>
|
<el-radio :label="1" border>启用</el-radio>
|
||||||
|
@ -246,38 +290,50 @@
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<template v-if="ruleForm.auth.type == 'radius'">
|
<template v-if="ruleForm.auth.type == 'radius'">
|
||||||
<el-form-item label="服务器地址" prop="auth.radius.addr" :rules="this.ruleForm.auth.type== 'radius' ? this.rules['auth.radius.addr'] : [{ required: false }]">
|
<el-form-item label="服务器地址" prop="auth.radius.addr"
|
||||||
|
:rules="this.ruleForm.auth.type== 'radius' ? this.rules['auth.radius.addr'] : [{ required: false }]">
|
||||||
<el-input v-model="ruleForm.auth.radius.addr" placeholder="例如 ip:1812"></el-input>
|
<el-input v-model="ruleForm.auth.radius.addr" placeholder="例如 ip:1812"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="密钥" prop="auth.radius.secret" :rules="this.ruleForm.auth.type== 'radius' ? this.rules['auth.radius.secret'] : [{ required: false }]">
|
<el-form-item label="密钥" prop="auth.radius.secret"
|
||||||
|
:rules="this.ruleForm.auth.type== 'radius' ? this.rules['auth.radius.secret'] : [{ required: false }]">
|
||||||
<el-input v-model="ruleForm.auth.radius.secret" placeholder=""></el-input>
|
<el-input v-model="ruleForm.auth.radius.secret" placeholder=""></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="ruleForm.auth.type == 'ldap'">
|
<template v-if="ruleForm.auth.type == 'ldap'">
|
||||||
<el-form-item label="服务器地址" prop="auth.ldap.addr" :rules="this.ruleForm.auth.type== 'ldap' ? this.rules['auth.ldap.addr'] : [{ required: false }]">
|
<el-form-item label="服务器地址" prop="auth.ldap.addr"
|
||||||
|
:rules="this.ruleForm.auth.type== 'ldap' ? this.rules['auth.ldap.addr'] : [{ required: false }]">
|
||||||
<el-input v-model="ruleForm.auth.ldap.addr" placeholder="例如 ip:389 / 域名:389"></el-input>
|
<el-input v-model="ruleForm.auth.ldap.addr" placeholder="例如 ip:389 / 域名:389"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="开启TLS" prop="auth.ldap.tls">
|
<el-form-item label="开启TLS" prop="auth.ldap.tls">
|
||||||
<el-switch v-model="ruleForm.auth.ldap.tls"></el-switch>
|
<el-switch v-model="ruleForm.auth.ldap.tls"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="管理员 DN" prop="auth.ldap.bind_name" :rules="this.ruleForm.auth.type== 'ldap' ? this.rules['auth.ldap.bind_name'] : [{ required: false }]">
|
<el-form-item label="管理员 DN" prop="auth.ldap.bind_name"
|
||||||
<el-input v-model="ruleForm.auth.ldap.bind_name" placeholder="例如 CN=bindadmin,DC=abc,DC=COM"></el-input>
|
:rules="this.ruleForm.auth.type== 'ldap' ? this.rules['auth.ldap.bind_name'] : [{ required: false }]">
|
||||||
|
<el-input v-model="ruleForm.auth.ldap.bind_name"
|
||||||
|
placeholder="例如 CN=bindadmin,DC=abc,DC=COM"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="管理员密码" prop="auth.ldap.bind_pwd" :rules="this.ruleForm.auth.type== 'ldap' ? this.rules['auth.ldap.bind_pwd'] : [{ required: false }]">
|
<el-form-item label="管理员密码" prop="auth.ldap.bind_pwd"
|
||||||
|
:rules="this.ruleForm.auth.type== 'ldap' ? this.rules['auth.ldap.bind_pwd'] : [{ required: false }]">
|
||||||
<el-input type="password" v-model="ruleForm.auth.ldap.bind_pwd" placeholder=""></el-input>
|
<el-input type="password" v-model="ruleForm.auth.ldap.bind_pwd" placeholder=""></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="Base DN" prop="auth.ldap.base_dn" :rules="this.ruleForm.auth.type== 'ldap' ? this.rules['auth.ldap.base_dn'] : [{ required: false }]">
|
<el-form-item label="Base DN" prop="auth.ldap.base_dn"
|
||||||
|
:rules="this.ruleForm.auth.type== 'ldap' ? this.rules['auth.ldap.base_dn'] : [{ required: false }]">
|
||||||
<el-input v-model="ruleForm.auth.ldap.base_dn" placeholder="例如 DC=abc,DC=com"></el-input>
|
<el-input v-model="ruleForm.auth.ldap.base_dn" placeholder="例如 DC=abc,DC=com"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="用户对象类" prop="auth.ldap.object_class" :rules="this.ruleForm.auth.type== 'ldap' ? this.rules['auth.ldap.object_class'] : [{ required: false }]">
|
<el-form-item label="用户对象类" prop="auth.ldap.object_class"
|
||||||
<el-input v-model="ruleForm.auth.ldap.object_class" placeholder="例如 person / user / posixAccount"></el-input>
|
:rules="this.ruleForm.auth.type== 'ldap' ? this.rules['auth.ldap.object_class'] : [{ required: false }]">
|
||||||
|
<el-input v-model="ruleForm.auth.ldap.object_class"
|
||||||
|
placeholder="例如 person / user / posixAccount"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="用户唯一ID" prop="auth.ldap.search_attr" :rules="this.ruleForm.auth.type== 'ldap' ? this.rules['auth.ldap.search_attr'] : [{ required: false }]">
|
<el-form-item label="用户唯一ID" prop="auth.ldap.search_attr"
|
||||||
<el-input v-model="ruleForm.auth.ldap.search_attr" placeholder="例如 sAMAccountName / uid / cn"></el-input>
|
:rules="this.ruleForm.auth.type== 'ldap' ? this.rules['auth.ldap.search_attr'] : [{ required: false }]">
|
||||||
|
<el-input v-model="ruleForm.auth.ldap.search_attr"
|
||||||
|
placeholder="例如 sAMAccountName / uid / cn"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="受限用户组" prop="auth.ldap.member_of">
|
<el-form-item label="受限用户组" prop="auth.ldap.member_of">
|
||||||
<el-input v-model="ruleForm.auth.ldap.member_of" placeholder="选填, 只允许指定组登入, 例如 CN=HomeWork,DC=abc,DC=com"></el-input>
|
<el-input v-model="ruleForm.auth.ldap.member_of"
|
||||||
|
placeholder="选填, 只允许指定组登入, 例如 CN=HomeWork,DC=abc,DC=com"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
@ -344,7 +400,9 @@
|
||||||
<el-tab-pane label="权限控制" name="link_acl">
|
<el-tab-pane label="权限控制" name="link_acl">
|
||||||
<el-form-item label="权限控制" prop="link_acl">
|
<el-form-item label="权限控制" prop="link_acl">
|
||||||
<el-row class="msg-info">
|
<el-row class="msg-info">
|
||||||
<el-col :span="22">输入CIDR格式如: 192.168.3.0/24 端口0表示所有端口,多个端口用','号分隔,连续端口:1234-5678</el-col>
|
<el-col :span="22">输入CIDR格式如: 192.168.3.0/24
|
||||||
|
端口0表示所有端口,多个端口用','号分隔,连续端口:1234-5678
|
||||||
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<el-button size="mini" type="success" icon="el-icon-plus" circle
|
<el-button size="mini" type="success" icon="el-icon-plus" circle
|
||||||
@click.prevent="addDomain(ruleForm.link_acl)"></el-button>
|
@click.prevent="addDomain(ruleForm.link_acl)"></el-button>
|
||||||
|
@ -361,10 +419,11 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="8">
|
||||||
<el-input type="textarea" :autosize="{ minRows: 1, maxRows: 2}" v-model="item.port" placeholder="多端口,号分隔"></el-input>
|
<!-- type="textarea" :autosize="{ minRows: 1, maxRows: 2}" -->
|
||||||
|
<el-input v-model="item.port" placeholder="多端口,号分隔"></el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="4">
|
||||||
<el-input v-model="item.note" placeholder="备注"></el-input>
|
<el-input v-model="item.note" placeholder="备注"></el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
|
@ -377,10 +436,12 @@
|
||||||
|
|
||||||
<el-tab-pane label="域名拆分隧道" name="ds_domains">
|
<el-tab-pane label="域名拆分隧道" name="ds_domains">
|
||||||
<el-form-item label="包含域名" prop="ds_include_domains">
|
<el-form-item label="包含域名" prop="ds_include_domains">
|
||||||
<el-input type="textarea" :rows="5" v-model="ruleForm.ds_include_domains" placeholder="输入域名用,号分隔,默认匹配所有子域名, 如baidu.com,163.com"></el-input>
|
<el-input type="textarea" :rows="5" v-model="ruleForm.ds_include_domains"
|
||||||
|
placeholder="输入域名用,号分隔,默认匹配所有子域名, 如baidu.com,163.com"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="排除域名" prop="ds_exclude_domains">
|
<el-form-item label="排除域名" prop="ds_exclude_domains">
|
||||||
<el-input type="textarea" :rows="5" v-model="ruleForm.ds_exclude_domains" placeholder="输入域名用,号分隔,默认匹配所有子域名, 如baidu.com,163.com"></el-input>
|
<el-input type="textarea" :rows="5" v-model="ruleForm.ds_exclude_domains"
|
||||||
|
placeholder="输入域名用,号分隔,默认匹配所有子域名, 如baidu.com,163.com"></el-input>
|
||||||
<div class="msg-info">注:域名拆分隧道,仅支持AnyConnect的windows和MacOS桌面客户端,不支持移动端.</div>
|
<div class="msg-info">注:域名拆分隧道,仅支持AnyConnect的windows和MacOS桌面客户端,不支持移动端.</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
@ -404,7 +465,8 @@
|
||||||
center>
|
center>
|
||||||
<el-form :model="authLoginForm" :rules="authLoginRules" ref="authLoginForm" label-width="100px">
|
<el-form :model="authLoginForm" :rules="authLoginRules" ref="authLoginForm" label-width="100px">
|
||||||
<el-form-item label="账号" prop="name">
|
<el-form-item label="账号" prop="name">
|
||||||
<el-input v-model="authLoginForm.name" ref="authLoginFormName" @keydown.enter.native="testAuthLogin"></el-input>
|
<el-input v-model="authLoginForm.name" ref="authLoginFormName"
|
||||||
|
@keydown.enter.native="testAuthLogin"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="密码" prop="pwd">
|
<el-form-item label="密码" prop="pwd">
|
||||||
<el-input type="password" v-model="authLoginForm.pwd" @keydown.enter.native="testAuthLogin"></el-input>
|
<el-input type="password" v-model="authLoginForm.pwd" @keydown.enter.native="testAuthLogin"></el-input>
|
||||||
|
@ -425,8 +487,12 @@
|
||||||
center>
|
center>
|
||||||
<el-form ref="ipEditForm" label-width="80px">
|
<el-form ref="ipEditForm" label-width="80px">
|
||||||
<el-form-item label="路由表" prop="ip_list">
|
<el-form-item label="路由表" prop="ip_list">
|
||||||
<el-input type="textarea" :rows="10" v-model="ipEditForm.ip_list" placeholder="每行一条路由,例:192.168.1.0/24,备注 或 192.168.1.0/24"></el-input>
|
<el-input type="textarea" :rows="10" v-model="ipEditForm.ip_list"
|
||||||
<div class="msg-info">当前共 {{ ipEditForm.ip_list.trim() === '' ? 0 : ipEditForm.ip_list.trim().split("\n").length }} 条(注:AnyConnect客户端最多支持{{ this.maxRouteRows }}条路由)</div>
|
placeholder="每行一条路由,例:192.168.1.0/24,备注 或 192.168.1.0/24"></el-input>
|
||||||
|
<div class="msg-info">当前共
|
||||||
|
{{ ipEditForm.ip_list.trim() === '' ? 0 : ipEditForm.ip_list.trim().split("\n").length }}
|
||||||
|
条(注:AnyConnect客户端最多支持{{ this.maxRouteRows }}条路由)
|
||||||
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" @click="ipEdit()" :loading="ipEditLoading">更新</el-button>
|
<el-button type="primary" @click="ipEdit()" :loading="ipEditLoading">更新</el-button>
|
||||||
|
@ -480,7 +546,8 @@ export default {
|
||||||
bandwidth_format: '0',
|
bandwidth_format: '0',
|
||||||
status: 1,
|
status: 1,
|
||||||
allow_lan: true,
|
allow_lan: true,
|
||||||
client_dns: [{val: '114.114.114.114'}],
|
client_dns: [{val: '114.114.114.114', note: '默认dns'}],
|
||||||
|
split_dns: [],
|
||||||
route_include: [{val: 'all', note: '默认全局代理'}],
|
route_include: [{val: 'all', note: '默认全局代理'}],
|
||||||
route_exclude: [],
|
route_exclude: [],
|
||||||
link_acl: [],
|
link_acl: [],
|
||||||
|
@ -624,7 +691,8 @@ export default {
|
||||||
// arr.pop()
|
// arr.pop()
|
||||||
},
|
},
|
||||||
addDomain(arr) {
|
addDomain(arr) {
|
||||||
arr.push({val: "", action: "allow", port: 0});
|
console.log("arr", arr)
|
||||||
|
arr.push({val: "", action: "allow", port: "0", note: ""});
|
||||||
},
|
},
|
||||||
submitForm(formName) {
|
submitForm(formName) {
|
||||||
this.$refs[formName].validate((valid) => {
|
this.$refs[formName].validate((valid) => {
|
||||||
|
@ -656,9 +724,11 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this.authLoginLoading = true;
|
this.authLoginLoading = true;
|
||||||
axios.post('/group/auth_login', {name:this.authLoginForm.name,
|
axios.post('/group/auth_login', {
|
||||||
|
name: this.authLoginForm.name,
|
||||||
pwd: this.authLoginForm.pwd,
|
pwd: this.authLoginForm.pwd,
|
||||||
auth:this.ruleForm.auth}).then(resp => {
|
auth: this.ruleForm.auth
|
||||||
|
}).then(resp => {
|
||||||
const rdata = resp.data;
|
const rdata = resp.data;
|
||||||
if (rdata.code === 0) {
|
if (rdata.code === 0) {
|
||||||
this.$message.success("登录成功");
|
this.$message.success("登录成功");
|
||||||
|
@ -824,6 +894,7 @@ export default {
|
||||||
max-height: calc(100% - 30px);
|
max-height: calc(100% - 30px);
|
||||||
max-width: calc(100% - 30px);
|
max-width: calc(100% - 30px);
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .valgin-dialog .el-dialog__body {
|
::v-deep .valgin-dialog .el-dialog__body {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
Loading…
Reference in New Issue