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'
|
import { useAsset } from '../../../providers/Asset'
|
||||||
|
|
||||||
export default function MetaFull(): ReactElement {
|
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 (
|
return (
|
||||||
<div className={styles.metaFull}>
|
<div className={styles.metaFull}>
|
||||||
@ -17,6 +25,9 @@ export default function MetaFull(): ReactElement {
|
|||||||
title="Owner"
|
title="Owner"
|
||||||
content={<Publisher account={ddo?.publicKey[0].owner} />}
|
content={<Publisher account={ddo?.publicKey[0].owner} />}
|
||||||
/>
|
/>
|
||||||
|
{type === 'algorithm' && (
|
||||||
|
<MetaItem title="Docker Image" content={<DockerImage />} />
|
||||||
|
)}
|
||||||
{/* <MetaItem
|
{/* <MetaItem
|
||||||
title="Data Created"
|
title="Data Created"
|
||||||
content={<Time date={metadata?.main.dateCreated} />}
|
content={<Time date={metadata?.main.dateCreated} />}
|
||||||
|
@ -7,7 +7,7 @@ import React, {
|
|||||||
useCallback,
|
useCallback,
|
||||||
ReactNode
|
ReactNode
|
||||||
} from 'react'
|
} 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 { PurgatoryData } from '@oceanprotocol/lib/dist/node/ddo/interfaces/PurgatoryData'
|
||||||
import { getDataTokenPrice, useOcean } from '@oceanprotocol/react'
|
import { getDataTokenPrice, useOcean } from '@oceanprotocol/react'
|
||||||
import getAssetPurgatoryData from '../utils/purgatory'
|
import getAssetPurgatoryData from '../utils/purgatory'
|
||||||
@ -25,7 +25,7 @@ interface AssetProviderValue {
|
|||||||
title: string | undefined
|
title: string | undefined
|
||||||
owner: string | undefined
|
owner: string | undefined
|
||||||
price: BestPrice | undefined
|
price: BestPrice | undefined
|
||||||
type: 'dataset' | 'algorithm' | undefined
|
type: MetadataMain['type'] | undefined
|
||||||
error?: string
|
error?: string
|
||||||
refreshInterval: number
|
refreshInterval: number
|
||||||
refreshDdo: (token?: CancelToken) => Promise<void>
|
refreshDdo: (token?: CancelToken) => Promise<void>
|
||||||
@ -53,7 +53,7 @@ function AssetProvider({
|
|||||||
const [price, setPrice] = useState<BestPrice>()
|
const [price, setPrice] = useState<BestPrice>()
|
||||||
const [owner, setOwner] = useState<string>()
|
const [owner, setOwner] = useState<string>()
|
||||||
const [error, setError] = useState<string>()
|
const [error, setError] = useState<string>()
|
||||||
const [type, setType] = useState<string>()
|
const [type, setType] = useState<MetadataMain['type']>()
|
||||||
|
|
||||||
const refreshPrice = useCallback(async () => {
|
const refreshPrice = useCallback(async () => {
|
||||||
if (
|
if (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user