retropilot-client/src/components/device/tabPane/index.jsx

80 lines
1.9 KiB
React
Raw Normal View History

2022-01-03 09:30:54 -07:00
import Box from '@mui/material/Box';
import Tab from '@mui/material/Tab';
import Tabs from '@mui/material/Tabs';
import React from 'react';
2022-01-09 09:52:29 -07:00
import BootLogsTable from './boot';
import Console from './console';
2022-01-09 09:52:29 -07:00
import CrashLogsTable from './crash';
import DeviceInfo from './device';
2022-01-09 09:52:29 -07:00
import DrivesLogTable from './drives';
2022-01-03 09:30:54 -07:00
function TabPanel(props) {
2022-01-09 09:52:29 -07:00
const {
children, value, index, ...other
} = props;
2022-01-03 09:30:54 -07:00
return (
<div
role="tabpanel"
hidden={value !== index}
id={`simple-tabpanel-${index}`}
aria-labelledby={`simple-tab-${index}`}
{...other}
>
{value === index && (
<div style={{ padding: '5px' }}>
{children}
</div>
)}
</div>
);
}
2022-01-05 09:55:56 -07:00
export default function SignIn(props) {
2022-01-03 09:30:54 -07:00
const [value, setValue] = React.useState(0);
const handleChange = (event, newValue) => {
setValue(newValue);
};
return (
<div className="wrapper">
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
2022-01-09 09:52:29 -07:00
<Tabs
value={value}
onChange={handleChange}
aria-label="basic tabs example"
variant="scrollable"
scrollButtons="auto"
>
2022-01-03 09:30:54 -07:00
<Tab label="Device" />
<Tab label="Drives" />
<Tab label="Crashes" />
<Tab label="Boot" />
<Tab label="Console" />
</Tabs>
</Box>
<TabPanel value={value} index={0}>
2022-01-07 10:59:15 -07:00
<DeviceInfo dongleId={props.dongleId} />
2022-01-03 09:30:54 -07:00
</TabPanel>
<TabPanel value={value} index={1}>
2022-01-07 10:59:15 -07:00
<DrivesLogTable dongleId={props.dongleId} />
2022-01-03 09:30:54 -07:00
</TabPanel>
<TabPanel value={value} index={2}>
2022-01-07 10:59:15 -07:00
<CrashLogsTable dongleId={props.dongleId} />
2022-01-03 09:30:54 -07:00
</TabPanel>
<TabPanel value={value} index={3}>
2022-01-07 10:59:15 -07:00
<BootLogsTable dongleId={props.dongleId} />
2022-01-03 09:30:54 -07:00
</TabPanel>
<TabPanel value={value} index={4}>
2022-01-05 09:55:56 -07:00
<Console dongleId={props.dongleId} />
2022-01-03 09:30:54 -07:00
</TabPanel>
{
}
2022-01-03 09:30:54 -07:00
</div>
);
}