<template v-if="item.subtitle">
{{ item.subtitle }}
</template>
- <template v-else-if="status">
+ <template v-else-if="api">
{{ percentage }}% blocked
</template>
</p>
</div>
- <div v-if="status" class="status" :class="status.status">
- {{ status.status }}
+ <div v-if="api" class="status" :class="api.status">
+ {{ api.status }}
</div>
</div>
<div class="tag" :class="item.tagstyle" v-if="item.tag">
item: Object,
},
data: () => ({
- status: {
+ api: {
status: "",
ads_percentage_today: 0,
},
}),
computed: {
percentage: function () {
- if (this.status) {
- return this.status.ads_percentage_today.toFixed(1);
+ if (this.api) {
+ return this.api.ads_percentage_today.toFixed(1);
}
return "";
},
methods: {
fetchStatus: async function () {
const url = `${this.item.url}/api.php`;
- this.status = await fetch(url)
+ this.api = await fetch(url)
.then((response) => response.json())
.catch((e) => console.log(e));
},