Skip to content

Commit e715e24

Browse files
perf: Optimize
* fix: New conversation user, user group should be a mandatory field(#3833) * fix: Filter empty files uploaded during application dialogue(#3836) * fix: License not uploaded, knowledge base hits test interface style issue(#3852) * perf: Optimize packaging --------- Co-authored-by: wangdan-fit2cloud <[email protected]>
1 parent c8ec7c5 commit e715e24

File tree

13 files changed

+62
-15
lines changed

13 files changed

+62
-15
lines changed

ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"screenfull": "^6.0.2",
4545
"sortablejs": "^1.15.6",
4646
"use-element-plus-theme": "^0.0.5",
47+
"vite-plugin-compression": "^0.5.1",
4748
"vite-plugin-html": "^3.2.2",
4849
"vue": "^3.5.13",
4950
"vue-clipboard3": "^2.0.0",

ui/src/components/ai-chat/component/chat-input-operate/index.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,16 +421,29 @@ const uploadFile = async (file: any, fileList: any) => {
421421
uploadAudioList.value.length +
422422
uploadVideoList.value.length +
423423
uploadOtherList.value.length
424+
424425
if (file_limit_once >= maxFiles) {
425426
MsgWarning(t('chat.uploadFile.limitMessage1') + maxFiles + t('chat.uploadFile.limitMessage2'))
426427
fileList.splice(0, fileList.length, ...fileList.slice(0, maxFiles))
427428
return
428429
}
430+
console.log(fileList)
431+
if (fileList.filter((f: any) => f.size == 0).length > 0) {
432+
// MB
433+
MsgWarning(t('chat.uploadFile.sizeLimit2') + fileLimit + 'MB')
434+
// 只保留未超出大小限制的文件
435+
fileList.splice(0, fileList.length, ...fileList.filter((f: any) => f.size > 0))
436+
return
437+
}
429438
if (fileList.filter((f: any) => f.size > fileLimit * 1024 * 1024).length > 0) {
430439
// MB
431440
MsgWarning(t('chat.uploadFile.sizeLimit') + fileLimit + 'MB')
432441
// 只保留未超出大小限制的文件
433-
fileList.splice(0, fileList.length, ...fileList.filter((f: any) => f.size <= fileLimit * 1024 * 1024))
442+
fileList.splice(
443+
0,
444+
fileList.length,
445+
...fileList.filter((f: any) => f.size <= fileLimit * 1024 * 1024),
446+
)
434447
return
435448
}
436449
const inner = reactive(file)

ui/src/locales/lang/en-US/ai-chat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export default {
6666
limitMessage1: 'You can upload up to',
6767
limitMessage2: 'files',
6868
sizeLimit: 'Each file must not exceed',
69+
sizeLimit2: 'Empty files are not supported for upload',
6970
imageMessage: 'Please process the image content',
7071
fileMessage: 'Please process the file content',
7172
errorMessage: 'Upload Failed',

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ export default {
33
syncUsers: 'Sync Users',
44
syncUsersTip: 'Only sync newly added users',
55
setUserGroups: 'Configure User Groups',
6-
knowledgeTitleTip: 'This configuration will only take effect after enabling chat user login authentication in the associated application',
7-
applicationTitleTip: 'This configuration requires login authentication to be enabled in the application',
6+
knowledgeTitleTip:
7+
'This configuration will only take effect after enabling chat user login authentication in the associated application',
8+
applicationTitleTip:
9+
'This configuration requires login authentication to be enabled in the application',
810
autoAuthorization: 'Auto Authorization',
911
authorization: 'Authorization',
1012
batchDeleteUser: 'Delete selected {count} users?',
@@ -14,16 +16,18 @@ export default {
1416
group: {
1517
title: 'User Groups',
1618
name: 'User Group Name',
19+
requiredMessage: 'Please select user group',
1720
usernameOrName: 'Username/Name',
1821
delete: {
1922
confirmTitle: 'Confirm to delete user group:',
20-
confirmMessage: 'All members in this group will be removed after deletion. Proceed with caution!',
23+
confirmMessage:
24+
'All members in this group will be removed after deletion. Proceed with caution!',
2125
},
2226
batchDeleteMember: 'Remove selected {count} members?',
2327
},
2428
syncMessage: {
2529
title: 'Successfully synced {count} users',
2630
usernameExist: 'The following usernames already exist:',
2731
nicknameExist: 'The following nicknames already exist:',
28-
}
32+
},
2933
}

ui/src/locales/lang/zh-CN/ai-chat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export default {
6868
limitMessage1: '最多上传',
6969
limitMessage2: '个文件',
7070
sizeLimit: '单个文件大小不能超过',
71+
sizeLimit2: '空文件不支持上传',
7172
imageMessage: '请解析图片内容',
7273
fileMessage: '请解析文件内容',
7374
errorMessage: '上传失败',

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default {
1313
replace: '替换',
1414
group: {
1515
title: '用户组',
16+
requiredMessage: '请选择用户组',
1617
name: '用户组名称',
1718
usernameOrName: '用户名/姓名',
1819
delete: {
@@ -25,5 +26,5 @@ export default {
2526
title: '成功同步 {count} 个用户',
2627
usernameExist: '以下用户名已存在:',
2728
nicknameExist: '以下姓名已存在:',
28-
}
29+
},
2930
}

ui/src/locales/lang/zh-Hant/ai-chat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export default {
6464
limitMessage1: '最多上傳',
6565
limitMessage2: '個文件',
6666
sizeLimit: '單個文件大小不能超過',
67+
sizeLimit2: '空文件不支持上傳',
6768
imageMessage: '請解析圖片內容',
6869
fileMessage: '請解析文件內容',
6970
errorMessage: '上傳失敗',

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default {
1313
replace: '替換',
1414
group: {
1515
title: '用戶組',
16+
requiredMessage: '請選擇用戶組',
1617
name: '用戶組名稱',
1718
usernameOrName: '用戶名/姓名',
1819
delete: {
@@ -25,5 +26,5 @@ export default {
2526
title: '成功同步 {count} 個用戶',
2627
usernameExist: '以下用戶名已存在:',
2728
nicknameExist: '以下姓名已存在:',
28-
}
29+
},
2930
}

ui/src/styles/element-plus.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,3 +287,13 @@
287287
.el-input {
288288
--el-input-text-color: var(--el-text-color-primary);
289289
}
290+
291+
.el-input-group__prepend div.el-select .el-select__wrapper {
292+
background: #ffffff;
293+
&:hover {
294+
background: #ffffff;
295+
}
296+
.el-select__placeholder {
297+
color: var(--el-text-color-regular);
298+
}
299+
}

ui/src/views/hit-test/index.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</div>
2323
</div>
2424
<el-scrollbar>
25-
<div class="hit-test-height">
25+
<div :style="{ height: user.isExpire() ? 'calc(100vh - 340px)' : 'calc(100vh - 300px)' }">
2626
<el-empty
2727
v-if="first"
2828
:image="emptyImg"
@@ -231,6 +231,7 @@
231231
<script setup lang="ts">
232232
import { nextTick, ref, onMounted, computed } from 'vue'
233233
import { useRoute } from 'vue-router'
234+
import useStore from '@/stores'
234235
import { cloneDeep } from 'lodash'
235236
import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
236237
import { arraySort } from '@/utils/array'
@@ -241,6 +242,7 @@ const route = useRoute()
241242
const {
242243
params: { id },
243244
} = route as any
245+
const { user } = useStore()
244246
const apiType = computed(() => {
245247
if (route.path.includes('shared')) {
246248
return 'systemShare'
@@ -408,10 +410,6 @@ onMounted(() => {})
408410
position: absolute;
409411
right: calc(var(--app-base-px) * 3);
410412
}
411-
412-
.hit-test-height {
413-
height: calc(100vh - 300px);
414-
}
415413
.document-card {
416414
height: 210px;
417415
border: 1px solid var(--app-layout-bg-color);

0 commit comments

Comments
 (0)