fix(striker-ui): rename PanelHeader->InnerPanelHeader

main
Tsu-ba-me 3 years ago
parent 3dff61b966
commit d0b36e9f99
  1. 6
      striker-ui/components/FileSystem/FileSystems.tsx
  2. 6
      striker-ui/components/Hosts/AnvilHost.tsx
  3. 10
      striker-ui/components/Panels/InnerPanelHeader.tsx
  4. 4
      striker-ui/components/Panels/index.tsx
  5. 6
      striker-ui/components/Resource/ResourceVolumes.tsx
  6. 6
      striker-ui/components/SharedStorage/SharedStorage.tsx

@ -3,7 +3,7 @@ import { useContext } from 'react';
import { Box } from '@mui/material'; import { Box } from '@mui/material';
import { styled } from '@mui/material/styles'; import { styled } from '@mui/material/styles';
import { BodyText, HeaderText } from '../Text'; import { BodyText, HeaderText } from '../Text';
import { Panel, InnerPanel, PanelHeader } from '../Panels'; import { Panel, InnerPanel, InnerPanelHeader } from '../Panels';
import SharedStorageHost from './FileSystemsHost'; import SharedStorageHost from './FileSystemsHost';
import PeriodicFetch from '../../lib/fetchers/periodicFetch'; import PeriodicFetch from '../../lib/fetchers/periodicFetch';
import { AnvilContext } from '../AnvilContext'; import { AnvilContext } from '../AnvilContext';
@ -48,7 +48,7 @@ const SharedStorage = ({ anvil }: { anvil: AnvilListItem[] }): JSX.Element => {
data.file_systems.map( data.file_systems.map(
(fs: AnvilFileSystem): JSX.Element => ( (fs: AnvilFileSystem): JSX.Element => (
<InnerPanel key={fs.mount_point}> <InnerPanel key={fs.mount_point}>
<PanelHeader> <InnerPanelHeader>
<Box <Box
display="flex" display="flex"
width="100%" width="100%"
@ -58,7 +58,7 @@ const SharedStorage = ({ anvil }: { anvil: AnvilListItem[] }): JSX.Element => {
<BodyText text={fs.mount_point} /> <BodyText text={fs.mount_point} />
</Box> </Box>
</Box> </Box>
</PanelHeader> </InnerPanelHeader>
{fs?.hosts && {fs?.hosts &&
fs.hosts.map( fs.hosts.map(
( (

@ -1,6 +1,6 @@
import { Box, Switch } from '@mui/material'; import { Box, Switch } from '@mui/material';
import { styled } from '@mui/material/styles'; import { styled } from '@mui/material/styles';
import { InnerPanel, PanelHeader } from '../Panels'; import { InnerPanel, InnerPanelHeader } from '../Panels';
import { ProgressBar } from '../Bars'; import { ProgressBar } from '../Bars';
import { BodyText } from '../Text'; import { BodyText } from '../Text';
import Decorator, { Colours } from '../Decorator'; import Decorator, { Colours } from '../Decorator';
@ -91,7 +91,7 @@ const AnvilHost = ({
// TODO: figure out why there are undefined host entries. // TODO: figure out why there are undefined host entries.
return host ? ( return host ? (
<InnerPanel key={host.host_uuid}> <InnerPanel key={host.host_uuid}>
<PanelHeader> <InnerPanelHeader>
<Box display="flex" width="100%" className={classes.header}> <Box display="flex" width="100%" className={classes.header}>
<Box flexGrow={1}> <Box flexGrow={1}>
<BodyText text={host.host_name} /> <BodyText text={host.host_name} />
@ -109,7 +109,7 @@ const AnvilHost = ({
/> />
</Box> </Box>
</Box> </Box>
</PanelHeader> </InnerPanelHeader>
<Box display="flex" className={classes.state}> <Box display="flex" className={classes.state}>
<Box className={classes.label}> <Box className={classes.label}>
<BodyText text="Power: " /> <BodyText text="Power: " />

@ -1,9 +1,9 @@
import { ReactNode } from 'react'; import { ReactNode } from 'react';
import { Box } from '@mui/material'; import { Box, styled } from '@mui/material';
import { styled } from '@mui/material/styles';
import { BORDER_RADIUS, DIVIDER } from '../../lib/consts/DEFAULT_THEME'; import { BORDER_RADIUS, DIVIDER } from '../../lib/consts/DEFAULT_THEME';
const PREFIX = 'PanelHeader'; const PREFIX = 'InnerPanelHeader';
const classes = { const classes = {
header: `${PREFIX}-header`, header: `${PREFIX}-header`,
@ -32,7 +32,7 @@ type Props = {
children: ReactNode; children: ReactNode;
}; };
const PanelHeader = ({ children }: Props): JSX.Element => { const InnerPanelHeader = ({ children }: Props): JSX.Element => {
return ( return (
<StyledBox> <StyledBox>
<div className={classes.header} /> <div className={classes.header} />
@ -41,4 +41,4 @@ const PanelHeader = ({ children }: Props): JSX.Element => {
); );
}; };
export default PanelHeader; export default InnerPanelHeader;

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

@ -2,7 +2,7 @@ import * as prettyBytes from 'pretty-bytes';
import { Box, Divider } from '@mui/material'; import { Box, Divider } from '@mui/material';
import { styled } from '@mui/material/styles'; import { styled } from '@mui/material/styles';
import InsertLinkIcon from '@mui/icons-material/InsertLink'; import InsertLinkIcon from '@mui/icons-material/InsertLink';
import { InnerPanel, PanelHeader } from '../Panels'; import { InnerPanel, InnerPanelHeader } from '../Panels';
import { BodyText } from '../Text'; import { BodyText } from '../Text';
import Decorator, { Colours } from '../Decorator'; import Decorator, { Colours } from '../Decorator';
import { DIVIDER } from '../../lib/consts/DEFAULT_THEME'; import { DIVIDER } from '../../lib/consts/DEFAULT_THEME';
@ -78,7 +78,7 @@ const ResourceVolumes = ({
resource.volumes.map((volume) => { resource.volumes.map((volume) => {
return ( return (
<InnerPanel key={volume.drbd_device_minor}> <InnerPanel key={volume.drbd_device_minor}>
<PanelHeader> <InnerPanelHeader>
<Box display="flex" width="100%" className={classes.header}> <Box display="flex" width="100%" className={classes.header}>
<Box flexGrow={1}> <Box flexGrow={1}>
<BodyText text={`Volume: ${volume.number}`} /> <BodyText text={`Volume: ${volume.number}`} />
@ -91,7 +91,7 @@ const ResourceVolumes = ({
/> />
</Box> </Box>
</Box> </Box>
</PanelHeader> </InnerPanelHeader>
{volume.connections.map( {volume.connections.map(
(connection, index): JSX.Element => { (connection, index): JSX.Element => {
return ( return (

@ -3,7 +3,7 @@ import { useContext } from 'react';
import { Box } from '@mui/material'; import { Box } from '@mui/material';
import { styled } from '@mui/material/styles'; import { styled } from '@mui/material/styles';
import { BodyText, HeaderText } from '../Text'; import { BodyText, HeaderText } from '../Text';
import { Panel, InnerPanel, PanelHeader } from '../Panels'; import { Panel, InnerPanel, InnerPanelHeader } from '../Panels';
import SharedStorageHost from './SharedStorageHost'; import SharedStorageHost from './SharedStorageHost';
import PeriodicFetch from '../../lib/fetchers/periodicFetch'; import PeriodicFetch from '../../lib/fetchers/periodicFetch';
import { AnvilContext } from '../AnvilContext'; import { AnvilContext } from '../AnvilContext';
@ -49,7 +49,7 @@ const SharedStorage = (): JSX.Element => {
data.storage_groups.map( data.storage_groups.map(
(storageGroup: AnvilSharedStorageGroup): JSX.Element => ( (storageGroup: AnvilSharedStorageGroup): JSX.Element => (
<InnerPanel key={storageGroup.storage_group_uuid}> <InnerPanel key={storageGroup.storage_group_uuid}>
<PanelHeader> <InnerPanelHeader>
<Box <Box
display="flex" display="flex"
width="100%" width="100%"
@ -59,7 +59,7 @@ const SharedStorage = (): JSX.Element => {
<BodyText text={storageGroup.storage_group_name} /> <BodyText text={storageGroup.storage_group_name} />
</Box> </Box>
</Box> </Box>
</PanelHeader> </InnerPanelHeader>
<SharedStorageHost <SharedStorageHost
group={storageGroup} group={storageGroup}
key={storageGroup.storage_group_uuid} key={storageGroup.storage_group_uuid}

Loading…
Cancel
Save