Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dashboard/src/i18n/locales/en-US/features/conversation.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"platform": "Platform",
"type": "Type",
"search": "Search Keywords",
"reset": "Reset"
"reset": "Reset",
"includeWebchat": "Show WebChat conversations"
},
"history": {
"title": "Conversation History",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion dashboard/src/i18n/locales/ru-RU/features/conversation.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"platform": "ID бота",
"type": "Тип",
"search": "Поиск по ключевым словам",
"reset": "Сбросить"
"reset": "Сбросить",
"includeWebchat": "Показывать WebChat-диалоги"
},
"history": {
"title": "История",
Expand Down Expand Up @@ -117,6 +118,7 @@
"types": "Тип диалога",
"umo": "UMO",
"umoPlaceholder": "Введите UMO полностью или частично",
"includeWebchat": "Показывать WebChat-диалоги",
"sort": "Сортировка",
"reset": "Сбросить фильтры",
"close": "Закрыть фильтры",
Expand Down
4 changes: 3 additions & 1 deletion dashboard/src/i18n/locales/zh-CN/features/conversation.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"platform": "机器人 ID",
"type": "类型",
"search": "搜索关键词",
"reset": "重置"
"reset": "重置",
"includeWebchat": "显示 WebChat 对话"
},
"history": {
"title": "对话历史",
Expand Down Expand Up @@ -117,6 +118,7 @@
"types": "对话类型",
"umo": "UMO",
"umoPlaceholder": "输入完整或部分 UMO",
"includeWebchat": "显示 WebChat 对话",
"sort": "排序",
"reset": "清除筛选",
"close": "关闭筛选",
Expand Down
20 changes: 16 additions & 4 deletions dashboard/src/views/ConversationPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<span class="text-h4">{{ tm('history.title') }}</span>
<v-chip size="small" class="ml-2">{{ pagination.total || 0 }}</v-chip>
<v-row class="me-4 ms-4" dense>
<v-col cols="12" sm="6" md="4">
<v-col cols="12" sm="6" md="3">
<v-combobox v-model="platformFilter" :label="tm('filters.platform')"
:items="availablePlatforms" chips multiple clearable variant="solo-filled" flat
density="compact" hide-details>
Expand All @@ -19,7 +19,7 @@
</v-combobox>
</v-col>

<v-col cols="12" sm="6" md="4">
<v-col cols="12" sm="6" md="3">
<v-select v-model="messageTypeFilter" :label="tm('filters.type')" :items="messageTypeItems"
chips multiple clearable variant="solo-filled" density="compact" hide-details flat>
<template v-slot:selection="{ item }">
Expand All @@ -30,11 +30,16 @@
</v-select>
</v-col>

<v-col cols="12" sm="12" md="4">
<v-col cols="12" sm="12" md="3">
<v-text-field v-model="search" prepend-inner-icon="mdi-magnify"
:label="tm('filters.search')" hide-details density="compact" variant="solo-filled" flat
clearable></v-text-field>
</v-col>

<v-col cols="12" sm="12" md="3">
<v-switch v-model="showWebchat" :label="tm('filters.includeWebchat')" color="primary"
density="compact" inset hide-details></v-switch>
</v-col>
</v-row>
<v-btn color="primary" prepend-icon="mdi-refresh" variant="tonal" @click="fetchConversations"
:loading="listLoading" size="small" class="mr-2">
Expand Down Expand Up @@ -454,6 +459,7 @@ export default {
// 筛选条件
platformFilter: [],
messageTypeFilter: [],
showWebchat: false, // Whether to include WebChat platform conversations in the history list
lastAppliedFilters: null, // 记录上次应用的筛选条件

// 分页数据
Expand Down Expand Up @@ -516,6 +522,10 @@ export default {
this.invalidateConversationListRequest();
this.debouncedApplyFilters();
},
showWebchat() {
this.invalidateConversationListRequest();
this.debouncedApplyFilters();
},
search() {
this.invalidateConversationListRequest();
this.debouncedApplyFilters();
Expand Down Expand Up @@ -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, {
Expand Down
23 changes: 21 additions & 2 deletions dashboard/src/views/conversation/ConversationWorkspacePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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<Record<string, boolean>>({});
const page = ref(1);
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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(",");
Expand Down Expand Up @@ -480,6 +484,7 @@ function resetFilters() {
clearUmoQuery();
selectedBotIds.value = [];
selectedTypes.value = [];
showWebchat.value = false;
sortValue.value = "updated_at:desc";
page.value = 1;
}
Expand Down Expand Up @@ -948,6 +953,20 @@ function changePage(nextPage: number) {
</v-text-field>
</div>

<div class="filter-block">
<div class="filter-label">
{{ tm("workspace.filters.includeWebchat") }}
</div>
<v-switch
v-model="showWebchat"
color="primary"
density="compact"
hide-details
inset
:aria-label="tm('workspace.filters.includeWebchat')"
/>
</div>

<div class="filter-block filter-block--last">
<label class="filter-label" for="conversation-sort">
{{ tm("workspace.filters.sort") }}
Expand Down