mirror of
https://github.com/bastienwirtz/homer.git
synced 2025-06-21 10:18:13 +02:00
Handle 404 error on config file.
This commit is contained in:
parent
049f85221e
commit
4f56c2c11b
18
src/App.vue
18
src/App.vue
@ -18,7 +18,10 @@
|
|||||||
</a>
|
</a>
|
||||||
<i v-if="config.icon" :class="config.icon"></i>
|
<i v-if="config.icon" :class="config.icon"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="dashboard-title">
|
<div
|
||||||
|
class="dashboard-title"
|
||||||
|
:class="{ 'no-logo': !config.icon || !config.logo }"
|
||||||
|
>
|
||||||
<span class="headline">{{ config.subtitle }}</span>
|
<span class="headline">{{ config.subtitle }}</span>
|
||||||
<h1>{{ config.title }}</h1>
|
<h1>{{ config.title }}</h1>
|
||||||
</div>
|
</div>
|
||||||
@ -61,7 +64,7 @@
|
|||||||
@network-status-update="offline = $event"
|
@network-status-update="offline = $event"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<GetStarted v-if="loaded && !services" />
|
<GetStarted v-if="configurationNeeded" />
|
||||||
|
|
||||||
<div v-if="!offline">
|
<div v-if="!offline">
|
||||||
<!-- Optional messages -->
|
<!-- Optional messages -->
|
||||||
@ -168,6 +171,7 @@ export default {
|
|||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
loaded: false,
|
loaded: false,
|
||||||
|
configNotFound: false,
|
||||||
config: null,
|
config: null,
|
||||||
services: null,
|
services: null,
|
||||||
offline: false,
|
offline: false,
|
||||||
@ -177,6 +181,11 @@ export default {
|
|||||||
showMenu: false,
|
showMenu: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
configurationNeeded: function () {
|
||||||
|
return (this.loaded && !this.services) || this.configNotFound;
|
||||||
|
},
|
||||||
|
},
|
||||||
created: async function () {
|
created: async function () {
|
||||||
this.buildDashboard();
|
this.buildDashboard();
|
||||||
window.onhashchange = this.buildDashboard;
|
window.onhashchange = this.buildDashboard;
|
||||||
@ -228,6 +237,11 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (response.status == 404) {
|
||||||
|
this.configNotFound = true;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw Error(`${response.statusText}: ${response.body}`);
|
throw Error(`${response.statusText}: ${response.body}`);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<p>
|
<p>
|
||||||
<a
|
<a
|
||||||
class="button is-primary mt-5 has-text-weight-bold"
|
class="button is-primary mt-5 has-text-weight-bold"
|
||||||
href="https://github.com/bastienwirtz/homer/blob/main/README.md#getting-started"
|
href="https://github.com/bastienwirtz/homer/blob/main/docs/configuration.md#configuration"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
Get started
|
Get started
|
||||||
|
Loading…
x
Reference in New Issue
Block a user