mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-25 03:00:25 +08:00
增加刷新、预热缓存任务管理
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<first-menu>
|
||||
<menu-item :href="'.?serverId=' + serverId" code="index">设置</menu-item>
|
||||
<menu-item :href="'.purge?serverId=' + serverId" code="purge">清理</menu-item>
|
||||
<menu-item :href="'.preheat?serverId=' + serverId" code="preheat">预热</menu-item>
|
||||
<menu-item :href="'.fetch?serverId=' + serverId" code="fetch">预热</menu-item>
|
||||
</first-menu>
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<div class="margin"></div>
|
||||
<div v-show="webConfig.cache == null || !webConfig.cache.isOn">
|
||||
<p class="comment">没有开启缓存,不需要清理。</p>
|
||||
<p class="comment">没有开启缓存,暂时无法预热缓存。</p>
|
||||
</div>
|
||||
<div v-show="webConfig.cache != null && webConfig.cache.isOn">
|
||||
<p class="comment">可以在这里批量预热一组Key。</p>
|
||||
@@ -27,9 +27,10 @@
|
||||
<td>
|
||||
<div v-if="isRequesting">数据发送中...</div>
|
||||
<span class="red" v-if="!isRequesting && !isOk && message.length > 0">失败:{{message}}</span>
|
||||
<div v-if="!isRequesting && isOk">
|
||||
<span v-if="results.length == 0" class="red">此集群下没有任何可用的节点。</span>
|
||||
<div class="ui label tiny" v-for="one in results" :class="{green:one.isOk, red:!one.isOk}" style="margin-bottom: 0.5em">{{one.nodeName}}:{{one.message}}</div>
|
||||
<div v-if="!isRequesting && !isOk && failKeys.length > 0" class="fail-keys-box">
|
||||
<div v-for="failKey in failKeys">
|
||||
<span class="red">{{failKey.key}}: {{failKey.reason}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -2,22 +2,28 @@ Tea.context(function () {
|
||||
this.isRequesting = false
|
||||
this.isOk = false
|
||||
this.message = ""
|
||||
this.results = []
|
||||
this.failKeys = []
|
||||
|
||||
this.before = function () {
|
||||
this.isRequesting = true
|
||||
this.isOk = false
|
||||
this.message = ""
|
||||
this.results = []
|
||||
this.failKeys = []
|
||||
}
|
||||
|
||||
this.success = function (resp) {
|
||||
this.isOk = true
|
||||
this.results = resp.data.results
|
||||
|
||||
let f = NotifyReloadSuccess("任务提交成功")
|
||||
f()
|
||||
}
|
||||
|
||||
this.fail = function (resp) {
|
||||
this.message = resp.message
|
||||
|
||||
if (resp.data.failKeys != null) {
|
||||
this.failKeys = resp.data.failKeys
|
||||
}
|
||||
}
|
||||
|
||||
this.done = function () {
|
||||
@@ -19,19 +19,19 @@
|
||||
<tr>
|
||||
<td class="title">操作类型</td>
|
||||
<td>
|
||||
<radio name="type" :v-value="'key'" v-model="type">根据Key</radio>
|
||||
<radio name="type" :v-value="'prefix'" v-model="type">根据前缀</radio>
|
||||
<radio name="keyType" :v-value="'key'" v-model="keyType">根据Key</radio>
|
||||
<radio name="keyType" :v-value="'prefix'" v-model="keyType">根据前缀</radio>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span v-if="type == 'key'">Key列表</span>
|
||||
<span v-if="type == 'prefix'">Key前缀列表</span>
|
||||
<span v-if="keyType == 'key'">Key列表</span>
|
||||
<span v-if="keyType == 'prefix'">Key前缀列表</span>
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="keys" rows="10" ref="focus"></textarea>
|
||||
<p class="comment" v-if="type == 'key'">每行一个Key,比如是一个完整的URL<code-label>https://example.com/hello/world.html</code-label>。</p>
|
||||
<p class="comment" v-if="type == 'prefix'">每行一个Key前缀,比如是一个URL前缀<code-label>https://example.com/hello/</code-label>。</p>
|
||||
<textarea name="keys" rows="10" ref="keysBox"></textarea>
|
||||
<p class="comment" v-if="keyType == 'key'">每行一个Key,比如是一个完整的URL<code-label>https://example.com/hello/world.html</code-label>。</p>
|
||||
<p class="comment" v-if="keyType == 'prefix'">每行一个Key前缀,比如是一个URL前缀<code-label>https://example.com/hello/</code-label>。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -39,9 +39,10 @@
|
||||
<td>
|
||||
<div v-if="isRequesting">数据发送中...</div>
|
||||
<span class="red" v-if="!isRequesting && !isOk && message.length > 0">失败:{{message}}</span>
|
||||
<div v-if="!isRequesting && isOk">
|
||||
<span v-if="results.length == 0" class="red">此集群下没有任何可用的节点。</span>
|
||||
<div class="ui label tiny" v-for="one in results" :class="{green:one.isOk, red:!one.isOk}" style="margin-bottom: 0.5em">{{one.nodeName}}:{{one.message}}</div>
|
||||
<div v-if="!isRequesting && !isOk && failKeys.length > 0" class="fail-keys-box">
|
||||
<div v-for="failKey in failKeys">
|
||||
<span class="red">{{failKey.key}}: {{failKey.reason}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -2,22 +2,34 @@ Tea.context(function () {
|
||||
this.isRequesting = false
|
||||
this.isOk = false
|
||||
this.message = ""
|
||||
this.results = []
|
||||
this.failKeys = []
|
||||
|
||||
this.$delay(function () {
|
||||
this.$refs.keysBox.focus()
|
||||
this.$watch("keyType", function () {
|
||||
this.$refs.keysBox.focus()
|
||||
})
|
||||
})
|
||||
|
||||
this.before = function () {
|
||||
this.isRequesting = true
|
||||
this.isOk = false
|
||||
this.message = ""
|
||||
this.results = []
|
||||
this.failKeys = []
|
||||
}
|
||||
|
||||
this.success = function (resp) {
|
||||
this.success = function () {
|
||||
this.isOk = true
|
||||
this.results = resp.data.results
|
||||
let f = NotifyReloadSuccess("任务提交成功")
|
||||
f()
|
||||
}
|
||||
|
||||
this.fail = function (resp) {
|
||||
this.message = resp.message
|
||||
|
||||
if (resp.data.failKeys != null) {
|
||||
this.failKeys = resp.data.failKeys
|
||||
}
|
||||
}
|
||||
|
||||
this.done = function () {
|
||||
@@ -27,5 +39,5 @@ Tea.context(function () {
|
||||
/**
|
||||
* 操作类型
|
||||
*/
|
||||
this.type = "key" // key | prefix
|
||||
this.keyType = "key" // key | prefix
|
||||
})
|
||||
Reference in New Issue
Block a user