fix(style): instance type card height

This commit is contained in:
jialin
2026-07-22 15:52:16 +08:00
parent fe24f9b53d
commit fe0bab041b
3 changed files with 20 additions and 8 deletions
@@ -137,13 +137,9 @@ export const InstanceMetadataSection: React.FC<MetadataSectionProps> = ({
spec
} as InstanceTypeItemModel);
// Sliceable types show "Max {n} · Sliceable {m}%" instead of just the count.
// Sliceable types get a dedicated "Sliceable {n}%" row (on its own grid row)
// rather than crowding it into the Max cell.
const showSliceable = !!spec.sliceable && (slicedMaxPercentage ?? 0) > 0;
const maxValue = showSliceable
? `${spec.maxComputeUnitCount || 0} · ${intl.formatMessage({
id: 'gpuservice.instance.sliceable'
})} ${slicedMaxPercentage}%`
: `${spec.maxComputeUnitCount || 0}`;
return (
<Meta $columns={isGPU ? 11 : 7}>
@@ -171,7 +167,7 @@ export const InstanceMetadataSection: React.FC<MetadataSectionProps> = ({
},
{ count: '' }
)}
value={maxValue}
value={`${spec.maxComputeUnitCount || 0}`}
/>
{/* row 2: OS | Arch | CPU */}
<MetaItem
@@ -196,6 +192,14 @@ export const InstanceMetadataSection: React.FC<MetadataSectionProps> = ({
</Flex>
}
/>
{/* row 3 (sliceable types only): Sliceable {n}% on its own row */}
<MetaItem
show={showSliceable}
showDot={false}
icon="icon-sliced"
label={intl.formatMessage({ id: 'gpuservice.instance.sliceable' })}
value={`${slicedMaxPercentage}%`}
/>
</>
)}
@@ -4,6 +4,7 @@ import { TemplateCard } from '@gpustack/core-ui';
import { Empty, Flex, Spin } from 'antd';
import _ from 'lodash';
import { InstanceTypeItem as InstanceTypeItemModel } from '../config/types';
import styles from '../styles/instances.module.less';
import InstanceTypeItem from './instance-type-item';
interface InstanceTypeListProps {
@@ -50,10 +51,10 @@ const InstanceTypeList: React.FC<InstanceTypeListProps> = ({
return (
<TemplateCard
key={name}
className={styles.instanceTypeCard}
clickable
ghost
hoverable
height={106}
active={value === name}
disabled={item.disabled}
onClick={() => handleSelect(item)}
@@ -45,3 +45,10 @@
font-weight: 400;
font-size: 12px;
}
// TemplateCard applies a fixed inline height; override to let sliceable cards
// (with the extra Sliceable row) grow while keeping a 106px floor.
.instanceTypeCard {
height: auto !important;
min-height: 106px;
}