2023-07-27 00:31:52 -05:00
|
|
|
<!--
|
2024-02-13 09:59:27 -06:00
|
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
2023-07-27 00:31:52 -05:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-10-17 06:12:00 -05:00
|
|
|
<template>
|
2022-01-15 16:55:19 -06:00
|
|
|
<MkLoading v-if="!loaded"/>
|
2023-03-31 23:42:40 -05:00
|
|
|
<Transition :name="defaultStore.state.animation ? '_transition_zoom' : ''" appear>
|
2023-05-19 02:20:53 -05:00
|
|
|
<div v-show="loaded" :class="$style.root">
|
2023-06-09 00:00:53 -05:00
|
|
|
<img :src="serverErrorImageUrl" class="_ghost" :class="$style.img"/>
|
2023-05-19 02:20:53 -05:00
|
|
|
<div class="_gaps">
|
2023-08-13 06:23:54 -05: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 02:20:53 -05:00
|
|
|
<template v-else>
|
2023-08-13 06:23:54 -05:00
|
|
|
<div>{{ i18n.ts.newVersionOfClientAvailable }}</div>
|
|
|
|
<div>{{ i18n.ts.youShouldUpgradeClient }}</div>
|
2023-05-19 02:20:53 -05:00
|
|
|
<MkButton style="margin: 8px auto;" @click="reload">{{ i18n.ts.reload }}</MkButton>
|
|
|
|
</template>
|
2024-02-13 22:10:36 -06:00
|
|
|
<div><MkLink url="https://misskey-hub.net/docs/for-users/resources/troubleshooting/" target="_blank">{{ i18n.ts.troubleshooting }}</MkLink></div>
|
2023-08-13 06:23:54 -05:00
|
|
|
<div v-if="error" style="opacity: 0.7;">ERROR: {{ error }}</div>
|
2023-05-19 02:20:53 -05:00
|
|
|
</div>
|
2020-10-17 06:12:00 -05:00
|
|
|
</div>
|
2022-12-29 22:37:14 -06:00
|
|
|
</Transition>
|
2020-10-17 06:12:00 -05:00
|
|
|
</template>
|
|
|
|
|
2022-01-15 16:55:19 -06:00
|
|
|
<script lang="ts" setup>
|
2023-12-06 23:42:09 -06:00
|
|
|
import { ref, computed } from 'vue';
|
2023-09-03 23:33:38 -05:00
|
|
|
import * as Misskey from 'misskey-js';
|
2022-09-06 04:21:49 -05:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2024-02-13 22:10:36 -06:00
|
|
|
import MkLink from '@/components/MkLink.vue';
|
2023-09-19 02:37:43 -05:00
|
|
|
import { version } from '@/config.js';
|
2024-01-04 03:32:46 -06:00
|
|
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
2023-09-19 02:37:43 -05:00
|
|
|
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 06:12:00 -05:00
|
|
|
|
2022-01-15 16:55:19 -06:00
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
error?: Error;
|
|
|
|
}>(), {
|
|
|
|
});
|
|
|
|
|
2023-12-06 23:42:09 -06:00
|
|
|
const loaded = ref(false);
|
|
|
|
const serverIsDead = ref(false);
|
|
|
|
const meta = ref<Misskey.entities.MetaResponse | null>(null);
|
2022-01-15 16:55:19 -06:00
|
|
|
|
2024-01-04 03:32:46 -06:00
|
|
|
misskeyApi('meta', {
|
2022-01-15 16:55:19 -06:00
|
|
|
detail: false,
|
|
|
|
}).then(res => {
|
2023-12-06 23:42:09 -06:00
|
|
|
loaded.value = true;
|
|
|
|
serverIsDead.value = false;
|
|
|
|
meta.value = res;
|
2023-01-06 19:13:02 -06:00
|
|
|
miLocalStorage.setItem('v', res.version);
|
2022-01-15 16:55:19 -06:00
|
|
|
}, () => {
|
2023-12-06 23:42:09 -06:00
|
|
|
loaded.value = true;
|
|
|
|
serverIsDead.value = true;
|
2022-01-15 16:55:19 -06:00
|
|
|
});
|
|
|
|
|
|
|
|
function reload() {
|
|
|
|
unisonReload();
|
|
|
|
}
|
|
|
|
|
2023-12-06 23:42:09 -06:00
|
|
|
const headerActions = computed(() => []);
|
2022-06-20 03:38:49 -05:00
|
|
|
|
2023-12-06 23:42:09 -06:00
|
|
|
const headerTabs = computed(() => []);
|
2022-06-20 03:38:49 -05:00
|
|
|
|
2024-02-16 01:17:09 -06:00
|
|
|
definePageMetadata(() => ({
|
2022-06-20 03:38:49 -05:00
|
|
|
title: i18n.ts.error,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-alert-triangle',
|
2024-02-16 01:17:09 -06:00
|
|
|
}));
|
2020-10-17 06:12:00 -05:00
|
|
|
</script>
|
|
|
|
|
2023-05-19 02:20:53 -05:00
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
2021-08-07 03:55:16 -05:00
|
|
|
padding: 32px;
|
2020-10-17 06:12:00 -05:00
|
|
|
text-align: center;
|
2023-05-19 02:20:53 -05:00
|
|
|
}
|
2020-10-17 06:12:00 -05:00
|
|
|
|
2023-05-19 02:20:53 -05:00
|
|
|
.img {
|
|
|
|
vertical-align: bottom;
|
|
|
|
height: 128px;
|
|
|
|
margin-bottom: 24px;
|
|
|
|
border-radius: 16px;
|
2020-10-17 06:12:00 -05:00
|
|
|
}
|
|
|
|
</style>
|