From a536be4f72a6b741b67fef4dd6a01faa43a0264f Mon Sep 17 00:00:00 2001
From: Matthias Kretschmann
Date: Mon, 30 Mar 2020 12:02:07 +0200
Subject: [PATCH] compute section restructuring and markup
---
src/Compute.js | 121 +++++++++++++++------
src/{compute-asset.js => asset-compute.js} | 0
2 files changed, 86 insertions(+), 35 deletions(-)
rename src/{compute-asset.js => asset-compute.js} (100%)
diff --git a/src/Compute.js b/src/Compute.js
index f95e859..eadaca5 100644
--- a/src/Compute.js
+++ b/src/Compute.js
@@ -1,7 +1,7 @@
import React, { useState } from 'react'
import { asset } from './asset'
-import { algoAsset, createComputeService, rawAlgoMeta } from './compute-asset'
+import { algoAsset, createComputeService, rawAlgoMeta } from './asset-compute'
export default function Compute({ ocean, web3 }) {
const [ddoAssetId, setDdoAssetId] = useState('')
@@ -83,7 +83,7 @@ export default function Compute({ ocean, web3 }) {
)
setJobId(status.jobId)
console.log(status)
- alert('Job created. You can query for status now')
+ alert('Compute job created. You can query for its status now.')
} catch (error) {
console.error(error.message)
}
@@ -123,9 +123,11 @@ export default function Compute({ ocean, web3 }) {
async function updateDdoAssetId(event) {
setDdoAssetId(event.target.value)
}
+
async function handlePublishOutputState(event) {
setPublishOutputState(event.target.checked)
}
+
async function handlePublishLogState(event) {
setPublishLogState(event.target.checked)
}
@@ -136,30 +138,71 @@ export default function Compute({ ocean, web3 }) {
return (
<>
- Compute
+ Compute
+ 1. Publish Dataset
- Asset DID:
-
+
+
+
+
+
+ 2. Publish Algorithm
- Algo DID:
-
+
+
+ {ddoAlgorithmId}
+
-
- Publish Output into the Marketplace
-
- Publish Algorithm Logs into the Marketplace
+ 3. Start Compute Job
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {jobId}
+
+
-
-
-
-
- Job ID:
-
+ 4. Get Compute Job Status
+
+
+
+
+ {jobStatus}
+
+
+
- Compute status:
-
>
)
@@ -197,9 +239,10 @@ function ComputeSection({ children }) {
<>
{children}
@@ -208,3 +251,11 @@ function ComputeSection({ children }) {
>
)
}
+
+function Label({ children, ...props }) {
+ return (
+
+ )
+}
diff --git a/src/compute-asset.js b/src/asset-compute.js
similarity index 100%
rename from src/compute-asset.js
rename to src/asset-compute.js