From 4f56c2c11baad8f98c338989fb0cd8e5af78d0c8 Mon Sep 17 00:00:00 2001 From: Bastien Wirtz Date: Sun, 10 Apr 2022 11:56:44 +0200 Subject: Handle 404 error on config file. --- src/App.vue | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/App.vue') diff --git a/src/App.vue b/src/App.vue index 81f92f7..515177e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -18,7 +18,10 @@ -
+
{{ config.subtitle }}

{{ config.title }}

@@ -61,7 +64,7 @@ @network-status-update="offline = $event" /> - +
@@ -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}`); } -- cgit v1.2.3