2020-10-17 05:12:00 -06:00
|
|
|
<template>
|
2022-01-15 15:55:19 -07:00
|
|
|
<MkLoading v-if="!loaded"/>
|
2020-12-18 18:55:52 -07:00
|
|
|
<transition :name="$store.state.animation ? 'zoom' : ''" appear>
|
2021-11-19 03:36:12 -07:00
|
|
|
<div v-show="loaded" class="mjndxjch">
|
2022-08-08 15:07:09 -06:00
|
|
|
<img src="/static-assets/badges/error.png" class="_ghost" alt="Error"/>
|
2022-11-06 19:30:26 -07:00
|
|
|
<p><b><i class="ph-warning-bold"></i> {{ i18n.ts.pageLoadError }}</b></p>
|
2022-01-27 19:39:49 -07:00
|
|
|
<p v-if="meta && (version === meta.version)">{{ i18n.ts.pageLoadErrorDescription }}</p>
|
|
|
|
<p v-else-if="serverIsDead">{{ i18n.ts.serverIsDead }}</p>
|
2021-10-02 01:36:25 -06:00
|
|
|
<template v-else>
|
2022-01-27 19:39:49 -07:00
|
|
|
<p>{{ i18n.ts.newVersionOfClientAvailable }}</p>
|
|
|
|
<p>{{ i18n.ts.youShouldUpgradeClient }}</p>
|
|
|
|
<MkButton class="button primary" @click="reload">{{ i18n.ts.reload }}</MkButton>
|
2021-10-02 01:36:25 -06:00
|
|
|
</template>
|
2022-01-27 19:39:49 -07:00
|
|
|
<p><MkA to="/docs/general/troubleshooting" class="_link">{{ i18n.ts.troubleshooting }}</MkA></p>
|
2021-08-07 02:55:16 -06:00
|
|
|
<p v-if="error" class="error">ERROR: {{ error }}</p>
|
2020-10-17 05:12:00 -06:00
|
|
|
</div>
|
|
|
|
</transition>
|
|
|
|
</template>
|
|
|
|
|
2022-01-15 15:55:19 -07:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
|
|
|
import * as misskey from 'misskey-js';
|
2022-09-06 03:21:49 -06:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2021-11-11 10:02:25 -07:00
|
|
|
import { version } from '@/config';
|
|
|
|
import * as os from '@/os';
|
|
|
|
import { unisonReload } from '@/scripts/unison-reload';
|
2022-01-15 15:55:19 -07:00
|
|
|
import { i18n } from '@/i18n';
|
2022-06-20 02:38:49 -06:00
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
2020-10-17 05:12:00 -06:00
|
|
|
|
2022-01-15 15:55:19 -07:00
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
error?: Error;
|
|
|
|
}>(), {
|
|
|
|
});
|
|
|
|
|
|
|
|
let loaded = $ref(false);
|
|
|
|
let serverIsDead = $ref(false);
|
|
|
|
let meta = $ref<misskey.entities.LiteInstanceMetadata | null>(null);
|
|
|
|
|
|
|
|
os.api('meta', {
|
|
|
|
detail: false,
|
|
|
|
}).then(res => {
|
|
|
|
loaded = true;
|
|
|
|
serverIsDead = false;
|
|
|
|
meta = res;
|
|
|
|
localStorage.setItem('v', res.version);
|
|
|
|
}, () => {
|
|
|
|
loaded = true;
|
|
|
|
serverIsDead = true;
|
|
|
|
});
|
|
|
|
|
|
|
|
function reload() {
|
|
|
|
unisonReload();
|
|
|
|
}
|
|
|
|
|
2022-06-20 02:38:49 -06:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.error,
|
2022-11-06 19:30:26 -07:00
|
|
|
icon: 'ph-warning-bold',
|
2020-10-17 05:12:00 -06:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.mjndxjch {
|
2021-08-07 02:55:16 -06:00
|
|
|
padding: 32px;
|
2020-10-17 05:12:00 -06:00
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
> p {
|
2021-08-07 02:55:16 -06:00
|
|
|
margin: 0 0 12px 0;
|
2020-10-17 05:12:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
> .button {
|
2021-10-02 01:36:25 -06:00
|
|
|
margin: 8px auto;
|
2020-10-17 05:12:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
> img {
|
|
|
|
vertical-align: bottom;
|
|
|
|
height: 128px;
|
2021-08-07 02:55:16 -06:00
|
|
|
margin-bottom: 24px;
|
2020-10-17 05:12:00 -06:00
|
|
|
border-radius: 16px;
|
|
|
|
}
|
2021-08-07 02:55:16 -06:00
|
|
|
|
|
|
|
> .error {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
2020-10-17 05:12:00 -06:00
|
|
|
}
|
|
|
|
</style>
|