]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
Allow running Homer in a subdirectory
authorFelix Bartels <felix@host-consultants.de>
Thu, 19 Dec 2019 14:35:11 +0000 (15:35 +0100)
committerFelix Bartels <felix@host-consultants.de>
Thu, 19 Dec 2019 14:35:11 +0000 (15:35 +0100)
When running homer in a subpath the worker cannot be loaded (404) the same accounts for the images in the default configuration.

Signed-off-by: Felix Bartels <felix@host-consultants.de>
app.js
config.yml

diff --git a/app.js b/app.js
index def0be7957c525689365c9ea17ba203cb5212b39..40830da1a457f3053b4ff230b54e0814c0add6a2 100644 (file)
--- a/app.js
+++ b/app.js
@@ -9,14 +9,14 @@ const app = new Vue({
     },
     created: function () {
         let that = this;
-        
-        this.isDark = 'overrideDark' in localStorage ? 
+
+        this.isDark = 'overrideDark' in localStorage ?
             JSON.parse(localStorage.overrideDark) : matchMedia("(prefers-color-scheme: dark)").matches;
 
         if ('vlayout' in localStorage) {
             this.vlayout = JSON.parse(localStorage.vlayout)
         }
-        
+
         this.checkOffline();
         that.getConfig().then(function (config) {
             that.config = config;
@@ -58,8 +58,8 @@ const app = new Vue({
         }, 
         toggleLayout: function() {
             this.vlayout = !this.vlayout;
-            localStorage.vlayout = this.vlayout; 
-        }, 
+            localStorage.vlayout = this.vlayout;
+        },
     }
 });
 
@@ -95,6 +95,6 @@ Vue.component('service', {
 
 if ('serviceWorker' in navigator) {
     window.addEventListener('load', function () {
-        navigator.serviceWorker.register('/worker.js');
+        navigator.serviceWorker.register('worker.js');
     });
 }
index 8060119ada58cff2316e08fef80d4b2cb5dfeae2..2adddb181ea9478ce7a63cb20bc0e93c209c29df 100644 (file)
@@ -31,12 +31,12 @@ services:
     icon: "fas fa-code-branch"
     items:
       - name: "Jenkins"
-        logo: "/assets/tools/jenkins.png"
+        logo: "assets/tools/jenkins.png"
         subtitle: "Continuous integration server"
         tag: "CI"
         url: "#"
       - name: "RabbitMQ Management"
-        logo: "/assets/tools/rabbitmq.png"
+        logo: "assets/tools/rabbitmq.png"
         subtitle: "Manage & monitor RabbitMQ server"
         tag: "haproxy"
         # Optional tagstyle
@@ -47,21 +47,21 @@ services:
     icon: "fas fa-heartbeat"
     items:
       - name: "M/Monit"
-        logo: "/assets/tools/monit.png"
+        logo: "assets/tools/monit.png"
         subtitle: "Monitor & manage all monit enabled hosts"
         tag: "monit"
         url: "#"
       - name: "Grafana"
-        logo: "/assets/tools/grafana.png"
+        logo: "assets/tools/grafana.png"
         subtitle: "Metric analytics & dashboards"
         url: "#"
       - name: "Kibana"
-        logo: "/assets/tools/elastic.png"
+        logo: "assets/tools/elastic.png"
         subtitle: "Explore & visualize logs"
         tag: "elk"
         url: "#"
       - name: "Website monitoring"
-        logo: "/assets/tools/pingdom.png"
+        logo: "assets/tools/pingdom.png"
         subtitle: "Pingdom public reports overview"
         tag: "CI"
         url: "#"