From d317eb50944b397a732aed71005933ceb953d487 Mon Sep 17 00:00:00 2001 From: Pavel Murygin Date: Wed, 21 Jul 2021 19:21:23 +0300 Subject: [PATCH] rework form logic --- intro/4-ipfs-code-execution/web/src/App.scss | 63 +++---- intro/4-ipfs-code-execution/web/src/App.tsx | 186 ++++++++++--------- 2 files changed, 127 insertions(+), 122 deletions(-) diff --git a/intro/4-ipfs-code-execution/web/src/App.scss b/intro/4-ipfs-code-execution/web/src/App.scss index f0765f6..1955419 100644 --- a/intro/4-ipfs-code-execution/web/src/App.scss +++ b/intro/4-ipfs-code-execution/web/src/App.scss @@ -99,7 +99,7 @@ table { } .label { - width: 70px; + width: 240px; display: inline-block; } @@ -160,43 +160,40 @@ table { } .gg-trash { - box-sizing: border-box; - position: relative; - display: block; - transform: scale(var(--ggs,1)); - width: 10px; - height: 12px; - border: 2px solid transparent; - box-shadow: - 0 0 0 2px, - inset -2px 0 0, - inset 2px 0 0; - border-bottom-left-radius: 1px; - border-bottom-right-radius: 1px; - margin-top: 4px + box-sizing: border-box; + position: relative; + display: block; + transform: scale(var(--ggs, 1)); + width: 10px; + height: 12px; + border: 2px solid transparent; + box-shadow: 0 0 0 2px, inset -2px 0 0, inset 2px 0 0; + border-bottom-left-radius: 1px; + border-bottom-right-radius: 1px; + margin-top: 4px; } .gg-trash::after, .gg-trash::before { - content: ""; - display: block; - box-sizing: border-box; - position: absolute + content: ""; + display: block; + box-sizing: border-box; + position: absolute; } .gg-trash::after { - background: currentColor; - border-radius: 3px; - width: 16px; - height: 2px; - top: -4px; - left: -5px + background: currentColor; + border-radius: 3px; + width: 16px; + height: 2px; + top: -4px; + left: -5px; } .gg-trash::before { - width: 10px; - height: 4px; - border: 2px solid; - border-bottom: transparent; - border-top-left-radius: 2px; - border-top-right-radius: 2px; - top: -7px; - left: -2px + width: 10px; + height: 4px; + border: 2px solid; + border-bottom: transparent; + border-top-left-radius: 2px; + border-top-right-radius: 2px; + top: -7px; + left: -2px; } diff --git a/intro/4-ipfs-code-execution/web/src/App.tsx b/intro/4-ipfs-code-execution/web/src/App.tsx index 345949a..d1481a4 100644 --- a/intro/4-ipfs-code-execution/web/src/App.tsx +++ b/intro/4-ipfs-code-execution/web/src/App.tsx @@ -159,18 +159,22 @@ function App() { /> )} {deployed && ( - + <> + + + )} @@ -185,52 +189,10 @@ const Deployed = (props: { fileSize: string; fileSizeCID: string; getFileSize: () => Promise; - wasm: string; - serviceId: string | null; - removeService: () => {}; }) => { return ( <> -

Deployed

- - - - - - - - - - - - - - - -
process_files.wasm CID:{props.wasm} - -
ProcessFiles service ID:{props.serviceId}
File Size:{props.fileSize}
-
-

Set IPFS RPC address:

-

Specify IPFS to download file from

- props.setRpcAddr(e.target.value)} - value={props.rpcAddr} - /> -

Get file size

Upload any file to IPFS node @@ -278,43 +240,70 @@ const IpfsForm = (props: { }) => { return ( <> -

-
-

Set IPFS RPC address:

-

Specify IPFS to download process_files.wasm from

- props.setRpcAddr(e.target.value)} - value={props.rpcAddr} - /> -
-
-

Set process_files.wasm module CID

-

- To deploy a service, specify CID of WebAssembly module. -

- props.setWasm(e.target.value)} - value={props.wasm} - /> -
+

Ipfs

+

+ process_files.wasm will be downloaded via IPFS to the Fluence node, and + then a service will be dynamically created from it! After that, you will + be able to use that service to get sizes of IPFS files! +
+ To do so, please specify IPFS RPC address to download process_files.wasm + from +
+ And specify CID of WebAssembly module. +

+ + + + +
+
-
-

Deploy ProcessFiles service

-

- process_files.wasm will be downloaded via IPFS to the Fluence node, - and then a service will be dynamically created from it! After that, - you will be able to use that service to get sizes of IPFS files! -

-
-