aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/App.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/App.vue')
-rw-r--r--src/App.vue15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/App.vue b/src/App.vue
index 1f1791c..fda13c3 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -45,6 +45,7 @@
45 45
46 <SearchInput 46 <SearchInput
47 class="navbar-item is-inline-block-mobile" 47 class="navbar-item is-inline-block-mobile"
48 :hotkey="searchHotkey()"
48 @input="filterServices" 49 @input="filterServices"
49 @search-focus="showMenu = true" 50 @search-focus="showMenu = true"
50 @search-open="navigateToFirstService" 51 @search-open="navigateToFirstService"
@@ -59,6 +60,9 @@
59 v-if="config.connectivityCheck" 60 v-if="config.connectivityCheck"
60 @network-status-update="offline = $event" 61 @network-status-update="offline = $event"
61 /> 62 />
63
64 <GetStarted v-if="loaded && !services" />
65
62 <div v-if="!offline"> 66 <div v-if="!offline">
63 <!-- Optional messages --> 67 <!-- Optional messages -->
64 <Message :item="config.message" /> 68 <Message :item="config.message" />
@@ -133,6 +137,7 @@ const jsyaml = require("js-yaml");
133const merge = require("lodash.merge"); 137const merge = require("lodash.merge");
134 138
135import Navbar from "./components/Navbar.vue"; 139import Navbar from "./components/Navbar.vue";
140import GetStarted from "./components/GetStarted.vue";
136import ConnectivityChecker from "./components/ConnectivityChecker.vue"; 141import ConnectivityChecker from "./components/ConnectivityChecker.vue";
137import Service from "./components/Service.vue"; 142import Service from "./components/Service.vue";
138import Message from "./components/Message.vue"; 143import Message from "./components/Message.vue";
@@ -147,6 +152,7 @@ export default {
147 name: "App", 152 name: "App",
148 components: { 153 components: {
149 Navbar, 154 Navbar,
155 GetStarted,
150 ConnectivityChecker, 156 ConnectivityChecker,
151 Service, 157 Service,
152 Message, 158 Message,
@@ -157,6 +163,7 @@ export default {
157 }, 163 },
158 data: function () { 164 data: function () {
159 return { 165 return {
166 loaded: false,
160 config: null, 167 config: null,
161 services: null, 168 services: null,
162 offline: false, 169 offline: false,
@@ -169,8 +176,14 @@ export default {
169 created: async function () { 176 created: async function () {
170 this.buildDashboard(); 177 this.buildDashboard();
171 window.onhashchange = this.buildDashboard; 178 window.onhashchange = this.buildDashboard;
179 this.loaded = true;
172 }, 180 },
173 methods: { 181 methods: {
182 searchHotkey() {
183 if (this.config.hotkey && this.config.hotkey.search) {
184 return this.config.hotkey.search;
185 }
186 },
174 buildDashboard: async function () { 187 buildDashboard: async function () {
175 const defaults = jsyaml.load(defaultConfig); 188 const defaults = jsyaml.load(defaultConfig);
176 let config; 189 let config;
@@ -191,6 +204,7 @@ export default {
191 } 204 }
192 this.config = merge(defaults, config); 205 this.config = merge(defaults, config);
193 this.services = this.config.services; 206 this.services = this.config.services;
207
194 document.title = 208 document.title =
195 this.config.documentTitle || 209 this.config.documentTitle ||
196 `${this.config.title} | ${this.config.subtitle}`; 210 `${this.config.title} | ${this.config.subtitle}`;
@@ -209,6 +223,7 @@ export default {
209 window.location.href = response.url; 223 window.location.href = response.url;
210 return; 224 return;
211 } 225 }
226
212 if (!response.ok) { 227 if (!response.ok) {
213 throw Error(`${response.statusText}: ${response.body}`); 228 throw Error(`${response.statusText}: ${response.body}`);
214 } 229 }