Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kozakura913 committed Dec 13, 2024
1 parent a9e740d commit e8ce264
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions packages/frontend/src/pages/admin/update.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ SPDX-License-Identifier: AGPL-3.0-only

<FormSection first>
<template #label>{{ instanceName }}</template>
<MkKeyValue @click="whatIsNewCherryPick">
<MkKeyValue @click="whatIsNewYojoArt">
<template #key>{{ i18n.ts.currentVersion }} <i class="ti ti-external-link"></i></template>
<template #value>{{ version }}</template>
</MkKeyValue>
<MkKeyValue v-if="version < releasesYojoArt[0].tag_name && !skipVersion" style="margin-top: 10px;" @click="whatIsNewLatestCherryPick">
<MkKeyValue v-if="version < releasesYojoArt[0].tag_name && !skipVersion" style="margin-top: 10px;" @click="whatIsNewLatestYojoArt">
<template #key>{{ i18n.ts.latestVersion }} <i class="ti ti-external-link"></i></template>
<template v-if="releasesYojoArt" #value>{{ releasesYojoArt[0].tag_name }}</template>
<template v-else #value><MkEllipsis/></template>
Expand Down Expand Up @@ -99,9 +99,8 @@ import MkButton from '@/components/MkButton.vue';
const enableReceivePrerelease = ref<boolean>(false);
const skipVersion = ref<boolean>(false);
const skipCherryPickVersion = ref<string | null>(null);
const skipYojoArtVersion = ref<string | null>(null);

const releasesYojoArt = ref(null);
const releasesYojoArt = ref<any[]>([]);
const releasesCherryPick = ref(null);
const releasesMisskey = ref(null);

Expand All @@ -110,16 +109,15 @@ const meta = await misskeyApi('admin/meta');
async function init() {
enableReceivePrerelease.value = meta.enableReceivePrerelease;
skipVersion.value = meta.skipVersion;
skipCherryPickVersion.value = meta.skipCherryPickVersion;
skipYojoArtVersion.value = meta.skipYojoArtVersion;
skipCherryPickVersion.value = meta.skipCherryPickVersion ?? null;

try {
// yojo-art Releases Fetch
const yojoArtResponse = await fetch('https://api.github.com/repos/yojo-art/cherrypick/releases');
const yojoArtData = await yojoArtResponse.json();
releasesYojoArt.value = meta.enableReceivePrerelease ? yojoArtData : yojoArtData.filter(x => !x.prerelease);

if (compareVersions(skipYojoArtVersion.value, releasesYojoArt.value[0].tag_name) < 0) {
if (compareVersions(skipCherryPickVersion.value ?? '0.0.0', releasesYojoArt.value[0].tag_name) < 0) {
skipVersion.value = false;
await misskeyApi('admin/update-meta', { skipVersion: skipVersion.value });
}
Expand Down Expand Up @@ -168,12 +166,12 @@ function save() {
}

function skipThisVersion() {
skipYojoArtVersion.value = releasesYojoArt.value[0].tag_name;
skipCherryPickVersion.value = releasesYojoArt.value[0].tag_name;
skipVersion.value = true;

os.apiWithDialog('admin/update-meta', {
skipVersion: skipVersion.value,
skipYojoArtVersion: skipYojoArtVersion.value,
skipCherrypickVersion: skipCherryPickVersion.value,
}).then(() => {
fetchInstance(true);
});
Expand Down

0 comments on commit e8ce264

Please sign in to comment.