Servers: servers, ips, hw, storages

This commit is contained in:
cracklesparkle
2024-07-15 12:39:53 +09:00
parent 416e2e39b5
commit e566e23f6d
8 changed files with 722 additions and 287 deletions

View File

@ -1,14 +1,33 @@
import { Box } from '@mui/material'
import { IServer } from '../interfaces/servers'
import { useServerIps } from '../hooks/swrHooks'
import FullFeaturedCrudGrid from './TableEditable'
import { GridColDef } from '@mui/x-data-grid'
function ServerData({ id, name, region_id }: IServer) {
const { serverIps } = useServerIps(id, 0, 10)
const serverIpsColumns: GridColDef[] = [
{ field: 'id', headerName: 'ID', type: 'number' },
{ field: 'server_id', headerName: 'Server ID', type: 'number' },
{ field: 'name', headerName: 'Название', type: 'string' },
{ field: 'is_actual', headerName: 'Действителен', type: 'boolean' },
{ field: 'ip', headerName: 'IP', type: 'string' },
{ field: 'servername', headerName: 'Название сервера', type: 'string' },
]
return (
<Box>
<Box sx={{ display: 'flex', flexDirection: 'column', p: '16px' }}>
{serverIps &&
JSON.stringify(serverIps)
<FullFeaturedCrudGrid
initialRows={serverIps}
columns={serverIpsColumns}
actions
onRowClick={(params, event, details) => {
//setCurrentServerData(params.row)
//setServerDataOpen(true)
}}
/>
}
</Box>
)