feat: 自行开发设计 ui样式优化 超管端-控制台 相关的页面
This commit is contained in:
@@ -18,17 +18,13 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import {
|
||||
Button,
|
||||
Space,
|
||||
Tag,
|
||||
Typography,
|
||||
Modal,
|
||||
Tooltip,
|
||||
} from '@/components/ui';
|
||||
import { Button as AntButton, Tooltip as AntTooltip } from 'antd';
|
||||
import { Copy } from 'lucide-react';
|
||||
import { Button, Space, Tag, Modal, Tooltip } from '@/components/ui';
|
||||
import {
|
||||
timestamp2string,
|
||||
getLobeHubIcon,
|
||||
renderGroup,
|
||||
stringToColor,
|
||||
isRoot,
|
||||
} from '../../../helpers';
|
||||
@@ -37,8 +33,6 @@ import {
|
||||
renderDescription,
|
||||
} from '../../common/ui/RenderUtils';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
// Render timestamp
|
||||
function renderTimestamp(timestamp) {
|
||||
return <>{timestamp2string(timestamp)}</>;
|
||||
@@ -48,11 +42,7 @@ function renderTimestamp(timestamp) {
|
||||
const renderModelIconCol = (record, vendorMap) => {
|
||||
const iconKey = record?.icon || vendorMap[record?.vendor_id]?.icon;
|
||||
if (!iconKey) return '-';
|
||||
return (
|
||||
<div className='flex items-center justify-center'>
|
||||
{getLobeHubIcon(iconKey, 20)}
|
||||
</div>
|
||||
);
|
||||
return <div className='models-model-icon'>{getLobeHubIcon(iconKey, 20)}</div>;
|
||||
};
|
||||
|
||||
// Render vendor column with icon
|
||||
@@ -125,9 +115,7 @@ const renderGroups = (groups) => {
|
||||
return renderLimitedItems({
|
||||
items: groups,
|
||||
renderItem: (g, idx) => (
|
||||
<Tag key={idx} size='small' shape='circle' color={stringToColor(g)}>
|
||||
{g}
|
||||
</Tag>
|
||||
<React.Fragment key={idx}>{renderGroup(g)}</React.Fragment>
|
||||
),
|
||||
});
|
||||
};
|
||||
@@ -247,14 +235,19 @@ const renderOperations = (
|
||||
manageModel,
|
||||
refresh,
|
||||
t,
|
||||
setDetailModel,
|
||||
) => {
|
||||
return (
|
||||
<Space wrap>
|
||||
<Space wrap className='console-module-row-actions'>
|
||||
<Button type='link' size='small' onClick={() => setDetailModel(record)}>
|
||||
{t('详情')}
|
||||
</Button>
|
||||
{isRoot() && (
|
||||
<>
|
||||
{record.status === 1 ? (
|
||||
<Button
|
||||
type='danger'
|
||||
type='link'
|
||||
danger
|
||||
size='small'
|
||||
onClick={() => manageModel(record.id, 'disable', record)}
|
||||
>
|
||||
@@ -262,6 +255,7 @@ const renderOperations = (
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => manageModel(record.id, 'enable', record)}
|
||||
>
|
||||
@@ -270,7 +264,7 @@ const renderOperations = (
|
||||
)}
|
||||
|
||||
<Button
|
||||
type='tertiary'
|
||||
type='link'
|
||||
size='small'
|
||||
onClick={() => {
|
||||
setEditingModel(record);
|
||||
@@ -281,7 +275,8 @@ const renderOperations = (
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
type='danger'
|
||||
type='link'
|
||||
danger
|
||||
size='small'
|
||||
onClick={() => {
|
||||
Modal.confirm({
|
||||
@@ -347,8 +342,10 @@ export const getModelsColumns = ({
|
||||
setEditingModel,
|
||||
setShowEdit,
|
||||
refresh,
|
||||
copyText,
|
||||
vendorMap,
|
||||
categoryNames = {},
|
||||
setDetailModel,
|
||||
}) => {
|
||||
return [
|
||||
{
|
||||
@@ -362,9 +359,19 @@ export const getModelsColumns = ({
|
||||
title: t('模型名称'),
|
||||
dataIndex: 'model_name',
|
||||
render: (text) => (
|
||||
<Text copyable onClick={(e) => e.stopPropagation()}>
|
||||
{text}
|
||||
</Text>
|
||||
<span className='models-name-cell' onClick={(e) => e.stopPropagation()}>
|
||||
<span>{text}</span>
|
||||
<AntTooltip title={t('复制模型名称')}>
|
||||
<AntButton
|
||||
type='text'
|
||||
size='small'
|
||||
className='models-name-copy'
|
||||
aria-label={t('复制模型名称')}
|
||||
icon={<Copy size={14} />}
|
||||
onClick={() => copyText(text)}
|
||||
/>
|
||||
</AntTooltip>
|
||||
</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
@@ -436,7 +443,7 @@ export const getModelsColumns = ({
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '',
|
||||
title: t('操作'),
|
||||
dataIndex: 'operate',
|
||||
fixed: 'right',
|
||||
render: (text, record, index) =>
|
||||
@@ -448,6 +455,7 @@ export const getModelsColumns = ({
|
||||
manageModel,
|
||||
refresh,
|
||||
t,
|
||||
setDetailModel,
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user