diff --git a/ui/src/api/system/resource-authorization.ts b/ui/src/api/system/resource-authorization.ts index b12e72358..a53a9d10a 100644 --- a/ui/src/api/system/resource-authorization.ts +++ b/ui/src/api/system/resource-authorization.ts @@ -1,8 +1,7 @@ -import { Permission } from '@/utils/permission/type' import { Result } from '@/request/Result' import { get, put, post, del } from '@/request/index' -import type { pageRequest } from '@/api/type/common' import type { Ref } from 'vue' +import type { pageRequest } from '@/api/type/common' const prefix = '/workspace' /** @@ -13,11 +12,13 @@ const getResourceAuthorization: ( workspace_id: string, user_id: string, resource: string, + page: pageRequest, + params?: any, loading?: Ref, -) => Promise> = (workspace_id, user_id, resource, loading) => { +) => Promise> = (workspace_id, user_id, resource, page, params, loading) => { return get( - `${prefix}/${workspace_id}/user_resource_permission/user/${user_id}/resource/${resource}`, - undefined, + `${prefix}/${workspace_id}/user_resource_permission/user/${user_id}/resource/${resource}/${page.current_page}/${page.page_size}`, + params, loading, ) } @@ -26,18 +27,12 @@ const getResourceAuthorization: ( * 修改成员权限 * @param 参数 member_id * @param 参数 { - "team_resource_permission_list": [ - { - "auth_target_type": "KNOWLEDGE", - "target_id": "string", - "auth_type": "ROLE", - "permission": { - "VIEW": true, - "MANAGE": true, - "ROLE": true - } - } - ] + [ + { + "target_id": "string", + "permission": "NOT_AUTH" + } + ] } */ const putResourceAuthorization: ( diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index 0c1b8c08b..3af8b9c1b 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -22,7 +22,8 @@ :type="type" :send-message="sendMessage" :chat-management="ChatManagement" :executionIsRightPanel="props.executionIsRightPanel" @open-execution-detail="emit('openExecutionDetail', chatList[index])" - @openParagraph="emit('openParagraph', chatList[index])" @openParagraphDocument=" + @openParagraph="emit('openParagraph', chatList[index])" + @openParagraphDocument=" (val: any) => emit('openParagraphDocument', chatList[index], val) "> diff --git a/ui/src/enums/system.ts b/ui/src/enums/system.ts index 3fcbf7217..5a4fd920d 100644 --- a/ui/src/enums/system.ts +++ b/ui/src/enums/system.ts @@ -2,6 +2,7 @@ export enum AuthorizationEnum { MANAGE = 'MANAGE', VIEW = 'VIEW', ROLE = 'ROLE', + NOT_AUTH = 'NOT_AUTH', KNOWLEDGE = 'KNOWLEDGE', APPLICATION = 'APPLICATION', MODEL = 'MODEL', diff --git a/ui/src/locales/lang/en-US/views/system.ts b/ui/src/locales/lang/en-US/views/system.ts index 8b2efe24f..045d7a59d 100644 --- a/ui/src/locales/lang/en-US/views/system.ts +++ b/ui/src/locales/lang/en-US/views/system.ts @@ -109,18 +109,20 @@ export default { enableSSL: 'Enable SSL (if the SMTP port is 465, you usually need to enable SSL)', enableTLS: 'Enable TLS (if the SMTP port is 587, you usually need to enable TLS)', }, + resourceAuthorization: { title: 'Resource Authorization', member: 'Member', permissionSetting: 'Permission Setting', setting: { management: 'management', + managementDesc: 'Can delete or modify this resource', check: 'check', - authorization: 'authorization', - }, - priority: { - label: 'Resource permission priority', - role: 'Role', + checkDesc: 'Can only view the resource', + role: 'User Role', + roleDesc: 'Authorize users based on their roles to access this resource', + notAuthorized: 'Not Authorized', + configure: 'Configure Permission', }, }, resource_management: { diff --git a/ui/src/locales/lang/zh-CN/views/system.ts b/ui/src/locales/lang/zh-CN/views/system.ts index 666d0874f..4bf583d1e 100644 --- a/ui/src/locales/lang/zh-CN/views/system.ts +++ b/ui/src/locales/lang/zh-CN/views/system.ts @@ -1,3 +1,5 @@ +import role from './role' + export default { title: '系统管理', subTitle: '系统设置', @@ -115,12 +117,13 @@ export default { permissionSetting: '资源权限配置', setting: { management: '管理', + managementDesc: '可对该资源进行删改操作', check: '查看', - authorization: '授权', - }, - priority: { - label: '资源权限优先级', - role: '按角色', + checkDesc: '仅能查看使用该资源', + role: '按用户角色', + roleDesc: '根据用户角色中的权限授权用户对该资源的操作权限', + notAuthorized: '不授权', + configure: '配置权限', }, }, resource_management: { diff --git a/ui/src/locales/lang/zh-Hant/views/system.ts b/ui/src/locales/lang/zh-Hant/views/system.ts index 1527b507e..4fb0c9323 100644 --- a/ui/src/locales/lang/zh-Hant/views/system.ts +++ b/ui/src/locales/lang/zh-Hant/views/system.ts @@ -109,18 +109,20 @@ export default { enableSSL: '啟用 SSL(如果 SMTP 端口是 465,通常需要啟用 SSL)', enableTLS: '啟用 TLS(如果 SMTP 端口是 587,通常需要啟用 TLS)', }, + resourceAuthorization: { - title: '資源授权', + title: '資源授權', member: '成員', - permissionSetting: '資源权限配置', + permissionSetting: '資源權限配置', setting: { management: '管理', + managementDesc: '可對該資源進行刪改操作', check: '查看', - authorization: '授权', - }, - priority: { - label: '資源权限优先级', - role: '按角色', + checkDesc: '僅能查看使用該資源', + role: '按用戶角色', + roleDesc: '根據用戶角色中的權限授權用戶對該資源的操作權限', + notAuthorized: '不授權', + configure: '配置權限', }, }, resource_management: { diff --git a/ui/src/views/chat-log/index.vue b/ui/src/views/chat-log/index.vue index 55575ff5a..03d37f601 100644 --- a/ui/src/views/chat-log/index.vue +++ b/ui/src/views/chat-log/index.vue @@ -359,12 +359,12 @@ const nextChatRecord = () => { } } const pre_disable = computed(() => { - let index = tableIndexMap.value[currentChatId.value] - 1 + const index = tableIndexMap.value[currentChatId.value] - 1 return index < 0 && paginationConfig.current_page <= 1 }) const next_disable = computed(() => { - let index = tableIndexMap.value[currentChatId.value] + 1 + const index = tableIndexMap.value[currentChatId.value] + 1 return ( index >= tableData.value.length && index + (paginationConfig.current_page - 1) * paginationConfig.page_size >= diff --git a/ui/src/views/document/index.vue b/ui/src/views/document/index.vue index 8d87f0ad9..b30a64384 100644 --- a/ui/src/views/document/index.vue +++ b/ui/src/views/document/index.vue @@ -51,10 +51,11 @@ >{{ $t('views.document.generateQuestion.title') }} {{ $t('views.document.setting.migration') }} + v-if="permissionPrecise.doc_edit(id)" + > + {{ $t('common.setting') }} @@ -63,11 +64,11 @@