Skip to content

Commit 6d38a71

Browse files
perf: Login authentication added prompt message
1 parent f09b68d commit 6d38a71

File tree

10 files changed

+42
-29
lines changed

10 files changed

+42
-29
lines changed

ui/src/api/knowledge/document.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ const postTableDocument: (
462462
}
463463

464464
/**
465-
* 获得QA模版
465+
* 获得QA模板
466466
* @param 参数 fileName,type,
467467
*/
468468
const exportQATemplate: (fileName: string, type: string, loading?: Ref<boolean>) => void = (
@@ -474,7 +474,7 @@ const exportQATemplate: (fileName: string, type: string, loading?: Ref<boolean>)
474474
}
475475

476476
/**
477-
* 获得table模版
477+
* 获得table模板
478478
* @param 参数 fileName,type,
479479
*/
480480
const exportTableTemplate: (fileName: string, type: string, loading?: Ref<boolean>) => void = (

ui/src/api/system-resource-management/document.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ const postTableDocument: (
433433
}
434434

435435
/**
436-
* 获得QA模版
436+
* 获得QA模板
437437
* @param 参数 fileName,type,
438438
*/
439439
const exportQATemplate: (fileName: string, type: string, loading?: Ref<boolean>) => void = (
@@ -445,7 +445,7 @@ const exportQATemplate: (fileName: string, type: string, loading?: Ref<boolean>)
445445
}
446446

447447
/**
448-
* 获得table模版
448+
* 获得table模板
449449
* @param 参数 fileName,type,
450450
*/
451451
const exportTableTemplate: (fileName: string, type: string, loading?: Ref<boolean>) => void = (

ui/src/api/system-shared/document.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ const postTableDocument: (
433433
}
434434

435435
/**
436-
* 获得QA模版
436+
* 获得QA模板
437437
* @param 参数 fileName,type,
438438
*/
439439
const exportQATemplate: (fileName: string, type: string, loading?: Ref<boolean>) => void = (
@@ -445,7 +445,7 @@ const exportQATemplate: (fileName: string, type: string, loading?: Ref<boolean>)
445445
}
446446

447447
/**
448-
* 获得table模版
448+
* 获得table模板
449449
* @param 参数 fileName,type,
450450
*/
451451
const exportTableTemplate: (fileName: string, type: string, loading?: Ref<boolean>) => void = (

ui/src/api/system/role.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const getRoleList: (loading?: Ref<boolean>) => Promise<Result<{ internal_role: R
1414
}
1515

1616
/**
17-
* 根据类型获取角色权限模版列表
17+
* 根据类型获取角色权限模板列表
1818
*/
1919
const getRoleTemplate: (role_type: RoleTypeEnum, loading?: Ref<boolean>) => Promise<Result<RolePermissionItem[]>> = (role_type, loading) => {
2020
return get(`${prefix}/template/${role_type}`, undefined, loading)
@@ -106,4 +106,4 @@ export default {
106106
getRoleMemberList,
107107
CreateMember,
108108
deleteRoleMember
109-
}
109+
}

ui/src/components/model-select/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
</slot>
6262
</template>
6363
</el-select>
64-
<!-- 添加模版 -->
64+
<!-- 添加模板 -->
6565
<CreateModelDialog
6666
v-if="showFooter"
6767
ref="createModelRef"

ui/src/locales/lang/en-US/views/application-overview.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export default {
4343
loginMethodRequired: 'Please select login method',
4444
toSettingChatUser: 'Go to configure chat user',
4545
displayCodeRequired: 'Please enter the number of failed attempts',
46+
authenticationTooltip:
47+
'Enabling login authentication requires chat users to have authorization configured for both the app and its associated knowledge bases. Without proper authorization, users will not be able to log in or access knowledge base retrieval features.',
4648
},
4749
SettingAPIKeyDialog: {
4850
allowCrossDomainLabel: 'Allow Cross-Domain Access',

ui/src/locales/lang/zh-CN/views/application-overview.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ export default {
4343
loginMethodRequired: '请选择登录方式',
4444
displayCodeRequired: '请输入失败次数',
4545
toSettingChatUser: '去配置对话用户',
46+
authenticationTooltip:
47+
'开启登录认证后,应用和关联的知识库均需要对话用户授权配置,否则用户无权限登录和知识库检索',
4648
},
4749
SettingAPIKeyDialog: {
4850
allowCrossDomainLabel: '允许跨域地址',
@@ -99,7 +101,6 @@ export default {
99101
disapproval: '反对',
100102
tokenUsage: '用户消耗 Tokens',
101103
topQuestions: '用户提问次数',
102-
103104
},
104105
},
105106
}

ui/src/locales/lang/zh-CN/views/document.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default {
3737
errorMessage2: '文件格式不支持',
3838
errorMessage3: '文件不能为空',
3939
// errorMessage4: '每次最多上传50个文件',
40-
template: '模版',
40+
template: '模板',
4141
download: '下载',
4242
},
4343

@@ -48,13 +48,13 @@ export default {
4848
},
4949
table: {
5050
label: '表格',
51-
tip1: '1、点击下载对应模版并完善信息:',
51+
tip1: '1、点击下载对应模板并完善信息:',
5252
tip2: '2、第一行必须是列标题,且列标题必须是有意义的术语,表中每条记录将作为一个分段',
5353
tip3: '3、上传的表格文件中每个 sheet 会作为一个文档,sheet名称为文档名称',
5454
},
5555
QA: {
5656
label: 'QA 问答对',
57-
tip1: '1、点击下载对应模版并完善信息',
57+
tip1: '1、点击下载对应模板并完善信息',
5858
tip2: '2、上传的表格文件中每个 sheet 会作为一个文档,sheet名称为文档名称',
5959
},
6060
lark: {},

ui/src/locales/lang/zh-Hant/views/application-overview.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export default {
4242
loginMethodRequired: '請選擇登陸方式',
4343
displayCodeRequired: '請輸入失敗次數',
4444
toSettingChatUser: '去配置對話用戶',
45+
authenticationTooltip:
46+
'開啟登陸認證後,應用和關聯的知識庫均需要對話用戶授權配置,否則用戶無權限登陸和知識庫檢索',
4547
},
4648
SettingAPIKeyDialog: {
4749
dialogTitle: '設定',

ui/src/views/application-overview/xpack-component/XPackLimitDrawer.vue

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
step-strictly
2424
/>
2525
<span class="ml-4">{{
26-
$t('views.applicationOverview.appInfo.LimitDialog.timesDays')
27-
}}</span>
26+
$t('views.applicationOverview.appInfo.LimitDialog.timesDays')
27+
}}</span>
2828
</el-form-item>
2929
<!-- 身份验证 -->
3030
<el-form-item
@@ -74,7 +74,7 @@
7474
style="margin: 0 4px 0 0 !important"
7575
>
7676
<el-icon>
77-
<RefreshRight/>
77+
<RefreshRight />
7878
</el-icon>
7979
</el-button>
8080
</el-tooltip>
@@ -88,8 +88,16 @@
8888
:class="form.authentication_value.type === 'login' ? 'active' : ''"
8989
>
9090
<el-radio value="login" size="large">
91-
<p class="mb-16 lighter">
91+
<p class="mb-16 lighter flex align-center">
9292
{{ $t('views.system.authentication.title') }}
93+
<el-tooltip
94+
popper-class="max-w-350"
95+
effect="dark"
96+
:content="$t('views.applicationOverview.appInfo.LimitDialog.authenticationTooltip')"
97+
>
98+
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
99+
</el-tooltip>
100+
93101
<el-button type="primary" link @click="router.push({ name: 'applicationChatUser' })">
94102
{{ $t('views.applicationOverview.appInfo.LimitDialog.toSettingChatUser') }}
95103
</el-button>
@@ -111,7 +119,7 @@
111119
>
112120
<el-checkbox-group v-model="form.authentication_value.login_value">
113121
<template v-for="t in auth_list" :key="t.value">
114-
<el-checkbox :label="t.label" :value="t.value"/>
122+
<el-checkbox :label="t.label" :value="t.value" />
115123
</template>
116124
</el-checkbox-group>
117125
</el-form-item>
@@ -178,18 +186,18 @@
178186
</el-drawer>
179187
</template>
180188
<script setup lang="ts">
181-
import {ref, watch, computed} from 'vue'
182-
import {useRoute, useRouter} from 'vue-router'
183-
import type {FormInstance, FormRules} from 'element-plus'
184-
import {MsgSuccess} from '@/utils/message'
185-
import {t} from '@/locales'
186-
import {copyClick} from '@/utils/clipboard'
187-
import {loadSharedApi} from '@/utils/dynamics-api/shared-api'
189+
import { ref, watch, computed } from 'vue'
190+
import { useRoute, useRouter } from 'vue-router'
191+
import type { FormInstance, FormRules } from 'element-plus'
192+
import { MsgSuccess } from '@/utils/message'
193+
import { t } from '@/locales'
194+
import { copyClick } from '@/utils/clipboard'
195+
import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
188196
189197
const router = useRouter()
190198
const route = useRoute()
191199
const {
192-
params: {id},
200+
params: { id },
193201
} = route
194202
195203
const apiType = computed(() => {
@@ -243,7 +251,7 @@ const open = (data: any) => {
243251
}
244252
form.value.authentication = data.authentication
245253
dialogVisible.value = true
246-
loadSharedApi({type: 'application', systemType: apiType.value})
254+
loadSharedApi({ type: 'application', systemType: apiType.value })
247255
.getChatUserAuthType()
248256
.then((ok: any) => {
249257
auth_list.value = ok.data
@@ -261,7 +269,7 @@ const submit = async (formEl: FormInstance | undefined) => {
261269
authentication: form.value.authentication,
262270
authentication_value: form.value.authentication_value,
263271
}
264-
loadSharedApi({type: 'application', systemType: apiType.value})
272+
loadSharedApi({ type: 'application', systemType: apiType.value })
265273
.putAccessToken(id as string, obj, loading)
266274
.then(() => {
267275
emit('refresh')
@@ -297,7 +305,7 @@ function firstGeneration() {
297305
}
298306
}
299307
300-
defineExpose({open})
308+
defineExpose({ open })
301309
</script>
302310
<style lang="scss" scoped>
303311
.authentication-append-input {

0 commit comments

Comments
 (0)