api-client/layouts/error.vue

75 lines
1.4 KiB
Vue
Raw Normal View History

2019-08-24 03:06:57 +00:00
<template>
<div class="page page-error">
<h1 class="mb-4 font-mono heading text-4xl">{{ statusCode }}</h1>
<h3 class="mb-4 heading font-mono text-xs">{{ message }}</h3>
2021-06-12 16:46:17 +00:00
<p class="mt-4 border-t border-tooltip">
2019-10-25 08:14:34 +00:00
<nuxt-link to="/">
<button class="icon button">
2021-05-17 11:41:58 +00:00
<i class="material-icons">home</i>
<span>
{{ $t("go_home") }}
</span>
</button>
2019-10-25 08:14:34 +00:00
</nuxt-link>
<button class="icon button" @click="reloadApplication">
2021-05-17 11:41:58 +00:00
<i class="material-icons">refresh</i>
<span>
{{ $t("reload") }}
</span>
</button>
2019-10-25 08:14:34 +00:00
</p>
2019-08-24 03:06:57 +00:00
</div>
</template>
<script>
2021-06-17 12:22:59 +00:00
import { initializeFirebase } from "~/helpers/fb"
2019-11-02 05:32:21 +00:00
export default {
2021-05-17 11:41:58 +00:00
props: {
error: {
type: Object,
default: null,
2020-02-24 18:44:50 +00:00
},
2019-11-02 05:32:21 +00:00
},
head() {
return {
bodyAttrs: {
class: "sticky-footer",
2020-02-24 18:44:50 +00:00
},
}
},
2021-05-17 11:41:58 +00:00
computed: {
statusCode() {
return (this.error && this.error.statusCode) || 500
},
message() {
return this.error.message || this.$t("something_went_wrong")
},
},
2021-06-21 04:27:45 +00:00
beforeMount() {
initializeFirebase()
},
2021-05-17 11:41:58 +00:00
methods: {
reloadApplication() {
window.location.reload()
},
},
2020-02-24 18:44:50 +00:00
}
2019-08-24 03:06:57 +00:00
</script>
2021-05-17 11:41:58 +00:00
<style scoped lang="scss">
.page-error {
2021-06-26 10:41:19 +00:00
@apply flex flex-col;
2021-05-17 11:41:58 +00:00
@apply items-center;
@apply justify-center;
@apply text-center;
}
.error_banner {
@apply w-24;
@apply mb-12;
}
</style>