]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
added support for Get method to Ping custom service
authorIsaac Suttell <isaac@isaacsuttell.com>
Sun, 10 Jul 2022 20:06:02 +0000 (13:06 -0700)
committerBastien Wirtz <bastien.wirtz@gmail.com>
Sat, 8 Oct 2022 09:53:26 +0000 (11:53 +0200)
src/components/services/Ping.vue

index d1fda576eff412d964739c58d8e16a3ae0b11253..9f4a03de337ee0738fec767629b3d4ee4a3a8710 100644 (file)
@@ -29,7 +29,8 @@ export default {
   },
   methods: {
     fetchStatus: async function () {
-      this.fetch("/", { method: "HEAD", cache: "no-cache" }, false)
+      const method = typeof this.item.method === 'string' && this.item.method.toLowerCase() === "get" ? "GET" : "HEAD"
+      this.fetch("/", { method, cache: "no-cache" }, false)
         .then(() => {
           this.status = "online";
         })
@@ -45,6 +46,8 @@ export default {
 .status {
   font-size: 0.8rem;
   color: var(--text-title);
+  white-space: nowrap;
+  margin-left: 0.25rem;
 
   &.online:before {
     background-color: #94e185;