diff --git a/web/src/components/table/usage-logs/modals/UserInfoModal.jsx b/web/src/components/table/usage-logs/modals/UserInfoModal.jsx index 586e9c53..294f55ef 100644 --- a/web/src/components/table/usage-logs/modals/UserInfoModal.jsx +++ b/web/src/components/table/usage-logs/modals/UserInfoModal.jsx @@ -18,7 +18,7 @@ For commercial licensing, please contact support@quantumnous.com */ import React from 'react'; -import { Modal } from '@douyinfe/semi-ui'; +import { Modal, Badge } from '@douyinfe/semi-ui'; import { renderQuota, renderNumber } from '../../../../helpers'; const UserInfoModal = ({ @@ -27,28 +27,130 @@ const UserInfoModal = ({ userInfoData, t, }) => { + const infoItemStyle = { + marginBottom: '16px' + }; + + const labelStyle = { + display: 'flex', + alignItems: 'center', + marginBottom: '2px', + fontSize: '12px', + color: 'var(--semi-color-text-2)', + gap: '6px' + }; + + const renderLabel = (text, type = 'tertiary') => ( +
+ + {text} +
+ ); + + const valueStyle = { + fontSize: '14px', + fontWeight: '600', + color: 'var(--semi-color-text-0)' + }; + + const rowStyle = { + display: 'flex', + justifyContent: 'space-between', + marginBottom: '16px', + gap: '20px' + }; + + const colStyle = { + flex: 1, + minWidth: 0 + }; + return ( setShowUserInfoModal(false)} footer={null} - centered={true} + centered + closable + maskClosable + width={600} > {userInfoData && ( -
-

- {t('用户名')}: {userInfoData.username} -

-

- {t('余额')}: {renderQuota(userInfoData.quota)} -

-

- {t('已用额度')}:{renderQuota(userInfoData.used_quota)} -

-

- {t('请求次数')}:{renderNumber(userInfoData.request_count)} -

+
+ {/* 基本信息 */} +
+
+ {renderLabel(t('用户名'), 'primary')} +
{userInfoData.username}
+
+ {userInfoData.display_name && ( +
+ {renderLabel(t('显示名称'), 'primary')} +
{userInfoData.display_name}
+
+ )} +
+ + {/* 余额信息 */} +
+
+ {renderLabel(t('余额'), 'success')} +
{renderQuota(userInfoData.quota)}
+
+
+ {renderLabel(t('已用额度'), 'warning')} +
{renderQuota(userInfoData.used_quota)}
+
+
+ + {/* 统计信息 */} +
+
+ {renderLabel(t('请求次数'), 'warning')} +
{renderNumber(userInfoData.request_count)}
+
+ {userInfoData.group && ( +
+ {renderLabel(t('用户组'), 'tertiary')} +
{userInfoData.group}
+
+ )} +
+ + {/* 邀请信息 */} + {(userInfoData.aff_code || userInfoData.aff_count !== undefined) && ( +
+ {userInfoData.aff_code && ( +
+ {renderLabel(t('邀请码'), 'tertiary')} +
{userInfoData.aff_code}
+
+ )} + {userInfoData.aff_count !== undefined && ( +
+ {renderLabel(t('邀请人数'), 'tertiary')} +
{renderNumber(userInfoData.aff_count)}
+
+ )} +
+ )} + + {/* 邀请获得额度 */} + {userInfoData.aff_quota !== undefined && userInfoData.aff_quota > 0 && ( +
+ {renderLabel(t('邀请获得额度'), 'success')} +
{renderQuota(userInfoData.aff_quota)}
+
+ )} + + {/* 备注 */} + {userInfoData.remark && ( +
+ {renderLabel(t('备注'), 'tertiary')} +
{userInfoData.remark}
+
+ )}
)} diff --git a/web/src/i18n/locales/en.json b/web/src/i18n/locales/en.json index 5b4e94b6..23d1a5e8 100644 --- a/web/src/i18n/locales/en.json +++ b/web/src/i18n/locales/en.json @@ -1780,5 +1780,7 @@ "美元汇率(非充值汇率,仅用于定价页面换算)": "USD exchange rate (not recharge rate, only used for pricing page conversion)", "美元汇率": "USD exchange rate", "隐藏操作项": "Hide actions", - "显示操作项": "Show actions" + "显示操作项": "Show actions", + "用户组": "User group", + "邀请获得额度": "Invitation quota" } \ No newline at end of file