refactor: move panels to their own module

main
Josue 4 years ago committed by Tsu-ba-me
parent 5efd3938e2
commit cf40057e97
  1. 2
      striker-ui/components/Anvils/index.tsx
  2. 2
      striker-ui/components/CPU.tsx
  3. 2
      striker-ui/components/Memory.tsx
  4. 2
      striker-ui/components/Network.tsx
  5. 3
      striker-ui/components/Nodes/AnvilNode.tsx
  6. 6
      striker-ui/components/Nodes/index.tsx
  7. 2
      striker-ui/components/Panels/InnerPanel.tsx
  8. 2
      striker-ui/components/Panels/Panel.tsx
  9. 2
      striker-ui/components/Panels/PanelHeader.tsx
  10. 5
      striker-ui/components/Panels/index.tsx
  11. 2
      striker-ui/components/Servers.tsx
  12. 4
      striker-ui/components/SharedStorage.tsx
  13. 2
      striker-ui/components/Storage.tsx

@ -1,4 +1,4 @@
import Panel from '../Panel'; import { Panel } from '../Panels';
import PeriodicFetch from '../../lib/fetchers/periodicFetch'; import PeriodicFetch from '../../lib/fetchers/periodicFetch';
import SelectedAnvil from './SelectedAnvil'; import SelectedAnvil from './SelectedAnvil';
import AnvilList from './AnvilList'; import AnvilList from './AnvilList';

@ -1,6 +1,6 @@
import { useContext } from 'react'; import { useContext } from 'react';
import { Box } from '@material-ui/core'; import { Box } from '@material-ui/core';
import Panel from './Panel'; import { Panel } from './Panels';
import { AllocationBar } from './Bars'; import { AllocationBar } from './Bars';
import { HeaderText, BodyText } from './Text'; import { HeaderText, BodyText } from './Text';
import PeriodicFetch from '../lib/fetchers/periodicFetch'; import PeriodicFetch from '../lib/fetchers/periodicFetch';

@ -1,7 +1,7 @@
import { useContext } from 'react'; import { useContext } from 'react';
import { Box } from '@material-ui/core'; import { Box } from '@material-ui/core';
import * as prettyBytes from 'pretty-bytes'; import * as prettyBytes from 'pretty-bytes';
import Panel from './Panel'; import { Panel } from './Panels';
import { AllocationBar } from './Bars'; import { AllocationBar } from './Bars';
import { HeaderText, BodyText } from './Text'; import { HeaderText, BodyText } from './Text';
import PeriodicFetch from '../lib/fetchers/periodicFetch'; import PeriodicFetch from '../lib/fetchers/periodicFetch';

@ -2,7 +2,7 @@ import { useContext } from 'react';
import { Box, Divider } from '@material-ui/core'; import { Box, Divider } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { ClassNameMap } from '@material-ui/styles'; import { ClassNameMap } from '@material-ui/styles';
import Panel from './Panel'; import { Panel } from './Panels';
import { HeaderText, BodyText } from './Text'; import { HeaderText, BodyText } from './Text';
import PeriodicFetch from '../lib/fetchers/periodicFetch'; import PeriodicFetch from '../lib/fetchers/periodicFetch';
import { BLUE, PURPLE_OFF, DIVIDER } from '../lib/consts/DEFAULT_THEME'; import { BLUE, PURPLE_OFF, DIVIDER } from '../lib/consts/DEFAULT_THEME';

@ -2,10 +2,9 @@ import { Box, Switch } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { ClassNameMap } from '@material-ui/styles'; import { ClassNameMap } from '@material-ui/styles';
import InnerPanel from '../InnerPanel'; import { InnerPanel, PanelHeader } from '../Panels';
import { ProgressBar } from '../Bars'; import { ProgressBar } from '../Bars';
import { BodyText } from '../Text'; import { BodyText } from '../Text';
import PanelHeader from '../PanelHeader';
import { BLUE, RED_ON, TEXT, PURPLE_OFF } from '../../lib/consts/DEFAULT_THEME'; import { BLUE, RED_ON, TEXT, PURPLE_OFF } from '../../lib/consts/DEFAULT_THEME';
import nodeState from '../../lib/consts/NODES'; import nodeState from '../../lib/consts/NODES';

