mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-14 12:20:27 +08:00
实现服务的缓存策略设置
This commit is contained in:
18
web/views/@default/servers/server/settings/cache/createPopup.html
vendored
Normal file
18
web/views/@default/servers/server/settings/cache/createPopup.html
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>添加缓存设置</h3>
|
||||
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">缓存策略 *</td>
|
||||
<td>
|
||||
<select class="ui dropdown auto-width" name="cachePolicyId" v-model="cachePolicyId">
|
||||
<option v-for="cachePolicy in cachePolicies" :value="cachePolicy.id">{{cachePolicy.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tbody is="http-cache-ref-box" :v-cache-ref="cacheRef"></tbody>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
17
web/views/@default/servers/server/settings/cache/createPopup.js
vendored
Normal file
17
web/views/@default/servers/server/settings/cache/createPopup.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
this.cacheRef = null
|
||||
|
||||
let cachePolicyId = 0
|
||||
if (this.cachePolicies.length > 0) {
|
||||
cachePolicyId = this.cachePolicies[0].id
|
||||
}
|
||||
if (window.parent.UPDATING_CACHE_REF != null) {
|
||||
let cacheRef = window.parent.UPDATING_CACHE_REF
|
||||
this.cacheRef = cacheRef
|
||||
if (cacheRef.cachePolicy != null) {
|
||||
cachePolicyId = cacheRef.cachePolicy.id
|
||||
}
|
||||
}
|
||||
this.cachePolicyId = cachePolicyId
|
||||
})
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="right-box">
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-cache-config-box :v-cache-config="cacheConfig" :v-cache-policies="policies"></http-cache-config-box>
|
||||
<http-cache-config-box :v-cache-config="cacheConfig"></http-cache-config-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
Reference in New Issue
Block a user