diff options
author | Bastien Wirtz <bastien.wirtz@gmail.com> | 2021-10-10 10:37:20 +0200 |
---|---|---|
committer | Bastien Wirtz <bastien.wirtz@gmail.com> | 2021-10-10 10:37:20 +0200 |
commit | 2fba043575e6a8db94434986c1781d2716c8f6d4 (patch) | |
tree | 636929cc74f164d9cbe2f8db3eee6c1d0806cffd /src/components/services | |
parent | efc2bbb85673fb269e75d64655e433bed90a995a (diff) | |
download | homer-2fba043575e6a8db94434986c1781d2716c8f6d4.tar.gz homer-2fba043575e6a8db94434986c1781d2716c8f6d4.tar.zst homer-2fba043575e6a8db94434986c1781d2716c8f6d4.zip |
Allow non json reponse in fetch.
Diffstat (limited to 'src/components/services')
-rw-r--r-- | src/components/services/Ping.vue | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/components/services/Ping.vue b/src/components/services/Ping.vue index 6fd3ec5..d1fda57 100644 --- a/src/components/services/Ping.vue +++ b/src/components/services/Ping.vue | |||
@@ -9,10 +9,12 @@ | |||
9 | </template> | 9 | </template> |
10 | 10 | ||
11 | <script> | 11 | <script> |
12 | import service from "@/mixins/service.js"; | ||
12 | import Generic from "./Generic.vue"; | 13 | import Generic from "./Generic.vue"; |
13 | 14 | ||
14 | export default { | 15 | export default { |
15 | name: "Ping", | 16 | name: "Ping", |
17 | mixins: [service], | ||
16 | props: { | 18 | props: { |
17 | item: Object, | 19 | item: Object, |
18 | }, | 20 | }, |
@@ -27,16 +29,8 @@ export default { | |||
27 | }, | 29 | }, |
28 | methods: { | 30 | methods: { |
29 | fetchStatus: async function () { | 31 | fetchStatus: async function () { |
30 | const url = `${this.item.url}`; | 32 | this.fetch("/", { method: "HEAD", cache: "no-cache" }, false) |
31 | fetch(url, { | 33 | .then(() => { |
32 | method: "HEAD", | ||
33 | cache: "no-cache", | ||
34 | credentials: "include", | ||
35 | }) | ||
36 | .then((response) => { | ||
37 | if (!response.ok) { | ||
38 | throw Error(response.statusText); | ||
39 | } | ||
40 | this.status = "online"; | 34 | this.status = "online"; |
41 | }) | 35 | }) |
42 | .catch(() => { | 36 | .catch(() => { |