Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kozakura913 committed Dec 13, 2024
1 parent 935d308 commit a9e740d
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkMigrated.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<div :class="$style.version">
<div>✨{{ version }}🚀</div>
<div style="font-size: 0.8em;">{{ basedMisskeyVersion }}</div>
<div style="font-size: 0.8em;">{{ basedCherrypickVersion }}</div>
<div style="font-size: 0.8em;">{{ basedMisskeyVersion }}</div>
</div>
<MkButton rounded full @click="whatIsNewYojo">{{ i18n.ts.whatIsNew }}</MkButton>
<MkButton :class="$style.gotIt" primary rounded full @click="close">{{ i18n.ts.gotIt }}</MkButton>
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkUpdated.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<div :class="$style.version">
<div>✨{{ version }}🚀</div>
<div style="font-size: 0.8em;">{{ basedMisskeyVersion }}</div>
<div style="font-size: 0.8em;">{{ basedCherrypickVersion }}</div>
<div style="font-size: 0.8em;">{{ basedMisskeyVersion }}</div>
</div>
<MkButton rounded full @click="whatIsNewYojo">{{ i18n.ts.whatIsNew }}</MkButton>
<MkButton :class="$style.gotIt" primary rounded full @click="close">{{ i18n.ts.gotIt }}</MkButton>
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/about-misskey.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ SPDX-License-Identifier: AGPL-3.0-only
<img src="/client-assets/about-icon.png" alt="" class="icon" draggable="false" @load="iconLoaded" @click="gravity"/>
<div class="cherrypick">yojo-art</div>
<div class="version" @click="whatIsNewYojo">v{{ version }}</div>
<div class="version" style="font-size: 11px;" @click="whatIsNewMisskey">v{{ basedMisskeyVersion }} (Based on Misskey)</div>
<div class="version" style="font-size: 11px;" @click="whatIsNewCherryPick">v{{ basedCherrypickVersion }} (Based on CherryPick)</div>
<div class="version" style="font-size: 11px;" @click="whatIsNewMisskey">v{{ basedMisskeyVersion }} (Based on Misskey)</div>
<span v-for="emoji in easterEggEmojis" :key="emoji.id" class="emoji" :data-physics-x="emoji.left" :data-physics-y="emoji.top" :class="{ _physics_circle_: !emoji.emoji.startsWith(':') }">
<MkCustomEmoji v-if="emoji.emoji[0] === ':'" class="emoji" :name="emoji.emoji" :normal="true" :noStyle="true" :fallbackToImage="true"/>
<MkEmoji v-else class="emoji" :emoji="emoji.emoji" :normal="true" :noStyle="true"/>
Expand Down
62 changes: 47 additions & 15 deletions packages/frontend/src/pages/admin/update.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkSwitch>
</div>

<template v-if="(version && version.length > 0) && (releasesCherryPick && releasesCherryPick.length > 0)">
<FormInfo v-if="compareVersions(version, releasesCherryPick[0].tag_name) > 0">{{ i18n.ts.youAreRunningBetaClient }}</FormInfo>
<FormInfo v-else-if="compareVersions(version, releasesCherryPick[0].tag_name) === 0">{{ i18n.ts.youAreRunningUpToDateClient }}</FormInfo>
<template v-if="(version && version.length > 0) && (releasesYojoArt && releasesYojoArt.length > 0)">
<FormInfo v-if="compareVersions(version, releasesYojoArt[0].tag_name) > 0">{{ i18n.ts.youAreRunningBetaClient }}</FormInfo>
<FormInfo v-else-if="compareVersions(version, releasesYojoArt[0].tag_name) === 0">{{ i18n.ts.youAreRunningUpToDateClient }}</FormInfo>
<FormInfo v-else warn>{{ i18n.ts.newVersionOfClientAvailable }}</FormInfo>
</template>
<FormInfo v-else>{{ i18n.ts.loading }}</FormInfo>
Expand All @@ -28,12 +28,25 @@ 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 v-if="version < releasesCherryPick[0].tag_name && !skipVersion" style="margin-top: 10px;" @click="whatIsNewLatestCherryPick">
<MkKeyValue v-if="version < releasesYojoArt[0].tag_name && !skipVersion" 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-if="releasesYojoArt" #value>{{ releasesYojoArt[0].tag_name }}</template>
<template v-else #value><MkEllipsis/></template>
</MkKeyValue>
<MkButton v-if="!skipVersion && (compareVersions(version, releasesYojoArt[0].tag_name) < 0)" style="margin-top: 10px;" @click="skipThisVersion">{{ i18n.ts.skipThisVersion }}</MkButton>
</FormSection>

