Skip to content

Commit

Permalink
improve update.vue
Browse files Browse the repository at this point in the history
  • Loading branch information
noridev committed Oct 3, 2023
1 parent b2b9492 commit 79eb595
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions packages/frontend/src/pages/admin/update.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :contentMax="700" :marginMin="16" :marginMax="32">
<div class="_gaps_m">
<template v-if="meta">
<template>
<FormInfo v-if="version > releasesCherryPick[0].tag_name">{{ i18n.ts.youAreRunningBetaClient }}</FormInfo>
<FormInfo v-else-if="version === (meta.version && releasesCherryPick[0].tag_name)">{{ i18n.ts.youAreRunningUpToDateClient }}</FormInfo>
<FormInfo v-else-if="version === releasesCherryPick[0].tag_name">{{ i18n.ts.youAreRunningUpToDateClient }}</FormInfo>
<FormInfo v-else warn>{{ i18n.ts.newVersionOfClientAvailable }}</FormInfo>
</template>

Expand All @@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #key>{{ i18n.ts.currentVersion }} <i class="ti ti-external-link"></i></template>
<template #value>{{ version }}</template>
</MkKeyValue>
<MkKeyValue style="margin-top: 10px;" @click="whatIsNewLatestCherryPick">
<MkKeyValue v-if="version < releasesCherryPick[0].tag_name" style="margin-top: 10px;" @click="whatIsNewLatestCherryPick">
<template #key>{{ i18n.ts.latestVersion }} <i class="ti ti-external-link"></i></template>
<template v-if="releasesCherryPick" #value>{{ releasesCherryPick[0].tag_name }}</template>
<template v-else #value><MkEllipsis/></template>
Expand Down Expand Up @@ -59,7 +59,6 @@ SPDX-License-Identifier: AGPL-3.0-only

<script lang="ts" setup>
import { onMounted } from 'vue';
import * as Misskey from 'cherrypick-js';
import * as os from '@/os.js';
import FormInfo from '@/components/MkInfo.vue';
import FormSection from '@/components/form/section.vue';
Expand All @@ -69,17 +68,10 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
import { i18n } from '@/i18n.js';
import XHeader from '@/pages/admin/_header_.vue';

let meta = $ref<Misskey.entities.LiteInstanceMetadata | null>(null);
let releasesCherryPick = $ref(null);
let releasesMisskey = $ref(null);

onMounted(() => {
os.api('meta', {
detail: false,
}).then(res => {
meta = res;
});

fetch('https://api.github.com/repos/kokonect-link/cherrypick/releases', {
method: 'GET',
}).then(res => res.json())
Expand Down

0 comments on commit 79eb595

Please sign in to comment.