aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components
diff options
context:
space:
mode:
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 },