From 3f7ba1160db34a1d9da5ecdfb042540e4d2e75f9 Mon Sep 17 00:00:00 2001 From: bakashigure Date: Tue, 24 Oct 2023 03:06:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/main/componentManager/components/core.ts | 4 ++++ packages/renderer/src/assets/icons/new.svg | 1 + .../src/components/Setting/Version/Index.vue | 13 ++++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 packages/renderer/src/assets/icons/new.svg 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},点击以更新` : '点击来管理' }} + + + + +