From e7a09943886f1e83a651db1c6926c363cb2b4216 Mon Sep 17 00:00:00 2001 From: monster Date: Thu, 3 Jul 2025 14:37:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=BA=E6=BF=80=E6=B4=BB=E7=9A=84?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E5=B1=95=E7=A4=BA=E5=A2=9E=E5=8A=A0=E9=AB=98?= =?UTF-8?q?=E4=BA=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/pages/model/components/modelCard.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/src/pages/model/components/modelCard.tsx b/ui/src/pages/model/components/modelCard.tsx index a719770..42bf7fb 100644 --- a/ui/src/pages/model/components/modelCard.tsx +++ b/ui/src/pages/model/components/modelCard.tsx @@ -78,6 +78,9 @@ const ModelItem = ({ overflow: 'hidden', position: 'relative', transition: 'all 0.3s ease', + borderStyle: 'solid', + borderWidth: '1px', + borderColor: data.is_active ? 'success.main' : 'transparent', boxShadow: '0px 0px 10px 0px rgba(68, 80, 91, 0.1), 0px 0px 2px 0px rgba(68, 80, 91, 0.1)', '&:hover': { From 82d5042286f9f475bd18077099ae78d2a7825680 Mon Sep 17 00:00:00 2001 From: monster Date: Thu, 3 Jul 2025 15:52:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E6=88=90?= =?UTF-8?q?=E5=91=98=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/components/header/Bread.tsx | 2 +- ui/src/components/sidebar/index.tsx | 2 +- ui/src/pages/user/index.tsx | 170 +++++++++++++--------------- ui/src/pages/user/memberManage.tsx | 63 ++++++----- 4 files changed, 115 insertions(+), 122 deletions(-) diff --git a/ui/src/components/header/Bread.tsx b/ui/src/components/header/Bread.tsx index 34a1848..82f14a0 100644 --- a/ui/src/components/header/Bread.tsx +++ b/ui/src/components/header/Bread.tsx @@ -9,7 +9,7 @@ const OtherBread = { chat: { title: '对话记录', to: '/chat' }, completion: { title: '补全记录', to: '/completion' }, model: { title: '模型管理', to: '/model' }, - user: { title: '用户管理', to: '/user' }, + user: { title: '成员管理', to: '/user' }, admin: { title: '管理员', to: '/admin' }, }; diff --git a/ui/src/components/sidebar/index.tsx b/ui/src/components/sidebar/index.tsx index 737a454..c470836 100644 --- a/ui/src/components/sidebar/index.tsx +++ b/ui/src/components/sidebar/index.tsx @@ -45,7 +45,7 @@ const menus = [ show: true, }, { - label: '用户管理', + label: '成员管理', value: '/user', pathname: 'user', icon: 'icon-yonghuguanli1', diff --git a/ui/src/pages/user/index.tsx b/ui/src/pages/user/index.tsx index 271351c..7a8316c 100644 --- a/ui/src/pages/user/index.tsx +++ b/ui/src/pages/user/index.tsx @@ -72,98 +72,90 @@ const User = () => { }; return ( - - - - - - 强制成员启用两步认证 - { - updateSetting({ force_two_factor_auth: e.target.checked }); - }} - /> - - - - - 禁止成员使用密码登录 - - updateSetting({ disable_password_login: e.target.checked }) + + + + + + + 第三方登录 + + - - + }} + > + + + + + 钉钉 + - - - - + + + + + + + 禁止成员使用密码登录 + + updateSetting({ disable_password_login: e.target.checked }) + } + /> + + + 强制成员启用两步认证 + { + updateSetting({ force_two_factor_auth: e.target.checked }); + }} + /> + + + - - setDingdingLoginSettingModalOpen(false)} diff --git a/ui/src/pages/user/memberManage.tsx b/ui/src/pages/user/memberManage.tsx index 7c27310..348a819 100644 --- a/ui/src/pages/user/memberManage.tsx +++ b/ui/src/pages/user/memberManage.tsx @@ -11,10 +11,11 @@ import { TextField, Chip, Paper, - ButtonBase, + Link, IconButton, Menu, MenuItem, + Typography, } from '@mui/material'; import { Table, MenuSelect, Modal, message } from '@c-x/ui'; import InviteUserModal from './inviteUserModal'; @@ -23,6 +24,7 @@ import { ConstsUserStatus, DomainUser } from '@/api/types'; import dayjs from 'dayjs'; import { CopyToClipboard } from 'react-copy-to-clipboard'; import ErrorRoundedIcon from '@mui/icons-material/ErrorRounded'; +import AccountCircleIcon from '@mui/icons-material/AccountCircle'; const ResetPasswordModal = ({ open, @@ -248,40 +250,39 @@ const MemberManage = () => { { title: '账号', dataIndex: 'username', - }, - { - title: '两步认证', - dataIndex: 'two_step_auth', - render: (text) => { - return text ? ( - - ) : ( - - ); + render: (text, record) => { + return <> + + navigate(`/dashboard/member/${record.id}`)} sx={{ + '&:hover': { + color: 'info.main', + }, + cursor: 'pointer' + }}> + + + {text} + + + {record.email} + + ; }, }, { - title: '最近活跃时间', + title: '加入时间', + dataIndex: 'created_at', + width: 120, + render: (text) => { + return dayjs.unix(text).fromNow(); + }, + }, + { + title: '最近活跃', dataIndex: 'last_active_at', - render: (text) => { - return dayjs.unix(text).format('YYYY-MM-DD HH:mm:ss'); - }, - }, - { - title: '统计使用情况', - dataIndex: 'status', - render: (_, record) => { - return ( - navigate(`/dashboard/member/${record.id}`)} - sx={{ - color: 'info.main', - }} - > - 点击查看 - - ); + width: 120, + render: (text, record) => { + return record.last_active_at === 0 ? '从未使用' : dayjs.unix(text).fromNow(); }, }, {