mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
displayed Docker Image, used MetadataMain type interface for asset type
This commit is contained in:
parent
bee7c1ecbf
commit
042e40eeb6
@ -6,7 +6,15 @@ import Publisher from '../../atoms/Publisher'
|
||||
import { useAsset } from '../../../providers/Asset'
|
||||
|
||||
export default function MetaFull(): ReactElement {
|
||||
const { ddo, metadata, isInPurgatory } = useAsset()
|
||||
const { ddo, metadata, isInPurgatory, type } = useAsset()
|
||||
|
||||
function DockerImage() {
|
||||
const algorithmContainer = ddo.findServiceByType('metadata').attributes.main
|
||||
.algorithm.container
|
||||
const { image } = algorithmContainer
|
||||
const { tag } = algorithmContainer
|
||||
return <span>{`${image}:${tag}`}</span>
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={styles.metaFull}>
|
||||
@ -17,6 +25,9 @@ export default function MetaFull(): ReactElement {
|
||||
title="Owner"
|
||||
content={<Publisher account={ddo?.publicKey[0].owner} />}
|
||||
/>
|
||||
{type === 'algorithm' && (
|
||||
<MetaItem title="Docker Image" content={<DockerImage />} />
|
||||
)}
|
||||
{/* <MetaItem
|
||||
title="Data Created"
|
||||
content={<Time date={metadata?.main.dateCreated} />}
|
||||
|
@ -7,7 +7,7 @@ import React, {
|
||||
useCallback,
|
||||
ReactNode
|
||||
} from 'react'
|
||||
import { Logger, DDO, BestPrice } from '@oceanprotocol/lib'
|
||||
import { Logger, DDO, BestPrice, MetadataMain } from '@oceanprotocol/lib'
|
||||
import { PurgatoryData } from '@oceanprotocol/lib/dist/node/ddo/interfaces/PurgatoryData'
|
||||
import { getDataTokenPrice, useOcean } from '@oceanprotocol/react'
|
||||
import getAssetPurgatoryData from '../utils/purgatory'
|
||||
@ -25,7 +25,7 @@ interface AssetProviderValue {
|
||||
title: string | undefined
|
||||
owner: string | undefined
|
||||
price: BestPrice | undefined
|
||||
type: 'dataset' | 'algorithm' | undefined
|
||||
type: MetadataMain['type'] | undefined
|
||||
error?: string
|
||||
refreshInterval: number
|
||||
refreshDdo: (token?: CancelToken) => Promise<void>
|
||||
@ -53,7 +53,7 @@ function AssetProvider({
|
||||
const [price, setPrice] = useState<BestPrice>()
|
||||
const [owner, setOwner] = useState<string>()
|
||||
const [error, setError] = useState<string>()
|
||||
const [type, setType] = useState<string>()
|
||||
const [type, setType] = useState<MetadataMain['type']>()
|
||||
|
||||
const refreshPrice = useCallback(async () => {
|
||||
if (
|
||||
|
Loading…
Reference in New Issue
Block a user