perf: 增加稳定版,预览版区分,预览版是最新版,稳定版在预览版验证稳定后,再将预览版转为稳定版

This commit is contained in:
xiaojunnuo
2026-07-17 00:58:19 +08:00
parent 85e9ff7a96
commit 15740904e5
16 changed files with 402 additions and 17 deletions
@@ -25,5 +25,7 @@ export default {
expiringCerts: "Soon-to-Expire Certificates",
supportedTasks: "Overview of Supported Deployment Tasks",
changeLog: "Change Log",
stableRelease: "Stable",
latestRelease: "Preview",
},
};
@@ -26,5 +26,7 @@ export default {
expiringCerts: "最快到期证书",
supportedTasks: "已支持的部署任务总览",
changeLog: "更新日志",
stableRelease: "稳定版",
latestRelease: "预览版",
},
};
@@ -11,6 +11,7 @@ export type AppInfo = {
version?: string;
time?: number;
deltaTime?: number;
releaseMode?: string;
};
export type SiteInfo = {
title?: string;
@@ -35,6 +35,7 @@ export interface SettingState {
version?: string;
time?: number;
deltaTime?: number;
releaseMode?: string;
};
productInfo: {
notice?: string;
@@ -109,6 +110,7 @@ export const useSettingStore = defineStore({
version: "",
time: 0,
deltaTime: 0,
releaseMode: "latest",
},
productInfo: {
notice: "",
@@ -229,6 +231,9 @@ export const useSettingStore = defineStore({
this.app.time = appInfo.time;
this.app.version = appInfo.version;
this.app.deltaTime = new Date().getTime() - this.app.time;
if (appInfo.releaseMode) {
this.app.releaseMode = appInfo.releaseMode;
}
},
initSiteInfo(siteInfo: SiteInfo) {
//@ts-ignore
@@ -1,4 +1,4 @@
<template>
<template>
<div class="dashboard-user">
<div class="header-profile flex-wrap bg-white dark:bg-black">
<div class="flex flex-1">
@@ -23,9 +23,9 @@
<template v-if="userStore.isAdmin">
<a-divider type="vertical" />
<a-badge :dot="hasNewVersion">
<a-tag color="blue" class="flex-inline pointer mr-0" :title="t('certd.dashboard.latestVersion', { version: latestVersion })" @click="openUpgradeUrl()">
<a-tag color="blue" class="flex-inline pointer mr-0" :title="'v' + version + ' ' + (settingsStore.app.releaseMode === 'stable' ? '稳定版' : '预览版')" @click="openUpgradeUrl()">
<fs-icon icon="ion:rocket-outline" class="mr-5"></fs-icon>
v{{ version }}
v{{ version }}-{{ settingsStore.app.releaseMode }}
</a-tag>
</a-badge>
<a-divider type="vertical" />
@@ -179,7 +179,6 @@ defineOptions({
const version = ref(import.meta.env.VITE_APP_VERSION);
const latestVersion = ref("");
function isNewVersion(version: string, latestVersion: string) {
if (!latestVersion) {
return false;