2023-07-27 08:31:52 +03:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-10-17 14:12:00 +03:00
|
|
|
<template>
|
2022-01-16 00:55:19 +02:00
|
|
|
<MkLoading v-if="!loaded"/>
|
2023-04-01 07:42:40 +03:00
|
|
|
<Transition :name="defaultStore.state.animation ? '_transition_zoom' : ''" appear>
|
2023-05-19 10:20:53 +03:00
|
|
|
<div v-show="loaded" :class="$style.root">
|
2023-06-09 08:00:53 +03:00
|
|
|
<img :src="serverErrorImageUrl" class="_ghost" :class="$style.img"/>
|
2023-05-19 10:20:53 +03:00
|
|
|
<div class="_gaps">
|
2023-08-13 14:23:54 +03:00
|
|
|
<div><b><i class="ti ti-alert-triangle"></i> {{ i18n.ts.pageLoadError }}</b></div>
|
|
|
|
<div v-if="meta && (version === meta.version)">{{ i18n.ts.pageLoadErrorDescription }}</div>
|
|
|
|
<div v-else-if="serverIsDead">{{ i18n.ts.serverIsDead }}</div>
|
2023-05-19 10:20:53 +03:00
|
|
|
<template v-else>
|
2023-08-13 14:23:54 +03:00
|
|
|
<div>{{ i18n.ts.newVersionOfClientAvailable }}</div>
|
|
|
|
<div>{{ i18n.ts.youShouldUpgradeClient }}</div>
|
2023-05-19 10:20:53 +03:00
|
|
|
<MkButton style="margin: 8px auto;" @click="reload">{{ i18n.ts.reload }}</MkButton>
|
|
|
|
</template>
|
2023-08-13 14:23:54 +03:00
|
|
|
<div><MkA to="/docs/general/troubleshooting" class="_link">{{ i18n.ts.troubleshooting }}</MkA></div>
|
|
|
|
<div v-if="error" style="opacity: 0.7;">ERROR: {{ error }}</div>
|
2023-05-19 10:20:53 +03:00
|
|
|
</div>
|
2020-10-17 14:12:00 +03:00
|
|
|
</div>
|
2022-12-30 06:37:14 +02:00
|
|
|
</Transition>
|
2020-10-17 14:12:00 +03:00
|
|
|
</template>
|
|
|
|
|
2022-01-16 00:55:19 +02:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
2023-09-04 07:33:38 +03:00
|
|
|
import * as Misskey from 'misskey-js';
|
2022-09-06 12:21:49 +03:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2023-09-19 10:37:43 +03:00
|
|
|
import { version } from '@/config.js';
|
|
|
|
import * as os from '@/os.js';
|
|
|
|
import { unisonReload } from '@/scripts/unison-reload.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
|
|
|
import { miLocalStorage } from '@/local-storage.js';
|
|
|
|
import { defaultStore } from '@/store.js';
|
|
|
|
import { serverErrorImageUrl } from '@/instance.js';
|
2020-10-17 14:12:00 +03:00
|
|
|
|
2022-01-16 00:55:19 +02:00
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
error?: Error;
|
|
|
|
}>(), {
|
|
|
|
});
|
|
|
|
|
|
|
|
let loaded = $ref(false);
|
|
|
|
let serverIsDead = $ref(false);
|
2023-12-02 14:00:05 +02:00
|
|
|
let meta = $ref<Misskey.entities.MetaResponse | null>(null);
|
2022-01-16 00:55:19 +02:00
|
|
|
|
|
|
|
os.api('meta', {
|
|
|
|
detail: false,
|
|
|
|
}).then(res => {
|
|
|
|
loaded = true;
|
|
|
|
serverIsDead = false;
|
|
|
|
meta = res;
|
2023-01-07 03:13:02 +02:00
|
|
|
miLocalStorage.setItem('v', res.version);
|
2022-01-16 00:55:19 +02:00
|
|
|
}, () => {
|
|
|
|
loaded = true;
|
|
|
|
serverIsDead = true;
|
|
|
|
});
|
|
|
|
|
|
|
|
function reload() {
|
|
|
|
unisonReload();
|
|
|
|
}
|
|
|
|
|
2022-06-20 11:38:49 +03:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.error,
|
2022-12-19 12:01:30 +02:00
|
|
|
icon: 'ti ti-alert-triangle',
|
2020-10-17 14:12:00 +03:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2023-05-19 10:20:53 +03:00
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
2021-08-07 11:55:16 +03:00
|
|
|
padding: 32px;
|
2020-10-17 14:12:00 +03:00
|
|
|
text-align: center;
|
2023-05-19 10:20:53 +03:00
|
|
|
}
|
2020-10-17 14:12:00 +03:00
|
|
|
|
2023-05-19 10:20:53 +03:00
|
|
|
.img {
|
|
|
|
vertical-align: bottom;
|
|
|
|
height: 128px;
|
|
|
|
margin-bottom: 24px;
|
|
|
|
border-radius: 16px;
|
2020-10-17 14:12:00 +03:00
|
|
|
}
|
|
|
|
</style>
|