Files
EdgeAdmin/web/views/@default/servers/components/cache/update.html

102 lines
4.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{$layout}
{$template "policy_menu"}
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="cachePolicyId" :value="cachePolicy.id"/>
<table class="ui table definition selectable">
<tr>
<td class="title">策略名称 *</td>
<td><input type="text" name="name" maxlength="100" ref="focus" v-model="cachePolicy.name"/> </td>
</tr>
<tr>
<td class="color-border">缓存类型 *</td>
<td>
<select class="ui dropdown auto-width" name="type" v-model="policyType">
<option v-for="type in types" :value="type.type">{{type.name}}</option>
</select>
</td>
</tr>
<!-- 文件缓存选项 -->
<tbody v-if="policyType == 'file'">
<tr>
<td class="color-border">缓存目录 *</td>
<td>
<input type="text" name="fileDir" maxlength="500" v-model="cachePolicy.options.dir"/>
<p class="comment">存放文件缓存的目录,通常填写绝对路径。</p>
</td>
</tr>
<tr>
<td class="color-border">文件目录最大容量</td>
<td>
<size-capacity-box :v-name="'capacityJSON'" :v-value="cachePolicy.capacity" :v-count="0" :v-unit="'gb'"></size-capacity-box>
<p class="comment">作为二级缓存的文件目录允许缓存的最大容量如果为0表示没有限制。</p>
</td>
</tr>
<tr v-if="cachePolicy.options.memoryPolicy != null && cachePolicy.options.memoryPolicy.capacity != null">
<td class="color-border">内存最大容量</td>
<td>
<size-capacity-box :v-name="'fileMemoryCapacityJSON'" :v-value="cachePolicy.options.memoryPolicy.capacity" :v-count="1" :v-unit="'gb'"></size-capacity-box>
<p class="comment">作为一级缓存的内存最大容量如果为0表示不使用内存作为一级缓存。</p>
</td>
</tr>
<tr v-if="cachePolicy.options.memoryPolicy == null || cachePolicy.options.memoryPolicy.capacity == null">
<td class="color-border">内存最大容量</td>
<td>
<size-capacity-box :v-name="'fileMemoryCapacityJSON'" :v-count="0" :v-unit="'gb'"></size-capacity-box>
<p class="comment">作为一级缓存的内存最大容量如果为0表示不使用内存作为一级缓存。</p>
</td>
</tr>
</tbody>
<tbody v-if="policyType != 'file'">
<tr>
<td>缓存最大容量</td>
<td>
<size-capacity-box :v-name="'capacityJSON'" :v-value="cachePolicy.capacity" :v-count="0" :v-unit="'gb'"></size-capacity-box>
<p class="comment">允许缓存的最大容量如果为0表示没有限制。</p>
</td>
</tr>
</tbody>
<tr>
<td colspan="2"><more-options-indicator></more-options-indicator></td>
</tr>
<tbody v-show="moreOptionsVisible">
<tr>
<td>最大内容长度</td>
<td>
<size-capacity-box :v-value="cachePolicy.maxSize" :v-name="'maxSizeJSON'" :v-count="32" :v-unit="'mb'"></size-capacity-box>
<p class="comment">允许缓存的最大内容长度如果为0表示没有限制。</p>
</td>
</tr>
<tr>
<td>容纳Key数量</td>
<td>
<input type="text" name="maxKeys" maxlength="10" style="width:10em" v-model="cachePolicy.maxKeys"/>
<p class="comment">可以容纳多少数量的Key0表示不限制。</p>
</td>
</tr>
<tr>
<td>描述</td>
<td>
<textarea maxlength="200" name="description" rows="3" v-model="cachePolicy.description"></textarea>
</td>
</tr>
<tr>
<td>是否启用</td>
<td>
<div class="ui checkbox">
<input type="checkbox" name="isOn" value="1" v-model="cachePolicy.isOn"/>
<label></label>
</div>
</td>
</tr>
</tbody>
</table>
<h4>默认缓存条件</h4>
<http-cache-refs-config-box :v-cache-refs="cachePolicy.cacheRefs" :v-cache-policy-id="cachePolicy.id"></http-cache-refs-config-box>
<submit-btn></submit-btn>
</form>