Skip to content
Snippets Groups Projects
Commit 82207598 authored by syuilo's avatar syuilo
Browse files

Add misskey update page

parent a2bef1fa
No related branches found
No related tags found
No related merge requests found
......@@ -692,6 +692,10 @@ deleteConfirm: "削除しますか?"
invalidValue: "有効な値ではありません。"
registry: "レジストリ"
closeAccount: "アカウントを閉鎖する"
currentVersion: "現在のバージョン"
latestVersion: "最新のバージョン"
youAreRunningUpToDateClient: "お使いのクライアントは最新です。"
newVersionOfClientAvailable: "新しいバージョンのクライアントが利用可能です。"
_registry:
scope: "スコープ"
......
......@@ -106,6 +106,7 @@ export default defineComponent({
case 'plugins': return defineAsyncComponent(() => import('./plugins.vue'));
case 'import-export': return defineAsyncComponent(() => import('./import-export.vue'));
case 'account-info': return defineAsyncComponent(() => import('./account-info.vue'));
case 'update': return defineAsyncComponent(() => import('./update.vue'));
case 'registry': return defineAsyncComponent(() => import('./registry.vue'));
case 'experimental-features': return defineAsyncComponent(() => import('./experimental-features.vue'));
}
......
<template>
<FormBase>
<FormLink to="/settings/update">Misskey Update</FormLink>
<FormSwitch :value="$i.injectFeaturedNote" @update:value="onChangeInjectFeaturedNote">
{{ $ts.showFeaturedNotesInTimeline }}
</FormSwitch>
......
<template>
<FormBase>
<template v-if="meta">
<MkInfo v-if="version === meta.version">{{ $ts.youAreRunningUpToDateClient }}</MkInfo>
<MkInfo v-else warn>{{ $ts.newVersionOfClientAvailable }}</MkInfo>
</template>
<FormGroup>
<template #label>{{ instanceName }}</template>
<FormKeyValueView>
<template #key>{{ $ts.currentVersion }}</template>
<template #value>{{ version }}</template>
</FormKeyValueView>
<FormKeyValueView>
<template #key>{{ $ts.latestVersion }}</template>
<template #value v-if="meta">{{ meta.version }}</template>
<template #value v-else><MkEllipsis/></template>
</FormKeyValueView>
</FormGroup>
<FormGroup>
<template #label>Misskey</template>
<FormKeyValueView>
<template #key>{{ $ts.latestVersion }}</template>
<template #value v-if="releases">{{ releases[0].tag_name }}</template>
<template #value v-else><MkEllipsis/></template>
</FormKeyValueView>
<template #caption v-if="releases"><MkTime :time="releases[0].published_at" mode="detail"/></template>
</FormGroup>
</FormBase>
</template>
<script lang="ts">
import { defineAsyncComponent, defineComponent } from 'vue';
import { faInfoCircle, faSyncAlt } from '@fortawesome/free-solid-svg-icons';
import FormSwitch from '@/components/form/switch.vue';
import FormSelect from '@/components/form/select.vue';
import FormLink from '@/components/form/link.vue';
import FormBase from '@/components/form/base.vue';
import FormGroup from '@/components/form/group.vue';
import FormButton from '@/components/form/button.vue';
import FormKeyValueView from '@/components/form/key-value-view.vue';
import MkInfo from '@/components/ui/info.vue';
import * as os from '@/os';
import { version, instanceName } from '@/config';
export default defineComponent({
components: {
FormBase,
FormSelect,
FormSwitch,
FormButton,
FormLink,
FormGroup,
FormKeyValueView,
MkInfo,
},
emits: ['info'],
data() {
return {
INFO: {
title: 'Misskey Update',
icon: faSyncAlt
},
version,
instanceName,
releases: null,
meta: null
}
},
mounted() {
this.$emit('info', this.INFO);
os.api('meta', {
detail: false
}).then(meta => {
this.meta = meta;
localStorage.setItem('v', meta.version);
});
fetch('https://api.github.com/repos/syuilo/misskey/releases', {
method: 'GET',
})
.then(res => res.json())
.then(res => {
this.releases = res;
});
},
methods: {
}
});
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment