Skip to content
Merged
5 changes: 4 additions & 1 deletion site/src/components/Queue/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,15 @@ function ProgressBar(props: { progress: UploadProgress | null }) {
return []
}, [props.progress])

// 一行以内就需要撑开
const isExpanded = chunks.length < 18

return (
<ul className={classnames.progressBar}>
{chunks.map((chunk, index) => {
const cacheName = chunk.fromCache ? classnames.cachedChunk : ''
return (
<li key={index}>
<li key={index} className={isExpanded ? classnames.expanded : ''}>
<span className={cacheName} style={{ width: chunk.percent + '%' }}>
</span>
</li>
Expand Down
11 changes: 8 additions & 3 deletions site/src/components/Queue/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,23 @@
position: relative;

display: flex;
flex-wrap: wrap;
flex-direction: row;
align-items: center;

list-style: none;
padding-inline-start: 0;

li {
.expanded {
flex: 1;
}

li {
margin: 1px;
padding: 1px;
margin: 0 1px;
min-width: 4px;
border-radius: 2px;
border:#333 solid 1px;
border: #333 solid 1px;

span {
height: 10px;
Expand Down