<FormSection @click="whatIsNewLatestYojoArt">
<template #label>YojoArt <i class="ti ti-external-link"></i></template>
<MkKeyValue>
<template #key>{{ i18n.ts.latestVersion }}</template>
<template v-if="releasesYojoArt" #value>{{ releasesYojoArt[0].tag_name }}</template>
<template v-else #value><MkEllipsis/></template>
</MkKeyValue>
<MkKeyValue style="margin: 8px 0 0; color: var(--MI_THEME-fgTransparentWeak); font-size: 0.85em;">
<template v-if="releasesYojoArt" #value><MkTime :time="releasesYojoArt[0].published_at" mode="detail"/></template>
<template v-else #value><MkEllipsis/></template>
</MkKeyValue>
<MkButton v-if="!skipVersion && (compareVersions(version, releasesCherryPick[0].tag_name) < 0)" style="margin-top: 10px;" @click="skipThisVersion">{{ i18n.ts.skipThisVersion }}</MkButton>
</FormSection>

<FormSection @click="whatIsNewLatestCherryPick">
Expand Down Expand Up @@ -69,7 +82,7 @@ SPDX-License-Identifier: AGPL-3.0-only

<script lang="ts" setup>
import { computed, ref } from 'vue';
import { version, instanceName, basedMisskeyVersion } from '@@/js/config.js';
import { version, instanceName, basedMisskeyVersion, basedCherrypickVersion } from '@@/js/config.js';
import * as os from '@/os.js';
import { misskeyApi } from '@/scripts/misskey-api.js';
import FormInfo from '@/components/MkInfo.vue';
Expand All @@ -86,7 +99,9 @@ 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 releasesCherryPick = ref(null);
const releasesMisskey = ref(null);

Expand All @@ -96,17 +111,26 @@ async function init() {
enableReceivePrerelease.value = meta.enableReceivePrerelease;
skipVersion.value = meta.skipVersion;
skipCherryPickVersion.value = meta.skipCherryPickVersion;
skipYojoArtVersion.value = meta.skipYojoArtVersion;

try {
// CherryPick Releases Fetch
const cherryPickResponse = await fetch('https://api.github.com/repos/kokonect-link/cherrypick/releases');
const cherryPickData = await cherryPickResponse.json();
releasesCherryPick.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease);
// 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(skipCherryPickVersion.value, releasesCherryPick.value[0].tag_name) < 0) {
if (compareVersions(skipYojoArtVersion.value, releasesYojoArt.value[0].tag_name) < 0) {
skipVersion.value = false;
await misskeyApi('admin/update-meta', { skipVersion: skipVersion.value });
}
} catch (error) {
console.error('Failed to fetch YojoArt releases:', error);
}
try {
// CherryPick Releases Fetch
const cherryPickResponse = await fetch('https://api.github.com/repos/kokonect-link/cherrypick/releases');
const cherryPickData = await cherryPickResponse.json();
releasesCherryPick.value = meta.enableReceivePrerelease ? cherryPickData : cherryPickData.filter(x => !x.prerelease);
} catch (error) {
console.error('Failed to fetch CherryPick releases:', error);
}
Expand Down Expand Up @@ -144,19 +168,27 @@ function save() {
}

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

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

const whatIsNewYojoArt = () => {
window.open(`https://github.com/yojo-art/cherrypick/blob/develop/CHANGELOG_YOJO.md#${version.replace(/\./g, '')}`, '_blank');
};

const whatIsNewLatestYojoArt = () => {
window.open(`https://github.com/yojo-art/cherrypick/blob/develop/CHANGELOG_YOJO.md#${releasesYojoArt.value[0].tag_name.replace(/\./g, '')}`, '_blank');
};

const whatIsNewCherryPick = () => {
window.open(`https://github.com/kokonect-link/cherrypick/blob/develop/CHANGELOG_CHERRYPICK.md#${version.replace(/\./g, '')}`, '_blank');
window.open(`https://github.com/kokonect-link/cherrypick/blob/develop/CHANGELOG_CHERRYPICK.md#${basedCherrypickVersion.replace(/\./g, '')}`, '_blank');
};

const whatIsNewLatestCherryPick = () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/frontend/src/pages/welcome.entrance.a.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkFeaturedPhotos class="bg"/>
<div class="shape1"></div>
<div class="shape2"></div>
<!--
<div class="logo-wrapper">
<div class="powered-by">Powered by</div>
<img :src="cherrypicksvg" class="cherrypick"/>
</div>
-->
<div class="emojis">
<MkEmoji :normal="true" :noStyle="true" emoji="👍"/>
<MkEmoji :normal="true" :noStyle="true" emoji="❤"/>
Expand Down

0 comments on commit a9e740d

Please sign in to comment.