修改相关域名、文字等

This commit is contained in:
GoEdgeLab
2021-12-17 14:17:48 +08:00
parent ed9c834a8d
commit 3eda99c636
8 changed files with 92 additions and 19 deletions

View File

@@ -3477,6 +3477,9 @@ Vue.component("http-cache-config-box", {
isOn: function () { isOn: function () {
return ((!this.vIsLocation && !this.vIsGroup) || this.cacheConfig.isPrior) && this.cacheConfig.isOn return ((!this.vIsLocation && !this.vIsGroup) || this.cacheConfig.isPrior) && this.cacheConfig.isOn
}, },
isPlus: function () {
return Tea.Vue.teaIsPlus
},
generatePurgeKey: function () { generatePurgeKey: function () {
let r = Math.random().toString() + Math.random().toString() let r = Math.random().toString() + Math.random().toString()
let s = r.replace(/0\./g, "") let s = r.replace(/0\./g, "")
@@ -3489,6 +3492,9 @@ Vue.component("http-cache-config-box", {
}, },
showMoreOptions: function () { showMoreOptions: function () {
this.moreOptionsVisible = !this.moreOptionsVisible this.moreOptionsVisible = !this.moreOptionsVisible
},
changeStale: function (stale) {
this.cacheConfig.stale = stale
} }
}, },
template: `<div> template: `<div>
@@ -3545,14 +3551,14 @@ Vue.component("http-cache-config-box", {
</td> </td>
</tr> </tr>
<tr> <tr>
<td>允许PURGE</td> <td class="color-border">允许PURGE</td>
<td> <td>
<checkbox v-model="cacheConfig.purgeIsOn"></checkbox> <checkbox v-model="cacheConfig.purgeIsOn"></checkbox>
<p class="comment">允许使用PURGE方法清除某个URL缓存。</p> <p class="comment">允许使用PURGE方法清除某个URL缓存。</p>
</td> </td>
</tr> </tr>
<tr v-show="cacheConfig.purgeIsOn"> <tr v-show="cacheConfig.purgeIsOn">
<td>PURGE Key *</td> <td class="color-border">PURGE Key *</td>
<td> <td>
<input type="text" maxlength="200" v-model="cacheConfig.purgeKey"/> <input type="text" maxlength="200" v-model="cacheConfig.purgeKey"/>
<p class="comment"><a href="" @click.prevent="generatePurgeKey">[随机生成]</a>。需要在PURGE方法调用时加入<code-label>Edge-Purge-Key: {{cacheConfig.purgeKey}}</code-label> Header。只能包含字符、数字、下划线。</p> <p class="comment"><a href="" @click.prevent="generatePurgeKey">[随机生成]</a>。需要在PURGE方法调用时加入<code-label>Edge-Purge-Key: {{cacheConfig.purgeKey}}</code-label> Header。只能包含字符、数字、下划线。</p>
@@ -3561,7 +3567,12 @@ Vue.component("http-cache-config-box", {
</tbody> </tbody>
</table> </table>
<div v-show="isOn()"> <div v-if="isOn() && moreOptionsVisible && isPlus()">
<h4>过时缓存策略</h4>
<http-cache-stale-config :v-cache-stale-config="cacheConfig.stale" @change="changeStale"></http-cache-stale-config>
</div>
<div v-show="isOn()" style="margin-top: 1em">
<h4>缓存条件</h4> <h4>缓存条件</h4>
<http-cache-refs-config-box :v-cache-config="cacheConfig" :v-cache-refs="cacheConfig.cacheRefs" ></http-cache-refs-config-box> <http-cache-refs-config-box :v-cache-config="cacheConfig" :v-cache-refs="cacheConfig.cacheRefs" ></http-cache-refs-config-box>
</div> </div>
@@ -4587,6 +4598,68 @@ Vue.component("server-name-box", {
</div>` </div>`
}) })
Vue.component("http-cache-stale-config", {
props: ["v-cache-stale-config"],
data: function () {
let config = this.vCacheStaleConfig
if (config == null) {
config = {
isPrior: false,
isOn: false,
status: [],
supportStaleIfErrorHeader: true,
life: {
count: 1,
unit: "day"
}
}
}
return {
config: config
}
},
watch: {
config: {
deep: true,
handler: function () {
this.$emit("change", this.config)
}
}
},
methods: {},
template: `<table class="ui table definition selectable">
<tbody>
<tr>
<td class="title">启用过时缓存</td>
<td>
<checkbox v-model="config.isOn"></checkbox>
<p class="comment">选中后,在更新缓存失败后会尝试读取过时的缓存。</p>
</td>
</tr>
<tr v-show="config.isOn">
<td>有效期</td>
<td>
<time-duration-box :v-value="config.life"></time-duration-box>
<p class="comment">缓存在过期之后,仍然保留的时间。</p>
</td>
</tr>
<tr v-show="config.isOn">
<td>状态码</td>
<td><http-status-box :v-status-list="config.status"></http-status-box>
<p class="comment">在这些状态码出现时使用过时缓存,默认支持<code-label>50x</code-label>状态码。</p>
</td>
</tr>
<tr v-show="config.isOn">
<td>支持stale-if-error</td>
<td>
<checkbox v-model="config.supportStaleIfErrorHeader"></checkbox>
<p class="comment">选中后支持在Cache-Control中通过<code-label>stale-if-error</code-label>指定过时缓存有效期。</p>
</td>
</tr>
</tbody>
</table>`
})
// 域名列表 // 域名列表
Vue.component("domains-box", { Vue.component("domains-box", {
props: ["v-domains"], props: ["v-domains"],
@@ -6694,7 +6767,7 @@ Vue.component("http-access-log-box", {
template: `<div style="word-break: break-all" :style="{'color': (accessLog.status >= 400) ? '#dc143c' : ''}" ref="box"> template: `<div style="word-break: break-all" :style="{'color': (accessLog.status >= 400) ? '#dc143c' : ''}" ref="box">
<a v-if="accessLog.node != null && accessLog.node.nodeCluster != null" :href="'/clusters/cluster/node?nodeId=' + accessLog.node.id + '&clusterId=' + accessLog.node.nodeCluster.id" title="点击查看节点详情" target="_top"><span class="grey">[{{accessLog.node.name}}<span v-if="!accessLog.node.name.endsWith('节点')">节点</span>]</span></a> <a v-if="accessLog.node != null && accessLog.node.nodeCluster != null" :href="'/clusters/cluster/node?nodeId=' + accessLog.node.id + '&clusterId=' + accessLog.node.nodeCluster.id" title="点击查看节点详情" target="_top"><span class="grey">[{{accessLog.node.name}}<span v-if="!accessLog.node.name.endsWith('节点')">节点</span>]</span></a>
<a :href="'/servers/server/log?serverId=' + accessLog.serverId" title="点击到网站服务" v-if="vShowServerLink"><span class="grey">[服务]</span></a> <a :href="'/servers/server/log?serverId=' + accessLog.serverId" title="点击到网站服务" v-if="vShowServerLink"><span class="grey">[服务]</span></a>
<span v-if="accessLog.region != null && accessLog.region.length > 0" class="grey"><ip-box :v-ip="accessLog.remoteAddr">[{{accessLog.region}}]</ip-box></span> <ip-box><keyword :v-word="vKeyword">{{accessLog.remoteAddr}}</keyword></ip-box> [{{accessLog.timeLocal}}] <em>&quot;<keyword :v-word="vKeyword">{{accessLog.requestMethod}}</keyword> {{accessLog.scheme}}://<keyword :v-word="vKeyword">{{accessLog.host}}</keyword><keyword :v-word="vKeyword">{{accessLog.requestURI}}</keyword> <a :href="accessLog.scheme + '://' + accessLog.host + accessLog.requestURI" target="_blank" title="新窗口打开" class="disabled"><i class="external icon tiny"></i> </a> {{accessLog.proto}}&quot; </em> <keyword :v-word="vKeyword">{{accessLog.status}}</keyword> <code-label v-if="accessLog.attrs != null && accessLog.attrs['cache.status'] == 'HIT'">cache hit</code-label> <code-label v-if="accessLog.firewallActions != null && accessLog.firewallActions.length > 0">waf {{accessLog.firewallActions}}</code-label> <span v-if="accessLog.tags != null && accessLog.tags.length > 0">- <code-label v-for="tag in accessLog.tags" :key="tag">{{tag}}</code-label></span> - 耗时:{{formatCost(accessLog.requestTime)}} ms <span v-if="accessLog.humanTime != null && accessLog.humanTime.length > 0" class="grey small">&nbsp; ({{accessLog.humanTime}})</span> <span v-if="accessLog.region != null && accessLog.region.length > 0" class="grey"><ip-box :v-ip="accessLog.remoteAddr">[{{accessLog.region}}]</ip-box></span> <ip-box><keyword :v-word="vKeyword">{{accessLog.remoteAddr}}</keyword></ip-box> [{{accessLog.timeLocal}}] <em>&quot;<keyword :v-word="vKeyword">{{accessLog.requestMethod}}</keyword> {{accessLog.scheme}}://<keyword :v-word="vKeyword">{{accessLog.host}}</keyword><keyword :v-word="vKeyword">{{accessLog.requestURI}}</keyword> <a :href="accessLog.scheme + '://' + accessLog.host + accessLog.requestURI" target="_blank" title="新窗口打开" class="disabled"><i class="external icon tiny"></i> </a> {{accessLog.proto}}&quot; </em> <keyword :v-word="vKeyword">{{accessLog.status}}</keyword> <code-label v-if="accessLog.attrs != null && (accessLog.attrs['cache.status'] == 'HIT' || accessLog.attrs['cache.status'] == 'STALE')">cache {{accessLog.attrs['cache.status'].toLowerCase()}}</code-label> <code-label v-if="accessLog.firewallActions != null && accessLog.firewallActions.length > 0">waf {{accessLog.firewallActions}}</code-label> <span v-if="accessLog.tags != null && accessLog.tags.length > 0">- <code-label v-for="tag in accessLog.tags" :key="tag">{{tag}}</code-label></span> - 耗时:{{formatCost(accessLog.requestTime)}} ms <span v-if="accessLog.humanTime != null && accessLog.humanTime.length > 0" class="grey small">&nbsp; ({{accessLog.humanTime}})</span>
&nbsp; <a href="" @click.prevent="showLog" title="查看详情"><i class="icon expand"></i></a> &nbsp; <a href="" @click.prevent="showLog" title="查看详情"><i class="icon expand"></i></a>
</div>` </div>`
}) })

View File

@@ -117,7 +117,7 @@ Vue.component("http-cache-config-box", {
</table> </table>
<div v-if="isOn() && moreOptionsVisible && isPlus()"> <div v-if="isOn() && moreOptionsVisible && isPlus()">
<h4>陈旧缓存策略</h4> <h4>过时缓存策略</h4>
<http-cache-stale-config :v-cache-stale-config="cacheConfig.stale" @change="changeStale"></http-cache-stale-config> <http-cache-stale-config :v-cache-stale-config="cacheConfig.stale" @change="changeStale"></http-cache-stale-config>
</div> </div>

View File

@@ -30,10 +30,10 @@ Vue.component("http-cache-stale-config", {
template: `<table class="ui table definition selectable"> template: `<table class="ui table definition selectable">
<tbody> <tbody>
<tr> <tr>
<td class="title">启用陈旧缓存</td> <td class="title">启用过时缓存</td>
<td> <td>
<checkbox v-model="config.isOn"></checkbox> <checkbox v-model="config.isOn"></checkbox>
<p class="comment">选中后,在更新缓存失败后会尝试读取陈旧的缓存。</p> <p class="comment">选中后,在更新缓存失败后会尝试读取过时的缓存。</p>
</td> </td>
</tr> </tr>
<tr v-show="config.isOn"> <tr v-show="config.isOn">
@@ -46,14 +46,14 @@ Vue.component("http-cache-stale-config", {
<tr v-show="config.isOn"> <tr v-show="config.isOn">
<td>状态码</td> <td>状态码</td>
<td><http-status-box :v-status-list="config.status"></http-status-box> <td><http-status-box :v-status-list="config.status"></http-status-box>
<p class="comment">在这些状态码出现时使用陈旧缓存,默认支持<code-label>50x</code-label>状态码。</p> <p class="comment">在这些状态码出现时使用过时缓存,默认支持<code-label>50x</code-label>状态码。</p>
</td> </td>
</tr> </tr>
<tr v-show="config.isOn"> <tr v-show="config.isOn">
<td>支持stale-if-error</td> <td>支持stale-if-error</td>
<td> <td>
<checkbox v-model="config.supportStaleIfErrorHeader"></checkbox> <checkbox v-model="config.supportStaleIfErrorHeader"></checkbox>
<p class="comment">选中后支持在Cache-Control中通过<code-label>stale-if-error</code-label>指定陈旧缓存有效期。</p> <p class="comment">选中后支持在Cache-Control中通过<code-label>stale-if-error</code-label>指定过时缓存有效期。</p>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@@ -122,8 +122,8 @@
<a href="https://goedge.cn" target="_blank" class="item">官网</a> <a href="https://goedge.cn" target="_blank" class="item">官网</a>
<a href="https://goedge.cn/docs" target="_blank" class="item">文档</a> <a href="https://goedge.cn/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" target="_blank" class="item">GitHub</a>
<!--<a href="http://teaos.cn" target="_blank" class="item">官网</a> <!--<a href="https://goedge.cn" target="_blank" class="item">官网</a>
<a href="http://teaos.cn/doc" target="_blank" class="item">文档</a>--> <a href="https://goedge.cn/docs" target="_blank" class="item">文档</a>-->
<a href="https://github.com/TeaOSLab/EdgeAdmin/issues" target="_blank" class="item">提Bug</a> <a href="https://github.com/TeaOSLab/EdgeAdmin/issues" target="_blank" class="item">提Bug</a>
<a class="item" @click.prevent="showQQGroupQrcode()">QQ讨论群659832182 &nbsp;<i class="icon qrcode"></i> </a> <a class="item" @click.prevent="showQQGroupQrcode()">QQ讨论群659832182 &nbsp;<i class="icon qrcode"></i> </a>
<a class="item right" href="https://goedge.cn/commercial" target="_blank" v-if="!teaIsPlus">企业版</a> <a class="item right" href="https://goedge.cn/commercial" target="_blank" v-if="!teaIsPlus">企业版</a>

View File

@@ -31,7 +31,7 @@
</div> </div>
</div> </div>
<p class="comment" v-if="params.length > 0">可以在参数值中使用一些变量<a href="http://teaos.cn/doc/proxy/Fastcgi.md#%E5%8F%82%E6%95%B0%E5%8F%98%E9%87%8F" target="_blank">点这里查看</a></p> <p class="comment" v-if="params.length > 0">可以在参数值中使用一些变量<a href="https://goedge.cn/docs/Server/Variables.md" target="_blank">点这里查看</a></p>
<button class="ui button tiny" type="button" @click.prevent="addParam()">+</button> <button class="ui button tiny" type="button" @click.prevent="addParam()">+</button>
</td> </td>

View File

@@ -32,7 +32,7 @@
</div> </div>
</div> </div>
<p class="comment" v-if="params.length > 0">可以在参数值中使用一些变量<a href="http://teaos.cn/doc/proxy/Fastcgi.md#%E5%8F%82%E6%95%B0%E5%8F%98%E9%87%8F" target="_blank">点这里查看</a></p> <p class="comment" v-if="params.length > 0">可以在参数值中使用一些变量<a href="https://goedge.cn/docs/Server/Variables.md" target="_blank">点这里查看</a></p>
<button class="ui button tiny" type="button" @click.prevent="addParam()">+</button> <button class="ui button tiny" type="button" @click.prevent="addParam()">+</button>
</td> </td>

View File

@@ -8,14 +8,14 @@
<td class="title">匹配规则 *</td> <td class="title">匹配规则 *</td>
<td> <td>
<input type="text" name="pattern" maxlength="500" placeholder="比如 /post/(.+)" ref="focus"/> <input type="text" name="pattern" maxlength="500" placeholder="比如 /post/(.+)" ref="focus"/>
<p class="comment">需要符合正则表达式规范,<a href="http://teaos.cn/doc/regexp/Regexp.md" target="_blank">正则表达式语法 &raquo;</a></p> <p class="comment">需要符合正则表达式规范,<a href="https://goedge.cn/docs/Appendix/Regexp/Index.md" target="_blank">正则表达式语法 &raquo;</a></p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>目标URL *</td> <td>目标URL *</td>
<td> <td>
<input type="text" name="replace" placeholder="比如 /post/${1}.html" maxlength="500"/> <input type="text" name="replace" placeholder="比如 /post/${1}.html" maxlength="500"/>
<p class="comment">URL中可以包含一些<a href="http://teaos.cn/doc/proxy/Variables.md" target="_blank">内置的变量</a>也可以是一个完整的URL比如http://example.com/hello。</p> <p class="comment">URL中可以包含一些<a href="https://goedge.cn/docs/Server/Variables.md" target="_blank">内置的变量</a>也可以是一个完整的URL比如http://example.com/hello。</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -49,7 +49,7 @@
<td>代理主机名</td> <td>代理主机名</td>
<td> <td>
<input type="text" name="proxyHost" placeholder="比如 example.com" maxlength="100"/> <input type="text" name="proxyHost" placeholder="比如 example.com" maxlength="100"/>
<p class="comment">如果转发的方式为隐式而且目标URL为不同的域名时需要用到此选项用于修改被代理服务接收到的域名默认和客户端请求的主机名一致通常不必填写支持<a href="http://teaos.cn/doc/proxy/Variables.md#%E8%AF%B7%E6%B1%82%E7%9B%B8%E5%85%B3%E5%8F%98%E9%87%8F" target="_blank">请求变量</a></p> <p class="comment">如果转发的方式为隐式而且目标URL为不同的域名时需要用到此选项用于修改被代理服务接收到的域名默认和客户端请求的主机名一致通常不必填写支持<a href="https://goedge.cn/docs/Server/Variables.md" target="_blank">请求变量</a></p>
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@@ -9,14 +9,14 @@
<td class="title">匹配规则 *</td> <td class="title">匹配规则 *</td>
<td> <td>
<input type="text" name="pattern" maxlength="500" placeholder="比如 /post/(.+)" ref="focus" v-model="rewriteRule.pattern"/> <input type="text" name="pattern" maxlength="500" placeholder="比如 /post/(.+)" ref="focus" v-model="rewriteRule.pattern"/>
<p class="comment">需要符合正则表达式规范,<a href="http://teaos.cn/doc/regexp/Regexp.md" target="_blank">正则表达式语法 &raquo;</a></p> <p class="comment">需要符合正则表达式规范,<a href="https://goedge.cn/docs/Appendix/Regexp/Index.md" target="_blank">正则表达式语法 &raquo;</a></p>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>目标URL *</td> <td>目标URL *</td>
<td> <td>
<input type="text" name="replace" placeholder="比如 /post/${1}.html" maxlength="500" v-model="rewriteRule.replace"/> <input type="text" name="replace" placeholder="比如 /post/${1}.html" maxlength="500" v-model="rewriteRule.replace"/>
<p class="comment">URL中可以包含一些<a href="http://teaos.cn/doc/proxy/Variables.md" target="_blank">内置的变量</a>也可以是一个完整的URL比如http://example.com/hello。</p> <p class="comment">URL中可以包含一些<a href="https://goedge.cn/docs/Server/Variables.md" target="_blank">内置的变量</a>也可以是一个完整的URL比如http://example.com/hello。</p>
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -50,7 +50,7 @@
<td>代理主机名</td> <td>代理主机名</td>
<td> <td>
<input type="text" name="proxyHost" placeholder="比如 example.com" maxlength="100" v-model="rewriteRule.proxyHost"/> <input type="text" name="proxyHost" placeholder="比如 example.com" maxlength="100" v-model="rewriteRule.proxyHost"/>
<p class="comment">如果转发的方式为隐式而且目标URL为不同的域名时需要用到此选项用于修改被代理服务接收到的域名默认和客户端请求的主机名一致通常不必填写支持<a href="http://teaos.cn/doc/proxy/Variables.md#%E8%AF%B7%E6%B1%82%E7%9B%B8%E5%85%B3%E5%8F%98%E9%87%8F" target="_blank">请求变量</a></p> <p class="comment">如果转发的方式为隐式而且目标URL为不同的域名时需要用到此选项用于修改被代理服务接收到的域名默认和客户端请求的主机名一致通常不必填写支持<a href="https://goedge.cn/docs/Server/Variables.md" target="_blank">请求变量</a></p>
</td> </td>
</tr> </tr>
<tr> <tr>