]> git.immae.eu Git - github/bastienwirtz/homer.git/blobdiff - src/App.vue
Update docs/configuration.md
[github/bastienwirtz/homer.git] / src / App.vue
index 042fb073505f9a29ee27bf59ab0e19a070e2951c..c58fca1096726f8f8d13196def444547b983dccb 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 -->
           <!-- Horizontal layout -->
           <div v-if="!vlayout || filter" class="columns is-multiline">
             <template v-for="(group, groupIndex) in services">
-              <h2 
+              <h2
                 v-if="group.name"
                 class="column is-full group-title"
-                :key="`header-${groupIndex}`">
+                :key="`header-${groupIndex}`"
+              >
                 <i v-if="group.icon" :class="['fa-fw', group.icon]"></i>
                 <div v-else-if="group.logo" class="group-logo media-left">
                   <figure class="image is-48x48">
@@ -167,6 +171,7 @@ export default {
   data: function () {
     return {
       loaded: false,
+      configNotFound: false,
       config: null,
       services: null,
       offline: false,
@@ -176,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;
@@ -227,6 +237,11 @@ export default {
           return;
         }
 
+        if (response.status == 404) {
+          this.configNotFound = true;
+          return {};
+        }
+
         if (!response.ok) {
           throw Error(`${response.statusText}: ${response.body}`);
         }
@@ -249,7 +264,8 @@ export default {
       return (
         item.name.toLowerCase().includes(this.filter) ||
         (item.subtitle && item.subtitle.toLowerCase().includes(this.filter)) ||
-        (item.tag && item.tag.toLowerCase().includes(this.filter))
+        (item.tag && item.tag.toLowerCase().includes(this.filter)) ||
+        (item.keywords && item.keywords.toLowerCase().includes(this.filter))
       );
     },
     navigateToFirstService: function (target) {