api-client/layouts/error.vue

62 lines
1.1 KiB
Vue
Raw Normal View History

2019-08-24 03:06:57 +00:00
<template>
<div class="page page-error">
<h1 class="mb-4 text-4xl heading">{{ statusCode }}</h1>
<h3 class="select-text">{{ message }}</h3>
<p class="mt-4">
2021-08-02 18:53:04 +00:00
<ButtonSecondary to="/" icon="home" outline :label="$t('home')" />
2021-07-03 13:14:58 +00:00
<ButtonSecondary
icon="refresh"
:label="$t('reload')"
2021-08-02 18:53:04 +00:00
outline
2021-07-03 13:14:58 +00:00
@click.native="reloadApplication"
/>
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
},
2021-05-17 11:41:58 +00:00
computed: {
statusCode() {
return (this.error && this.error.statusCode) || 500
},
message() {
return this.error.message || this.$t("error.something_went_wrong")
2021-05-17 11:41:58 +00:00
},
},
2021-07-03 13:14:58 +00:00
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>