2020-10-17 13:12:00 +02:00
|
|
|
<template>
|
2022-01-15 23:55:19 +01:00
|
|
|
<MkLoading v-if="!loaded"/>
|
2023-04-01 06:42:40 +02:00
|
|
|
<Transition :name="defaultStore.state.animation ? '_transition_zoom' : ''" appear>
|
2023-05-19 09:20:53 +02:00
|
|
|
<div v-show="loaded" :class="$style.root">
|
|
|
|
<img src="https://xn--931a.moe/assets/error.jpg" class="_ghost" :class="$style.img"/>
|
|
|
|
<div class="_gaps">
|
|
|
|
<p><b><i class="ti ti-alert-triangle"></i> {{ i18n.ts.pageLoadError }}</b></p>
|
|
|
|
<p v-if="meta && (version === meta.version)">{{ i18n.ts.pageLoadErrorDescription }}</p>
|
|
|
|
<p v-else-if="serverIsDead">{{ i18n.ts.serverIsDead }}</p>
|
|
|
|
<template v-else>
|
|
|
|
<p>{{ i18n.ts.newVersionOfClientAvailable }}</p>
|
|
|
|
<p>{{ i18n.ts.youShouldUpgradeClient }}</p>
|
|
|
|
<MkButton style="margin: 8px auto;" @click="reload">{{ i18n.ts.reload }}</MkButton>
|
|
|
|
</template>
|
|
|
|
<p><MkA to="/docs/general/troubleshooting" class="_link">{{ i18n.ts.troubleshooting }}</MkA></p>
|
|
|
|
<p v-if="error" style="opacity: 0.7;">ERROR: {{ error }}</p>
|
|
|
|
</div>
|
2020-10-17 13:12:00 +02:00
|
|
|
</div>
|
2022-12-30 05:37:14 +01:00
|
|
|
</Transition>
|
2020-10-17 13:12:00 +02:00
|
|
|
</template>
|
|
|
|
|
2022-01-15 23:55:19 +01:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
|
|
|
import * as misskey from 'misskey-js';
|
2022-09-06 11:21:49 +02:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2021-11-11 18:02:25 +01:00
|
|
|
import { version } from '@/config';
|
|
|
|
import * as os from '@/os';
|
|
|
|
import { unisonReload } from '@/scripts/unison-reload';
|
2022-01-15 23:55:19 +01:00
|
|
|
import { i18n } from '@/i18n';
|
2022-06-20 10:38:49 +02:00
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
2023-01-07 02:13:02 +01:00
|
|
|
import { miLocalStorage } from '@/local-storage';
|
2023-04-01 06:42:40 +02:00
|
|
|
import { defaultStore } from '@/store';
|
2020-10-17 13:12:00 +02:00
|
|
|
|
2022-01-15 23:55:19 +01: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;
|
2023-01-07 02:13:02 +01:00
|
|
|
miLocalStorage.setItem('v', res.version);
|
2022-01-15 23:55:19 +01:00
|
|
|
}, () => {
|
|
|
|
loaded = true;
|
|
|
|
serverIsDead = true;
|
|
|
|
});
|
|
|
|
|
|
|
|
function reload() {
|
|
|
|
unisonReload();
|
|
|
|
}
|
|
|
|
|
2022-06-20 10:38:49 +02:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.error,
|
2022-12-19 11:01:30 +01:00
|
|
|
icon: 'ti ti-alert-triangle',
|
2020-10-17 13:12:00 +02:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2023-05-19 09:20:53 +02:00
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
2021-08-07 10:55:16 +02:00
|
|
|
padding: 32px;
|
2020-10-17 13:12:00 +02:00
|
|
|
text-align: center;
|
2023-05-19 09:20:53 +02:00
|
|
|
}
|
2020-10-17 13:12:00 +02:00
|
|
|
|
2023-05-19 09:20:53 +02:00
|
|
|
.img {
|
|
|
|
vertical-align: bottom;
|
|
|
|
height: 128px;
|
|
|
|
margin-bottom: 24px;
|
|
|
|
border-radius: 16px;
|
2020-10-17 13:12:00 +02:00
|
|
|
}
|
|
|
|
</style>
|