diff --git a/package-lock.json b/package-lock.json index 2af70e4a0..8b73a8f39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4462,9 +4462,9 @@ "integrity": "sha512-LING+GvW37I0L40rZdPCZ1SvcZurDSGGhT0WOVPNO8oyh2C3bXModDBNE4+gCFa8pTbQBOc4ot1/Zoj9PfT/zA==" }, "@oceanprotocol/lib": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.6.5.tgz", - "integrity": "sha512-GH7ZujwmV997kZT4GJy7cZF0TBitM/RVm+xBLtqpr5qmrP/4Pq38WODbOol3dGEHsyT62qzDTvCGoBYSRSCU1g==", + "version": "0.6.7", + "resolved": "https://registry.npmjs.org/@oceanprotocol/lib/-/lib-0.6.7.tgz", + "integrity": "sha512-6Il5PJfaZXXkXO8ECZCsH13OOGlPaN9vK3pLW9EQ6Zj9NlESeLdh0lmvvYSyvloYU999rOY4+X9ujhN6P18clw==", "requires": { "@ethereum-navigator/navigator": "^0.5.0", "@oceanprotocol/contracts": "^0.5.6", diff --git a/package.json b/package.json index 92fc050cf..dadcce34f 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "@coingecko/cryptoformat": "^0.4.2", "@loadable/component": "5.13.1", "@oceanprotocol/art": "^3.0.0", - "@oceanprotocol/lib": "^0.6.5", + "@oceanprotocol/lib": "^0.6.7", "@oceanprotocol/react": "^0.2.2", "@oceanprotocol/typographies": "^0.1.0", "@sindresorhus/slugify": "^1.0.0", diff --git a/src/@types/ComputeJobMetaData.d.ts b/src/@types/ComputeJobMetaData.d.ts new file mode 100644 index 000000000..e2e090f24 --- /dev/null +++ b/src/@types/ComputeJobMetaData.d.ts @@ -0,0 +1,10 @@ +export interface ComputeJobMetaData { + did: string + dateCreated: string + dateFinished: string + assetName: string + status: number + statusText: string + algorithmLogUrl: string + resultsUrls: string[] +} diff --git a/src/components/pages/History/ComputeDetailsModal.tsx b/src/components/pages/History/ComputeDetailsModal.tsx index b1f27731b..ce7fdd928 100644 --- a/src/components/pages/History/ComputeDetailsModal.tsx +++ b/src/components/pages/History/ComputeDetailsModal.tsx @@ -5,13 +5,15 @@ import Loader from '../../atoms/Loader' import AssetList from '../../organisms/AssetList' import BaseDialog from '../../atoms/BaseDialog' import { ComputeJob } from '@oceanprotocol/lib/dist/node/ocean/interfaces/ComputeJob' +import { ComputeJobMetaData } from '@types/ComputeJobMetaData' +import Time from '../../atoms/Time' export default function ComputeDetailsModal({ computeJob, open, onClose }: { - computeJob: ComputeJob + computeJob: ComputeJobMetaData open: boolean onClose: () => void }): ReactElement { @@ -33,7 +35,26 @@ export default function ComputeDetailsModal({ return ( - {isLoading ? : <>Details} + {isLoading ? ( + + ) : ( + <> +

{computeJob.assetName}

+

+

+

+

+

{computeJob.statusText}

+

{computeJob.algorithmLogUrl}

+

+ {computeJob.resultsUrls?.map((url) => { + return {url} + })}{' '} +

+ + )}
) } diff --git a/src/components/pages/History/ComputeJobs.tsx b/src/components/pages/History/ComputeJobs.tsx index c24c33167..a6ba76015 100644 --- a/src/components/pages/History/ComputeJobs.tsx +++ b/src/components/pages/History/ComputeJobs.tsx @@ -1,33 +1,16 @@ -import { ComputeJob } from '@oceanprotocol/lib/dist/node/ocean/interfaces/ComputeJob' import { useOcean } from '@oceanprotocol/react' -import React, { ReactElement, useState } from 'react' +import React, { ReactElement, useEffect, useState } from 'react' import DataTable from 'react-data-table-component' import Time from '../../atoms/Time' import styles from './PoolTransactions.module.css' import Loader from '../../atoms/Loader' +import Tooltip from '../../atoms/Tooltip' import Button from '../../atoms/Button' import ComputeDetailsModal from './ComputeDetailsModal' +import { ComputeJobMetaData } from '@types/ComputeJobMetaData' +import { Link } from 'gatsby' -// function AssetTitle({ row }: { row: ComputeJob }): ReactElement { -// const { ocean } = useOcean() - -// useEffect(() => { -// if (!ocean) return - -// async function getDid() { -// const { did } = await ocean.keeper.agreementStoreManager.getAgreement( -// job.agreementId -// ) -// ocean. - -// const ddo = await ocean.assets.resolve(did) -// } -// getDid() -// }, [ocean, row]) -// return {title || did} -// } - -function DetailsButton({ row }: { row: ComputeJob }): ReactElement { +function DetailsButton({ row }: { row: ComputeJobMetaData }): ReactElement { const [isDialogOpen, setIsDialogOpen] = useState(false) return ( @@ -51,33 +34,35 @@ function Empty() { const columns = [ { name: 'Created', - selector: function getTimeRow(row: ComputeJob) { + selector: function getTimeRow(row: ComputeJobMetaData) { return