From 2126002b7af164e09ac288a2df86810bab2ac7ff Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Thu, 2 Apr 2026 23:16:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20Vue=20=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E7=A9=BF=E9=80=8F=E8=AD=A6=E5=91=8A=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=20tsconfig=20=E8=A7=A3=E6=9E=90=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dashboard/scripts/patch-dompurify.mjs | 25 +- dashboard/src/components/auth/DiamondBg.vue | 28 +- dashboard/src/components/chat/MessageList.vue | 16 +- .../MessagePartsRenderer.vue | 13 +- .../components/extension/PinnedPluginItem.vue | 194 +- .../provider/ProviderModelsPanel.vue | 310 +- .../provider/ProviderSourcesPanel.vue | 123 +- .../src/components/shared/AstrBotConfigV4.vue | 5 +- .../src/components/shared/ChangelogDialog.vue | 5 +- .../components/shared/ConsoleDisplayer.vue | 229 +- .../src/components/shared/DailyQuote.vue | 140 +- dashboard/src/components/shared/Logo.vue | 13 +- dashboard/src/composables/useSessions.ts | 4 +- dashboard/src/layouts/full/FullLayout.vue | 14 +- .../full/vertical-header/VerticalHeader.vue | 10 +- dashboard/src/stores/customizer.ts | 4 +- dashboard/src/theme/BlueBusinessDarkTheme.ts | 4 +- dashboard/src/theme/constants.ts | 2 +- dashboard/src/views/ConfigPage.vue | 5 +- dashboard/src/views/ConsolePage.vue | 77 +- dashboard/src/views/ConversationPage.vue | 2618 +++++++++-------- dashboard/src/views/CronJobPage.vue | 700 +++-- dashboard/src/views/ExtensionPage.vue | 4 +- dashboard/src/views/PlatformPage.vue | 26 +- dashboard/src/views/ProviderPage.vue | 682 +++-- dashboard/src/views/Settings.vue | 90 +- dashboard/src/views/SubAgentPage.vue | 717 +++-- dashboard/src/views/WelcomePage.vue | 3 +- .../views/authentication/auth/LoginPage.vue | 59 +- .../default/components/MemoryUsage.vue | 4 +- .../default/components/OnlinePlatform.vue | 4 +- .../default/components/OnlineTime.vue | 12 +- .../default/components/RunningTime.vue | 4 +- .../views/extension/InstalledPluginsTab.vue | 1125 +++---- dashboard/src/views/knowledge-base/KBList.vue | 591 ++-- dashboard/tsconfig.vite-config.json | 6 +- 36 files changed, 4846 insertions(+), 3020 deletions(-) diff --git a/dashboard/scripts/patch-dompurify.mjs b/dashboard/scripts/patch-dompurify.mjs index 2fb3718b7..058af3d32 100644 --- a/dashboard/scripts/patch-dompurify.mjs +++ b/dashboard/scripts/patch-dompurify.mjs @@ -25,7 +25,7 @@ const MONACO_DOMPURIFY = join( "base", "browser", "dompurify", - "dompurify.js" + "dompurify.js", ); // Files inside monaco-editor dev/min bundles that embed dompurify source @@ -35,7 +35,8 @@ const BUNDLED_FILES = [ ]; const PATCHED_VERSION = "3.3.3"; -const PATCHED_URL = "https://raw.githubusercontent.com/cure53/DOMPurify/main/dist/purify.js"; +const PATCHED_URL = + "https://raw.githubusercontent.com/cure53/DOMPurify/main/dist/purify.js"; const dompurifyVersion = (content) => { const m = content.match(/DOMPurify\s+(\d+\.\d+\.\d+)/); @@ -73,24 +74,26 @@ async function patchFile(source, target) { if (currentVersion && !isVulnerable(currentVersion)) { console.log( - `[patch-dompurify] ${target} already at safe version ${currentVersion}, skipping.` + `[patch-dompurify] ${target} already at safe version ${currentVersion}, skipping.`, ); return; } - console.log(`[patch-dompurify] Downloading patched DOMPurify ${PATCHED_VERSION}...`); + console.log( + `[patch-dompurify] Downloading patched DOMPurify ${PATCHED_VERSION}...`, + ); const patched = await download(source); const patchedVer = dompurifyVersion(patched); if (!patchedVer || isVulnerable(patchedVer)) { throw new Error( - `Downloaded DOMPurify version is still vulnerable: got ${patchedVer}` + `Downloaded DOMPurify version is still vulnerable: got ${patchedVer}`, ); } writeFileSync(target, patched, "utf8"); console.log( - `[patch-dompurify] Patched ${target} (${currentVersion || "new"} -> ${PATCHED_VERSION})` + `[patch-dompurify] Patched ${target} (${currentVersion || "new"} -> ${PATCHED_VERSION})`, ); } @@ -103,27 +106,27 @@ async function patchBundledContent(target) { if (!currentVersion || !isVulnerable(currentVersion)) return; console.log( - `[patch-dompurify] Downloading patched DOMPurify ${PATCHED_VERSION} for bundling...` + `[patch-dompurify] Downloading patched DOMPurify ${PATCHED_VERSION} for bundling...`, ); const patched = await download(PATCHED_URL); // Replace the dompurify version header + IIFE in the bundled file const patchedHeader = patched.match( - /\/\*! @license DOMPurify [\d.]+ \|[\s\S]*?Mozilla Public License 2.0 \*\/[\s\S]*?^\(function\(\)/m + /\/\*! @license DOMPurify [\d.]+ \|[\s\S]*?Mozilla Public License 2.0 \*\/[\s\S]*?^\(function\(\)/m, )?.[0]; if (patchedHeader) { const newContent = content.replace( /\/\*! @license DOMPurify 3\.2\.7[\s\S]*?^\(function\(\)/m, - patchedHeader + patchedHeader, ); writeFileSync(target, newContent, "utf8"); console.log( - `[patch-dompurify] Patched bundled dompurify in ${target} (${currentVersion} -> ${PATCHED_VERSION})` + `[patch-dompurify] Patched bundled dompurify in ${target} (${currentVersion} -> ${PATCHED_VERSION})`, ); } else { console.warn( - `[patch-dompurify] Could not find dompurify IIFE pattern in ${target}, skipping.` + `[patch-dompurify] Could not find dompurify IIFE pattern in ${target}, skipping.`, ); } } diff --git a/dashboard/src/components/auth/DiamondBg.vue b/dashboard/src/components/auth/DiamondBg.vue index f2a44d9d5..b4486c02a 100644 --- a/dashboard/src/components/auth/DiamondBg.vue +++ b/dashboard/src/components/auth/DiamondBg.vue @@ -1,5 +1,10 @@ diff --git a/dashboard/src/views/ExtensionPage.vue b/dashboard/src/views/ExtensionPage.vue index 756a748d8..3edc36fa9 100644 --- a/dashboard/src/views/ExtensionPage.vue +++ b/dashboard/src/views/ExtensionPage.vue @@ -168,7 +168,9 @@ const {
-

