diff --git a/src/Compute.js b/src/Compute.js index a2bcfe2..e387cfe 100644 --- a/src/Compute.js +++ b/src/Compute.js @@ -8,7 +8,8 @@ export default function Compute({ ocean, web3 }) { const [jobId, setJobId] = useState('') const [agreementId, setAgreementId] = useState('') const [ddoAlgorithmId, setDdoAlgorithmId] = useState('') - + const [divAlgoStyle, setdivAlgoStyle] = useState('') + const [textRawAlgo, settextRawAlgo] = useState('') // publish a dataset and an algorithm async function publish() { try { @@ -63,7 +64,7 @@ export default function Compute({ ocean, web3 }) { accounts[0], agreement, algorithmId, - algorithmMeta + JSON.stringify(algorithmMeta) ) setJobId(status.jobId) console.log(status) @@ -80,6 +81,7 @@ export default function Compute({ ocean, web3 }) { // order and start the compute service with a passed raw algorithm async function startWithRawAlgo() { + rawAlgoMeta.rawcode = textRawAlgo return startCompute(undefined, rawAlgoMeta) } @@ -95,6 +97,18 @@ export default function Compute({ ocean, web3 }) { } } + async function showDivAlgo() { + if (divAlgoStyle === 'none') setdivAlgoStyle('block') + else setdivAlgoStyle('none') + } + + async function updateRawAlgoCode(event) { + settextRawAlgo(event.target.value) + } + + async function updateDdoAssetId(event) { + setDdoAssetId(event.target.value) + } if (!web3) { return null } @@ -105,7 +119,7 @@ export default function Compute({ ocean, web3 }) { Asset DID: - + @@ -122,6 +136,15 @@ export default function Compute({ ocean, web3 }) { + +
+