Skip to content

Commit cdc086c

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 57b3e62 + e283803 commit cdc086c

File tree

13 files changed

+65
-17
lines changed

13 files changed

+65
-17
lines changed

backend/apps/system/api/assistant.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,15 @@ async def ui(session: SessionDep, data: str = Form(), files: List[UploadFile] =
125125
file_name, flag_name = SQLBotFileUtils.split_filename_and_flag(origin_file_name)
126126
file.filename = file_name
127127
if flag_name == 'logo' or flag_name == 'float_icon':
128-
SQLBotFileUtils.check_file(file=file, file_types=[".jpg", ".jpeg", ".png", ".svg"],
129-
limit_file_size=(10 * 1024 * 1024))
128+
try:
129+
SQLBotFileUtils.check_file(file=file, file_types=[".jpg", ".png", ".svg"],
130+
limit_file_size=(10 * 1024 * 1024))
131+
except ValueError as e:
132+
error_msg = str(e)
133+
if '文件大小超过限制' in error_msg:
134+
raise ValueError(f"文件大小超过限制(最大 10 M)")
135+
else:
136+
raise e
130137
if config_obj.get(flag_name):
131138
SQLBotFileUtils.delete_file(config_obj.get(flag_name))
132139
file_id = await SQLBotFileUtils.upload(file)

frontend/src/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@
465465
"import": "Import",
466466
"change_file": "Change file",
467467
"data_import_completed": "Data import completed",
468+
"notes_import_completed": "Import of notes complete",
468469
"imported_100_data": "Successfully imported {msg} data",
469470
"return_to_view": "Return to view",
470471
"continue_importing": "Continue importing",

frontend/src/i18n/ko-KR.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@
465465
"import": "가져오기",
466466
"change_file": "파일 변경",
467467
"data_import_completed": "데이터 가져오기 완료",
468+
"notes_import_completed": "메모 가져오기 완료",
468469
"imported_100_data": "데이터 {msg}개를 성공적으로 가져왔습니다",
469470
"return_to_view": "돌아가서 보기",
470471
"continue_importing": "계속 가져오기",
@@ -850,4 +851,4 @@
850851
"to_doc": "API 보기",
851852
"trigger_limit": "최대 {0}개의 API 키 생성 지원"
852853
}
853-
}
854+
}

frontend/src/i18n/zh-CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@
466466
"import": "导入",
467467
"change_file": "更换文件",
468468
"data_import_completed": "数据导入完成",
469+
"notes_import_completed": "备注导入完成",
469470
"imported_100_data": "成功导入数据 {msg} 条",
470471
"return_to_view": "返回查看",
471472
"continue_importing": "继续导入",

frontend/src/router/watch.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@ export const watchRouter = (router: Router) => {
3434
next('/login')
3535
return
3636
}
37+
let isFirstDynamicPath = false
3738
if (!userStore.getUid) {
3839
await userStore.info()
3940
generateDynamicRouters(router)
41+
isFirstDynamicPath = to?.path === '/ds/index'
42+
if (isFirstDynamicPath) {
43+
next({ ...to, replace: true })
44+
return
45+
}
4046
}
4147
if (to.path === '/' || accessCrossPermission(to)) {
4248
next('/chat')

frontend/src/views/chat/RecommendQuestionQuick.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async function getRecommendQuestions(articles_number: number) {
5353
if (res.recommended_config === 2) {
5454
questions.value = res.questions
5555
} else if (currentChat.value.recommended_generate) {
56-
questions.value = currentChat.value.recommended_question
56+
questions.value = currentChat.value.recommended_question as string
5757
} else {
5858
getRecommendQuestionsLLM(articles_number)
5959
}

frontend/src/views/ds/DataTable.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,13 @@ const handleCurrentChange = (val: number) => {
107107
108108
const fieldListComputed = computed(() => {
109109
const { currentPage, pageSize } = pageInfo
110-
return fieldList.value
111-
.filter((ele: any) => ele.field_name.toLowerCase().includes(fieldName.value.toLowerCase()))
112-
.slice((currentPage - 1) * pageSize, currentPage * pageSize)
110+
return fieldListTotalComputed.value.slice((currentPage - 1) * pageSize, currentPage * pageSize)
111+
})
112+
113+
const fieldListTotalComputed = computed(() => {
114+
return fieldList.value.filter((ele: any) =>
115+
ele.field_name.toLowerCase().includes(fieldName.value.toLowerCase())
116+
)
113117
})
114118
115119
const init = (reset = false) => {
@@ -319,7 +323,7 @@ const renderHeader = ({ column }: any) => {
319323
}
320324
const fieldNameSearch = debounce(() => {
321325
pageInfo.currentPage = 1
322-
pageInfo.total = fieldListComputed.value.length
326+
pageInfo.total = fieldListTotalComputed.value.length
323327
}, 100)
324328
const fieldName = ref('')
325329
const btnSelectClick = (val: any) => {

frontend/src/views/ds/DatasourceForm.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,8 @@ const onSuccess = (response: any) => {
424424
uploadLoading.value = false
425425
}
426426
427-
const onError = () => {
427+
const onError = (e: any) => {
428+
ElMessage.error(e.toString())
428429
uploadLoading.value = false
429430
}
430431

frontend/src/views/login/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
}}</span>
2525
</div>
2626
<div v-if="appearanceStore.getShowSlogan" class="welcome">
27-
{{ appearanceStore.slogan || $t('common.intelligent_questioning_platform') }}
27+
{{ appearanceStore.slogan ?? $t('common.intelligent_questioning_platform') }}
2828
</div>
2929
<div v-else class="welcome" style="height: 0"></div>
3030
<div class="login-form">

frontend/src/views/login/xpack/Handler.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,8 @@ const auto2Platform = async () => {
556556
resObj[item.pkey] = item.pval
557557
})
558558
res = parseInt(resObj['login.default_login'] || 0)
559-
560-
if (res && !adminLogin.value) {
559+
const originArray = ['default', 'cas', 'oidc', 'ldap', 'oauth2', 'saml2']
560+
if (res && !adminLogin.value && loginCategory.value[originArray[res] as keyof LoginCategory]) {
561561
if (res === 3) {
562562
qrStatusChange('ldap')
563563
updateLoading(false)

0 commit comments

Comments
 (0)