fix(style): catalog size tags overflow
This commit is contained in:
@@ -27,6 +27,28 @@ const CatalogItem: React.FC<CatalogItemProps> = (props) => {
|
||||
e.target.src = fallbackImg;
|
||||
};
|
||||
|
||||
const renderTag = (sItem: any) => {
|
||||
return (
|
||||
<Tag
|
||||
key={sItem}
|
||||
className="tag-item"
|
||||
style={{
|
||||
marginRight: 0,
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
padding: '2px 6px',
|
||||
borderRadius: 4,
|
||||
fontSize: 12,
|
||||
opacity: 0.7,
|
||||
height: 22
|
||||
}}
|
||||
>
|
||||
{sItem}B
|
||||
</Tag>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
onClick={handleOnClick}
|
||||
@@ -81,7 +103,7 @@ const CatalogItem: React.FC<CatalogItemProps> = (props) => {
|
||||
<span className="flex-center">
|
||||
{_.map(data.licenses, (license: string, index: number) => {
|
||||
return (
|
||||
<span key={license} className="flex-center m-r-16">
|
||||
<span key={license} className="flex-center m-r-8">
|
||||
<IconFont type="icon-justice1" className="m-r-5"></IconFont>
|
||||
<span>{license}</span>
|
||||
</span>
|
||||
@@ -113,15 +135,11 @@ const CatalogItem: React.FC<CatalogItemProps> = (props) => {
|
||||
<>
|
||||
<span className="dot"></span>
|
||||
<div className="box">
|
||||
<TagWrapper>
|
||||
{data.sizes.map((sItem, i) => {
|
||||
return (
|
||||
<Tag key={sItem} className="tag-item">
|
||||
{sItem}B
|
||||
</Tag>
|
||||
);
|
||||
})}
|
||||
</TagWrapper>
|
||||
<TagWrapper
|
||||
gap={8}
|
||||
dataList={data.sizes}
|
||||
renderTag={renderTag}
|
||||
></TagWrapper>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
ThunderboltFilled
|
||||
} from '@ant-design/icons';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import { Col, Divider, Row, Space, Tag, Tooltip } from 'antd';
|
||||
import { Button, Col, Divider, Row, Space, Tag, Tooltip } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import _ from 'lodash';
|
||||
import React, { useCallback } from 'react';
|
||||
@@ -282,6 +282,21 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
||||
? { percent: item.download_progress }
|
||||
: undefined
|
||||
}
|
||||
extra={
|
||||
item.state === InstanceStatusMap.Error ? (
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
onClick={() =>
|
||||
handleChildSelect('viewlog', item, list)
|
||||
}
|
||||
>
|
||||
{intl.formatMessage({
|
||||
id: 'models.list.more.logs'
|
||||
})}
|
||||
</Button>
|
||||
) : null
|
||||
}
|
||||
statusValue={{
|
||||
status:
|
||||
item.state === InstanceStatusMap.Downloading &&
|
||||
|
||||
@@ -31,7 +31,8 @@ const PlaygroundEmbedding: React.FC = () => {
|
||||
const getModelListByEmbedding = async () => {
|
||||
try {
|
||||
const params = {
|
||||
categories: modelCategoriesMap.embedding
|
||||
categories: modelCategoriesMap.embedding,
|
||||
with_meta: true
|
||||
};
|
||||
const res = await queryModelsList(params);
|
||||
const list = _.map(res.data || [], (item: any) => {
|
||||
|
||||
@@ -33,7 +33,8 @@ const PlaygroundRerank: React.FC = () => {
|
||||
const getModelListByReranker = async () => {
|
||||
try {
|
||||
const params = {
|
||||
categories: modelCategoriesMap.reranker
|
||||
categories: modelCategoriesMap.reranker,
|
||||
with_meta: true
|
||||
};
|
||||
const res = await queryModelsList(params);
|
||||
const list = _.map(res.data || [], (item: any) => {
|
||||
|
||||
@@ -59,7 +59,6 @@ const AddWorker: React.FC<ViewModalProps> = (props) => {
|
||||
{ version: versionInfo.version }
|
||||
)}
|
||||
</li>
|
||||
<li>{intl.formatMessage({ id: 'resources.worker.select.command' })}</li>
|
||||
<li>
|
||||
<span>
|
||||
{intl.formatMessage({ id: 'resources.worker.driver.install' })}
|
||||
|
||||
@@ -57,6 +57,11 @@ export const addWorkerGuide: Record<string, any> = {
|
||||
return `docker run -d --ipc=host --network=host gpustack/gpustack:${params.tag} --server-url ${params.server} --token ${params.token}`;
|
||||
}
|
||||
},
|
||||
rocm: {
|
||||
registerWorker(params: { server: string; tag: string; token: string }) {
|
||||
return `docker run -d --network=host --ipc=host --group-add=video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --device /dev/kfd --device /dev/dri gpustack/gpustack:${params.tag} --server-url ${params.server} --token ${params.token}`;
|
||||
}
|
||||
},
|
||||
container: {
|
||||
getToken:
|
||||
'docker run -it ${gpustack_container_id} cat /var/lib/gpustack/token'
|
||||
@@ -65,6 +70,7 @@ export const addWorkerGuide: Record<string, any> = {
|
||||
|
||||
export const containerInstallOptions = [
|
||||
{ label: 'CUDA', value: 'cuda' },
|
||||
{ label: 'AMD', value: 'rocm' },
|
||||
{ label: 'CANN', value: 'npu' },
|
||||
{ label: 'MUSA', value: 'musa' },
|
||||
{ label: 'CPU', value: 'cpu' }
|
||||
|
||||
Reference in New Issue
Block a user