From 1b9820af44998df275fd11e6e6ac3297bd70fcf8 Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Wed, 18 Mar 2026 20:12:22 +0800 Subject: [PATCH] feat: update dashboard --- astrbot/dashboard/server.py | 4 +- dashboard/.eslintignore | 29 + dashboard/.eslintrc.cjs | 149 + dashboard/src/App.vue | 26 +- dashboard/src/components/ConfirmDialog.vue | 25 +- dashboard/src/components/chat/Chat.vue | 465 +-- dashboard/src/components/chat/ChatInput.vue | 406 ++- .../src/components/chat/ConfigSelector.vue | 175 +- .../components/chat/ConversationSidebar.vue | 725 +++-- dashboard/src/components/chat/LiveMode.vue | 83 +- dashboard/src/components/chat/LiveOrb.vue | 144 +- dashboard/src/components/chat/MessageList.vue | 2611 +++++++++-------- .../src/components/chat/ProjectDialog.vue | 76 +- dashboard/src/components/chat/ProjectList.vue | 118 +- dashboard/src/components/chat/ProjectView.vue | 113 +- .../components/chat/ProviderConfigDialog.vue | 228 +- .../src/components/chat/ProviderModelMenu.vue | 169 +- .../src/components/chat/StandaloneChat.vue | 46 +- dashboard/src/components/chat/WelcomeView.vue | 51 +- .../chat/message_list_comps/ActionRef.vue | 51 +- .../message_list_comps/IPythonToolBlock.vue | 51 +- .../MessagePartsRenderer.vue | 307 +- .../message_list_comps/ReasoningBlock.vue | 45 +- .../chat/message_list_comps/RefNode.vue | 32 +- .../chat/message_list_comps/RefsSidebar.vue | 80 +- .../chat/message_list_comps/ToolCallCard.vue | 148 +- .../chat/message_list_comps/ToolCallItem.vue | 35 +- .../config/AstrBotCoreConfigWrapper.vue | 108 +- .../config/UnsavedChangesConfirmDialog.vue | 33 +- .../components/extension/MarketPluginCard.vue | 63 +- .../extension/McpServersSection.vue | 344 ++- .../extension/PluginSortControl.vue | 17 +- .../components/extension/SkillsSection.vue | 240 +- .../components/CommandFilters.vue | 67 +- .../components/CommandTable.vue | 133 +- .../components/DetailsDialog.vue | 82 +- .../components/RenameDialog.vue | 54 +- .../componentPanel/components/ToolTable.vue | 120 +- .../composables/useComponentData.ts | 2 +- .../extension/componentPanel/index.vue | 113 +- .../folder/BaseCreateFolderDialog.vue | 81 +- .../folder/BaseFolderBreadcrumb.vue | 49 +- .../src/components/folder/BaseFolderCard.vue | 129 +- .../folder/BaseFolderItemSelector.vue | 473 ++- .../src/components/folder/BaseFolderTree.vue | 192 +- .../components/folder/BaseFolderTreeNode.vue | 89 +- .../components/folder/BaseMoveTargetNode.vue | 75 +- .../folder/BaseMoveToFolderDialog.vue | 124 +- .../components/platform/AddNewPlatform.vue | 502 +++- .../components/provider/AddNewProvider.vue | 200 +- .../provider/ProviderModelsPanel.vue | 234 +- .../provider/ProviderSourcesPanel.vue | 112 +- .../src/components/shared/AstrBotConfig.vue | 155 +- .../src/components/shared/AstrBotConfigV4.vue | 132 +- .../src/components/shared/BackupDialog.vue | 1014 ++++--- .../src/components/shared/ChangelogDialog.vue | 72 +- .../components/shared/ConfigItemRenderer.vue | 118 +- .../components/shared/ConsoleDisplayer.vue | 49 +- .../src/components/shared/ExtensionCard.vue | 180 +- .../src/components/shared/FileConfigItem.vue | 109 +- dashboard/src/components/shared/ItemCard.vue | 87 +- .../src/components/shared/ItemCardGrid.vue | 69 +- .../shared/KnowledgeBaseSelector.vue | 116 +- .../components/shared/LanguageSwitcher.vue | 16 +- .../src/components/shared/ListConfigItem.vue | 175 +- dashboard/src/components/shared/Logo.vue | 16 +- .../src/components/shared/MigrationDialog.vue | 288 +- .../src/components/shared/ObjectEditor.vue | 193 +- .../src/components/shared/PersonaForm.vue | 861 ++++-- .../components/shared/PersonaQuickPreview.vue | 74 +- .../src/components/shared/PersonaSelector.vue | 5 +- .../components/shared/PluginPlatformChip.vue | 52 +- .../components/shared/PluginSetSelector.vue | 102 +- .../components/shared/ProviderSelector.vue | 126 +- .../src/components/shared/ProxySelector.vue | 247 +- .../src/components/shared/ReadmeDialog.vue | 88 +- .../components/shared/SidebarCustomizer.vue | 57 +- .../src/components/shared/StyledMenu.vue | 25 +- .../components/shared/T2ITemplateEditor.vue | 181 +- .../components/shared/TemplateListEditor.vue | 87 +- .../src/components/shared/TraceDisplayer.vue | 112 +- .../shared/UninstallConfirmDialog.vue | 34 +- .../components/shared/WaitingForRestart.vue | 23 +- dashboard/src/composables/useConversations.ts | 2 +- dashboard/src/composables/useMessages.ts | 14 +- dashboard/src/composables/useSessions.ts | 2 +- dashboard/src/i18n/tools/index.ts | 2 +- dashboard/src/i18n/validator.ts | 4 +- dashboard/src/layouts/full/FullLayout.vue | 21 +- .../full/vertical-header/VerticalHeader.vue | 269 +- .../layouts/full/vertical-sidebar/NavItem.vue | 75 +- .../full/vertical-sidebar/VerticalSidebar.vue | 92 +- dashboard/src/main.ts | 2 +- dashboard/src/stores/auth.ts | 1 - dashboard/src/stores/common.js | 3 +- dashboard/src/utils/pluginSearch.js | 6 +- dashboard/src/views/AboutPage.vue | 51 +- dashboard/src/views/AlkaidPage.vue | 77 +- dashboard/src/views/ChatBoxPage.vue | 20 +- dashboard/src/views/ChatPage.vue | 6 +- dashboard/src/views/ConfigPage.vue | 429 ++- dashboard/src/views/ConsolePage.vue | 46 +- dashboard/src/views/ConversationPage.vue | 887 ++++-- dashboard/src/views/CronJobPage.vue | 222 +- dashboard/src/views/ExtensionPage.vue | 536 +++- dashboard/src/views/PersonaPage.vue | 42 +- dashboard/src/views/PlatformPage.vue | 233 +- dashboard/src/views/ProviderPage.vue | 359 ++- dashboard/src/views/SessionManagementPage.vue | 1046 +++++-- dashboard/src/views/Settings.vue | 152 +- dashboard/src/views/SubAgentPage.vue | 133 +- dashboard/src/views/TracePage.vue | 8 +- dashboard/src/views/WelcomePage.vue | 68 +- dashboard/src/views/alkaid/KnowledgeBase.vue | 1209 +++++--- dashboard/src/views/alkaid/LongTermMemory.vue | 368 ++- dashboard/src/views/alkaid/Other.vue | 15 +- .../views/authentication/auth/LoginPage.vue | 88 +- .../authentication/authForms/AuthLogin.vue | 60 +- .../dashboards/default/DefaultDashboard.vue | 48 +- .../default/components/MemoryUsage.vue | 32 +- .../default/components/MessageStat.vue | 85 +- .../default/components/OnlinePlatform.vue | 22 +- .../default/components/OnlineTime.vue | 65 +- .../default/components/PlatformStat.vue | 85 +- .../default/components/RunningTime.vue | 22 +- .../default/components/TotalMessage.vue | 29 +- .../views/extension/InstalledPluginsTab.vue | 1076 +++---- .../src/views/extension/MarketPluginsTab.vue | 416 +-- .../src/views/extension/useExtensionPage.js | 1 + .../views/knowledge-base/DocumentDetail.vue | 176 +- .../src/views/knowledge-base/KBDetail.vue | 128 +- dashboard/src/views/knowledge-base/KBList.vue | 293 +- .../components/DocumentsTab.vue | 414 ++- .../components/RetrievalTab.vue | 188 +- .../knowledge-base/components/SettingsTab.vue | 97 +- .../components/TavilyKeyDialog.vue | 24 +- dashboard/src/views/knowledge-base/index.vue | 10 +- .../src/views/persona/CreateFolderDialog.vue | 9 +- .../src/views/persona/FolderBreadcrumb.vue | 49 +- dashboard/src/views/persona/FolderCard.vue | 129 +- dashboard/src/views/persona/FolderTree.vue | 316 +- .../src/views/persona/FolderTreeNode.vue | 20 +- .../src/views/persona/MoveTargetNode.vue | 9 +- .../src/views/persona/MoveToFolderDialog.vue | 124 +- dashboard/src/views/persona/PersonaCard.vue | 210 +- .../src/views/persona/PersonaManager.vue | 818 ++++-- dashboard/tsconfig.eslint.json | 26 + dashboard/vite.config.ts | 3 +- 148 files changed, 17917 insertions(+), 8446 deletions(-) create mode 100644 dashboard/.eslintignore create mode 100644 dashboard/.eslintrc.cjs create mode 100644 dashboard/tsconfig.eslint.json diff --git a/astrbot/dashboard/server.py b/astrbot/dashboard/server.py index 2b6040aa3..c7e7be3c0 100644 --- a/astrbot/dashboard/server.py +++ b/astrbot/dashboard/server.py @@ -151,7 +151,7 @@ class AstrBotDashboard: @self.app.route("/") async def index(): if not self.enable_webui: - return "WebUI is disabled." + return "Buildin WebUI is disabled." try: return await self.app.send_static_file("index.html") except werkzeug.exceptions.NotFound: @@ -161,7 +161,7 @@ class AstrBotDashboard: @self.app.errorhandler(404) async def not_found(e): if not self.enable_webui: - return "WebUI is disabled." + return "Buildin WebUI is disabled." if request.path.startswith("/api/"): return jsonify(Response().error("Not Found").to_json()), 404 try: diff --git a/dashboard/.eslintignore b/dashboard/.eslintignore new file mode 100644 index 000000000..3e7871a3a --- /dev/null +++ b/dashboard/.eslintignore @@ -0,0 +1,29 @@ +# ESLint ignore file for AstrBot dashboard +# Skip dependency directories and build artifacts + +node_modules/ +dist/ +build/ +public/ +coverage/ +.vite/ +.cache/ +*.min.js +*.bundle.js +*.map + +# Dashboard-specific artifacts (when lint is run from repo root using --prefix) +dashboard/dist/ +dashboard/node_modules/ + +# Generated TypeScript declaration used by environment - can cause parser issues in some setups +env.d.ts + +# Scripts and tooling files (often use newer syntax or are run in node env) +scripts/**/*.mjs +scripts/**/*.cjs + +# Misc +*.log +.idea/ +.vscode/ diff --git a/dashboard/.eslintrc.cjs b/dashboard/.eslintrc.cjs new file mode 100644 index 000000000..28944a0f4 --- /dev/null +++ b/dashboard/.eslintrc.cjs @@ -0,0 +1,149 @@ +module.exports = { + root: true, + env: { + browser: true, + node: true, + es2021: true, + }, + + // Use vue-eslint-parser so .vue SFCs are parsed correctly. + parser: "vue-eslint-parser", + + parserOptions: { + // vue-eslint-parser will forward the script content to this parser + parser: "@typescript-eslint/parser", + ecmaVersion: "latest", + sourceType: "module", + extraFileExtensions: [".vue"], + ecmaFeatures: { + jsx: true, + }, + // NOTE: Intentionally NO `project` here to avoid requiring type-aware linting. + // This keeps eslint fast and avoids the TSConfig inclusion errors. + }, + + plugins: ["vue", "@typescript-eslint"], + + extends: [ + "eslint:recommended", + "plugin:vue/vue3-recommended", + "plugin:@typescript-eslint/recommended", + // Intentionally not extending type-aware or prettier-requiring configs. + ], + + settings: { + // Allow using Vue compiler macros like defineProps/defineEmits in templates + "vue/setup-compiler-macros": true, + }, + + // Avoid linting build artifacts and generated files + ignorePatterns: [ + "dist/", + "build/", + "node_modules/", + "public/", + "dashboard/dist/", + "dashboard/node_modules/", + "env.d.ts", + "scripts/**/*.mjs", + ".vite/", + ".cache/", + ], + + rules: { + // Keep console/debug permissible but warned + "no-console": ["warn", { allow: ["warn", "error", "info"] }], + "no-debugger": "warn", + + // TypeScript rules (relaxed) + "@typescript-eslint/no-unused-vars": [ + "warn", + { + argsIgnorePattern: "^_", + varsIgnorePattern: "^_", + caughtErrorsIgnorePattern: "^_", + }, + ], + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/no-explicit-any": "off", + + // Vue rules adjustments — relax a few rules that generate a lot of noise + // These are intentionally relaxed to allow incremental, safe fixes of template code. + "vue/multi-word-component-names": "off", + "vue/html-self-closing": [ + "error", + { + html: { + void: "never", + normal: "always", + component: "always", + }, + svg: "always", + math: "always", + }, + ], + + // Reduce template noise for legacy / Vuetify patterns used across this codebase + "vue/valid-v-slot": "off", + "vue/v-on-event-hyphenation": "off", + "vue/no-unused-components": "off", + // Broadly disable unused vars detection for templates to avoid false positives from compiled/generated template usage + "vue/no-unused-vars": "off", + "vue/require-default-prop": "off", + // Keep v-html as a warn so security-sensitive usage is highlighted + "vue/no-v-html": "warn", + }, + + overrides: [ + // Vue Single File Components + { + files: ["*.vue", "src/**/*.vue"], + parser: "vue-eslint-parser", + parserOptions: { + parser: "@typescript-eslint/parser", + extraFileExtensions: [".vue"], + ecmaVersion: "latest", + sourceType: "module", + // Enable type-aware rules for script blocks inside .vue files + project: "./tsconfig.eslint.json", + tsconfigRootDir: __dirname, + }, + rules: { + // Component/template specific overrides can go here + }, + }, + + // TypeScript files (no project required) + { + files: ["*.ts", "*.tsx", "src/**/*.ts", "src/**/*.tsx"], + parser: "@typescript-eslint/parser", + parserOptions: { + ecmaVersion: "latest", + sourceType: "module", + // Use type-aware linting for TS files via the dedicated tsconfig for ESLint + project: "./tsconfig.eslint.json", + tsconfigRootDir: __dirname, + }, + rules: { + // Project-specific relaxations for TS files + }, + }, + + // Node scripts / tooling + { + files: ["scripts/**/*.mjs", "scripts/**/*.cjs", "*.cjs"], + env: { node: true }, + parserOptions: { sourceType: "module" }, + }, + // Disable strict v-slot validation for extension component panels where shorthand slots are used + { + files: [ + "src/components/extension/componentPanel/**", + "src/components/extension/**", + ], + rules: { + "vue/valid-v-slot": "off", + }, + }, + ], +}; diff --git a/dashboard/src/App.vue b/dashboard/src/App.vue index 4822d8489..12c622e4a 100644 --- a/dashboard/src/App.vue +++ b/dashboard/src/App.vue @@ -1,14 +1,28 @@