@ -1,6 +1,6 @@
import { useContext } from 'react'; import { useContext } from 'react';
import Panel from '../Panel'; import { Panel } from '../Panels';
import Text from '../Text/HeaderText'; import { HeaderText } from '../Text';
import AnvilNode from './AnvilNode'; import AnvilNode from './AnvilNode';
import PeriodicFetch from '../../lib/fetchers/periodicFetch'; import PeriodicFetch from '../../lib/fetchers/periodicFetch';
import { AnvilContext } from '../AnvilContext'; import { AnvilContext } from '../AnvilContext';
@ -15,7 +15,7 @@ const Nodes = ({ anvil }: { anvil: AnvilListItem[] }): JSX.Element => {
return ( return (
<Panel> <Panel>
<Text text="Nodes" /> <HeaderText text="Nodes" />
{anvil.findIndex((a) => a.anvil_uuid === uuid) !== -1 && ( {anvil.findIndex((a) => a.anvil_uuid === uuid) !== -1 && (
<AnvilNode <AnvilNode
nodes={anvil[anvil.findIndex((a) => a.anvil_uuid === uuid)].nodes.map( nodes={anvil[anvil.findIndex((a) => a.anvil_uuid === uuid)].nodes.map(

@ -1,7 +1,7 @@
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import { Box } from '@material-ui/core'; import { Box } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { DIVIDER } from '../lib/consts/DEFAULT_THEME'; import { DIVIDER } from '../../lib/consts/DEFAULT_THEME';
type Props = { type Props = {
children: ReactNode; children: ReactNode;

@ -1,6 +1,6 @@
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { PANEL_BACKGROUND, TEXT } from '../lib/consts/DEFAULT_THEME'; import { PANEL_BACKGROUND, TEXT } from '../../lib/consts/DEFAULT_THEME';
type Props = { type Props = {
children: ReactNode; children: ReactNode;

@ -1,7 +1,7 @@
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import { Box } from '@material-ui/core'; import { Box } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { DIVIDER } from '../lib/consts/DEFAULT_THEME'; import { DIVIDER } from '../../lib/consts/DEFAULT_THEME';
type Props = { type Props = {
children: ReactNode; children: ReactNode;

@ -0,0 +1,5 @@
import PanelHeader from './PanelHeader';
import InnerPanel from './InnerPanel';
import Panel from './Panel';
export { Panel, PanelHeader, InnerPanel };

@ -2,7 +2,7 @@ import { useContext } from 'react';
import { List, ListItem, Divider, Box } from '@material-ui/core'; import { List, ListItem, Divider, Box } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { ClassNameMap } from '@material-ui/styles'; import { ClassNameMap } from '@material-ui/styles';
import Panel from './Panel'; import { Panel } from './Panels';
import PeriodicFetch from '../lib/fetchers/periodicFetch'; import PeriodicFetch from '../lib/fetchers/periodicFetch';
import { HeaderText, BodyText } from './Text'; import { HeaderText, BodyText } from './Text';
import { import {

@ -3,10 +3,8 @@ import { useContext } from 'react';
import { Box } from '@material-ui/core'; import { Box } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { BodyText, HeaderText } from './Text'; import { BodyText, HeaderText } from './Text';
import Panel from './Panel'; import { Panel, InnerPanel, PanelHeader } from './Panels';
import SharedStorageNode from './SharedStorageNode'; import SharedStorageNode from './SharedStorageNode';
import InnerPanel from './InnerPanel';
import PanelHeader from './PanelHeader';
import PeriodicFetch from '../lib/fetchers/periodicFetch'; import PeriodicFetch from '../lib/fetchers/periodicFetch';
import { AnvilContext } from './AnvilContext'; import { AnvilContext } from './AnvilContext';

@ -1,6 +1,6 @@
import { Grid } from '@material-ui/core'; import { Grid } from '@material-ui/core';
import * as prettyBytes from 'pretty-bytes'; import * as prettyBytes from 'pretty-bytes';
import Panel from './Panel'; import { Panel } from './Panels';
import { AllocationBar } from './Bars'; import { AllocationBar } from './Bars';
import { HeaderText, BodyText } from './Text'; import { HeaderText, BodyText } from './Text';
import PeriodicFetch from '../lib/fetchers/periodicFetch'; import PeriodicFetch from '../lib/fetchers/periodicFetch';

Loading…
Cancel
Save