mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
compute jobs profile visual fixes
This commit is contained in:
parent
923569e61a
commit
18b487dd75
@ -42,9 +42,11 @@ function Asset({
|
|||||||
|
|
||||||
function DetailsAssets({ job }: { job: ComputeJobMetaData }) {
|
function DetailsAssets({ job }: { job: ComputeJobMetaData }) {
|
||||||
const { appConfig } = useMarketMetadata()
|
const { appConfig } = useMarketMetadata()
|
||||||
|
const newCancelToken = useCancelToken()
|
||||||
|
|
||||||
const [algoName, setAlgoName] = useState<string>()
|
const [algoName, setAlgoName] = useState<string>()
|
||||||
const [algoDtSymbol, setAlgoDtSymbol] = useState<string>()
|
const [algoDtSymbol, setAlgoDtSymbol] = useState<string>()
|
||||||
const newCancelToken = useCancelToken()
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function getAlgoMetadata() {
|
async function getAlgoMetadata() {
|
||||||
const ddo = await retrieveAsset(job.algoDID, newCancelToken())
|
const ddo = await retrieveAsset(job.algoDID, newCancelToken())
|
||||||
@ -52,7 +54,7 @@ function DetailsAssets({ job }: { job: ComputeJobMetaData }) {
|
|||||||
setAlgoName(ddo?.metadata.name)
|
setAlgoName(ddo?.metadata.name)
|
||||||
}
|
}
|
||||||
getAlgoMetadata()
|
getAlgoMetadata()
|
||||||
}, [appConfig.metadataCacheUri, job.algoDID])
|
}, [appConfig.metadataCacheUri, job.algoDID, newCancelToken])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -3,8 +3,10 @@
|
|||||||
border-bottom-left-radius: var(--border-radius) !important;
|
border-bottom-left-radius: var(--border-radius) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.results li {
|
.title {
|
||||||
list-style-type: none;
|
font-size: var(--font-size-base);
|
||||||
|
color: var(--font-color-text);
|
||||||
|
margin-bottom: calc(var(--spacer) / 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.help {
|
.help {
|
||||||
|
@ -26,31 +26,32 @@ export default function Results({
|
|||||||
|
|
||||||
const [datasetProvider, setDatasetProvider] = useState<string>()
|
const [datasetProvider, setDatasetProvider] = useState<string>()
|
||||||
const newCancelToken = useCancelToken()
|
const newCancelToken = useCancelToken()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function getAssetMetadata() {
|
async function getAssetMetadata() {
|
||||||
const ddo = await retrieveAsset(job.inputDID[0], newCancelToken())
|
const ddo = await retrieveAsset(job.inputDID[0], newCancelToken())
|
||||||
setDatasetProvider(ddo.services[0].serviceEndpoint)
|
setDatasetProvider(ddo.services[0].serviceEndpoint)
|
||||||
}
|
}
|
||||||
getAssetMetadata()
|
getAssetMetadata()
|
||||||
}, [job.inputDID[0]])
|
}, [job.inputDID, newCancelToken])
|
||||||
|
|
||||||
function getDownloadButtonValue(type: ComputeResultType): string {
|
function getDownloadButtonValue(type: ComputeResultType): string {
|
||||||
let buttonName
|
let buttonName
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'output':
|
case 'output':
|
||||||
buttonName = 'Download results'
|
buttonName = 'results'
|
||||||
break
|
break
|
||||||
case 'algorithmLog':
|
case 'algorithmLog':
|
||||||
buttonName = 'Download algorithm logs'
|
buttonName = 'algorithm logs'
|
||||||
break
|
break
|
||||||
case 'configrationLog':
|
case 'configrationLog':
|
||||||
buttonName = 'Download configuration logs'
|
buttonName = 'configuration logs'
|
||||||
break
|
break
|
||||||
case 'publishLog':
|
case 'publishLog':
|
||||||
buttonName = 'Download publish logs'
|
buttonName = 'publish logs'
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
buttonName = 'Download results'
|
buttonName = 'results'
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
return buttonName
|
return buttonName
|
||||||
@ -78,6 +79,7 @@ export default function Results({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.results}>
|
<div className={styles.results}>
|
||||||
|
<h4 className={styles.title}>Results</h4>
|
||||||
{isFinished ? (
|
{isFinished ? (
|
||||||
<ul>
|
<ul>
|
||||||
{job.results &&
|
{job.results &&
|
||||||
@ -86,10 +88,10 @@ export default function Results({
|
|||||||
jobResult.filename ? (
|
jobResult.filename ? (
|
||||||
<ListItem key={i}>
|
<ListItem key={i}>
|
||||||
<Button
|
<Button
|
||||||
style="primary"
|
style="text"
|
||||||
size="small"
|
size="small"
|
||||||
onClick={() => downloadResults(i)}
|
onClick={() => downloadResults(i)}
|
||||||
disabled={isLoading || !isFinished}
|
download
|
||||||
>
|
>
|
||||||
{getDownloadButtonValue(jobResult.type)}
|
{getDownloadButtonValue(jobResult.type)}
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import React, { ReactElement, useEffect, useState, useCallback } from 'react'
|
import React, { ReactElement, useEffect, useState, useCallback } from 'react'
|
||||||
import Time from '@shared/atoms/Time'
|
import Time from '@shared/atoms/Time'
|
||||||
import Link from 'next/link'
|
|
||||||
import { LoggerInstance } from '@oceanprotocol/lib'
|
import { LoggerInstance } from '@oceanprotocol/lib'
|
||||||
import Dotdotdot from 'react-dotdotdot'
|
|
||||||
import Table from '@shared/atoms/Table'
|
import Table from '@shared/atoms/Table'
|
||||||
import Button from '@shared/atoms/Button'
|
import Button from '@shared/atoms/Button'
|
||||||
import { useWeb3 } from '@context/Web3'
|
import { useWeb3 } from '@context/Web3'
|
||||||
@ -15,6 +13,7 @@ import styles from './index.module.css'
|
|||||||
import { useAsset } from '@context/Asset'
|
import { useAsset } from '@context/Asset'
|
||||||
import { useIsMounted } from '@hooks/useIsMounted'
|
import { useIsMounted } from '@hooks/useIsMounted'
|
||||||
import { useCancelToken } from '@hooks/useCancelToken'
|
import { useCancelToken } from '@hooks/useCancelToken'
|
||||||
|
import AssetListTitle from '@shared/AssetList/AssetListTitle'
|
||||||
|
|
||||||
export function Status({ children }: { children: string }): ReactElement {
|
export function Status({ children }: { children: string }): ReactElement {
|
||||||
return <div className={styles.status}>{children}</div>
|
return <div className={styles.status}>{children}</div>
|
||||||
@ -24,13 +23,7 @@ const columns = [
|
|||||||
{
|
{
|
||||||
name: 'Data Set',
|
name: 'Data Set',
|
||||||
selector: function getAssetRow(row: ComputeJobMetaData) {
|
selector: function getAssetRow(row: ComputeJobMetaData) {
|
||||||
return (
|
return <AssetListTitle did={row.inputDID[0]} title={row.assetName} />
|
||||||
<Dotdotdot clamp={2}>
|
|
||||||
<Link href={`/asset/${row.inputDID[0]}`}>
|
|
||||||
<a>{row.assetName}</a>
|
|
||||||
</Link>
|
|
||||||
</Dotdotdot>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user