{{ tm("tabs.handlersOperation") }}

+

+ {{ tm("tabs.handlersOperation") }} +

diff --git a/dashboard/src/views/ProviderPage.vue b/dashboard/src/views/ProviderPage.vue index 96ca6ef97..a73a76d99 100644 --- a/dashboard/src/views/ProviderPage.vue +++ b/dashboard/src/views/ProviderPage.vue @@ -5,31 +5,50 @@

- mdi-creation{{ tm('title') }} + mdi-creation{{ tm("title") }}

- {{ tm('subtitle') }} + {{ tm("subtitle") }}

- - {{ tm('providers.addProvider') }} + + {{ tm("providers.addProvider") }}
- - + + {{ type.icon }} {{ type.label }} -
+
- -
+ +
-
{{ tm('providers.settings') }}
-
{{ selectedProviderSource.id }}
+
+ {{ tm("providers.settings") }} +
+
+ {{ selectedProviderSource.id }} +
- {{ selectedProviderSource.api_base || 'N/A' }} + {{ selectedProviderSource.api_base || "N/A" }}
@@ -65,7 +94,7 @@ @click="saveProviderSource" variant="tonal" > - {{ tm('providerSources.save') }} + {{ tm("providerSources.save") }}
@@ -74,15 +103,27 @@
- mdi-cursor-default-click -

{{ tm('providerSources.selectHint') }}

+ mdi-cursor-default-click +

{{ tm("providerSources.selectHint") }}

@@ -134,35 +177,77 @@
- - - + + @@ -173,20 +258,38 @@ - + - - + + - 取消 + 取消 添加 @@ -195,21 +298,36 @@ + :title=" + updatingMode + ? tm('dialogs.config.editTitle') + : tm('dialogs.config.addTitle') + + ` ${newSelectedProviderName} ` + + tm('dialogs.config.provider') + " + > - + - - {{ tm('dialogs.config.cancel') }} + + {{ tm("dialogs.config.cancel") }} - {{ tm('dialogs.config.save') }} + {{ tm("dialogs.config.save") }} @@ -219,25 +337,46 @@ - 不建议修改 ID,可能会导致指向该模型的相关配置(如默认模型、插件相关配置等)失效。旧版本 AstrBot 的 “提供商 ID” 是下方的 “ID”。 - + 不建议修改 + ID,可能会导致指向该模型的相关配置(如默认模型、插件相关配置等)失效。旧版本 + AstrBot 的 “提供商 ID” 是下方的 “ID”。 + - - {{ tm('dialogs.config.cancel') }} + + {{ tm("dialogs.config.cancel") }} - - {{ tm('dialogs.config.save') }} + + {{ tm("dialogs.config.save") }} - + {{ snackbar.message }} @@ -259,8 +398,15 @@ - 好的 - 点击前往 + 好的 + 点击前往 @@ -268,36 +414,36 @@ diff --git a/dashboard/src/views/WelcomePage.vue b/dashboard/src/views/WelcomePage.vue index 434bc8665..d440acf73 100644 --- a/dashboard/src/views/WelcomePage.vue +++ b/dashboard/src/views/WelcomePage.vue @@ -712,7 +712,8 @@ watch(showProviderDialog, async (visible, wasVisible) => { } @keyframes energyPulse { - 0%, 100% { + 0%, + 100% { opacity: 0.6; box-shadow: 0 0 6px rgba(0, 242, 255, 0.4); } diff --git a/dashboard/src/views/authentication/auth/LoginPage.vue b/dashboard/src/views/authentication/auth/LoginPage.vue index ea9955a0e..8b8e95626 100644 --- a/dashboard/src/views/authentication/auth/LoginPage.vue +++ b/dashboard/src/views/authentication/auth/LoginPage.vue @@ -1,23 +1,26 @@