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

@@ -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>