mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-10 17:30:29 +08:00
实现服务的缓存策略设置
This commit is contained in:
@@ -5,14 +5,15 @@ Vue.component("more-options-indicator", {
|
||||
data: function () {
|
||||
return {
|
||||
visible: false
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeVisible: function () {
|
||||
this.visible = !this.visible;
|
||||
this.visible = !this.visible
|
||||
if (Tea.Vue != null) {
|
||||
Tea.Vue.moreOptionsVisible = this.visible;
|
||||
Tea.Vue.moreOptionsVisible = this.visible
|
||||
}
|
||||
this.$emit("change", this.visible)
|
||||
}
|
||||
},
|
||||
template: '<a href="" style="font-weight: normal" @click.prevent="changeVisible()"><span v-if="!visible">更多选项</span><span v-if="visible">收起选项</span> <i class="icon angle" :class="{down:!visible, up:visible}"></i> </a>'
|
||||
|
||||
@@ -12,7 +12,7 @@ Vue.component("size-capacity-box", {
|
||||
v["count"] = -1
|
||||
}
|
||||
return {
|
||||
"size": v,
|
||||
size: v,
|
||||
countString: (v.count >= 0) ? v.count.toString() : ""
|
||||
}
|
||||
},
|
||||
@@ -21,12 +21,19 @@ Vue.component("size-capacity-box", {
|
||||
let value = newValue.trim()
|
||||
if (value.length == 0) {
|
||||
this.size.count = -1
|
||||
this.change()
|
||||
return
|
||||
}
|
||||
let count = parseInt(value)
|
||||
if (!isNaN(count)) {
|
||||
this.size.count = count
|
||||
}
|
||||
this.change()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
change: function () {
|
||||
this.$emit("change", this.size)
|
||||
}
|
||||
},
|
||||
template: `<div class="ui fields inline">
|
||||
@@ -35,7 +42,7 @@ Vue.component("size-capacity-box", {
|
||||
<input type="text" v-model="countString" maxlength="11" size="11"/>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<select class="ui dropdown" v-model="size.unit">
|
||||
<select class="ui dropdown" v-model="size.unit" @change="change">
|
||||
<option value="byte">字节</option>
|
||||
<option value="kb">KB</option>
|
||||
<option value="mb">MB</option>
|
||||
|
||||
@@ -12,7 +12,7 @@ Vue.component("time-duration-box", {
|
||||
v["count"] = -1
|
||||
}
|
||||
return {
|
||||
"size": v,
|
||||
duration: v,
|
||||
countString: (v.count >= 0) ? v.count.toString() : ""
|
||||
}
|
||||
},
|
||||
@@ -20,22 +20,28 @@ Vue.component("time-duration-box", {
|
||||
"countString": function (newValue) {
|
||||
let value = newValue.trim()
|
||||
if (value.length == 0) {
|
||||
this.size.count = -1
|
||||
this.duration.count = -1
|
||||
return
|
||||
}
|
||||
let count = parseInt(value)
|
||||
if (!isNaN(count)) {
|
||||
this.size.count = count
|
||||
this.duration.count = count
|
||||
}
|
||||
this.change()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
change: function () {
|
||||
this.$emit("change", this.duration)
|
||||
}
|
||||
},
|
||||
template: `<div class="ui fields inline">
|
||||
<input type="hidden" :name="vName" :value="JSON.stringify(size)"/>
|
||||
<input type="hidden" :name="vName" :value="JSON.stringify(duration)"/>
|
||||
<div class="ui field">
|
||||
<input type="text" v-model="countString" maxlength="11" size="11"/>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<select class="ui dropdown" v-model="size.unit">
|
||||
<select class="ui dropdown" v-model="duration.unit" @change="change">
|
||||
<option value="ms">毫秒</option>
|
||||
<option value="second">秒</option>
|
||||
<option value="minute">分钟</option>
|
||||
|
||||
Reference in New Issue
Block a user