From 12787522c10059c10c643d66470097bd879a1368 Mon Sep 17 00:00:00 2001 From: Luca Milanese Date: Mon, 11 Sep 2023 15:50:47 +0200 Subject: [PATCH 1/2] feat: add file name and size to compute results --- .../History/ComputeJobs/Results.module.css | 4 ++++ .../Profile/History/ComputeJobs/Results.tsx | 22 +++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/components/Profile/History/ComputeJobs/Results.module.css b/src/components/Profile/History/ComputeJobs/Results.module.css index 563be31b7..0c84a4b2a 100644 --- a/src/components/Profile/History/ComputeJobs/Results.module.css +++ b/src/components/Profile/History/ComputeJobs/Results.module.css @@ -9,6 +9,10 @@ margin-bottom: calc(var(--spacer) / 3); } +.downloadButton { + text-transform: none; +} + .help { margin-top: calc(var(--spacer) / 3); } diff --git a/src/components/Profile/History/ComputeJobs/Results.tsx b/src/components/Profile/History/ComputeJobs/Results.tsx index 0d2744c68..2f4e4acc9 100644 --- a/src/components/Profile/History/ComputeJobs/Results.tsx +++ b/src/components/Profile/History/ComputeJobs/Results.tsx @@ -13,6 +13,7 @@ import content from '../../../../../content/pages/history.json' import { useWeb3 } from '@context/Web3' import { useCancelToken } from '@hooks/useCancelToken' import { getAsset } from '@utils/aquarius' +import { prettySize } from '@components/@shared/FormInput/InputElement/FilesInput/utils' export default function Results({ job @@ -34,23 +35,26 @@ export default function Results({ getAssetMetadata() }, [job.inputDID, newCancelToken]) - function getDownloadButtonValue(type: ComputeResultType): string { + function getDownloadButtonValue( + type: ComputeResultType, + name: string + ): string { let buttonName switch (type) { case 'output': - buttonName = 'results' + buttonName = `RESULTS (${name})` break case 'algorithmLog': - buttonName = 'algorithm logs' + buttonName = 'ALGORITHM LOGS' break case 'configrationLog': - buttonName = 'configuration logs' + buttonName = 'CONFIGURATION LOGS' break case 'publishLog': - buttonName = 'publish logs' + buttonName = 'PUBLISH LOGS' break default: - buttonName = 'results' + buttonName = `RESULTS (${name})` break } return buttonName @@ -86,10 +90,14 @@ export default function Results({ ) : ( From fdc58c359b820230505453777273fa9a935e688a Mon Sep 17 00:00:00 2001 From: Luca Milanese Date: Mon, 11 Sep 2023 15:54:29 +0200 Subject: [PATCH 2/2] feat: update prettySize utility function --- .../@shared/FormInput/InputElement/FilesInput/utils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/@shared/FormInput/InputElement/FilesInput/utils.ts b/src/components/@shared/FormInput/InputElement/FilesInput/utils.ts index d3c42a126..e1a384470 100644 --- a/src/components/@shared/FormInput/InputElement/FilesInput/utils.ts +++ b/src/components/@shared/FormInput/InputElement/FilesInput/utils.ts @@ -3,6 +3,7 @@ export function prettySize( separator = ' ', postFix = '' ): string { + if (bytes === 0) return '0 Bytes' if (!bytes) return 'n/a' const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']