Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/global/support/user/api.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { MemberGroupSchemaType, MemberGroupType } from 'support/permission/memberGroup/type';
import { OAuthEnum } from './constant';
import { TrackRegisterParams } from './login/api';
import { TeamMemberStatusEnum } from './team/constant';
import { OrgType } from './team/org/type';
import { TeamMemberItemType } from './team/type';

export type PostLoginProps = {
username: string;
Expand All @@ -21,3 +25,9 @@ export type FastLoginProps = {
token: string;
code: string;
};

export type SearchResult = {
members: Omit<TeamMemberItemType, 'teamId' | 'permission'>[];
orgs: Omit<OrgType, 'permission' | 'members'>[];
groups: MemberGroupSchemaType[];
};
7 changes: 7 additions & 0 deletions packages/global/support/user/team/controller.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type CreateTeamProps = {
defaultTeam?: boolean;
memberName?: string;
memberAvatar?: string;
notificationAccount?: string;
};
export type UpdateTeamProps = Omit<ThirdPartyAccountType, 'externalWorkflowVariable'> & {
name?: string;
Expand All @@ -39,6 +40,12 @@ export type UpdateInviteProps = {
tmbId: string;
status: TeamMemberSchema['status'];
};

export type UpdateStatusProps = {
tmbId: string;
status: TeamMemberSchema['status'];
};

export type InviteMemberResponse = Record<
'invite' | 'inValid' | 'inTeam',
{ username: string; userId: string }[]
Expand Down
5 changes: 5 additions & 0 deletions packages/global/support/user/team/type.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ export type TeamTagSchema = TeamTagItemType & {
_id: string;
teamId: string;
createTime: Date;
updateTime?: Date;
};

export type TeamMemberSchema = {
_id: string;
teamId: string;
userId: string;
createTime: Date;
updateTime?: Date;
name: string;
role: `${TeamMemberRoleEnum}`;
status: `${TeamMemberStatusEnum}`;
Expand Down Expand Up @@ -79,6 +81,9 @@ export type TeamMemberItemType = {
role: `${TeamMemberRoleEnum}`;
status: `${TeamMemberStatusEnum}`;
permission: TeamPermission;
contact?: string;
createTime: Date;
updateTime?: Date;
};

export type TeamTagItemType = {
Expand Down
2 changes: 2 additions & 0 deletions packages/global/support/user/type.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type UserModelSchema = {
fastgpt_sem?: {
keyword: string;
};
contact?: string;
};

export type UserType = {
Expand All @@ -29,6 +30,7 @@ export type UserType = {
standardInfo?: standardInfoType;
notificationAccount?: string;
permission: TeamPermission;
contact?: string;
};

export type SourceMemberType = {
Expand Down
4 changes: 4 additions & 0 deletions packages/service/common/file/csv.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const generateCsv = (headers: string[], data: string[][]) => {
const csv = [headers.join(','), ...data.map((row) => row.join(','))].join('\n');
return csv;
};
3 changes: 2 additions & 1 deletion packages/service/support/user/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export async function getUserDetail({
promotionRate: user.promotionRate,
team: tmb,
notificationAccount: tmb.notificationAccount,
permission: tmb.permission
permission: tmb.permission,
contact: user.contact
};
}
1 change: 1 addition & 0 deletions packages/service/support/user/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const UserSchema = new Schema({
},
fastgpt_sem: Object,
sourceDomain: String,
contact: String,

/** @deprecated */
avatar: String
Expand Down
3 changes: 3 additions & 0 deletions packages/service/support/user/team/teamMemberSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const TeamMemberSchema = new Schema({
type: Date,
default: () => new Date()
},
updateTime: {
type: Date
},
defaultTeam: {
type: Boolean,
default: false
Expand Down
3 changes: 2 additions & 1 deletion packages/web/components/common/Icon/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const iconPaths = {
'common/closeLight': () => import('./icons/common/closeLight.svg'),
'common/confirm/commonTip': () => import('./icons/common/confirm/commonTip.svg'),
'common/confirm/deleteTip': () => import('./icons/common/confirm/deleteTip.svg'),
'common/confirm/restoreTip': () => import('./icons/common/confirm/restoreTip.svg'),
'common/confirm/rightTip': () => import('./icons/common/confirm/rightTip.svg'),
'common/courseLight': () => import('./icons/common/courseLight.svg'),
'common/customTitleLight': () => import('./icons/common/customTitleLight.svg'),
Expand Down Expand Up @@ -387,9 +388,9 @@ export const iconPaths = {
'model/moonshot': () => import('./icons/model/moonshot.svg'),
'model/ollama': () => import('./icons/model/ollama.svg'),
'model/openai': () => import('./icons/model/openai.svg'),
'model/ppio': () => import('./icons/model/ppio.svg'),
'model/qwen': () => import('./icons/model/qwen.svg'),
'model/siliconflow': () => import('./icons/model/siliconflow.svg'),
'model/ppio': () => import('./icons/model/ppio.svg'),
'model/sparkDesk': () => import('./icons/model/sparkDesk.svg'),
'model/stepfun': () => import('./icons/model/stepfun.svg'),
'model/yi': () => import('./icons/model/yi.svg'),
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/web/components/common/Input/SearchInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useState } from 'react';
import { Input, InputProps, InputGroup, InputLeftElement } from '@chakra-ui/react';
import MyIcon from '../../Icon';

Expand Down
2 changes: 1 addition & 1 deletion packages/web/components/common/MyModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const MyModal = ({
objectFit={'contain'}
alt=""
src={iconSrc}
w={'1.5rem'}
w={'20px'}
borderRadius={'sm'}
/>
</>
Expand Down
12 changes: 10 additions & 2 deletions packages/web/hooks/useConfirm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { useDisclosure, Button, ModalBody, ModalFooter } from '@chakra-ui/react';
import { useDisclosure, Button, ModalBody, ModalFooter, type ImageProps } from '@chakra-ui/react';
import { useTranslation } from 'next-i18next';
import MyModal from '../components/common/MyModal';
import { useMemoizedFn } from 'ahooks';
Expand All @@ -11,6 +11,7 @@ export const useConfirm = (props?: {
showCancel?: boolean;
type?: 'common' | 'delete';
hideFooter?: boolean;
iconColor?: ImageProps['color'];
}) => {
const { t } = useTranslation();

Expand All @@ -34,6 +35,7 @@ export const useConfirm = (props?: {
const {
title = map?.title || t('common:Warning'),
iconSrc = map?.iconSrc,
iconColor,
content,
showCancel = true,
hideFooter = false
Expand Down Expand Up @@ -93,7 +95,13 @@ export const useConfirm = (props?: {
}, [isOpen]);

return (
<MyModal isOpen={isOpen} iconSrc={iconSrc} title={title} maxW={['90vw', '400px']}>
<MyModal
isOpen={isOpen}
iconSrc={iconSrc}
iconColor={iconColor}
title={title}
maxW={['90vw', '400px']}
>
<ModalBody pt={5} whiteSpace={'pre-wrap'} fontSize={'sm'}>
{customContent}
</ModalBody>
Expand Down
4 changes: 3 additions & 1 deletion packages/web/i18n/zh-CN/account_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,7 @@
"user_team_team_name": "团队名",
"verification_code": "验证码",
"you_can_convert": "您可以兑换",
"yuan": "元"
"yuan": "元",
"contact": "联系方式",
"please_bind_contact": "请绑定联系方式"
}
19 changes: 16 additions & 3 deletions packages/web/i18n/zh-CN/account_team.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"action": "操作",
"confirm_delete_group": "确认删除群组?",
"confirm_delete_member": "确认删除成员?",
"confirm_delete_org": "确认删除该部门?",
"confirm_leave_team": "确认离开该团队? \n退出后,您在该团队所有的资源均转让给团队所有者。",
"create_group": "创建群组",
Expand All @@ -26,7 +25,9 @@
"owner": "所有者",
"permission": "权限",
"remark": "备注",
"remove_tip": "确认将 {{username}} 移出团队?",
"remove_tip": "确认将 {{username}} 移出团队?成员将被标记为“已离职”,不删除操作数据,账号下资源自动转让给团队所有者。",
"restore_tip": "确认将 {{username}} 加入团队吗?仅恢复该成员账号可用性及相关权限,无法恢复账号下资源。",
"restore_tip_title": "恢复确认",
"retain_admin_permissions": "保留管理员权限",
"search_member_group_name": "搜索成员/群组名称",
"total_team_members": "共 {{amount}} 名成员",
Expand All @@ -38,5 +39,17 @@
"waiting": "待接受",
"sync_immediately": "立即同步",
"sync_member_failed": "同步成员失败",
"sync_member_success": "同步成员成功"
"sync_member_success": "同步成员成功",
"contact": "联系方式",
"join_update_time": "加入/更新时间",
"leave": "已离职",
"search_member": "搜索成员",
"export_members": "导出成员",
"delete_from_team": "移出团队",
"delete_from_org": "移出部门",
"confirm_delete_from_team": "确认将 {{username}} 移出团队?",
"confirm_delete_from_org": "确认将 {{username}} 移出部门?",
"search_org": "搜索部门",
"notification_recieve": "团队通知接收",
"set_name_avatar": "团队头像 & 团队名"
}
2 changes: 1 addition & 1 deletion projects/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app",
"version": "4.8.21",
"version": "4.8.22",
"private": false,
"scripts": {
"dev": "next dev",
Expand Down
6 changes: 2 additions & 4 deletions projects/app/src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ const UpdateInviteModal = dynamic(() => import('@/components/support/user/team/U
const NotSufficientModal = dynamic(() => import('@/components/support/wallet/NotSufficientModal'));
const SystemMsgModal = dynamic(() => import('@/components/support/user/inform/SystemMsgModal'));
const ImportantInform = dynamic(() => import('@/components/support/user/inform/ImportantInform'));
const UpdateNotification = dynamic(
() => import('@/components/support/user/inform/UpdateNotificationModal')
);
const UpdateContact = dynamic(() => import('@/components/support/user/inform/UpdateContactModal'));

const pcUnShowLayoutRoute: Record<string, boolean> = {
'/': true,
Expand Down Expand Up @@ -150,7 +148,7 @@ const Layout = ({ children }: { children: JSX.Element }) => {
{notSufficientModalType && <NotSufficientModal type={notSufficientModalType} />}
{!!userInfo && <SystemMsgModal />}
{showUpdateNotification && (
<UpdateNotification onClose={() => setIsUpdateNotification(false)} />
<UpdateContact onClose={() => setIsUpdateNotification(false)} mode="contact" />
)}
{!!userInfo && importantInforms.length > 0 && (
<ImportantInform informs={importantInforms} refetch={refetchUnRead} />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React from 'react';
import { Box, Checkbox, HStack, VStack } from '@chakra-ui/react';
import Avatar from '@fastgpt/web/components/common/Avatar';
import PermissionTags from './PermissionTags';
import { PermissionValueType } from '@fastgpt/global/support/permission/type';
import MyIcon from '@fastgpt/web/components/common/Icon';
import OrgTags from '../../user/team/OrgTags';

function MemberItemCard({
avatar,
key,
onChange,
isChecked,
onDelete,
name,
permission,
orgs
}: {
avatar: string;
key: string;
onChange: () => void;
isChecked?: boolean;
onDelete?: () => void;
name: string;
permission?: PermissionValueType;
orgs?: string[];
}) {
return (
<>
<HStack
justifyContent="space-between"
alignItems="center"
key={key}
px="3"
py="2"
borderRadius="sm"
_hover={{
bgColor: 'myGray.50',
cursor: 'pointer'
}}
onClick={onChange}
>
{isChecked !== undefined && <Checkbox isChecked={isChecked} pointerEvents="none" />}
<Avatar src={avatar} w="1.5rem" borderRadius={'50%'} />

<VStack w="full" gap={0}>
<Box w="full">{name}</Box>
<Box w="full">{orgs && orgs.length > 0 && <OrgTags orgs={orgs} />}</Box>
</VStack>
{permission && <PermissionTags permission={permission} />}
{onDelete !== undefined && (
<MyIcon
name="common/closeLight"
w="1rem"
cursor={'pointer'}
_hover={{
color: 'red.600'
}}
onClick={onDelete}
/>
)}
</HStack>
</>
);
}

export default MemberItemCard;
Loading
Loading