-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25a3be0
commit 070973a
Showing
4 changed files
with
93 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,47 @@ | ||
import React from "react"; | ||
import styled from '@emotion/styled'; | ||
import React from 'react'; | ||
import { | ||
BarChart, | ||
Bar, | ||
XAxis, | ||
YAxis, | ||
CartesianGrid, | ||
Tooltip, | ||
Legend, | ||
} from 'recharts'; | ||
import { DiskData, ServerResponseType, ServerServiceNameType } from './ServerType'; | ||
|
||
interface ServerDetailServicesTabPanelDiskType { | ||
serverName: | ||
| "disk" | ||
| "docker" | ||
| "uptime" | ||
| "memory" | ||
| "process" | ||
| "loadavg" | ||
| "tcp"; | ||
serverData: Object | []; | ||
serverName: ServerServiceNameType; | ||
serverData: ServerResponseType<Array<DiskData>>; | ||
} | ||
|
||
const Div = styled.div` | ||
margin-top: 2rem; | ||
`; | ||
|
||
export default function ServerDetailServicesTabPanelDisk( | ||
props: ServerDetailServicesTabPanelDiskType | ||
) { | ||
return <div>{/* <ServicesTabPanel /> */}</div>; | ||
const { serverData:{ Message:{ Data }}} = props; | ||
|
||
return ( | ||
<Div> | ||
{ | ||
/* <ServicesTabPanel /> */ | ||
// <ResponsiveContainer width='100%' height='100%'> | ||
<BarChart width={900} height={500} data={Data}> | ||
<CartesianGrid strokeDasharray='3 3' /> | ||
<XAxis dataKey='FileSystem' /> | ||
<YAxis /> | ||
<Tooltip /> | ||
<Legend /> | ||
<Bar dataKey='Available' fill='#8884d8' /> | ||
<Bar dataKey='Used' fill='red' /> | ||
<Bar dataKey='Size' fill='green' /> | ||
</BarChart> | ||
// </ResponsiveContainer> | ||
} | ||
</Div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,57 @@ | ||
import React from "react"; | ||
import styled from '@emotion/styled'; | ||
import React from 'react'; | ||
import { | ||
BarChart, | ||
Bar, | ||
XAxis, | ||
YAxis, | ||
CartesianGrid, | ||
Tooltip, | ||
Legend, | ||
} from 'recharts'; | ||
import { | ||
MemoryData, | ||
ServerResponseType, | ||
ServerServiceNameType, | ||
} from './ServerType'; | ||
|
||
interface ServerDetailServicesTabPanelMemoryType { | ||
serverName: | ||
| "disk" | ||
| "docker" | ||
| "uptime" | ||
| "memory" | ||
| "process" | ||
| "loadavg" | ||
| "tcp"; | ||
serverData: Object | []; | ||
serverName: ServerServiceNameType; | ||
serverData: ServerResponseType<MemoryData>; | ||
} | ||
|
||
|
||
const Div = styled.div` | ||
margin-top:2rem; | ||
` | ||
|
||
export default function ServerDetailServicesTabPanelMemory( | ||
props: ServerDetailServicesTabPanelMemoryType | ||
) { | ||
return <div>{/* <ServicesTabPanel /> */}</div>; | ||
const { | ||
serverData: { | ||
Message: { Data }, | ||
}, | ||
} = props; | ||
console.log({ Data }); | ||
return ( | ||
<Div> | ||
{ | ||
/* <ServicesTabPanel /> */ | ||
// <ResponsiveContainer width='100%' height='100%'> | ||
<BarChart width={900} height={500} data={[Data]}> | ||
<CartesianGrid strokeDasharray='3 3' /> | ||
<XAxis dataKey='FileSystem' /> | ||
<YAxis /> | ||
<Tooltip /> | ||
<Legend /> | ||
<Bar dataKey='MemFree' fill='#003f5c' /> | ||
<Bar dataKey='MemTotal' fill='#58508d' /> | ||
<Bar dataKey='SwapFree' fill='#bc5090' /> | ||
<Bar dataKey='SwapTotal' fill='#ff6361' /> | ||
</BarChart> | ||
// </ResponsiveContainer> | ||
} | ||
</Div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters