]> git.immae.eu Git - github/bastienwirtz/homer.git/blobdiff - src/App.vue
Handle 404 error on config file.
[github/bastienwirtz/homer.git] / src / App.vue
index 81f92f788f6bd63f4818b60b50c8525933a95ceb..515177eba13b80d096a89727781655114dadf35d 100644 (file)
             </a>
             <i v-if="config.icon" :class="config.icon"></i>
           </div>
-          <div class="dashboard-title">
+          <div
+            class="dashboard-title"
+            :class="{ 'no-logo': !config.icon || !config.logo }"
+          >
             <span class="headline">{{ config.subtitle }}</span>
             <h1>{{ config.title }}</h1>
           </div>
@@ -61,7 +64,7 @@
           @network-status-update="offline = $event"
         />
 
-        <GetStarted v-if="loaded && !services" />
+        <GetStarted v-if="configurationNeeded" />
 
         <div v-if="!offline">
           <!-- Optional messages -->
@@ -168,6 +171,7 @@ export default {
   data: function () {
     return {
       loaded: false,
+      configNotFound: false,
       config: null,
       services: null,
       offline: false,
@@ -177,6 +181,11 @@ export default {
       showMenu: false,
     };
   },
+  computed: {
+    configurationNeeded: function () {
+      return (this.loaded && !this.services) || this.configNotFound;
+    },
+  },
   created: async function () {
     this.buildDashboard();
     window.onhashchange = this.buildDashboard;
@@ -228,6 +237,11 @@ export default {
           return;
         }
 
+        if (response.status == 404) {
+          this.configNotFound = true;
+          return {};
+        }
+
         if (!response.ok) {
           throw Error(`${response.statusText}: ${response.body}`);
         }