-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from vertex-center/feature/download-logs
Better download logs display
- Loading branch information
Showing
6 changed files
with
138 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@use "../../styles/colors" | ||
@use "../../styles/dimensions" | ||
@use "../../styles/fonts" | ||
|
||
.downloads | ||
display: flex | ||
flex-direction: column | ||
margin: 0 10px | ||
line-height: 1.7 | ||
|
||
&List | ||
display: flex | ||
flex-direction: column | ||
|
||
.download | ||
display: flex | ||
flex-direction: row | ||
align-items: center | ||
gap: 10px | ||
padding: 2px 0 | ||
|
||
&ID | ||
font-family: fonts.$font-family-code | ||
color: colors.$fg-primary | ||
opacity: 0.4 | ||
|
||
&Progress | ||
flex-grow: 1 | ||
|
||
&Status | ||
color: colors.$fg-secondary | ||
font-size: 13px |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import Progress from "../Progress"; | ||
import styles from "./Downloads.module.sass"; | ||
|
||
export type Download = { | ||
id: string; | ||
status: string; | ||
current?: number; | ||
total?: number; | ||
}; | ||
|
||
export default function Downloads(props: { downloads?: Download[] }) { | ||
const { downloads } = props; | ||
|
||
console.log(downloads); | ||
if (!downloads) return null; | ||
if (downloads.length === 0) return null; | ||
|
||
const status = downloads?.find((dl) => dl.id === "")?.status; | ||
|
||
return ( | ||
<div className={styles.downloads}> | ||
<div className={styles.downloadsList}> | ||
{downloads.map((dl) => { | ||
if (dl.id === "") return null; | ||
return ( | ||
<div key={dl.id} className={styles.download}> | ||
{dl.id && ( | ||
<div className={styles.downloadID}>{dl.id}</div> | ||
)} | ||
{dl.status} | ||
{dl.current && dl.total && ( | ||
<div className={styles.downloadProgress}> | ||
<Progress | ||
value={(dl.current / dl.total) * 100} | ||
/> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
})} | ||
</div> | ||
{status && <div className={styles.download}>{status}</div>} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters