|
|
@ -11,14 +11,14 @@ function QueueDetails(props) {
|
|
|
|
size,
|
|
|
|
size,
|
|
|
|
sizeleft,
|
|
|
|
sizeleft,
|
|
|
|
estimatedCompletionTime,
|
|
|
|
estimatedCompletionTime,
|
|
|
|
status: queueStatus,
|
|
|
|
status,
|
|
|
|
|
|
|
|
trackedDownloadState,
|
|
|
|
|
|
|
|
trackedDownloadStatus,
|
|
|
|
errorMessage,
|
|
|
|
errorMessage,
|
|
|
|
progressBar
|
|
|
|
progressBar
|
|
|
|
} = props;
|
|
|
|
} = props;
|
|
|
|
|
|
|
|
|
|
|
|
const status = queueStatus.toLowerCase();
|
|
|
|
const progress = size ? (100 - sizeleft / size * 100) : 0;
|
|
|
|
|
|
|
|
|
|
|
|
const progress = (100 - sizeleft / size * 100);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (status === 'pending') {
|
|
|
|
if (status === 'pending') {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
@ -40,7 +40,35 @@ function QueueDetails(props) {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: show an icon when download is complete, but not imported yet?
|
|
|
|
if (trackedDownloadStatus === 'warning') {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<Icon
|
|
|
|
|
|
|
|
name={icons.DOWNLOAD}
|
|
|
|
|
|
|
|
kind={kinds.WARNING}
|
|
|
|
|
|
|
|
title={'Downloaded - Unable to Import: check logs for details'}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (trackedDownloadState === 'importPending') {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<Icon
|
|
|
|
|
|
|
|
name={icons.DOWNLOAD}
|
|
|
|
|
|
|
|
kind={kinds.PURPLE}
|
|
|
|
|
|
|
|
title={`${translate('Downloaded')} - ${translate('WaitingToImport')}`}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (trackedDownloadState === 'importing') {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<Icon
|
|
|
|
|
|
|
|
name={icons.DOWNLOAD}
|
|
|
|
|
|
|
|
kind={kinds.PURPLE}
|
|
|
|
|
|
|
|
title={`${translate('Downloaded')} - ${translate('Importing')}`}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (errorMessage) {
|
|
|
|
if (errorMessage) {
|
|
|
@ -91,6 +119,8 @@ QueueDetails.propTypes = {
|
|
|
|
sizeleft: PropTypes.number.isRequired,
|
|
|
|
sizeleft: PropTypes.number.isRequired,
|
|
|
|
estimatedCompletionTime: PropTypes.string,
|
|
|
|
estimatedCompletionTime: PropTypes.string,
|
|
|
|
status: PropTypes.string.isRequired,
|
|
|
|
status: PropTypes.string.isRequired,
|
|
|
|
|
|
|
|
trackedDownloadState: PropTypes.string.isRequired,
|
|
|
|
|
|
|
|
trackedDownloadStatus: PropTypes.string.isRequired,
|
|
|
|
errorMessage: PropTypes.string,
|
|
|
|
errorMessage: PropTypes.string,
|
|
|
|
progressBar: PropTypes.node.isRequired
|
|
|
|
progressBar: PropTypes.node.isRequired
|
|
|
|
};
|
|
|
|
};
|
|
|
|