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