X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FApp.vue;h=515177eba13b80d096a89727781655114dadf35d;hb=98b460d6fe0e09cbdbf37f882f5e5bf7daa48e73;hp=1f4f5099625a26583174a504bf862d0497e32661;hpb=66eace9e95d1962b437154b95e8f206d0da658ec;p=github%2Fbastienwirtz%2Fhomer.git
diff --git a/src/App.vue b/src/App.vue
index 1f4f509..515177e 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -18,7 +18,10 @@
-
+
{{ config.subtitle }}
{{ config.title }}
@@ -30,17 +33,22 @@
:links="config.links"
@navbar-toggle="showMenu = !showMenu"
>
-
+
+
+
+
-
-
+
+
@@ -127,6 +144,7 @@ const jsyaml = require("js-yaml");
const merge = require("lodash.merge");
import Navbar from "./components/Navbar.vue";
+import GetStarted from "./components/GetStarted.vue";
import ConnectivityChecker from "./components/ConnectivityChecker.vue";
import Service from "./components/Service.vue";
import Message from "./components/Message.vue";
@@ -141,6 +159,7 @@ export default {
name: "App",
components: {
Navbar,
+ GetStarted,
ConnectivityChecker,
Service,
Message,
@@ -151,6 +170,8 @@ export default {
},
data: function () {
return {
+ loaded: false,
+ configNotFound: false,
config: null,
services: null,
offline: false,
@@ -160,11 +181,22 @@ export default {
showMenu: false,
};
},
+ computed: {
+ configurationNeeded: function () {
+ return (this.loaded && !this.services) || this.configNotFound;
+ },
+ },
created: async function () {
this.buildDashboard();
window.onhashchange = this.buildDashboard;
+ this.loaded = true;
},
methods: {
+ searchHotkey() {
+ if (this.config.hotkey && this.config.hotkey.search) {
+ return this.config.hotkey.search;
+ }
+ },
buildDashboard: async function () {
const defaults = jsyaml.load(defaultConfig);
let config;
@@ -185,6 +217,7 @@ export default {
}
this.config = merge(defaults, config);
this.services = this.config.services;
+
document.title =
this.config.documentTitle ||
`${this.config.title} | ${this.config.subtitle}`;
@@ -203,6 +236,12 @@ export default {
window.location.href = response.url;
return;
}
+
+ if (response.status == 404) {
+ this.configNotFound = true;
+ return {};
+ }
+
if (!response.ok) {
throw Error(`${response.statusText}: ${response.body}`);
}