diff --git a/dashboard/src/i18n/locales/en-US/features/conversation.json b/dashboard/src/i18n/locales/en-US/features/conversation.json index ac6179bd0f..0d1144f32e 100644 --- a/dashboard/src/i18n/locales/en-US/features/conversation.json +++ b/dashboard/src/i18n/locales/en-US/features/conversation.json @@ -6,7 +6,8 @@ "platform": "Platform", "type": "Type", "search": "Search Keywords", - "reset": "Reset" + "reset": "Reset", + "includeWebchat": "Show WebChat conversations" }, "history": { "title": "Conversation History", @@ -117,6 +118,7 @@ "types": "Conversation type", "umo": "UMO", "umoPlaceholder": "Enter a full or partial UMO", + "includeWebchat": "Show WebChat conversations", "sort": "Sort", "reset": "Clear filters", "close": "Close filters", diff --git a/dashboard/src/i18n/locales/ru-RU/features/conversation.json b/dashboard/src/i18n/locales/ru-RU/features/conversation.json index 8afda742bb..71723cac82 100644 --- a/dashboard/src/i18n/locales/ru-RU/features/conversation.json +++ b/dashboard/src/i18n/locales/ru-RU/features/conversation.json @@ -6,7 +6,8 @@ "platform": "ID бота", "type": "Тип", "search": "Поиск по ключевым словам", - "reset": "Сбросить" + "reset": "Сбросить", + "includeWebchat": "Показывать WebChat-диалоги" }, "history": { "title": "История", @@ -117,6 +118,7 @@ "types": "Тип диалога", "umo": "UMO", "umoPlaceholder": "Введите UMO полностью или частично", + "includeWebchat": "Показывать WebChat-диалоги", "sort": "Сортировка", "reset": "Сбросить фильтры", "close": "Закрыть фильтры", diff --git a/dashboard/src/i18n/locales/zh-CN/features/conversation.json b/dashboard/src/i18n/locales/zh-CN/features/conversation.json index ef7ae0d7b0..ce03529987 100644 --- a/dashboard/src/i18n/locales/zh-CN/features/conversation.json +++ b/dashboard/src/i18n/locales/zh-CN/features/conversation.json @@ -6,7 +6,8 @@ "platform": "机器人 ID", "type": "类型", "search": "搜索关键词", - "reset": "重置" + "reset": "重置", + "includeWebchat": "显示 WebChat 对话" }, "history": { "title": "对话历史", @@ -117,6 +118,7 @@ "types": "对话类型", "umo": "UMO", "umoPlaceholder": "输入完整或部分 UMO", + "includeWebchat": "显示 WebChat 对话", "sort": "排序", "reset": "清除筛选", "close": "关闭筛选", diff --git a/dashboard/src/views/ConversationPage.vue b/dashboard/src/views/ConversationPage.vue index cb25012a37..da43b898f3 100644 --- a/dashboard/src/views/ConversationPage.vue +++ b/dashboard/src/views/ConversationPage.vue @@ -7,7 +7,7 @@ {{ tm('history.title') }} {{ pagination.total || 0 }} - + @@ -19,7 +19,7 @@ - + @@ -30,11 +30,16 @@ - + + + + + @@ -454,6 +459,7 @@ export default { // 筛选条件 platformFilter: [], messageTypeFilter: [], + showWebchat: false, // Whether to include WebChat platform conversations in the history list lastAppliedFilters: null, // 记录上次应用的筛选条件 // 分页数据 @@ -516,6 +522,10 @@ export default { this.invalidateConversationListRequest(); this.debouncedApplyFilters(); }, + showWebchat() { + this.invalidateConversationListRequest(); + this.debouncedApplyFilters(); + }, search() { this.invalidateConversationListRequest(); this.debouncedApplyFilters(); @@ -803,7 +813,9 @@ export default { } params.exclude_ids = 'astrbot'; - params.exclude_platforms = 'webchat'; + if (!this.showWebchat) { + params.exclude_platforms = 'webchat'; + } params.include_history = false; const response = await conversationApi.list(params, { diff --git a/dashboard/src/views/conversation/ConversationWorkspacePage.vue b/dashboard/src/views/conversation/ConversationWorkspacePage.vue index e8853729c3..92a25e623d 100644 --- a/dashboard/src/views/conversation/ConversationWorkspacePage.vue +++ b/dashboard/src/views/conversation/ConversationWorkspacePage.vue @@ -100,6 +100,7 @@ const umoQuery = ref( ); const sortValue = ref("updated_at:desc"); const groupBySession = ref(false); +const showWebchat = ref(false); const mobileFiltersOpen = ref(false); const expandedSessions = ref>({}); const page = ref(1); @@ -135,6 +136,7 @@ const hasFilters = computed( Boolean(umoQuery.value.trim()) || selectedBotIds.value.length > 0 || selectedTypes.value.length > 0 || + showWebchat.value || sortValue.value !== "updated_at:desc", ); const selectedItems = computed(() => Object.values(selectedByKey.value)); @@ -284,7 +286,7 @@ watch([keyword, umoQuery], () => { scheduleFetch(); }); -watch([selectedBotIds, selectedTypes, sortValue, groupBySession], () => { +watch([selectedBotIds, selectedTypes, sortValue, groupBySession, showWebchat], () => { cancelScheduledFetch(); page.value = 1; expandedSessions.value = @@ -419,7 +421,9 @@ async function fetchConversations() { params.umo = umoQuery.value.trim(); } else { params.exclude_ids = "astrbot"; - params.exclude_platforms = "webchat"; + if (!showWebchat.value) { + params.exclude_platforms = "webchat"; + } } if (selectedBotIds.value.length) { params.platforms = selectedBotIds.value.join(","); @@ -480,6 +484,7 @@ function resetFilters() { clearUmoQuery(); selectedBotIds.value = []; selectedTypes.value = []; + showWebchat.value = false; sortValue.value = "updated_at:desc"; page.value = 1; } @@ -948,6 +953,20 @@ function changePage(nextPage: number) { + + + {{ tm("workspace.filters.includeWebchat") }} + + + + {{ tm("workspace.filters.sort") }}