mirror of
https://github.com/bastienwirtz/homer.git
synced 2025-06-21 10:18:13 +02:00
Fixed wrongly removed computed property
This commit is contained in:
parent
273a268ac4
commit
f81dc6f488
@ -21,7 +21,7 @@
|
|||||||
{{ item.subtitle }}
|
{{ item.subtitle }}
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="status">
|
<template v-else-if="status">
|
||||||
{{ percentage }}% blocked
|
{{ percentage }}% blocked
|
||||||
</template>
|
</template>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@ -44,27 +44,29 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
item: Object,
|
item: Object,
|
||||||
},
|
},
|
||||||
data: () => {
|
data: () => ({
|
||||||
return {
|
status: {
|
||||||
status: null,
|
status: "",
|
||||||
};
|
ads_percentage_today: 0,
|
||||||
},
|
},
|
||||||
|
}),
|
||||||
computed: {
|
computed: {
|
||||||
blocked: function () {
|
percentage: function () {
|
||||||
if (this.status) {
|
if (this.status) {
|
||||||
return this.status.dns_queries_today.toFixed(0);
|
return this.status.ads_percentage_today.toFixed(1);
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created: function () {
|
created() {
|
||||||
this.fetchStatus();
|
this.fetchStatus();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchStatus: async function () {
|
fetchStatus: async function () {
|
||||||
this.status = await fetch(`${this.item.url}/api.php`).then((response) =>
|
const url = `${this.item.url}/api.php`;
|
||||||
response.json()
|
this.status = await fetch(url)
|
||||||
);
|
.then((response) => response.json())
|
||||||
|
.catch((e) => console.log(e));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user