fix(style): compare sroll

This commit is contained in:
jialin
2024-09-26 19:52:54 +08:00
parent cc7d2ded6c
commit 7e985991cd
16 changed files with 147 additions and 112 deletions
+1 -1
View File
@@ -219,10 +219,10 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
filterOption
defaultActiveFirstOption
disabled={action === PageAction.EDIT}
options={ollamaModelOptions}
label={intl.formatMessage({ id: 'model.form.ollama.model' })}
placeholder={intl.formatMessage({ id: 'model.form.ollamaholder' })}
required
options={ollamaModelOptions}
></SealAutoComplete>
</Form.Item>
</>
@@ -118,7 +118,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
width={width}
footer={false}
>
<div style={{ display: 'flex' }}>
<div style={{ display: 'flex', height: '100%' }}>
{SEARCH_SOURCE.includes(props.source) && (
<>
<div style={{ display: 'flex', flex: 1 }}>
+28 -18
View File
@@ -6,30 +6,40 @@ import '../style/gpu-card.less';
const GPUCard: React.FC<{
data: any;
}> = ({ data }) => {
header?: React.ReactNode;
info?: React.ReactNode;
}> = ({ data, header, info }) => {
const intl = useIntl();
return (
<div className="gpu-card">
<div className="header">
{data.label}({data.worker_name})[
{intl.formatMessage({ id: 'resources.table.index' })}:{data.index}]
{header ?? (
<>
{data.label}({data.worker_name})[
{intl.formatMessage({ id: 'resources.table.index' })}:{data.index}]
</>
)}
</div>
<div className="info">
<span>
{intl.formatMessage({ id: 'resources.table.vram' })}(
{intl.formatMessage({ id: 'resources.table.used' })}/
{intl.formatMessage({ id: 'resources.table.total' })}):{' '}
<span>
{convertFileSize(data?.memory?.used || 0)} /{' '}
{convertFileSize(data?.memory?.total || 0)}
</span>
</span>
<span>
<span>
{intl.formatMessage({ id: 'resources.table.gpuutilization' })}:{' '}
</span>
{_.round(data?.memory?.utilization_rate || 0, 2)}%
</span>
{info ?? (
<>
<span>
{intl.formatMessage({ id: 'resources.table.vram' })}(
{intl.formatMessage({ id: 'resources.table.used' })}/
{intl.formatMessage({ id: 'resources.table.total' })}):{' '}
<span>
{convertFileSize(data?.memory?.used || 0)} /{' '}
{convertFileSize(data?.memory?.total || 0)}
</span>
</span>
<span>
<span>
{intl.formatMessage({ id: 'resources.table.gpuutilization' })}:{' '}
</span>
{_.round(data?.memory?.utilization_rate || 0, 2)}%
</span>
</>
)}
</div>
</div>
);
+2 -1
View File
@@ -111,6 +111,7 @@ const ModelCard: React.FC<{
const getModelCardData = async () => {
if (!props.selectedModel.name) {
setModelData(null);
setReadmeText(null);
return;
}
requestToken.current?.cancel?.();
@@ -191,7 +192,7 @@ const ModelCard: React.FC<{
<div className="card-wrapper">
{modelData ? (
<div className="model-card-wrap">
<div className="flex-between flex-center">
<div className="flex-center">
{modelData.config?.model_type && (
<Tag className="tag-item" color="gold">
<span style={{ opacity: 0.65 }}>
+7 -7
View File
@@ -44,13 +44,13 @@ export const ollamaModelOptions = [
tags: ['7B'],
id: 'mistral'
},
// {
// label: 'llava',
// value: 'llava',
// name: 'llava',
// tags: ['7B', '13B', '34B'],
// id: 'llava'
// },
{
label: 'llava',
value: 'llava',
name: 'llava',
tags: ['7B', '13B', '34B'],
id: 'llava'
},
{
label: 'qwen2',
value: 'qwen2',
+4 -3
View File
@@ -5,14 +5,15 @@
position: absolute;
border-radius: 0 2px 0 0;
top: 10px;
left: -10px;
width: 22px;
height: 22px;
left: -13px;
width: 24px;
height: 24px;
border: 2px solid var(--ant-color-split);
transform: rotate(45deg);
border-left: none;
border-bottom: none;
background-color: var(--color-white-1);
z-index: 100;
clip-path: polygon(0 -1px, 24px 0, 24px 23px);
}
}