chore: model instance show gpu info

This commit is contained in:
jialin
2024-09-12 18:34:44 +08:00
parent b6d5b45650
commit f339133245
18 changed files with 376 additions and 39 deletions
+3 -1
View File
@@ -14,12 +14,14 @@ interface AutoTooltipProps extends React.ComponentProps<typeof Tag> {
color?: string;
style?: React.CSSProperties;
ghost?: boolean;
showTitle?: boolean;
}
const AutoTooltip: React.FC<AutoTooltipProps> = ({
children,
maxWidth = '100%',
ghost = false,
showTitle = false,
...tagProps
}) => {
const contentRef = useRef<HTMLDivElement>(null);
@@ -62,7 +64,7 @@ const AutoTooltip: React.FC<AutoTooltipProps> = ({
);
return (
<Tooltip title={isOverflowing ? children : ''}>
<Tooltip title={isOverflowing || showTitle ? children : ''}>
{ghost ? (
<div ref={contentRef} style={tagStyle}>
{children}
@@ -159,6 +159,10 @@
background-color: @bgColor !important;
}
:global(.ant-select-selection-search) {
inset-inline-start: 8px !important;
}
:global(.ant-select-selection-item) {
height: @inputheight !important;
padding-block: 5px !important;
@@ -3,7 +3,7 @@
display: flex;
align-items: center;
height: 54px;
border-radius: var(--ant-table-header-border-radius);
border-radius: var(--border-radius-mdium);
transition: all 0.2s ease;
&:hover {
+22
View File
@@ -0,0 +1,22 @@
import React from 'react';
interface TableHeaderProps {
columns: any[];
}
interface TableHeaderProps {
columns: any[];
}
const TableHeader = ({ columns }: TableHeaderProps) => {
return (
<tr>
{columns.map((column: any, index: number) => {
return (
<th key={index}>
<span className="cell-span">{column.title}</span>
</th>
);
})}
</tr>
);
};
export default React.memo(TableHeader);
+33
View File
@@ -0,0 +1,33 @@
.simple-table {
table-layout: auto;
width: 100%;
text-align: left;
&.simple-table-bordered {
border-collapse: collapse;
border-spacing: 0;
td {
border-bottom: 1px solid rgba(255, 255, 255, 10%);
}
th {
border-bottom: 1px solid rgba(255, 255, 255, 10%);
}
tr:last-child td {
border-bottom: none;
}
}
th {
height: 36px;
font-weight: 600;
}
.cell-span {
display: flex;
padding: 4px 6px;
min-height: 32px;
}
}
+38
View File
@@ -0,0 +1,38 @@
import classNames from 'classnames';
import React from 'react';
import SimpleBar from 'simplebar-react';
import 'simplebar-react/dist/simplebar.min.css';
import TableHeader from './header';
import './index.less';
import TableRow from './row';
interface SimpleTableProps {
columns: any[];
dataSource: any[];
bordered?: boolean;
}
const SimpleTabel: React.FC<SimpleTableProps> = (props) => {
const { columns, dataSource, bordered = true } = props;
return (
<SimpleBar style={{ maxHeight: 200 }}>
<table
className={classNames('simple-table', {
'simple-table-bordered': bordered
})}
>
<thead>
<TableHeader columns={columns}></TableHeader>
</thead>
<tbody>
{dataSource.map((item: any, index: number) => {
return (
<TableRow row={item} columns={columns} key="index"></TableRow>
);
})}
</tbody>
</table>
</SimpleBar>
);
};
export default React.memo(SimpleTabel);
+25
View File
@@ -0,0 +1,25 @@
import React from 'react';
interface TableRowProps {
row: any;
columns: any;
}
const TableRow = ({ row, columns }: TableRowProps) => {
return (
<tr>
{columns.map((column: any, index: number) => {
return (
<td key={index}>
<span className="cell-span">
{column.render
? column.render({ dataIndex: column.key, row: row })
: row[column.key]}
</span>
</td>
);
})}
</tr>
);
};
export default React.memo(TableRow);