]> git.immae.eu Git - github/bastienwirtz/homer.git/blobdiff - src/components/services/AdGuardHome.vue
fix: resolve typo in Healthchecks service name
[github/bastienwirtz/homer.git] / src / components / services / AdGuardHome.vue
index 16881fa59ea6d93ceb43bd4573e785fb1107cce1..4c5339873f909e980a5fe3c5c3947ad5563bd42a 100644 (file)
 </template>
 
 <script>
+import service from "@/mixins/service.js";
 import Generic from "./Generic.vue";
 
 export default {
   name: "AdGuardHome",
+  mixins: [service],
   props: {
     item: Object,
   },
@@ -60,27 +62,20 @@ export default {
   },
   methods: {
     fetchStatus: async function () {
-      this.status = await fetch(`${this.item.url}/control/status`, {
-        credentials: "include",
-      })
-        .then((response) => response.json())
-        .catch((e) => console.log(e));
+      this.status = await this.fetch("/control/status").catch((e) =>
+        console.log(e)
+      );
     },
     fetchStats: async function () {
-      this.stats = await fetch(`${this.item.url}/control/stats`, {
-        credentials: "include",
-      })
-        .then((response) => response.json())
-        .catch((e) => console.log(e));
+      this.stats = await this.fetch("/control/stats").catch((e) =>
+        console.log(e)
+      );
     },
   },
 };
 </script>
 
 <style scoped lang="scss">
-.media-left img {
-  max-height: 100%;
-}
 .status {
   font-size: 0.8rem;
   color: var(--text-title);