feat: 参考原型图 ui优化提交 企业端-企业中心 相关的页面

This commit is contained in:
zhanjunhao
2026-11-06 20:19:43 +08:00
parent bc6af74e9e
commit d58e468969
147 changed files with 9816 additions and 8768 deletions
@@ -39,7 +39,7 @@ const TokensActions = ({
// Handle copy selected tokens with options
const handleCopySelectedTokens = () => {
if (selectedKeys.length === 0) {
showError(t('请至少选择一个令牌!'));
showError(t('请至少选择一个密钥!'));
return;
}
setShowCopyModal(true);
@@ -48,7 +48,7 @@ const TokensActions = ({
// Handle delete selected tokens with confirmation
const handleDeleteSelectedTokens = () => {
if (selectedKeys.length === 0) {
showError(t('请至少选择一个令牌!'));
showError(t('请至少选择一个密钥!'));
return;
}
setShowDeleteModal(true);
@@ -74,7 +74,7 @@ const TokensActions = ({
}}
size='small'
>
{t('添加令牌')}
{t('添加密钥')}
</Button>
<Button
@@ -83,7 +83,7 @@ const TokensActions = ({
onClick={handleCopySelectedTokens}
size='small'
>
{t('复制所选令牌')}
{t('复制所选密钥')}
</Button>
<Button
@@ -92,7 +92,7 @@ const TokensActions = ({
onClick={handleDeleteSelectedTokens}
size='small'
>
{t('删除所选令牌')}
{t('删除所选密钥')}
</Button>
</div>
@@ -407,7 +407,7 @@ const renderOperations = (
size='small'
onClick={() => {
Modal.confirm({
title: t('确定是否要删除此令牌?'),
title: t('确定是否要删除此密钥?'),
content: t('此修改将不可逆'),
onOk: () => {
(async () => {
@@ -29,7 +29,7 @@ const TokensDescription = ({ compactMode, setCompactMode, t }) => {
<div className='flex flex-col md:flex-row justify-between items-start md:items-center gap-2 w-full'>
<div className='flex items-center text-blue-500'>
<Key size={16} className='mr-2' />
<Text>{t('令牌管理')}</Text>
<Text>{t('密钥管理')}</Text>
</div>
<CompactModeToggle
+3 -3
View File
@@ -55,7 +55,7 @@ function TokensPage({ labelReplace } = {}) {
? (key, options) => {
const result = originalT(key, options);
return typeof result === 'string'
? result.replace(/令牌/g, labelReplace)
? result.replace(/密钥/g, labelReplace)
: result;
}
: originalT;
@@ -145,7 +145,7 @@ function TokensPage({ labelReplace } = {}) {
<div style={{ marginBottom: 8 }}>
{key
? t('请选择模型。')
: t('选择模型后可一键填充当前选中令牌(或本页第一个令牌)。')}
: t('选择模型后可一键填充当前选中密钥(或本页第一个密钥)。')}
</div>
<div style={{ marginBottom: 8 }}>
<Select
@@ -235,7 +235,7 @@ function TokensPage({ labelReplace } = {}) {
? tokens[0]
: null;
if (!token) {
Toast.warning(t('没有可用令牌用于填充'));
Toast.warning(t('没有可用密钥用于填充'));
return;
}
apiKeyToUse = 'sk-' + token.key;
@@ -43,7 +43,7 @@ const CopyTokensModal = ({ visible, onCancel, selectedKeys, copyText, t }) => {
return (
<Modal
title={t('复制令牌')}
title={t('复制密钥')}
icon={null}
visible={visible}
onCancel={onCancel}
@@ -29,14 +29,14 @@ const DeleteTokensModal = ({
}) => {
return (
<Modal
title={t('批量删除令牌')}
title={t('批量删除密钥')}
visible={visible}
onCancel={onCancel}
onOk={onConfirm}
type='warning'
>
<div>
{t('确定要删除所选的 {{count}} 个令牌吗?', {
{t('确定要删除所选的 {{count}} 个密钥吗?', {
count: selectedKeys.length,
})}
</div>
@@ -95,9 +95,9 @@ const EditTokenDrawer = ({
<Drawer
open={open}
onClose={onCancel}
title={isEdit ? t('编辑令牌') : t('创建令牌')}
title={isEdit ? t('编辑密钥') : t('创建密钥')}
width={isMobile ? '100%' : 560}
maskClosable={false}
maskClosable
forceRender
rootClassName='km-edit-drawer'
footer={
@@ -108,7 +108,7 @@ const EditTokenDrawer = ({
loading={loading}
onClick={() => formApiRef.current?.submitForm()}
>
{isEdit ? t('保存') : t('创建令牌')}
{isEdit ? t('保存') : t('创建密钥')}
</Button>
</div>
}
@@ -126,13 +126,13 @@ const EditTokenDrawer = ({
<Form.Input
field='name'
label={t('名称')}
placeholder={t('请输入令牌名称')}
placeholder={t('请输入密钥名称')}
rules={[{ required: true, message: t('请输入名称') }]}
/>
{groups.length > 0 ? (
<Form.Select
field='group'
label={t('令牌分组')}
label={t('密钥分组')}
placeholder={t('选择分组,默认为用户分组')}
optionList={groups}
renderOptionItem={renderGroupOption}
@@ -142,7 +142,7 @@ const EditTokenDrawer = ({
) : (
<Form.Select
field='group'
label={t('令牌分组')}
label={t('密钥分组')}
placeholder={t('管理员未设置用户可选分组')}
disabled
style={{ width: '100%' }}
@@ -60,7 +60,7 @@ const EditTokenModal = (props) => {
? (key, options) => {
const result = originalT(key, options);
return typeof result === 'string'
? result.replace(/令牌/g, props.labelReplace)
? result.replace(/密钥/g, props.labelReplace)
: result;
}
: originalT;
@@ -365,7 +365,7 @@ const EditTokenModal = (props) => {
});
const { success, message } = res.data;
if (success) {
showSuccess(t('令牌更新成功!'));
showSuccess(t('密钥更新成功!'));
props.refresh();
props.handleClose();
} else {
@@ -393,7 +393,7 @@ const EditTokenModal = (props) => {
}
}
if (successCount > 0) {
showSuccess(t('令牌创建成功,请在列表页面点击复制获取令牌!'));
showSuccess(t('密钥创建成功,请在列表页面点击复制获取密钥!'));
props.refresh();
props.handleClose();
}
@@ -464,10 +464,10 @@ const EditTokenModal = (props) => {
</div>
<div>
<h2 className='text-base font-semibold text-gray-800 dark:text-gray-100'>
{isEdit ? t('编辑令牌') : t('创建令牌')}
{isEdit ? t('编辑密钥') : t('创建密钥')}
</h2>
<p className='text-xs text-gray-500 dark:text-gray-400'>
{isEdit ? t('修改令牌配置') : t('快速创建访问令牌')}
{isEdit ? t('修改密钥配置') : t('快速创建访问密钥')}
</p>
</div>
</div>
@@ -506,16 +506,16 @@ const EditTokenModal = (props) => {
<Form.Input
field='name'
noLabel
placeholder={t('请输入令牌名称')}
placeholder={t('请输入密钥名称')}
rules={[{ required: true, message: t('请输入名称') }]}
showClear
/>
</div>
{/* 秘钥分组 */}
{/* 密钥分组 */}
<div>
<FieldLabel icon={Layers} iconColor='text-brand'>
{t('令牌分组')}
{t('密钥分组')}
</FieldLabel>
{groups.length > 0 ? (
<Form.Select
@@ -664,7 +664,7 @@ const EditTokenModal = (props) => {
<Form.Switch
field='unlimited_quota'
label={t('无限额度')}
extraText={t('开启后令牌不限制使用额度')}
extraText={t('开启后密钥不限制使用额度')}
/>
{!values.unlimited_quota && (
@@ -755,7 +755,7 @@ const EditTokenModal = (props) => {
icon={<Check size={16} />}
loading={loading}
>
{isEdit ? t('保存修改') : t('创建令牌')}
{isEdit ? t('保存修改') : t('创建密钥')}
</Button>
<Button
theme='light'