diff --git a/dashboard/src/config.ts b/dashboard/src/config.ts index 9f70123a7..f52812ad8 100644 --- a/dashboard/src/config.ts +++ b/dashboard/src/config.ts @@ -8,10 +8,10 @@ export type ConfigProps = { }; function checkUITheme() { + /* 检查localStorage有无记忆的主题选项,如有则使用,否则使用默认值 */ const theme = localStorage.getItem("uiTheme"); - console.log('memorized theme: ', theme); if (!theme || !(['PurpleTheme', 'PurpleThemeDark'].includes(theme))) { - localStorage.setItem("uiTheme", "PurpleTheme"); + localStorage.setItem("uiTheme", "PurpleTheme"); // todo: 这部分可以根据vuetify.ts的默认主题动态调整 return 'PurpleTheme'; } else return theme; } diff --git a/dashboard/src/layouts/full/FullLayout.vue b/dashboard/src/layouts/full/FullLayout.vue index 0380b350e..a0754cafd 100644 --- a/dashboard/src/layouts/full/FullLayout.vue +++ b/dashboard/src/layouts/full/FullLayout.vue @@ -2,14 +2,13 @@ import { RouterView } from 'vue-router'; import VerticalSidebarVue from './vertical-sidebar/VerticalSidebar.vue'; import VerticalHeaderVue from './vertical-header/VerticalHeader.vue'; -import { useCustomizerStore } from '../../stores/customizer'; +import { useCustomizerStore } from '@/stores/customizer'; const customizer = useCustomizerStore(); @@ -265,6 +267,7 @@ export default { loading_: false, upload_file: null, pluginMarketData: [], + showPluginFullName: false, loadingDialog: { show: false, title: "加载中...", @@ -283,8 +286,8 @@ export default { pluginMarketHeaders: [ { title: '名称', key: 'name', maxWidth: '200px' }, { title: '描述', key: 'desc', maxWidth: '250px' }, - { title: '作者', key: 'author', maxWidth: '70px' }, - { title: 'Star数', key: 'stars', maxWidth: '100px' }, + { title: '作者', key: 'author', maxWidth: '90px' }, + { title: 'Star数', key: 'stars', maxWidth: '80px' }, { title: '最近更新', key: 'updated_at', maxWidth: '100px' }, { title: '标签', key: 'tags', maxWidth: '100px' }, { title: '操作', key: 'actions', sortable: false } @@ -319,6 +322,7 @@ export default { this.loading_ = true this.commonStore.getPluginCollections().then((data) => { this.pluginMarketData = data; + this.trimExtensionName(); this.checkAlreadyInstalled(); this.checkUpdate(); this.loading_ = false @@ -367,11 +371,23 @@ export default { getExtensions() { axios.get('/api/plugin/get').then((res) => { this.extension_data = res.data; + this.trimExtensionName(); this.checkAlreadyInstalled(); this.checkUpdate() }); }, - + trimExtensionName() { + this.pluginMarketData.forEach(plugin => { + if (plugin.name) { + let name = plugin.name.trim().toLowerCase(); + if (name.startsWith("astrbot_plugin_")) { + plugin.trimmedName = name.substring(15); + } else if (name.startsWith("astrbot_") || name.startsWith("astrbot-")) { + plugin.trimmedName = name.substring(8); + } else plugin.trimmedName = plugin.name; + } + }); + }, checkUpdate() { // 创建在线插件的map const onlinePluginsMap = new Map(); diff --git a/dashboard/src/views/dashboards/default/components/MessageStat.vue b/dashboard/src/views/dashboards/default/components/MessageStat.vue index 3f8bdfbed..2a7648613 100644 --- a/dashboard/src/views/dashboards/default/components/MessageStat.vue +++ b/dashboard/src/views/dashboards/default/components/MessageStat.vue @@ -69,6 +69,7 @@