aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorluixal <luixal@gmail.com>2021-02-23 20:50:32 +0100
committerluixal <luixal@gmail.com>2021-02-23 20:50:32 +0100
commitc6267296ec03db24ff40959ef58eedcec904c39b (patch)
treefa43606b20614a2af7bb15a49018899ad42e6fcf
parente3bd2ecc2ca874270282c3c42813b8053d67dcbd (diff)
downloadhomer-c6267296ec03db24ff40959ef58eedcec904c39b.tar.gz
homer-c6267296ec03db24ff40959ef58eedcec904c39b.tar.zst
homer-c6267296ec03db24ff40959ef58eedcec904c39b.zip
Changes relative paths to hash. Avoids problems with #8
-rw-r--r--docs/configuration.md2
-rw-r--r--public/assets/page2.yml7
-rw-r--r--src/App.vue7
-rw-r--r--src/components/ConnectivityChecker.vue2
4 files changed, 7 insertions, 11 deletions
diff --git a/docs/configuration.md b/docs/configuration.md
index 81de590..3c16b25 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -85,7 +85,7 @@ links:
85 # see url field and assets/page.yml used in this example: 85 # see url field and assets/page.yml used in this example:
86 - name: "Second Page" 86 - name: "Second Page"
87 icon: "fas fa-file-alt" 87 icon: "fas fa-file-alt"
88 url: "/page2" 88 url: "#page2"
89 89
90# Services 90# Services
91# First level array represents a group. 91# First level array represents a group.
diff --git a/public/assets/page2.yml b/public/assets/page2.yml
index e10d706..00001e9 100644
--- a/public/assets/page2.yml
+++ b/public/assets/page2.yml
@@ -26,14 +26,9 @@ services:
26 - name: "NEW" 26 - name: "NEW"
27 icon: "fas fa-cloud" 27 icon: "fas fa-cloud"
28 items: 28 items:
29 - name: "Awesome app" 29 - name: "Awesome app on a second page!"
30 logo: "assets/tools/sample.png" 30 logo: "assets/tools/sample.png"
31 subtitle: "Bookmark example" 31 subtitle: "Bookmark example"
32 tag: "app" 32 tag: "app"
33 url: "https://www.reddit.com/r/selfhosted/" 33 url: "https://www.reddit.com/r/selfhosted/"
34 target: "_blank" 34 target: "_blank"
35 - name: "Another one"
36 logo: "assets/tools/sample2.png"
37 subtitle: "Another application"
38 tag: "app"
39 url: "#"
diff --git a/src/App.vue b/src/App.vue
index 03970ed..cd1d9ba 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -13,7 +13,7 @@
13 <section v-if="config.header" class="first-line"> 13 <section v-if="config.header" class="first-line">
14 <div v-cloak class="container"> 14 <div v-cloak class="container">
15 <div class="logo"> 15 <div class="logo">
16 <a href="/"><img v-if="config.logo" :src="config.logo" alt="dashboard logo" /></a> 16 <a href="#"><img v-if="config.logo" :src="config.logo" alt="dashboard logo" /></a>
17 <i v-if="config.icon" :class="config.icon"></i> 17 <i v-if="config.icon" :class="config.icon"></i>
18 </div> 18 </div>
19 <div class="dashboard-title"> 19 <div class="dashboard-title">
@@ -151,11 +151,12 @@ export default {
151 created: async function () { 151 created: async function () {
152 const defaults = jsyaml.load(defaultConfig); 152 const defaults = jsyaml.load(defaultConfig);
153 let config; 153 let config;
154 window.onhashchange = function() { location.reload(); };
154 try { 155 try {
155 config = await this.getConfig(); 156 config = await this.getConfig();
156 const path = (window.location.pathname != '/') ? window.location.pathname : null; 157 const path = (window.location.hash.substring(1) != '') ? window.location.hash.substring(1) : null;
157 if (path) { 158 if (path) {
158 let pathConfig = await this.getConfig(`assets${path}.yml`); // the slash (/) is included in the pathname 159 let pathConfig = await this.getConfig(`assets/${path}.yml`); // the slash (/) is included in the pathname
159 for (const prop in pathConfig) config[prop] = pathConfig[prop]; 160 for (const prop in pathConfig) config[prop] = pathConfig[prop];
160 } 161 }
161 // config = await this.getConfig(path ? `assets/${path}.yml` : null); 162 // config = await this.getConfig(path ? `assets/${path}.yml` : null);
diff --git a/src/components/ConnectivityChecker.vue b/src/components/ConnectivityChecker.vue
index e0e88bb..d41c443 100644
--- a/src/components/ConnectivityChecker.vue
+++ b/src/components/ConnectivityChecker.vue
@@ -33,7 +33,7 @@ export default {
33 methods: { 33 methods: {
34 checkOffline: function () { 34 checkOffline: function () {
35 let that = this; 35 let that = this;
36 return fetch(window.location.origin + "?alive", { 36 return fetch(window.location.href + "?alive", {
37 method: "HEAD", 37 method: "HEAD",
38 cache: "no-store", 38 cache: "no-store",
39 }) 39 })