8a48765a46
集中保留原版权声明,移除文件头检查和全局测试忽略规则。验证:全量单测、受影响用例复测及静态检查通过。
45 lines
1.2 KiB
React
45 lines
1.2 KiB
React
import React from 'react';
|
||
import { Modal, Typography, Banner } from '@/components/ui';
|
||
|
||
const { Text } = Typography;
|
||
|
||
const AdminDeleteTokenModal = ({ visible, onCancel, onConfirm, token, t }) => {
|
||
if (!token) return null;
|
||
const isOrgToken = token.organization_id > 0;
|
||
|
||
return (
|
||
<Modal
|
||
title={t('确定要删除此密钥吗?')}
|
||
visible={visible}
|
||
onCancel={onCancel}
|
||
onOk={onConfirm}
|
||
type='danger'
|
||
okType='danger'
|
||
okText={t('确认删除')}
|
||
>
|
||
<div className='space-y-2'>
|
||
{isOrgToken && (
|
||
<Banner
|
||
type='warning'
|
||
description={t(
|
||
'该密钥属于企业 Token,删除将影响企业内多用户的使用',
|
||
)}
|
||
closeIcon={null}
|
||
/>
|
||
)}
|
||
<div>{t('删除后将无法恢复,且会立即终止使用此密钥的所有调用')}</div>
|
||
<Text type='tertiary' size='small'>
|
||
{t('密钥名称')}:{token.name || '—'}
|
||
</Text>
|
||
<br />
|
||
<Text type='tertiary' size='small'>
|
||
{t('所属用户')}:{token.display_name || token.username || '—'} (ID:{' '}
|
||
{token.user_id})
|
||
</Text>
|
||
</div>
|
||
</Modal>
|
||
);
|
||
};
|
||
|
||
export default AdminDeleteTokenModal;
|