aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorBastien Wirtz <bastien.wirtz@gmail.com>2021-07-14 12:05:53 +0200
committerBastien Wirtz <bastien.wirtz@gmail.com>2021-07-14 12:05:53 +0200
commitc06c0cdf9bbdc98f71dadb5edcc015926ba878e4 (patch)
tree68a50b1f1d557130fc9b0af22267c9857f64db97 /src
parentf9cc1d27cc295498cc04b6965b88a366da7122e5 (diff)
downloadhomer-c06c0cdf9bbdc98f71dadb5edcc015926ba878e4.tar.gz
homer-c06c0cdf9bbdc98f71dadb5edcc015926ba878e4.tar.zst
homer-c06c0cdf9bbdc98f71dadb5edcc015926ba878e4.zip
Lint & updates
Diffstat (limited to 'src')
-rw-r--r--src/components/services/AdGuardHome.vue6
-rw-r--r--src/components/services/PaperlessNG.vue18
-rw-r--r--src/components/services/Ping.vue4
3 files changed, 15 insertions, 13 deletions
diff --git a/src/components/services/AdGuardHome.vue b/src/components/services/AdGuardHome.vue
index 6ef5302..d4a2b89 100644
--- a/src/components/services/AdGuardHome.vue
+++ b/src/components/services/AdGuardHome.vue
@@ -51,9 +51,9 @@ export default {
51 }, 51 },
52 methods: { 52 methods: {
53 fetchStatus: async function () { 53 fetchStatus: async function () {
54 this.status = await fetch( 54 this.status = await fetch(`${this.item.url}/control/status`).then(
55 `${this.item.url}/control/status` 55 (response) => response.json()
56 ).then((response) => response.json()); 56 );
57 }, 57 },
58 }, 58 },
59}; 59};
diff --git a/src/components/services/PaperlessNG.vue b/src/components/services/PaperlessNG.vue
index c4f50eb..4fb31f8 100644
--- a/src/components/services/PaperlessNG.vue
+++ b/src/components/services/PaperlessNG.vue
@@ -52,20 +52,22 @@ export default {
52 if (this.item.subtitle != null) return; // omitting unnecessary ajax call as the subtitle is showing 52 if (this.item.subtitle != null) return; // omitting unnecessary ajax call as the subtitle is showing
53 var apikey = this.item.apikey; 53 var apikey = this.item.apikey;
54 if (!apikey) { 54 if (!apikey) {
55 console.error("apikey is not present in config.yml for the paperless entry!"); 55 console.error(
56 "apikey is not present in config.yml for the paperless entry!"
57 );
56 return; 58 return;
57 } 59 }
58 const url = `${this.item.url}/api/documents/`; 60 const url = `${this.item.url}/api/documents/`;
59 this.api = await fetch(url, { 61 this.api = await fetch(url, {
60 headers: { 62 headers: {
61 "Authorization": "Token " + this.item.apikey 63 Authorization: "Token " + this.item.apikey,
62 } 64 },
63 }) 65 })
64 .then(function(response) { 66 .then(function (response) {
65 if (!response.ok) { 67 if (!response.ok) {
66 throw new Error("Not 2xx response") 68 throw new Error("Not 2xx response");
67 } else { 69 } else {
68 return response.json() 70 return response.json();
69 } 71 }
70 }) 72 })
71 .catch((e) => console.log(e)); 73 .catch((e) => console.log(e));
diff --git a/src/components/services/Ping.vue b/src/components/services/Ping.vue
index a9114a8..9684419 100644
--- a/src/components/services/Ping.vue
+++ b/src/components/services/Ping.vue
@@ -53,8 +53,8 @@ export default {
53 fetchStatus: async function () { 53 fetchStatus: async function () {
54 const url = `${this.item.url}`; 54 const url = `${this.item.url}`;
55 this.api.status = await fetch(url) 55 this.api.status = await fetch(url)
56 .then((response) => "enabled") 56 .then(() => "enabled")
57 .catch((e) => "disabled"); 57 .catch(() => "disabled");
58 }, 58 },
59 }, 59 },
60}; 60};