Files
linux-cloud-router/web/src/SystemPanel.tsx
T

32 lines
1.4 KiB
TypeScript

import { Box } from '@mui/material'
import ComponentsPanel from './ComponentsPanel.tsx'
import { Board, BoardButtons, type BoardPanel } from './PanelBoard.tsx'
import { useBoard } from './useBoard.ts'
import Toolbar from './Toolbar.tsx'
import UpdatesNotice from './UpdatesNotice.tsx'
/** The localStorage key of the tab's layout. */
const LAYOUT_KEY = 'linux-manager-ui.system-layout'
/**
* The server's operating system: the System updates panel lists the packages apt-get upgrade would upgrade, with Check
* update and Upgrade (UpdatesNotice with system), and the Components panel switches the installable components
* (ComponentsPanel), telling onComponentsChange of each change. The panels are on a PanelBoard whose layout is kept in
* the browser.
*/
export default function SystemPanel(props: { onComponentsChange?: () => void }) {
const board = useBoard(LAYOUT_KEY)
const panels: BoardPanel[] = [
{ id: 'updates', title: 'System updates', wide: true, fixed: true, content: <UpdatesNotice system /> },
{ id: 'components', title: 'Components', wide: true, content: <ComponentsPanel onChange={props.onComponentsChange} /> },
]
return (
<Box component="section">
<Toolbar description="The operating system's updates and the installable components.">
<BoardButtons board={board} />
</Toolbar>
<Board board={board} panels={panels} />
</Box>
)
}