diff --git a/packages/main/componentManager/components/core.ts b/packages/main/componentManager/components/core.ts index 0b7ef0cc..be9e0444 100644 --- a/packages/main/componentManager/components/core.ts +++ b/packages/main/componentManager/components/core.ts @@ -3,10 +3,13 @@ import CoreLoader from '@main/coreLoader' import type { Component } from '@type/componentManager' import fs from 'fs' import path from 'path' +import Storage from '@main/storageManager' import { getComponentBaseDir } from '../utils/path' import { infoPathOf } from '../utils/update' +const storage = new Storage() + export const getComponentCore = async (): Promise => { const coreLoader = new CoreLoader() const installer = new CoreInstaller() @@ -30,6 +33,7 @@ export const getComponentCore = async (): Promise => { fs.writeFileSync(ver, coreVersion, 'utf-8') // always check version const update = await installer.checkUpdate() if (update.msg === 'haveUpdate') { + storage.set('setting.version.core.latest', update.update.version) componentCore.status = 'upgradable' } } diff --git a/packages/renderer/src/assets/icons/new.svg b/packages/renderer/src/assets/icons/new.svg new file mode 100644 index 00000000..c63fa49e --- /dev/null +++ b/packages/renderer/src/assets/icons/new.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/renderer/src/components/Setting/Version/Index.vue b/packages/renderer/src/components/Setting/Version/Index.vue index f0aeed6d..5530f001 100644 --- a/packages/renderer/src/components/Setting/Version/Index.vue +++ b/packages/renderer/src/components/Setting/Version/Index.vue @@ -2,6 +2,7 @@ import IconBinary from '@/assets/icons/binary.svg?component' import IconFolder from '@/assets/icons/folder.svg?component' import IconInfo from '@/assets/icons/info.svg?component' +import IconNew from '@/assets/icons/new.svg?component' import IconWindowUi from '@/assets/icons/window-ui.svg?component' import useSettingStore from '@/store/settings' import { NButton, NIcon, NSpace, NText, NTooltip, useThemeVars } from 'naive-ui' @@ -78,7 +79,12 @@ onMounted(async () => { Maa Core: - {{ versionString(versionCore) }} + {{ versionString(versionCore) }} + + + + + @@ -106,6 +112,11 @@ onMounted(async () => { {{ needUpdate(versionUi) ? `UI可更新至${versionUi.latest},点击以更新` : '点击来管理' }} + + + + +