|
|
@ -10,11 +10,19 @@ import PanelHeader from './PanelHeader'; |
|
|
|
import PeriodicFetch from '../lib/fetchers/periodicFetch'; |
|
|
|
import PeriodicFetch from '../lib/fetchers/periodicFetch'; |
|
|
|
import { AnvilContext } from './AnvilContext'; |
|
|
|
import { AnvilContext } from './AnvilContext'; |
|
|
|
|
|
|
|
|
|
|
|
const useStyles = makeStyles(() => ({ |
|
|
|
const useStyles = makeStyles((theme) => ({ |
|
|
|
header: { |
|
|
|
header: { |
|
|
|
paddingTop: '3px', |
|
|
|
paddingTop: '3px', |
|
|
|
paddingRight: '10px', |
|
|
|
paddingRight: '10px', |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
root: { |
|
|
|
|
|
|
|
overflow: 'auto', |
|
|
|
|
|
|
|
height: '80vh', |
|
|
|
|
|
|
|
paddingLeft: '5px', |
|
|
|
|
|
|
|
[theme.breakpoints.down('md')]: { |
|
|
|
|
|
|
|
height: '100%', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
})); |
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
const SharedStorage = ({ anvil }: { anvil: AnvilListItem[] }): JSX.Element => { |
|
|
|
const SharedStorage = ({ anvil }: { anvil: AnvilListItem[] }): JSX.Element => { |
|
|
@ -27,37 +35,39 @@ const SharedStorage = ({ anvil }: { anvil: AnvilListItem[] }): JSX.Element => { |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<Panel> |
|
|
|
<Panel> |
|
|
|
<HeaderText text="Shared Storage" /> |
|
|
|
<HeaderText text="Shared Storage" /> |
|
|
|
{data?.file_systems && |
|
|
|
<Box className={classes.root}> |
|
|
|
data.file_systems.map( |
|
|
|
{data?.file_systems && |
|
|
|
(fs: AnvilSharedStorageFileSystem): JSX.Element => ( |
|
|
|
data.file_systems.map( |
|
|
|
<InnerPanel key={fs.mount_point}> |
|
|
|
(fs: AnvilSharedStorageFileSystem): JSX.Element => ( |
|
|
|
<PanelHeader> |
|
|
|
<InnerPanel key={fs.mount_point}> |
|
|
|
<Box display="flex" width="100%" className={classes.header}> |
|
|
|
<PanelHeader> |
|
|
|
<Box> |
|
|
|
<Box display="flex" width="100%" className={classes.header}> |
|
|
|
<BodyText text={fs.mount_point} /> |
|
|
|
<Box> |
|
|
|
|
|
|
|
<BodyText text={fs.mount_point} /> |
|
|
|
|
|
|
|
</Box> |
|
|
|
</Box> |
|
|
|
</Box> |
|
|
|
</Box> |
|
|
|
</PanelHeader> |
|
|
|
</PanelHeader> |
|
|
|
{fs?.nodes && |
|
|
|
{fs?.nodes && |
|
|
|
fs.nodes.map( |
|
|
|
fs.nodes.map( |
|
|
|
( |
|
|
|
( |
|
|
|
node: AnvilSharedStorageNode, |
|
|
|
node: AnvilSharedStorageNode, |
|
|
|
index: number, |
|
|
|
index: number, |
|
|
|
): JSX.Element => ( |
|
|
|
): JSX.Element => ( |
|
|
|
<SharedStorageNode |
|
|
|
<SharedStorageNode |
|
|
|
node={{ |
|
|
|
node={{ |
|
|
|
...node, |
|
|
|
...node, |
|
|
|
nodeInfo: |
|
|
|
nodeInfo: |
|
|
|
anvil[anvil.findIndex((a) => a.anvil_uuid === uuid)] |
|
|
|
anvil[anvil.findIndex((a) => a.anvil_uuid === uuid)] |
|
|
|
.nodes[index], |
|
|
|
.nodes[index], |
|
|
|
}} |
|
|
|
}} |
|
|
|
key={fs.nodes[index].free} |
|
|
|
key={fs.nodes[index].free} |
|
|
|
/> |
|
|
|
/> |
|
|
|
), |
|
|
|
), |
|
|
|
)} |
|
|
|
)} |
|
|
|
</InnerPanel> |
|
|
|
</InnerPanel> |
|
|
|
), |
|
|
|
), |
|
|
|
)} |
|
|
|
)} |
|
|
|
</Box> |
|
|
|
</Panel> |
|
|
|
</Panel> |
|
|
|
); |
|
|
|
); |
|
|
|
}; |
|
|
|
}; |
|
|
|