This commit is contained in:
GoEdgeLab
2024-07-27 15:42:58 +08:00
parent 7279dc873f
commit d7d0c8fbfe
490 changed files with 2158 additions and 738 deletions

View File

@@ -3,7 +3,7 @@
<!--
2016-2-8: Created with FontForge (http://fontforge.org)
-->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<metadata>
Created by FontForge 20151118 at Mon Feb 8 11:58:02 2016
By shyndman

Before

Width:  |  Height:  |  Size: 275 KiB

After

Width:  |  Height:  |  Size: 275 KiB

File diff suppressed because one or more lines are too long

View File

@@ -22893,7 +22893,7 @@ window.REQUEST_COND_COMPONENTS = [{"type":"url-extension","name":"文件扩展
window.REQUEST_COND_OPERATORS = [{"description":"判断是否正则表达式匹配","name":"正则表达式匹配","op":"regexp"},{"description":"判断是否正则表达式不匹配","name":"正则表达式不匹配","op":"not regexp"},{"description":"判断是否和指定的通配符匹配","name":"通配符匹配","op":"wildcard match"},{"description":"判断是否和指定的通配符不匹配","name":"通配符不匹配","op":"wildcard not match"},{"description":"使用字符串对比参数值是否相等于某个值","name":"字符串等于","op":"eq"},{"description":"参数值包含某个前缀","name":"字符串前缀","op":"prefix"},{"description":"参数值包含某个后缀","name":"字符串后缀","op":"suffix"},{"description":"参数值包含另外一个字符串","name":"字符串包含","op":"contains"},{"description":"参数值不包含另外一个字符串","name":"字符串不包含","op":"not contains"},{"description":"使用字符串对比参数值是否不相等于某个值","name":"字符串不等于","op":"not"},{"description":"判断参数值在某个列表中","name":"在列表中","op":"in"},{"description":"判断参数值不在某个列表中","name":"不在列表中","op":"not in"},{"description":"判断小写的扩展名(不带点)在某个列表中","name":"扩展名","op":"file ext"},{"description":"判断MimeType在某个列表中支持类似于image/*的语法","name":"MimeType","op":"mime type"},{"description":"判断版本号在某个范围内格式为version1,version2","name":"版本号范围","op":"version range"},{"description":"将参数转换为整数数字后进行对比","name":"整数等于","op":"eq int"},{"description":"将参数转换为可以有小数的浮点数字进行对比","name":"浮点数等于","op":"eq float"},{"description":"将参数转换为数字进行对比","name":"数字大于","op":"gt"},{"description":"将参数转换为数字进行对比","name":"数字大于等于","op":"gte"},{"description":"将参数转换为数字进行对比","name":"数字小于","op":"lt"},{"description":"将参数转换为数字进行对比","name":"数字小于等于","op":"lte"},{"description":"对整数参数值取模除数为10对比值为余数","name":"整数取模10","op":"mod 10"},{"description":"对整数参数值取模除数为100对比值为余数","name":"整数取模100","op":"mod 100"},{"description":"对整数参数值取模,对比值格式为:除数,余数比如10,1","name":"整数取模","op":"mod"},{"description":"将参数转换为IP进行对比","name":"IP等于","op":"eq ip"},{"description":"将参数转换为IP进行对比","name":"IP大于","op":"gt ip"},{"description":"将参数转换为IP进行对比","name":"IP大于等于","op":"gte ip"},{"description":"将参数转换为IP进行对比","name":"IP小于","op":"lt ip"},{"description":"将参数转换为IP进行对比","name":"IP小于等于","op":"lte ip"},{"description":"IP在某个范围之内范围格式可以是英文逗号分隔的\u003ccode-label\u003e开始IP,结束IP\u003c/code-label\u003e比如\u003ccode-label\u003e192.168.1.100,192.168.2.200\u003c/code-label\u003e或者CIDR格式的ip/bits比如\u003ccode-label\u003e192.168.2.1/24\u003c/code-label\u003e","name":"IP范围","op":"ip range"},{"description":"对IP参数值取模除数为10对比值为余数","name":"IP取模10","op":"ip mod 10"},{"description":"对IP参数值取模除数为100对比值为余数","name":"IP取模100","op":"ip mod 100"},{"description":"对IP参数值取模对比值格式为除数,余数比如10,1","name":"IP取模","op":"ip mod"}];
window.REQUEST_VARIABLES = [{"code":"${edgeVersion}","description":"","name":"边缘节点版本"},{"code":"${remoteAddr}","description":"会依次根据X-Forwarded-For、X-Real-IP、RemoteAddr获取适合前端有别的反向代理服务时使用存在伪造的风险","name":"客户端地址IP"},{"code":"${rawRemoteAddr}","description":"返回直接连接服务的客户端原始IP地址","name":"客户端地址IP"},{"code":"${remotePort}","description":"","name":"客户端端口"},{"code":"${remoteUser}","description":"","name":"客户端用户名"},{"code":"${requestURI}","description":"比如/hello?name=lily","name":"请求URI"},{"code":"${requestPath}","description":"比如/hello","name":"请求路径(不包括参数)"},{"code":"${requestURL}","description":"比如https://example.com/hello?name=lily","name":"完整的请求URL"},{"code":"${requestLength}","description":"","name":"请求内容长度"},{"code":"${requestMethod}","description":"比如GET、POST","name":"请求方法"},{"code":"${requestFilename}","description":"","name":"请求文件路径"},{"code":"${requestPathExtension}","description":"请求路径中的文件扩展名,包括点符号,比如.html、.png","name":"请求文件扩展名"},{"code":"${requestPathLowerExtension}","description":"请求路径中的文件扩展名,其中大写字母会被自动转换为小写,包括点符号,比如.html、.png","name":"请求文件小写扩展名"},{"code":"${scheme}","description":"","name":"请求协议http或https"},{"code":"${proto}","description:":"类似于HTTP/1.0","name":"包含版本的HTTP请求协议"},{"code":"${timeISO8601}","description":"比如2018-07-16T23:52:24.839+08:00","name":"ISO 8601格式的时间"},{"code":"${timeLocal}","description":"比如17/Jul/2018:09:52:24 +0800","name":"本地时间"},{"code":"${msec}","description":"比如1531756823.054","name":"带有毫秒的时间"},{"code":"${timestamp}","description":"","name":"unix时间戳单位为秒"},{"code":"${host}","description":"","name":"主机名"},{"code":"${cname}","description":"比如38b48e4f.goedge.cn","name":"当前网站的CNAME"},{"code":"${serverName}","description":"","name":"接收请求的服务器名"},{"code":"${serverPort}","description":"","name":"接收请求的服务器端口"},{"code":"${referer}","description":"","name":"请求来源URL"},{"code":"${referer.host}","description":"","name":"请求来源URL域名"},{"code":"${userAgent}","description":"","name":"客户端信息"},{"code":"${contentType}","description":"","name":"请求头部的Content-Type"},{"code":"${cookies}","description":"","name":"所有cookie组合字符串"},{"code":"${cookie.NAME}","description":"","name":"单个cookie值"},{"code":"${isArgs}","description":"如果URL有参数则值为`?`;否则,则值为空","name":"问号(?)标记"},{"code":"${args}","description":"","name":"所有参数组合字符串"},{"code":"${arg.NAME}","description":"","name":"单个参数值"},{"code":"${headers}","description":"","name":"所有Header信息组合字符串"},{"code":"${header.NAME}","description":"","name":"单个Header值"},{"code":"${geo.country.name}","description":"","name":"国家/地区名称"},{"code":"${geo.country.id}","description":"","name":"国家/地区ID"},{"code":"${geo.province.name}","description":"目前只包含中国省份","name":"省份名称"},{"code":"${geo.province.id}","description":"目前只包含中国省份","name":"省份ID"},{"code":"${geo.city.name}","description":"目前只包含中国城市","name":"城市名称"},{"code":"${geo.city.id}","description":"目前只包含中国城市","name":"城市名称"},{"code":"${isp.name}","description":"","name":"ISP服务商名称"},{"code":"${isp.id}","description":"","name":"ISP服务商ID"},{"code":"${browser.os.name}","description":"客户端所在操作系统名称","name":"操作系统名称"},{"code":"${browser.os.version}","description":"客户端所在操作系统版本","name":"操作系统版本"},{"code":"${browser.name}","description":"客户端浏览器名称","name":"浏览器名称"},{"code":"${browser.version}","description":"客户端浏览器版本","name":"浏览器版本"},{"code":"${browser.isMobile}","description":"如果客户端是手机则值为1否则为0","name":"手机标识"}];
window.REQUEST_VARIABLES = [{"code":"${edgeVersion}","description":"","name":"边缘节点版本"},{"code":"${remoteAddr}","description":"会依次根据X-Forwarded-For、X-Real-IP、RemoteAddr获取适合前端有别的反向代理服务时使用存在伪造的风险","name":"客户端地址IP"},{"code":"${rawRemoteAddr}","description":"返回直接连接服务的客户端原始IP地址","name":"客户端地址IP"},{"code":"${remotePort}","description":"","name":"客户端端口"},{"code":"${remoteUser}","description":"","name":"客户端用户名"},{"code":"${requestURI}","description":"比如/hello?name=lily","name":"请求URI"},{"code":"${requestPath}","description":"比如/hello","name":"请求路径(不包括参数)"},{"code":"${requestURL}","description":"比如https://example.com/hello?name=lily","name":"完整的请求URL"},{"code":"${requestLength}","description":"","name":"请求内容长度"},{"code":"${requestMethod}","description":"比如GET、POST","name":"请求方法"},{"code":"${requestFilename}","description":"","name":"请求文件路径"},{"code":"${requestPathExtension}","description":"请求路径中的文件扩展名,包括点符号,比如.html、.png","name":"请求文件扩展名"},{"code":"${requestPathLowerExtension}","description":"请求路径中的文件扩展名,其中大写字母会被自动转换为小写,包括点符号,比如.html、.png","name":"请求文件小写扩展名"},{"code":"${scheme}","description":"","name":"请求协议http或https"},{"code":"${proto}","description:":"类似于HTTP/1.0","name":"包含版本的HTTP请求协议"},{"code":"${timeISO8601}","description":"比如2018-07-16T23:52:24.839+08:00","name":"ISO 8601格式的时间"},{"code":"${timeLocal}","description":"比如17/Jul/2018:09:52:24 +0800","name":"本地时间"},{"code":"${msec}","description":"比如1531756823.054","name":"带有毫秒的时间"},{"code":"${timestamp}","description":"","name":"unix时间戳单位为秒"},{"code":"${host}","description":"","name":"主机名"},{"code":"${cname}","description":"比如38b48e4f.goedge.cloud","name":"当前网站的CNAME"},{"code":"${serverName}","description":"","name":"接收请求的服务器名"},{"code":"${serverPort}","description":"","name":"接收请求的服务器端口"},{"code":"${referer}","description":"","name":"请求来源URL"},{"code":"${referer.host}","description":"","name":"请求来源URL域名"},{"code":"${userAgent}","description":"","name":"客户端信息"},{"code":"${contentType}","description":"","name":"请求头部的Content-Type"},{"code":"${cookies}","description":"","name":"所有cookie组合字符串"},{"code":"${cookie.NAME}","description":"","name":"单个cookie值"},{"code":"${isArgs}","description":"如果URL有参数则值为`?`;否则,则值为空","name":"问号(?)标记"},{"code":"${args}","description":"","name":"所有参数组合字符串"},{"code":"${arg.NAME}","description":"","name":"单个参数值"},{"code":"${headers}","description":"","name":"所有Header信息组合字符串"},{"code":"${header.NAME}","description":"","name":"单个Header值"},{"code":"${geo.country.name}","description":"","name":"国家/地区名称"},{"code":"${geo.country.id}","description":"","name":"国家/地区ID"},{"code":"${geo.province.name}","description":"目前只包含中国省份","name":"省份名称"},{"code":"${geo.province.id}","description":"目前只包含中国省份","name":"省份ID"},{"code":"${geo.city.name}","description":"目前只包含中国城市","name":"城市名称"},{"code":"${geo.city.id}","description":"目前只包含中国城市","name":"城市名称"},{"code":"${isp.name}","description":"","name":"ISP服务商名称"},{"code":"${isp.id}","description":"","name":"ISP服务商ID"},{"code":"${browser.os.name}","description":"客户端所在操作系统名称","name":"操作系统名称"},{"code":"${browser.os.version}","description":"客户端所在操作系统版本","name":"操作系统版本"},{"code":"${browser.name}","description":"客户端浏览器名称","name":"浏览器名称"},{"code":"${browser.version}","description":"客户端浏览器版本","name":"浏览器版本"},{"code":"${browser.isMobile}","description":"如果客户端是手机则值为1否则为0","name":"手机标识"}];
window.METRIC_HTTP_KEYS = [{"name":"客户端地址IP","code":"${remoteAddr}","description":"会依次根据X-Forwarded-For、X-Real-IP、RemoteAddr获取适用于前端可能有别的反向代理的情形存在被伪造的可能","icon":""},{"name":"直接客户端地址IP","code":"${rawRemoteAddr}","description":"返回直接连接服务的客户端原始IP地址","icon":""},{"name":"客户端用户名","code":"${remoteUser}","description":"通过基本认证填入的用户名","icon":""},{"name":"请求URI","code":"${requestURI}","description":"包含参数,比如/hello?name=lily","icon":""},{"name":"请求路径","code":"${requestPath}","description":"不包含参数,比如/hello","icon":""},{"name":"完整URL","code":"${requestURL}","description":"比如https://example.com/hello?name=lily","icon":""},{"name":"请求方法","code":"${requestMethod}","description":"比如GET、POST等","icon":""},{"name":"请求协议Scheme","code":"${scheme}","description":"http或https","icon":""},{"name":"文件扩展名","code":"${requestPathExtension}","description":"请求路径中的文件扩展名,包括点符号,比如.html、.png","icon":""},{"name":"小写文件扩展名","code":"${requestPathLowerExtension}","description":"请求路径中的文件扩展名小写形式,包括点符号,比如.html、.png","icon":""},{"name":"主机名","code":"${host}","description":"通常是请求的域名","icon":""},{"name":"HTTP协议","code":"${proto}","description":"包含版本的HTTP请求协议类似于HTTP/1.0","icon":""},{"name":"URL参数值","code":"${arg.NAME}","description":"单个URL参数值","icon":""},{"name":"请求来源URL","code":"${referer}","description":"请求来源Referer URL","icon":""},{"name":"请求来源URL域名","code":"${referer.host}","description":"请求来源Referer URL域名","icon":""},{"name":"Header值","code":"${header.NAME}","description":"单个Header值比如${header.User-Agent}","icon":""},{"name":"Cookie值","code":"${cookie.NAME}","description":"单个cookie值比如${cookie.sid}","icon":""},{"name":"状态码","code":"${status}","description":"","icon":""},{"name":"响应的Content-Type值","code":"${response.contentType}","description":"","icon":""}];

View File

@@ -0,0 +1,55 @@
Vue.component("http-firewall-provider-selector", {
props: ["v-type", "v-providers"],
data: function () {
let providers = this.vProviders
if (providers == null) {
providers = []
}
return {
listType: this.vType,
providers: providers
}
},
methods: {
addProvider: function () {
let selectedProviderIds = this.providers.map(function (provider) {
return provider.id
})
let that = this
teaweb.popup("/servers/server/settings/waf/ipadmin/selectProvidersPopup?type=" + this.listType + "&selectedProviderIds=" + selectedProviderIds.join(","), {
width: "50em",
height: "26em",
callback: function (resp) {
that.providers = resp.data.selectedProviders
that.$forceUpdate()
that.notifyChange()
}
})
},
removeProvider: function (index) {
this.providers.$remove(index)
this.notifyChange()
},
resetProviders: function () {
this.providers = []
this.notifyChange()
},
notifyChange: function () {
this.$emit("change", {
"providers": this.providers
})
}
},
template: `<div>
<span v-if="providers.length == 0" class="disabled">暂时没有选择<span v-if="listType =='allow'">允许</span><span v-else>封禁</span>的运营商。</span>
<div v-show="providers.length > 0">
<div class="ui label tiny basic" v-for="(provider, index) in providers" style="margin-bottom: 0.5em">
<input type="hidden" :name="listType + 'ProviderIds'" :value="provider.id"/>
{{provider.name}} <a href="" @click.prevent="removeProvider(index)" title="删除"><i class="icon remove"></i></a>
</div>
</div>
<div class="ui divider"></div>
<button type="button" class="ui button tiny" @click.prevent="addProvider">修改</button> &nbsp; <button type="button" class="ui button tiny" v-show="providers.length > 0" @click.prevent="resetProviders">清空</button>
</div>`
})

View File

@@ -4,6 +4,6 @@
<a href="https://goedge.cloud/docs" target="_blank" class="item">文档</a>
<a href="https://github.com/TeaOSLab/EdgeAdmin" target="_blank" class="item">GitHub</a>
<a href="https://github.com/TeaOSLab/EdgeAdmin/issues" target="_blank" class="item">提Bug</a>
<!--<a class="item" href="https://goedge.cn/community/telegram" target="_blank" title="点击跳转到加群页面">Telegram群 &nbsp;<i class="icon paper plane"></i></a>-->
<!--<a class="item" href="https://goedge.cloud/community/telegram" target="_blank" title="点击跳转到加群页面">Telegram群 &nbsp;<i class="icon paper plane"></i></a>-->
<a class="item right" href="https://goedge.cloud/commercial" target="_blank" v-if="!teaIsPlus">企业版</a>
</div>

View File

@@ -57,6 +57,28 @@
<node-region-selector></node-region-selector>
<p class="comment">设置区域后可以根据区域进行流量统计和计费。</p>
</td>
</tr>
<tr>
<td>所属从集群</td>
<td>
<div>
<div>
<input type="hidden" name="secondaryClusterIds" :value="JSON.stringify(secondaryClusterIds)"/>
<table class="ui table">
<tr>
<td>
<div v-if="secondaryClusters.length > 0">
<div class="ui label basic small" v-for="(cluster, index) in secondaryClusters"><span class="grey">{{cluster.name}}</span> &nbsp; <a href="" title="删除" @click.prevent="removeSecondary(index)"><i class="icon remove small"></i></a> </div>
</div>
<div style="margin-top: 0.6em">
<button class="ui button tiny" type="button" @click.prevent="addSecondary">+</button>
</div>
</td>
</tr>
</table>
</div>
</div>
</td>
</tr>
<tr>
<td colspan="2">

View File

@@ -24,6 +24,30 @@ Tea.context(function () {
})
}
this.secondaryClusters = []
this.secondaryClusterIds = this.secondaryClusters.map(function (v) {
return v.id
})
this.addSecondary = function () {
let that = this
let selectedClusterIds = [this.clusterId].concat(this.secondaryClusterIds)
teaweb.popup("/clusters/selectPopup?selectedClusterIds=" + selectedClusterIds.join(",") + "&mode=multiple", {
height: "30em",
width: "50em",
callback: function (resp) {
if (resp.data.cluster != null) {
that.secondaryClusterIds.push(resp.data.cluster.id)
that.secondaryClusters.push(resp.data.cluster)
}
}
})
}
this.removeSecondary = function (index) {
this.secondaryClusterIds.$remove(index)
this.secondaryClusters.$remove(index)
}
/**
* 安装
*/
@@ -35,6 +59,7 @@ Tea.context(function () {
this.installMethod = method
}
this.selectSSHHost = function (host) {
this.sshHost = host
this.changeSSHHost()

View File

@@ -14,6 +14,23 @@
<p class="comment">当前节点可以使用的最多的CPU线程数如果为0则默认为总的CPU线程数。<pro-warning-label></pro-warning-label></p>
</td>
</tr>
<tr v-show="teaIsPlus">
<td class="title">BYPASS 移动</td>
<td>
<div class="ui checkbox">
<input type="checkbox" id="bypassMobileCheckbox" :name="bypassMobileCheckbox" v-model="node.bypassMobileCheckbox" @change="changeBypassMobile"/>
<label for="bypassMobileCheckbox"><slot></slot></label>
</div>
<p class="comment"><plus-label></plus-label>选中后可优化移动网络访问成功率对于正常站点会增加访问延迟节点需安装nftables。<pro-warning-label></pro-warning-label></p>
</td>
</tr>
<tr v-show="teaIsPlus && node.bypassMobileCheckbox">
<td class="title">BYPASS 移动,窗口大小</td>
<td>
<input type="text" name="bypassMobile" v-model="node.bypassMobile"/>
<p class="comment"><plus-label></plus-label>TCP接收窗口大小默认值17。<pro-warning-label></pro-warning-label></p>
</td>
</tr>
</table>
<h4>DNS解析</h4>

View File

@@ -1,3 +1,11 @@
Tea.context(function () {
this.success = NotifyReloadSuccess("保存成功")
this.changeBypassMobile = function(bypassMobile) {
if (bypassMobile.target.checked) {
this.node.bypassMobile = 17;
} else {
this.node.bypassMobile = 0;
}
}
})

View File

@@ -15,7 +15,6 @@
<td>服务商厂家 *</td>
<td>
<select class="ui dropdown auto-width" name="type" v-model="type" @change="changeType">
<option value="">[请选择]</option>
<option v-for="type in types" :value="type.code">{{type.name}}</option>
</select>
<p class="comment" v-if="typeDescription.length > 0">{{typeDescription}} 系统会保留原有域名下的域名解析,请放心使用。<span v-if="!teaIsPlus">购买商业版可获得更多厂商支持。</span></p>

View File

@@ -1,7 +1,7 @@
Tea.context(function () {
this.success = NotifyPopup
this.type = ""
this.typeDescription = ""
this.type = "dnsla"
this.typeDescription = "DNS.LA提供的DNS服务。"
this.changeType = function () {
let that = this

View File

@@ -1,6 +1,7 @@
<second-menu style="margin-top:-1em">
<menu-item :href="'/servers/components/waf/ipadmin?firewallPolicyId=' + firewallPolicyId" :active="subMenuItem == 'region'">国家/地区封禁</menu-item>
<menu-item :href="'/servers/components/waf/ipadmin/provinces?firewallPolicyId=' + firewallPolicyId" :active="subMenuItem == 'province'">省份封禁</menu-item>
<menu-item :href="'/servers/components/waf/ipadmin/providers?firewallPolicyId=' + firewallPolicyId" :active="subMenuItem == 'provider'">运营商封禁</menu-item>
<span class="item disabled">|</span>
<menu-item :href="'/servers/components/waf/ipadmin/lists?firewallPolicyId=' + firewallPolicyId + '&type=white'" :active="subMenuItem == 'white'">白名单</menu-item>
<menu-item :href="'/servers/components/waf/ipadmin/lists?firewallPolicyId=' + firewallPolicyId + '&type=black'" :active="subMenuItem == 'black'">黑名单</menu-item>

View File

@@ -0,0 +1,46 @@
{$layout}
{$template "../waf_menu"}
{$template "menu"}
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="firewallPolicyId" :value="firewallPolicyId"/>
<input type="hidden" name="exceptURLPatternsJSON" :value="JSON.stringify(exceptURLPatterns)"/>
<input type="hidden" name="onlyURLPatternsJSON" :value="JSON.stringify(onlyURLPatterns)"/>
<table class="ui table selectable definition">
<tr>
<td class="title">仅允许的运营商</td>
<td>
<http-firewall-provider-selector :v-providers="allowedProviders" :v-type="'allow'" @change="changeAllowedProviders"></http-firewall-provider-selector>
</td>
</tr>
<tr>
<td class="title">仅封禁的运营商</td>
<td>
<p class="comment" v-if="allowedProviders.length > 0">由于你已设置"仅允许的运营商",所以不需要再设置封禁运营商。</p>
<http-firewall-provider-selector :v-providers="deniedProviders" :v-type="'deny'" v-show="allowedProviders.length == 0"></http-firewall-provider-selector>
</td>
</tr>
<tr>
<td colspan="2"><more-options-indicator></more-options-indicator></td>
</tr>
<tbody v-show="moreOptionsVisible">
<tr>
<td>例外URL &nbsp;<tip-icon content="对这些URL将不做任何限制。"></tip-icon></td>
<td><url-patterns-box v-model="exceptURLPatterns"></url-patterns-box></td>
</tr>
<tr>
<td>限制URL &nbsp;<tip-icon content="只对这些URL做限制。"></tip-icon></td>
<td><url-patterns-box v-model="onlyURLPatterns"></url-patterns-box></td>
</tr>
<tr>
<td>提示内容</td>
<td>
<textarea v-model="providerHTML" name="providerHTML" rows="3"></textarea>
<p class="comment">当客户端所在区域被封禁时提示页面的HTML内容不填则表示使用默认的提示内容支持请求变量。</p>
</td>
</tr>
</tbody>
</table>
<submit-btn></submit-btn>
</form>

View File

@@ -0,0 +1,11 @@
Tea.context(function () {
this.success = function () {
teaweb.success("保存成功", function () {
teaweb.reload()
})
}
this.changeAllowedProviders = function (event) {
this.allowedProviders = event.providers
}
})

View File

@@ -18,7 +18,7 @@
</div>
</td>
</tr>
<tr>
<tr v-if="!asyncCreateCert">
<td>证书用户 *</td>
<td>
<div v-if="users.length > 0">
@@ -35,6 +35,24 @@
</div>
</td>
</tr>
<tr>
<td>异步申请证书</td>
<td>
<checkbox name="asyncCreateCert" v-model="asyncCreateCert">启用</checkbox>
<p class="comment">建议域名多的时候勾选,异步并发执行证书申请,申请成功后会自动绑定到服务</p>
</td>
</tr>
<tr v-if="asyncCreateCert">
<td>证书类型</td>
<td class="ui fields inline">
<div class="ui field">
<select class="ui dropdown" name="providerCode" v-model="providerCode">
<option value="letsencrypt">Let's Encrypt</option>
</select>
</div>
<p class="comment">选择证书类型。</p>
</td>
</tr>
</table>
<submit-btn v-if="!isRequesting">提交</submit-btn>

View File

@@ -1,6 +1,8 @@
Tea.context(function () {
this.isRequesting = false
this.userId = 0
this.asyncCreateCert = false
this.providerCode = "letsencrypt"
this.remove = function (index) {
this.serverNames.$remove(index)

View File

@@ -5,6 +5,7 @@
<span class="item disabled">|</span>
<menu-item :href="'/servers/server/settings/waf/ipadmin/countries?serverId=' + serverId + '&firewallPolicyId='+firewallPolicyId" code="country">国家/地区封禁</menu-item>
<menu-item :href="'/servers/server/settings/waf/ipadmin/provinces?serverId=' + serverId + '&firewallPolicyId='+firewallPolicyId" code="province">省份封禁</menu-item>
<menu-item :href="'/servers/server/settings/waf/ipadmin/providers?serverId=' + serverId + '&firewallPolicyId='+firewallPolicyId" code="provider">运营商封禁</menu-item>
<menu-item :href="'/servers/server/settings/waf/ipadmin/allowList?serverId=' + serverId + '&firewallPolicyId='+firewallPolicyId" code="allowList">白名单</menu-item>
<menu-item :href="'/servers/server/settings/waf/ipadmin/denyList?serverId=' + serverId + '&firewallPolicyId='+firewallPolicyId" code="denyList">黑名单</menu-item>
<menu-item :href="'/servers/server/settings/waf/ipadmin/greyList?serverId=' + serverId + '&firewallPolicyId='+firewallPolicyId" code="greyList">灰名单</menu-item>

View File

@@ -0,0 +1,59 @@
{$layout}
{$template "../../settings_menu"}
{$template "/left_menu_with_menu"}
<div class="right-box with-menu">
{$template "../menu"}
<warning-message v-if="!featureIsOn">尚未为当前用户开通此功能。</warning-message>
{$ if .featureIsOn}
<warning-message v-if="!wafIsOn">当前WAF未启用设置将在<a :href="'/servers/server/settings/waf?serverId=' + serverId">[启用Web防火墙]</a>后生效。</warning-message>
<warning-message v-if="clusterFirewallPolicy != null && clusterFirewallPolicy.mode != 'defend'">当前网站所在集群的WAF策略模式为
<span v-if="clusterFirewallPolicy.modeInfo != null"><strong>{{clusterFirewallPolicy.modeInfo.name}}</strong></span>
<span v-else>非防御模式</span>,当前设置将不会生效。
</warning-message>
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="firewallPolicyId" :value="firewallPolicyId"/>
<input type="hidden" name="exceptURLPatternsJSON" :value="JSON.stringify(exceptURLPatterns)"/>
<input type="hidden" name="onlyURLPatternsJSON" :value="JSON.stringify(onlyURLPatterns)"/>
<table class="ui table selectable definition">
<tr>
<td class="title">仅允许的运营商</td>
<td>
<http-firewall-provider-selector :v-providers="allowedProviders" :v-type="'allow'" @change="changeAllowedProviders"></http-firewall-provider-selector>
</td>
</tr>
<tr>
<td class="title">仅封禁的运营商</td>
<td>
<p class="comment" v-if="allowedProviders.length > 0">由于你已设置"仅允许的运营商",所以不需要再设置封禁运营商。</p>
<http-firewall-provider-selector :v-providers="deniedProviders" :v-type="'deny'" v-show="allowedProviders.length == 0"></http-firewall-provider-selector>
</td>
</tr>
<tr>
<td colspan="2"><more-options-indicator></more-options-indicator></td>
</tr>
<tbody v-show="moreOptionsVisible">
<tr>
<td>例外URL &nbsp;<tip-icon content="对这些URL将不做任何限制。"></tip-icon></td>
<td><url-patterns-box v-model="exceptURLPatterns"></url-patterns-box></td>
</tr>
<tr>
<td>限制URL &nbsp;<tip-icon content="只对这些URL做限制。"></tip-icon></td>
<td><url-patterns-box v-model="onlyURLPatterns"></url-patterns-box></td>
</tr>
<tr>
<td>提示内容</td>
<td>
<textarea v-model="providerHTML" name="providerHTML" rows="3"></textarea>
<p class="comment">当客户端所在运营商被封禁时提示页面的HTML内容不填则表示使用默认的提示内容支持请求变量。</p>
</td>
</tr>
</tbody>
</table>
<submit-btn></submit-btn>
</form>
{$end}
</div>

View File

@@ -0,0 +1,11 @@
Tea.context(function () {
this.success = function () {
teaweb.success("保存成功", function () {
teaweb.reload()
})
}
this.changeAllowedProviders = function (event) {
this.allowedProviders = event.providers
}
})

View File

@@ -0,0 +1,10 @@
.providers-list .item {
float: left;
width: 12em;
margin-bottom: 0.5em;
}
.providers-list .item .checkbox label {
font-size: 12px !important;
cursor: pointer !important;
}

View File

@@ -0,0 +1,32 @@
{$layout "layout_popup"}
<h3 v-show="type == 'allow'">选择允许的运营商</h3>
<h3 v-show="type == 'deny'">选择封禁的运营商</h3>
<form class="ui form">
<table class="ui table">
<tr>
<td>
<first-menu>
<div class="item right">
<div class="ui checkbox" @click.prevent="checkAll">
<input type="checkbox" v-model="isCheckingAll"/>
<label>全选</label>
</div>
</div>
</first-menu>
<div class="providers-list" style="margin-top:0.5em">
<div class="item" v-for="provider in providers">
<div class="ui checkbox" @click.prevent="selectProvider(provider)">
<input type="checkbox" v-model="provider.isChecked"/>
<label>{{provider.name}}</label>
</div>
</div>
</div>
<div class="clear"></div>
</td>
</tr>
</table>
<button class="ui button primary" type="button" @click.prevent="submit">确定</button>
</form>

View File

@@ -0,0 +1,46 @@
Tea.context(function () {
this.isCheckingAll = false
this.countSelectedProviders = this.providers.$count(function (k, provider) {
return provider.isChecked
})
this.selectProvider = function (provider) {
provider.isChecked = !provider.isChecked
this.change()
}
this.deselectProvider = function (provider) {
provider.isChecked = false
this.change()
}
this.checkAll = function () {
this.isCheckingAll = !this.isCheckingAll
let that = this
this.providers.forEach(function (provider) {
provider.isChecked = that.isCheckingAll
})
this.change()
}
this.change = function () {
}
this.submit = function () {
let selectedProviders = []
this.providers.forEach(function (provider) {
if (provider.isChecked) {
selectedProviders.push(provider)
}
})
NotifyPopup({
code: 200,
data: {
selectedProviders: selectedProviders
}
})
}
})

View File

@@ -24,7 +24,7 @@
<td>可以在你要安装MySQL的服务器上运行以下命令<span class="grey">目前仅支持Linux系统和X86架构服务器安装后的MySQL版本是8.x.x</span></td>
</tr>
<tr>
<td>sudo sh -c &quot;$(wget https://goedge.cn/install-mysql.sh -O -)&quot;</td>
<td>sudo sh -c &quot;$(wget https://goedge.cloud/install-mysql.sh -O -)&quot;</td>
</tr>
</table>