mirror of https://github.com/langgenius/dify.git
add apis
This commit is contained in:
parent
58f67acf07
commit
077f44ff58
|
|
@ -136,9 +136,12 @@ const MembersPage = () => {
|
|||
</div>
|
||||
<div className='system-sm-regular flex w-[104px] shrink-0 items-center py-2 text-text-secondary'>{dayjs(Number((account.last_active_at || account.created_at)) * 1000).locale(locale === 'zh-Hans' ? 'zh-cn' : 'en').fromNow()}</div>
|
||||
<div className='flex w-[96px] shrink-0 items-center'>
|
||||
{isCurrentWorkspaceOwner && account.role === 'owner' && (
|
||||
{isCurrentWorkspaceOwner && account.role === 'owner' && !systemFeatures.is_allow_transfer_workspace && (
|
||||
<TransferOwnership onOperate={() => setShowTransferOwnershipModal(true)}></TransferOwnership>
|
||||
)}
|
||||
{/* {isCurrentWorkspaceOwner && account.role === 'owner' && !systemFeatures.is_allow_transfer_workspace && (
|
||||
<div className='system-sm-regular px-3 text-text-secondary'>{RoleMap[account.role] || RoleMap.normal}</div>
|
||||
)} */}
|
||||
{isCurrentWorkspaceOwner && account.role !== 'owner' && (
|
||||
<Operation member={account} operatorRole={currentWorkspace.role} onOperate={mutate} />
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -131,6 +131,15 @@ export const deleteMemberOrCancelInvitation: Fetcher<CommonResponse, { url: stri
|
|||
return del<CommonResponse>(url)
|
||||
}
|
||||
|
||||
export const sendOwnerEmail = (memberID: string, body: { language?: string }) =>
|
||||
post<CommonResponse & { data: string }>(`/workspaces/current/members/${memberID}/send-owner-transfer-confirm-email`, { body })
|
||||
|
||||
export const verifyOwnerEmail = (body: { code: string; token: string }) =>
|
||||
post<CommonResponse & { is_valid: boolean; email: string; token: string }>('/workspaces/current/members/owner-transfer-check', { body })
|
||||
|
||||
export const ownershipTransfer = (memberID: string, body: { token: string }) =>
|
||||
post<CommonResponse & { is_valid: boolean; email: string; token: string }>(`/workspaces/current/members/${memberID}/owner-transfer`, { body })
|
||||
|
||||
export const fetchFilePreview: Fetcher<{ content: string }, { fileID: string }> = ({ fileID }) => {
|
||||
return get<{ content: string }>(`/files/${fileID}/preview`)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ export type SystemFeatures = {
|
|||
enable_email_password_login: boolean
|
||||
enable_social_oauth_login: boolean
|
||||
is_allow_create_workspace: boolean
|
||||
is_allow_transfer_workspace: boolean
|
||||
is_allow_register: boolean
|
||||
is_email_setup: boolean
|
||||
license: License
|
||||
|
|
@ -74,6 +75,7 @@ export const defaultSystemFeatures: SystemFeatures = {
|
|||
enable_email_password_login: false,
|
||||
enable_social_oauth_login: false,
|
||||
is_allow_create_workspace: false,
|
||||
is_allow_transfer_workspace: false,
|
||||
is_allow_register: false,
|
||||
is_email_setup: false,
|
||||
license: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue