diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py index b0ffee23..3078e65b 100755 --- a/backend/app_sdk/app_base.py +++ b/backend/app_sdk/app_base.py @@ -3556,15 +3556,15 @@ class AppBase: if "the JSON object must be" in errorstring: self.logger.info("[ERROR] Something is wrong with the input for this function. Are lists and JSON data handled parsed properly (0)? the JSON object must be in...") - try: - e = json.loads(f"{e}") - except: - e = f"{e}" + #try: + # e = json.loads(f"{e}") + #except: + # e = f"{e}" newres = json.dumps({ "success": False, "reason": "An exception occurred while running this function (1). See exception for more details and contact support if this persists (support@shuffler.io)", - "exception": e, + "exception": f"{type(e).__name__} - {e}", }) break elif "got an unexpected keyword argument" in errorstring: @@ -3587,15 +3587,16 @@ class AppBase: except Exception as e: self.logger.info(f"[ERROR] Something is wrong with the input for this function. Are lists and JSON data handled parsed properly (1)? err: {e}") - try: - e = json.loads(f"{e}") - except: - e = f"{e}" + #try: + # e = json.loads(f"{e}") + #except: + # e = f"{e}" newres = json.dumps({ "success": False, "reason": "An exception occurred while running this function (2). See exception for more details and contact support if this persists (support@shuffler.io)", - "exception": e, + "exception": f"{type(e).__name__} - {e}", + }) break diff --git a/backend/go-app/README.md b/backend/go-app/README.md new file mode 100644 index 00000000..158fb213 --- /dev/null +++ b/backend/go-app/README.md @@ -0,0 +1,20 @@ +# Run +go run main.go walkoff.go docker.go + +## Modify +- Make sure it's connected with the latest version of the shuffle-shared library, which is used to get resources from Shuffle + +## Database +- The database is Opensearch and can be modified with the SHUFFLE_OPENSEARCH_URL environment variable. See .env in the root directory for more. This requires Opensearch to be running (typically started from docker-compose.yml) +``` +docker-compose up -d +docker stop shuffle-backend +docker stop shuffle-frontend +docker stop shuffle-orborus +``` + +## Caching +- To handle caching, it by default runs it in memory of the application itself. If you want to offload this, it can be done using the SHUFFLE_MEMCACHED environment variable, connecting to a memcached instance. +``` +docker run --name shuffle-cache -p 11211:11211 -d memcached -m 1024 +``` diff --git a/backend/go-app/main.go b/backend/go-app/main.go index b1304b4f..26644fb8 100755 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -1064,7 +1064,6 @@ func handleInfo(resp http.ResponseWriter, request *http.Request) { } org, err := shuffle.GetOrg(ctx, item) - _ = err if len(org.Id) > 0 { userOrgs = append(userOrgs, shuffle.OrgMini{ Id: org.Id, @@ -1073,7 +1072,7 @@ func handleInfo(resp http.ResponseWriter, request *http.Request) { Image: org.Image, }) } else { - log.Printf("[WARNING] Failed to get org %s for user %s", item, userInfo.Username) + log.Printf("[WARNING] Failed to get org %s (%s) for user %s. Error: %#v", org.Name, item, userInfo.Username, err) } } diff --git a/frontend/package.json b/frontend/package.json index 157ceefc..4a4e9808 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -4,30 +4,25 @@ "version": "1.3.0", "private": true, "dependencies": { - "@codemirror/commands": "^6.2.2", + "@codemirror/commands": "^6.2.4", "@emotion/is-prop-valid": "^1.1.1", - "@emotion/react": "^11.7.0", - "@emotion/styled": "^11.6.0", + "@emotion/react": "^11.11.1", + "@emotion/styled": "^11.11.0", "@lezer/highlight": "^1.1.3", - "@metamask/detect-provider": "^1.2.0", "@mui/icons-material": "^5.14.0", - "@mui/material": "^5.2.3", + "@mui/material": "^5.14.0", "@mui/styles": "^5.14.0", "@mui/x-data-grid": "^5.17.11", - "@uiw/codemirror-themes": "^4.19.9", - "@uiw/react-codemirror": "^3.2.1", + "@uiw/codemirror-themes": "^4.21.7", + "@uiw/react-codemirror": "^4.21.7", "@use-it/interval": "^1.0.0", "algoliasearch": "^4.13.1", + "calculate-size": "^1.1.1", "class-transformer": "^0.4.0", "create-react-app": "^5.0.1", "cytoscape": "^3.15.1", - "cytoscape-clipboard": "^2.2.1", - "cytoscape-cxtmenu": "^3.1.1", "cytoscape-edgehandles": "^3.6.0", - "cytoscape-grid-guide": "~2.3.3", "cytoscape-node-html-label": "^1.1.5", - "cytoscape-panzoom": "^2.5.2", - "cytoscape-undo-redo": "^1.3.2", "d3": "^7.1.1", "dotenv": "^6.1.0", "downshift": "^3.3.5", @@ -41,8 +36,6 @@ "jss-nested": "^6.0.1", "jss-props-sort": "^6.0.0", "jss-vendor-prefixer": "^8.0.1", - "material-icons": "^0.7.7", - "material-icons-react": "^1.0.4", "material-ui-chip-input": "^2.0.0-beta.2", "md5-file": "^4.0.0", "mdbreact": "^4.21.1", @@ -51,43 +44,41 @@ "mui-nested-menu": "^3.2.1", "process": "^0.11.10", "react": "^18.2.0", - "react-alert": "^5.5.0", + "react-alert": "^7.0.3", "react-alert-template-basic": "^1.0.0", "react-alice-carousel": "^2.6.4", "react-avatar-editor": "^11.1.0", "react-beforeunload": "^2.2.1", "react-chartjs-2": "^2.11.1", "react-cookie": "^4.0.1", - "react-cytoscapejs": "^1.2.0", - "react-device-detect": "^1.9.10", + "react-cytoscapejs": "^2.0.0", + "react-device-detect": "^2.2.3", "react-dom": "^18.2.0", "react-draggable": "^3.3.2", "react-driftjs": "^1.2.2", - "react-dropzone": "^10.1.10", + "react-dropzone": "^14.2.3", "react-ga4": "^2.0.0", - "react-iframe": "^1.8.0", "react-instantsearch-dom": "^6.28.0", "react-json-pretty": "^2.2.0", - "react-json-view": "^1.19.1", + "react-json-view": "^1.21.3", "react-markdown": "^8.0.7", "react-markdown-github": "^3.3.1", - "react-powerhooks": "0.0.7", - "react-router": "6.2.1", - "react-router-dom": "6.2.1", + "react-powerhooks": "^0.0.7", + "react-router": "^6.14.1", + "react-router-dom": "^6.14.1", "react-scripts": "^5.0.1", - "react-shepherd": "^3.3.6", - "reactstrap": "^7.1.0", - "reaviz": "^12.1.0", + "reaviz": "^14.9.4", + "remark-gfm": "^3.0.1", "search-insights": "^2.2.1", "shellwords": "^0.1.1", "simplebar": "^4.2.3", "styled-components": "^4.4.0", "yaml": "^1.7.2", "yamljs": "^0.3.0", - "zone.js": "~0.11.4" + "zone.js": "^0.13.1" }, "scripts": { - "start": "HTTPS=false&&PORT=3000 react-scripts --openssl-legacy-provider start", + "start": "HTTPS=false&&PORT=3000 GENERATE_SOURCEMAP=false react-scripts --openssl-legacy-provider start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index fcbb006c..abeb8ab3 100755 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -30,6 +30,7 @@ import SettingsPage from "./views/SettingsPage"; import KeepAlive from "./views/KeepAlive.jsx"; import { ThemeProvider } from "@mui/material/styles"; +import CssBaseline from '@mui/material/CssBaseline'; import UpdateAuthentication from "./views/UpdateAuthentication.jsx"; import FrameworkWrapper from "./views/FrameworkWrapper.jsx"; @@ -38,7 +39,6 @@ import AlertTemplate from "./components/AlertTemplate"; import { useAlert, positions, Provider } from "react-alert"; import { isMobile } from "react-device-detect"; -import detectEthereumProvider from "@metamask/detect-provider"; import Drift from "react-driftjs"; // Production - backend proxy forwarding in nginx @@ -143,120 +143,6 @@ const App = (message, props) => { } // Handling Ethereum update - {/* - detectEthereumProvider().then((provider) => { - if ( - provider && - userInfo.eth_info !== undefined && - userInfo.eth_info !== null - ) { - if ( - userInfo.eth_info.account !== undefined && - userInfo.eth_info.account !== null && - userInfo.eth_info.account.length === 0 - ) { - userInfo.eth_info = {}; - var method = "eth_requestAccounts"; - var params = []; - provider - .request({ - method: method, - params, - }) - .then((result) => { - if ( - result !== undefined && - result !== null && - result.length > 0 - ) { - userInfo.eth_info.account = result[0]; - - // Getting and setting balance for the current user - method = "eth_getBalance"; - params = [userInfo.eth_info.account, "latest"]; - provider - .request({ - method: method, - params, - }) - .then((result) => { - if ( - result !== undefined && - result !== null && - result.length > 0 - ) { - userInfo.parsed_balance = - result / 1000000000000000000; - } else { - alert.error("Couldn't find balance: ", result); - } - // The result varies by RPC method. - // For example, this method will return a transaction hash hexadecimal string on success. - }) - .catch((error) => { - // If the request fails, the Promise will reject with an error. - alert.error( - "Failed getting info from ethereum API: " + error - ); - }); - } else { - alert.error("Couldn't find any user: ", result); - } - }) - .catch((error) => { - // If the request fails, the Promise will reject with an error. - alert.error( - "Failed getting info from ethereum API: " + error - ); - }); - } - - // Register hooks here - provider.on("message", (event) => { - alert.info("Message from MetaMask: ", event); - }); - - provider.on("chainChanged", (chainId) => { - console.log("Changed chain to: ", chainId); - - method = "eth_getBalance"; - params = [userInfo.eth_info.account, "latest"]; - provider - .request({ - method: method, - params, - }) - .then((result) => { - console.log("Got result: ", result); - if (result !== undefined && result !== null) { - userInfo.eth_info.balance = result; - userInfo.eth_info.parsed_balance = - result / 1000000000000000000; - console.log("INFO: ", userInfo); - setUserData(userInfo); - } else { - alert.error("Couldn't find balance: ", result); - } - }) - .catch((error) => { - // If the request fails, the Promise will reject with an error. - alert.error( - "Failed getting info from ethereum API: " + error - ); - }); - }); - } - }); - - if ( - userInfo.eth_info !== undefined && - userInfo.eth_info.balance !== undefined - ) { - //console.log(userInfo.eth_info.balance) - userInfo.eth_info.parsed_balance = - userInfo.eth_info.balance / 1000000000000000000; - } - */} //console.log("USER: ", userInfo) setUserData(userInfo); @@ -529,8 +415,8 @@ const App = (message, props) => { /> } /> - } /> - } /> + } /> + } /> { /> } /> - - } + + } + /> { return ( + diff --git a/frontend/src/components/ConfigureWorkflow.jsx b/frontend/src/components/ConfigureWorkflow.jsx index f54b73e5..c24703fe 100755 --- a/frontend/src/components/ConfigureWorkflow.jsx +++ b/frontend/src/components/ConfigureWorkflow.jsx @@ -14,7 +14,7 @@ import { List, ListItem, ListItemText, - Fade, + Collapse, } from "@mui/material"; import { FavoriteBorder as FavoriteBorderIcon, @@ -506,13 +506,6 @@ const ConfigureWorkflow = (props) => { borderRadius: 5, }} InputProps={{ - style: { - color: "white", - minHeight: 50, - marginLeft: 5, - maxWidth: "95%", - fontSize: "1em", - }, endAdornment: , }} fullWidth @@ -618,10 +611,10 @@ const ConfigureWorkflow = (props) => { /> */} {action.must_authenticate ? - */}