Skip to content

Commit 89c8821

Browse files
committed
feat: Support searching application conversation logs by user
1 parent 934c615 commit 89c8821

File tree

4 files changed

+32
-9
lines changed

4 files changed

+32
-9
lines changed

ui/src/locales/lang/en-US/views/chat-log.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default {
1212
},
1313
table: {
1414
abstract: 'Title',
15+
username: 'User',
1516
chat_record_count: 'Total Messages',
1617
user: 'User',
1718
feedback: {

ui/src/locales/lang/zh-CN/views/chat-log.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default {
1212
},
1313
table: {
1414
abstract: '摘要',
15+
username: '用户',
1516
chat_record_count: '对话提问数',
1617
user: '用户',
1718
feedback: {

ui/src/locales/lang/zh-Hant/views/chat-log.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default {
1212
},
1313
table: {
1414
abstract: '摘要',
15+
username: '用戶',
1516
chat_record_count: '對話提問數',
1617
user: '用戶',
1718
feedback: {

ui/src/views/chat-log/index.vue

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44

55
<el-card style="--el-card-padding: 24px">
66
<div class="mb-16">
7+
<el-select
8+
v-model="query_option"
9+
class="mr-12"
10+
@change="search_type_change"
11+
style="width: 75px"
12+
>
13+
<el-option :label="$t('views.chatLog.table.abstract')" value="abstract" />
14+
<el-option :label="$t('views.chatLog.table.username')" value="username" />
15+
</el-select>
16+
<el-input
17+
v-model="search"
18+
@change="getList"
19+
:placeholder="$t('common.search')"
20+
prefix-icon="Search"
21+
class="w-240 mr-12"
22+
clearable
23+
/>
724
<el-select
825
v-model="history_day"
926
class="mr-12"
@@ -29,14 +46,6 @@
2946
style="width: 240px"
3047
class="mr-12"
3148
/>
32-
<el-input
33-
v-model="search"
34-
@change="getList"
35-
:placeholder="$t('common.search')"
36-
prefix-icon="Search"
37-
class="w-240"
38-
clearable
39-
/>
4049
<div style="display: flex; align-items: center" class="float-right">
4150
<el-button @click="dialogVisible = true" v-if="permissionPrecise.chat_log_clear(id)">
4251
{{ $t('views.chatLog.buttons.clearStrategy') }}
@@ -256,6 +265,15 @@ const {
256265
const emit = defineEmits(['refresh'])
257266
const formRef = ref()
258267
268+
const search_form = ref<any>({
269+
abstract: '',
270+
username: '',
271+
})
272+
273+
const search_type_change = () => {
274+
search_form.value = {abstract: '', username: ''}
275+
}
276+
259277
const dayOptions = [
260278
{
261279
value: 7,
@@ -308,6 +326,7 @@ const tableIndexMap = computed<Dict<number>>(() => {
308326
.reduce((pre, next) => ({ ...pre, ...next }), {})
309327
})
310328
const history_day = ref<number | string>(7)
329+
const query_option = ref<string>('abstract')
311330
312331
const search = ref('')
313332
const detail = ref<any>(null)
@@ -416,7 +435,8 @@ function getList() {
416435
...filter.value,
417436
}
418437
if (search.value) {
419-
obj = { ...obj, abstract: search.value }
438+
if (query_option.value === 'abstract'){obj = { ...obj, abstract: search.value }}
439+
else if (query_option.value === 'username'){obj = { ...obj, username: search.value }}
420440
}
421441
return loadSharedApi({ type: 'chatLog', systemType: apiType.value })
422442
.getChatLog(id as string, paginationConfig, obj, loading)

0 commit comments

Comments
 (0)