mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-06 23:00:25 +08:00
Update components.src.js
This commit is contained in:
@@ -4225,6 +4225,67 @@ Vue.component("http-firewall-checkpoint-referer-block", {
|
|||||||
</div>`
|
</div>`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Vue.component("http-access-log-partitions-box", {
|
||||||
|
props: ["v-partition", "v-day"],
|
||||||
|
mounted: function () {
|
||||||
|
let that = this
|
||||||
|
Tea.action("/servers/logs/partitionData")
|
||||||
|
.params({
|
||||||
|
day: this.vDay
|
||||||
|
})
|
||||||
|
.success(function (resp) {
|
||||||
|
that.partitions = []
|
||||||
|
resp.data.partitions.reverse().forEach(function (v) {
|
||||||
|
that.partitions.push({
|
||||||
|
code: v,
|
||||||
|
isDisabled: false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
if (that.partitions.length > 0) {
|
||||||
|
if (that.vPartition == null || that.vPartition < 0) {
|
||||||
|
that.selectedPartition = that.partitions[0].code
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.post()
|
||||||
|
},
|
||||||
|
data: function () {
|
||||||
|
return {
|
||||||
|
partitions: [],
|
||||||
|
selectedPartition: this.vPartition
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
url: function (p) {
|
||||||
|
let u = window.location.toString()
|
||||||
|
u = u.replace(/\?partition=\d+/, "?")
|
||||||
|
u = u.replace(/\?requestId=\d+/, "?")
|
||||||
|
u = u.replace(/&partition=\d+/, "")
|
||||||
|
u = u.replace(/&requestId=\d+/, "")
|
||||||
|
if (u.indexOf("?") > 0) {
|
||||||
|
u += "&partition=" + p
|
||||||
|
} else {
|
||||||
|
u += "?partition=" + p
|
||||||
|
}
|
||||||
|
return u
|
||||||
|
},
|
||||||
|
disable: function (partition) {
|
||||||
|
this.partitions.forEach(function (p) {
|
||||||
|
if (p.code == partition) {
|
||||||
|
p.isDisabled = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
template: `<div v-if="partitions.length > 1">
|
||||||
|
<div class="ui divider" style="margin-bottom: 0"></div>
|
||||||
|
<div class="ui menu text small blue" style="margin-bottom: 0; margin-top: 0">
|
||||||
|
<a v-for="p in partitions" :href="url(p.code)" class="item" :class="{active: selectedPartition == p.code, disabled: p.isDisabled}">分表{{p.code}}</a>
|
||||||
|
</div>
|
||||||
|
<div class="ui divider" style="margin-top: 0"></div>
|
||||||
|
</div>`
|
||||||
|
})
|
||||||
|
|
||||||
Vue.component("http-cache-refs-config-box", {
|
Vue.component("http-cache-refs-config-box", {
|
||||||
props: ["v-cache-refs", "v-cache-config", "v-cache-policy-id", "v-web-id"],
|
props: ["v-cache-refs", "v-cache-config", "v-cache-policy-id", "v-web-id"],
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user