diff --git a/astrbot/core/db/sqlite.py b/astrbot/core/db/sqlite.py index 418b35761..b915cffee 100644 --- a/astrbot/core/db/sqlite.py +++ b/astrbot/core/db/sqlite.py @@ -18,6 +18,7 @@ from sqlalchemy import select, update, delete, text from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy.sql import func +from sqlalchemy import or_ NOT_GIVEN = T.TypeVar("NOT_GIVEN") @@ -153,8 +154,21 @@ async def get_filtered_conversations( ConversationV2.platform_id.in_(platform_ids) ) if search_query: + search_query = search_query.encode("unicode_escape").decode("utf-8") base_query = base_query.where( - ConversationV2.title.ilike(f"%{search_query}%") + or_( + ConversationV2.title.ilike(f"%{search_query}%"), + ConversationV2.content.ilike(f"%{search_query}%"), + ) + ) + if "message_types" in kwargs and len(kwargs["message_types"]) > 0: + for msg_type in kwargs["message_types"]: + base_query = base_query.where( + ConversationV2.user_id.ilike(f"%:{msg_type}:%") + ) + if "platforms" in kwargs and len(kwargs["platforms"]) > 0: + base_query = base_query.where( + ConversationV2.platform_id.in_(kwargs["platforms"]) ) # Get total count matching the filters diff --git a/dashboard/src/i18n/locales/zh-CN/features/conversation.json b/dashboard/src/i18n/locales/zh-CN/features/conversation.json index 1b8039fbc..17c2e1245 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/conversation.json +++ b/dashboard/src/i18n/locales/zh-CN/features/conversation.json @@ -3,7 +3,7 @@ "subtitle": "管理和查看用户对话历史记录", "filters": { "title": "筛选条件", - "platform": "平台", + "platform": "消息平台 ID", "type": "类型", "search": "搜索关键词", "reset": "重置" @@ -15,9 +15,9 @@ "table": { "headers": { "title": "对话标题", - "platform": "平台", + "platform": "消息平台 ID", "type": "类型", - "sessionId": "ID", + "sessionId": "ID (UMO)", "createdAt": "创建时间", "updatedAt": "更新时间", "actions": "操作" diff --git a/dashboard/src/i18n/locales/zh-CN/features/session-management.json b/dashboard/src/i18n/locales/zh-CN/features/session-management.json index 4639117f4..c3364c5b0 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/session-management.json +++ b/dashboard/src/i18n/locales/zh-CN/features/session-management.json @@ -5,7 +5,7 @@ "refresh": "刷新", "edit": "编辑", "apply": "应用批量设置", - "editName": "编辑会话名称", + "editName": "备注", "save": "保存", "cancel": "取消" }, @@ -22,13 +22,13 @@ "table": { "headers": { "sessionStatus": "会话状态", - "sessionInfo": "会话信息", + "sessionInfo": "ID (UMO)", "persona": "人格", - "chatProvider": "Chat Provider", - "sttProvider": "STT Provider", - "ttsProvider": "TTS Provider", - "llmStatus": "LLM启停", - "ttsStatus": "TTS启停", + "chatProvider": "聊天模型", + "sttProvider": "语音识别模型", + "ttsProvider": "语音合成模型", + "llmStatus": "启用 LLM", + "ttsStatus": "启用 TTS", "pluginManagement": "插件管理" } }, diff --git a/dashboard/src/views/ConversationPage.vue b/dashboard/src/views/ConversationPage.vue index 3f35d91d2..9d93bb279 100644 --- a/dashboard/src/views/ConversationPage.vue +++ b/dashboard/src/views/ConversationPage.vue @@ -1,50 +1,29 @@