style: model file list

This commit is contained in:
jialin
2024-08-23 18:33:23 +08:00
parent a60be9c88f
commit 8bb1961a02
10 changed files with 84 additions and 85 deletions
+13 -11
View File
@@ -8,17 +8,19 @@ const FileParts: React.FC<{
}> = ({ fileList }) => {
return (
<SimpleBar style={{ maxHeight: 200 }}>
{fileList.map((file, index) => {
return (
<div key={index} className="flex-between m-b-5">
<span>
{' '}
Part {file.part} of {file.total}
</span>
<span>{convertFileSize(file.size)}</span>
</div>
);
})}
<div style={{ padding: 10 }}>
{fileList.map((file, index) => {
return (
<div key={index} className="flex-between m-b-5">
<span>
{' '}
Part {file.part} of {file.total}
</span>
<span>{convertFileSize(file.size)}</span>
</div>
);
})}
</div>
</SimpleBar>
);
};
@@ -117,10 +117,9 @@ const HFModelFile: React.FC<HFModelFileProps> = (props) => {
return _.endsWith(file.path, '.gguf') || _.includes(file.path, '.gguf');
});
const newList = generateGroupByFilename(list);
// const newList = generateGroupByFilename(list);
console.log('newList==========', newList);
const sortList = _.sortBy(newList, (item: any) => {
const sortList = _.sortBy(list, (item: any) => {
return sortType === 'size' ? item.size : item.path;
});
setDataSource({ fileList: sortList, loading: false });
@@ -245,6 +244,7 @@ const HFModelFile: React.FC<HFModelFileProps> = (props) => {
color="var(--color-white-1)"
overlayInnerStyle={{
width: 150,
padding: 0,
color: 'var(--ant-color-text-secondary)'
}}
title={
+2 -1
View File
@@ -137,7 +137,8 @@ const ModelCard: React.FC<{
>
<span className="mkd-title" onClick={handleCollapse}>
<span>
<FileTextOutlined className="m-r-2" /> README.md
<FileTextOutlined className="m-r-2 text-tertiary" />{' '}
README.md
</span>
<span>
{collapsed ? <DownOutlined /> : <RightOutlined />}