From 11cb9ccb2646a57f923f7193a9bb9bd1126f11fe Mon Sep 17 00:00:00 2001
From: Shell <1592363624@qq.com>
Date: Tue, 21 Oct 2025 13:51:31 +0800
Subject: [PATCH] =?UTF-8?q?=E5=9C=A8WebUI=E7=95=8C=E9=9D=A2=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=20=E9=9A=90=E8=97=8F/=E6=98=BE=E7=A4=BA=20=E5=B7=B2?=
=?UTF-8?q?=E7=A6=81=E7=94=A8=E6=8F=92=E4=BB=B6=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../dashboard/routes/session_management.py | 6 +++-
.../locales/zh-CN/features/extension.json | 2 ++
dashboard/src/views/ExtensionPage.vue | 35 +++++++++++++++----
3 files changed, 35 insertions(+), 8 deletions(-)
diff --git a/astrbot/dashboard/routes/session_management.py b/astrbot/dashboard/routes/session_management.py
index 1d632171d..8396e9df0 100644
--- a/astrbot/dashboard/routes/session_management.py
+++ b/astrbot/dashboard/routes/session_management.py
@@ -8,7 +8,6 @@
from astrbot.core.provider.entities import ProviderType
from astrbot.core.star.session_llm_manager import SessionServiceManager
from astrbot.core.star.session_plugin_manager import SessionPluginManager
-
from .route import Response, Route, RouteContext
@@ -371,6 +370,7 @@ async def get_session_plugins(self):
"""获取指定会话的插件配置信息"""
try:
session_id = request.args.get("session_id")
+ hide_disabled = request.args.get("hide_disabled", "false").lower() == "true"
if not session_id:
return Response().error("缺少必要参数: session_id").__dict__
@@ -387,6 +387,10 @@ async def get_session_plugins(self):
session_id, plugin_name
)
+ # 如果启用了隐藏已禁用插件选项,则跳过已禁用的插件
+ if hide_disabled and not plugin_enabled:
+ continue
+
all_plugins.append(
{
"name": plugin_name,
diff --git a/dashboard/src/i18n/locales/zh-CN/features/extension.json b/dashboard/src/i18n/locales/zh-CN/features/extension.json
index 7b1cb6f84..1674eb67e 100644
--- a/dashboard/src/i18n/locales/zh-CN/features/extension.json
+++ b/dashboard/src/i18n/locales/zh-CN/features/extension.json
@@ -16,6 +16,8 @@
"buttons": {
"showSystemPlugins": "显示系统插件",
"hideSystemPlugins": "隐藏系统插件",
+ "hideDisabledPlugins": "隐藏已禁用插件",
+ "showDisabledPlugins": "显示已禁用插件",
"install": "安装",
"uninstall": "卸载",
"update": "更新",
diff --git a/dashboard/src/views/ExtensionPage.vue b/dashboard/src/views/ExtensionPage.vue
index c608960c4..d2b1105f6 100644
--- a/dashboard/src/views/ExtensionPage.vue
+++ b/dashboard/src/views/ExtensionPage.vue
@@ -5,11 +5,11 @@ import ConsoleDisplayer from '@/components/shared/ConsoleDisplayer.vue';
import ReadmeDialog from '@/components/shared/ReadmeDialog.vue';
import ProxySelector from '@/components/shared/ProxySelector.vue';
import axios from 'axios';
-import { pinyin } from 'pinyin-pro';
-import { useCommonStore } from '@/stores/common';
-import { useI18n, useModuleI18n } from '@/i18n/composables';
+import {pinyin} from 'pinyin-pro';
+import {useCommonStore} from '@/stores/common';
+import {useI18n, useModuleI18n} from '@/i18n/composables';
-import { ref, computed, onMounted, reactive } from 'vue';
+import {computed, onMounted, reactive, ref} from 'vue';
const commonStore = useCommonStore();
@@ -22,6 +22,7 @@ const extension_data = reactive({
message: ""
});
const showReserved = ref(false);
+const hideDisabled = ref(false);
const snack_message = ref("");
const snack_show = ref(false);
const snack_success = ref("success");
@@ -124,10 +125,17 @@ const pluginMarketHeaders = computed(() => [
// 过滤要显示的插件
const filteredExtensions = computed(() => {
+ let result = extension_data?.data || [];
+
if (!showReserved.value) {
- return extension_data?.data?.filter(ext => !ext.reserved) || [];
+ result = result.filter(ext => !ext.reserved);
+ }
+
+ if (!hideDisabled.value) {
+ result = result.filter(ext => ext.activated);
}
- return extension_data.data || [];
+
+ return result;
});
// 通过搜索过滤插件
@@ -153,6 +161,10 @@ const toggleShowReserved = () => {
showReserved.value = !showReserved.value;
};
+const toggleHideDisabled = () => {
+ hideDisabled.value = !hideDisabled.value;
+};
+
const toast = (message, success) => {
snack_message.value = message;
snack_show.value = true;
@@ -176,7 +188,11 @@ const onLoadingDialogResult = (statusCode, result, timeToClose = 2000) => {
const getExtensions = async () => {
loading_.value = true;
try {
- const res = await axios.get('/api/plugin/get');
+ const res = await axios.get('/api/plugin/get', {
+ params: {
+ hide_disabled: false // 强制获取所有插件,在前端过滤
+ }
+ });
Object.assign(extension_data, res.data);
checkUpdate();
} catch (err) {
@@ -595,6 +611,11 @@ onMounted(async () => {
{{ showReserved ? tm('buttons.hideSystemPlugins') : tm('buttons.showSystemPlugins') }}
+
+ {{ hideDisabled ? 'mdi-eye-off' : 'mdi-eye' }}
+ {{ hideDisabled ? tm('buttons.hideDisabledPlugins') : tm('buttons.showDisabledPlugins') }}
+
+
mdi-plus
{{ tm('buttons.install') }}