aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components
diff options
context:
space:
mode:
authorBram Ceulemans <bramceulemans@me.com>2020-12-10 00:07:53 +0100
committerBram Ceulemans <bramceulemans@me.com>2020-12-10 00:07:53 +0100
commit4ce53b68ea7143433bac39aa955a49981ceb6536 (patch)
treec9bf975a580b932c308455b5e7eff40dfb11ea0a /src/components
parentf81dc6f4888dbb64c7f86972016c1a7cb750fe99 (diff)
downloadhomer-4ce53b68ea7143433bac39aa955a49981ceb6536.tar.gz
homer-4ce53b68ea7143433bac39aa955a49981ceb6536.tar.zst
homer-4ce53b68ea7143433bac39aa955a49981ceb6536.zip
Fixed wrongly removed computed property
Diffstat (limited to 'src/components')
-rw-r--r--src/components/services/PiHole.vue14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/components/services/PiHole.vue b/src/components/services/PiHole.vue
index 03d3ae3..a9fd369 100644
--- a/src/components/services/PiHole.vue
+++ b/src/components/services/PiHole.vue
@@ -20,13 +20,13 @@
20 <template v-if="item.subtitle"> 20 <template v-if="item.subtitle">
21 {{ item.subtitle }} 21 {{ item.subtitle }}
22 </template> 22 </template>
23 <template v-else-if="status"> 23 <template v-else-if="api">
24 {{ percentage }}&percnt; blocked 24 {{ percentage }}&percnt; blocked
25 </template> 25 </template>
26 </p> 26 </p>
27 </div> 27 </div>
28 <div v-if="status" class="status" :class="status.status"> 28 <div v-if="api" class="status" :class="api.status">
29 {{ status.status }} 29 {{ api.status }}
30 </div> 30 </div>
31 </div> 31 </div>
32 <div class="tag" :class="item.tagstyle" v-if="item.tag"> 32 <div class="tag" :class="item.tagstyle" v-if="item.tag">
@@ -45,15 +45,15 @@ export default {
45 item: Object, 45 item: Object,
46 }, 46 },
47 data: () => ({ 47 data: () => ({
48 status: { 48 api: {
49 status: "", 49 status: "",
50 ads_percentage_today: 0, 50 ads_percentage_today: 0,
51 }, 51 },
52 }), 52 }),
53 computed: { 53 computed: {
54 percentage: function () { 54 percentage: function () {
55 if (this.status) { 55 if (this.api) {
56 return this.status.ads_percentage_today.toFixed(1); 56 return this.api.ads_percentage_today.toFixed(1);
57 } 57 }
58 return ""; 58 return "";
59 }, 59 },
@@ -64,7 +64,7 @@ export default {
64 methods: { 64 methods: {
65 fetchStatus: async function () { 65 fetchStatus: async function () {
66 const url = `${this.item.url}/api.php`; 66 const url = `${this.item.url}/api.php`;
67 this.status = await fetch(url) 67 this.api = await fetch(url)
68 .then((response) => response.json()) 68 .then((response) => response.json())
69 .catch((e) => console.log(e)); 69 .catch((e) => console.log(e));
70 }, 70 },