mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-14 04:10:26 +08:00
集群可以设置默认的WAF策略、缓存策略
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
<th>策略名称</th>
|
||||
<th>策略类型</th>
|
||||
<th>容量</th>
|
||||
<th class="center">引用服务</th>
|
||||
<th class="center">集群数</th>
|
||||
<th class="center">状态</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
@@ -25,7 +25,7 @@
|
||||
<span v-if="policy.capacity != null && policy.capacity.count > 0">{{policy.capacity.count}}{{policy.capacity.unit.toUpperCase()}}</span>
|
||||
<span v-else class="disabled">不限</span>
|
||||
</td>
|
||||
<td class="center">{{infos[index].countServers}}</td>
|
||||
<td class="center">{{infos[index].countClusters}}</td>
|
||||
<td class="center"><label-on :v-is-on="policy.isOn"></label-on></td>
|
||||
<td>
|
||||
<a :href="'/servers/components/cache/policy?cachePolicyId=' + policy.id">详情</a> <a href="" @click.prevent="deletePolicy(policy.id)">删除</a>
|
||||
|
||||
@@ -1,67 +1,74 @@
|
||||
{$layout}
|
||||
{$template "policy_menu"}
|
||||
|
||||
{$template "policy_menu"}
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">策略名称</td>
|
||||
<td>{{cachePolicy.name}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>状态</td>
|
||||
<td><label-on :v-is-on="cachePolicy.isOn"></label-on></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">缓存类型</td>
|
||||
<td>
|
||||
{{typeName}}<span class="small">({{cachePolicy.type}})</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">策略名称</td>
|
||||
<td>{{cachePolicy.name}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>状态</td>
|
||||
<td><label-on :v-is-on="cachePolicy.isOn"></label-on></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="color-border">缓存类型</td>
|
||||
<td>
|
||||
{{typeName}}<span class="small">({{cachePolicy.type}})</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 文件缓存选项 -->
|
||||
<tbody v-if="cachePolicy.type == 'file'">
|
||||
<tr>
|
||||
<td class="color-border">缓存目录</td>
|
||||
<td>
|
||||
{{cachePolicy.options.dir}}
|
||||
<p class="comment">存放文件缓存的目录,通常填写绝对路径。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<!-- 文件缓存选项 -->
|
||||
<tbody v-if="cachePolicy.type == 'file'">
|
||||
<tr>
|
||||
<td class="color-border">缓存目录</td>
|
||||
<td>
|
||||
{{cachePolicy.options.dir}}
|
||||
<p class="comment">存放文件缓存的目录,通常填写绝对路径。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>缓存最大容量</td>
|
||||
<td>
|
||||
<size-capacity-view :v-value="cachePolicy.capacity" :v-default-text="'不限'"></size-capacity-view>
|
||||
<p class="comment">允许缓存的最大内容长度,如果为0表示没有限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr>
|
||||
<td>最大内容长度</td>
|
||||
<td>
|
||||
<size-capacity-view :v-value="cachePolicy.maxSize" :v-default-text="'不限'"></size-capacity-view>
|
||||
<p class="comment">允许缓存的最大内容长度,如果为0表示没有限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>容纳Key数量</td>
|
||||
<td>
|
||||
<span v-if="cachePolicy.maxKeys > 0">{{cachePolicy.maxKeys}}</span>
|
||||
<span v-else>不限</span>
|
||||
<p class="comment">可以容纳多少数量的Key,0表示不限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>描述</td>
|
||||
<td>
|
||||
<span v-if="cachePolicy.description.length > 0">{{cachePolicy.description}}</span>
|
||||
<span v-else class="disabled">暂时还没有描述。</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<tr>
|
||||
<td>缓存最大容量</td>
|
||||
<td>
|
||||
<size-capacity-view :v-value="cachePolicy.capacity" :v-default-text="'不限'"></size-capacity-view>
|
||||
<p class="comment">允许缓存的最大内容长度,如果为0表示没有限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
<tbody v-show="moreOptionsVisible">
|
||||
<tr>
|
||||
<td>最大内容长度</td>
|
||||
<td>
|
||||
<size-capacity-view :v-value="cachePolicy.maxSize" :v-default-text="'不限'"></size-capacity-view>
|
||||
<p class="comment">允许缓存的最大内容长度,如果为0表示没有限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>容纳Key数量</td>
|
||||
<td>
|
||||
<span v-if="cachePolicy.maxKeys > 0">{{cachePolicy.maxKeys}}</span>
|
||||
<span v-else>不限</span>
|
||||
<p class="comment">可以容纳多少数量的Key,0表示不限制。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>描述</td>
|
||||
<td>
|
||||
<span v-if="cachePolicy.description.length > 0">{{cachePolicy.description}}</span>
|
||||
<span v-else class="disabled">暂时还没有描述。</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4>使用此策略的集群</h4>
|
||||
<p class="comment" v-if="clusters.length == 0">暂时还没有集群使用此策略。</p>
|
||||
<table class="ui table selectable" v-if="clusters.length > 0">
|
||||
<tr v-for="cluster in clusters">
|
||||
<td>{{cluster.name}}<link-icon :href="'/clusters/cluster?clusterId=' + cluster.id"></link-icon></td>
|
||||
</tr>
|
||||
</table>
|
||||
24
web/views/@default/servers/components/cache/selectPopup.html
vendored
Normal file
24
web/views/@default/servers/components/cache/selectPopup.html
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>选择缓存策略</h3>
|
||||
<table class="ui table selectable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>策略名称</th>
|
||||
<th style="width: 7em">状态</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="cachePolicy in cachePolicies">
|
||||
<td>{{cachePolicy.name}}</td>
|
||||
<td>
|
||||
<label-on :v-is-on="cachePolicy.isOn"></label-on>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="cachePolicy.isOn">
|
||||
<a href="" @click.prevent="selectPolicy(cachePolicy)">选择</a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="page" v-html="page"></div>
|
||||
11
web/views/@default/servers/components/cache/selectPopup.js
vendored
Normal file
11
web/views/@default/servers/components/cache/selectPopup.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
Tea.context(function () {
|
||||
this.selectPolicy = function (cachePolicy) {
|
||||
NotifyPopup({
|
||||
code: 200,
|
||||
data: {
|
||||
cachePolicy: cachePolicy
|
||||
},
|
||||
message: ""
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user