mirror of
https://github.com/oceanprotocol/react-tutorial
synced 2024-11-22 01:36:58 +01:00
fixes
This commit is contained in:
parent
8822bf7f4f
commit
79c66240f6
@ -9,10 +9,11 @@ export default function Compute({ ocean, web3 }) {
|
|||||||
const [jobId, setJobId] = useState('')
|
const [jobId, setJobId] = useState('')
|
||||||
const [agreementId, setAgreementId] = useState('')
|
const [agreementId, setAgreementId] = useState('')
|
||||||
const [ddoAlgorithmId, setDdoAlgorithmId] = useState('')
|
const [ddoAlgorithmId, setDdoAlgorithmId] = useState('')
|
||||||
const [divAlgoStyle, setdivAlgoStyle] = useState('')
|
const [isAlgoInputVisible, setIsAlgoInputVisible] = useState('')
|
||||||
const [textRawAlgo, setTextRawAlgo] = useState('')
|
const [textRawAlgo, setTextRawAlgo] = useState('')
|
||||||
const [publishLogState, setPublishLogState] = useState('')
|
const [publishLogState, setPublishLogState] = useState(false)
|
||||||
const [publishOutputState, setPublishOutputState] = useState('')
|
const [publishOutputState, setPublishOutputState] = useState(false)
|
||||||
|
|
||||||
// publish a dataset and an algorithm
|
// publish a dataset and an algorithm
|
||||||
async function publish() {
|
async function publish() {
|
||||||
try {
|
try {
|
||||||
@ -59,12 +60,8 @@ export default function Compute({ ocean, web3 }) {
|
|||||||
try {
|
try {
|
||||||
const accounts = await ocean.accounts.list()
|
const accounts = await ocean.accounts.list()
|
||||||
const ComputeOutput = {
|
const ComputeOutput = {
|
||||||
publishAlgorithmLog:
|
publishAlgorithmLog: publishLogState,
|
||||||
publishLogState === '' || publishLogState === false ? false : true,
|
publishOutput: publishOutputState,
|
||||||
publishOutput:
|
|
||||||
publishOutputState === '' || publishOutputState === false
|
|
||||||
? false
|
|
||||||
: true,
|
|
||||||
brizoAddress: ocean.config.brizoAddress,
|
brizoAddress: ocean.config.brizoAddress,
|
||||||
brizoUri: ocean.config.brizoUri,
|
brizoUri: ocean.config.brizoUri,
|
||||||
metadataUri: ocean.config.aquariusUri,
|
metadataUri: ocean.config.aquariusUri,
|
||||||
@ -117,8 +114,8 @@ export default function Compute({ ocean, web3 }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function showDivAlgo() {
|
async function showDivAlgo() {
|
||||||
if (divAlgoStyle === 'none') setdivAlgoStyle('block')
|
const style = isAlgoInputVisible ? false : true
|
||||||
else setdivAlgoStyle('none')
|
setIsAlgoInputVisible(style)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function updateRawAlgoCode(event) {
|
async function updateRawAlgoCode(event) {
|
||||||
@ -129,10 +126,10 @@ export default function Compute({ ocean, web3 }) {
|
|||||||
setDdoAssetId(event.target.value)
|
setDdoAssetId(event.target.value)
|
||||||
}
|
}
|
||||||
async function handlePublishOutputState(event) {
|
async function handlePublishOutputState(event) {
|
||||||
setPublishOutputState(event.target.checked)
|
setPublishOutputState(!!event.target.checked)
|
||||||
}
|
}
|
||||||
async function handlePublishLogState(event) {
|
async function handlePublishLogState(event) {
|
||||||
setPublishLogState(event.target.checked)
|
setPublishLogState(!!event.target.checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!web3) {
|
if (!web3) {
|
||||||
@ -175,7 +172,7 @@ export default function Compute({ ocean, web3 }) {
|
|||||||
Order and start compute service with raw algorithm
|
Order and start compute service with raw algorithm
|
||||||
</button>
|
</button>
|
||||||
<button onClick={showDivAlgo}>Show/Hide Raw Algo</button>
|
<button onClick={showDivAlgo}>Show/Hide Raw Algo</button>
|
||||||
<div style={{ display: divAlgoStyle }}>
|
<div style={{ display: isAlgoInputVisible ? 'block' : 'none' }}>
|
||||||
<textarea
|
<textarea
|
||||||
rows="10"
|
rows="10"
|
||||||
cols="120"
|
cols="120"
|
||||||
|
Loading…
Reference in New Issue
Block a user