From 4880eefb8eaa620d565536b535abfaac4c414dae Mon Sep 17 00:00:00 2001 From: Sergio Betanzos Date: Tue, 22 Jun 2021 18:34:40 +0200 Subject: [PATCH] F OpenNebula/one#5422: Remove web console page --- .../src/client/containers/WebConsole/index.js | 80 ------------------- src/fireedge/src/client/router/dev.js | 12 +-- 2 files changed, 1 insertion(+), 91 deletions(-) delete mode 100644 src/fireedge/src/client/containers/WebConsole/index.js diff --git a/src/fireedge/src/client/containers/WebConsole/index.js b/src/fireedge/src/client/containers/WebConsole/index.js deleted file mode 100644 index 331f52c309..0000000000 --- a/src/fireedge/src/client/containers/WebConsole/index.js +++ /dev/null @@ -1,80 +0,0 @@ -/* Copyright 2002-2021, OpenNebula Project, OpenNebula Systems */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ -/* not use this file except in compliance with the License. You may obtain */ -/* a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ -/* See the License for the specific language governing permissions and */ -/* limitations under the License. */ -/* -------------------------------------------------------------------------- */ - -import React, { useState, useEffect, memo } from 'react' - -import { Button, makeStyles } from '@material-ui/core' -import { useSocket } from 'client/hooks' - -const useStyles = makeStyles(theme => ({ - sticky: { - position: 'sticky', - top: 0, - padding: '1em', - backgroundColor: theme.palette.background.paper - }, - loading: { - '&::after': { - overflow: 'hidden', - display: 'inline-block', - verticalAlign: 'bottom', - animation: '$ellipsis steps(4,end) 1000ms infinite', - content: '"\\2026"', /* ascii code for the ellipsis character */ - width: 0 - } - }, - '@keyframes ellipsis': { - to: { width: 20 } - } -})) - -const ResponseComponent = memo(response => ( -

{JSON.stringify(response)}

-)) - -ResponseComponent.displayName = 'ResponseComponent' - -const Webconsole = () => { - const classes = useStyles() - const [listening, setListening] = useState(false) - const [response, setResponse] = useState([]) - const { getHooksSocket } = useSocket() - - const toggleListening = () => setListening(list => !list) - - useEffect(() => { - listening && getHooksSocket(data => setResponse(prev => [...prev, data])) - }, [listening]) - - return ( - <> -
-

- {`socket is ${listening ? '' : 'not'} listening`} -

- -
- {response?.map((res, index) => - - )} - - ) -} -export default Webconsole diff --git a/src/fireedge/src/client/router/dev.js b/src/fireedge/src/client/router/dev.js index a8191c266c..f0315c6a9d 100644 --- a/src/fireedge/src/client/router/dev.js +++ b/src/fireedge/src/client/router/dev.js @@ -6,12 +6,10 @@ import { const Newstone = loadable(() => import('client/containers/Newstone'), { ssr: false }) const TestApi = loadable(() => import('client/containers/TestApi'), { ssr: false }) -const WebConsole = loadable(() => import('client/containers/WebConsole'), { ssr: false }) export const PATH = { NEWSTONE: '/newstone/:resource', - TEST_API: '/test-api', - WEB_CONSOLE: '/webconsole' + TEST_API: '/test-api' } export const ENDPOINTS = [ @@ -29,14 +27,6 @@ export const ENDPOINTS = [ sidebar: true, icon: DevIcon, Component: TestApi - }, - { - label: 'Web Console', - path: PATH.WEB_CONSOLE, - devMode: true, - sidebar: true, - icon: DevIcon, - Component: WebConsole } ]