-
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
Showing
10 changed files
with
243 additions
and
31 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,30 +1,101 @@ | ||
import React from "react"; | ||
import React, { useMemo } from "react"; | ||
import { ServerNameEnum } from "./ServerConstant"; | ||
import ServerDetailServicesTabPanelDisk from "./ServerDetailServicesTabPanelDisk"; | ||
import ServerDetailServicesTabPanelDocker from "./ServerDetailServicesTabPanelDocker"; | ||
import ServerDetailServicesTabPanelLoadAvg from "./ServerDetailServicesTabPanelLoadAvg"; | ||
import ServerDetailServicesTabPanelMemory from "./ServerDetailServicesTabPanelMemory"; | ||
import ServerDetailServicesTabPanelProcess from "./ServerDetailServicesTabPanelProcess"; | ||
import ServerDetailServicesTabPanelTCP from "./ServerDetailServicesTabPanelTCP"; | ||
import ServerDetailServicesTabPanelUptime from "./ServerDetailServicesTabPanelUptime"; | ||
import { ServerResponseType, ServerServiceNameType } from "./ServerType"; | ||
|
||
interface ServerDetailServicesTabPanelType { | ||
serverName: | ||
| "disk" | ||
| "docker" | ||
| "uptime" | ||
| "memory" | ||
| "process" | ||
| "loadavg" | ||
| "tcp"; | ||
serverData: Object | []; | ||
serverName: ServerServiceNameType; | ||
serverData: ServerResponseType; | ||
} | ||
|
||
interface servicesTabPanelType { | ||
title: ServerServiceNameType; | ||
content: React.ReactElement; | ||
} | ||
|
||
export default function ServerDetailServicesTabPanel( | ||
props: ServerDetailServicesTabPanelType | ||
) { | ||
// const ServicesTabPanel: React.ElementType = { | ||
// [ServerNameEnum.DISK as "disk"]: <></>, | ||
// [ServerNameEnum.DOCKER]: <></>, | ||
// [ServerNameEnum.LOAD_AVG]: <></>, | ||
// [ServerNameEnum.MEMORY]: <></>, | ||
// [ServerNameEnum.PROCESS]: <></>, | ||
// [ServerNameEnum.TCP]: <></>, | ||
// [ServerNameEnum.UPTIME]: <></>, | ||
// }[ServerNameEnum]; | ||
const { serverData, serverName } = props; | ||
|
||
const servicesTabPanel: servicesTabPanelType[] = useMemo( | ||
() => [ | ||
{ | ||
title: ServerNameEnum.DISK as ServerServiceNameType, | ||
content: ( | ||
<ServerDetailServicesTabPanelDisk | ||
serverName={serverName} | ||
serverData={serverData} | ||
/> | ||
), | ||
}, | ||
{ | ||
title: ServerNameEnum.DOCKER as ServerServiceNameType, | ||
content: ( | ||
<ServerDetailServicesTabPanelDocker | ||
serverName={serverName} | ||
serverData={serverData} | ||
/> | ||
), | ||
}, | ||
{ | ||
title: ServerNameEnum.LOAD_AVG as ServerServiceNameType, | ||
content: ( | ||
<ServerDetailServicesTabPanelLoadAvg | ||
serverName={serverName} | ||
serverData={serverData} | ||
/> | ||
), | ||
}, | ||
{ | ||
title: ServerNameEnum.MEMORY as ServerServiceNameType, | ||
content: ( | ||
<ServerDetailServicesTabPanelMemory | ||
serverName={serverName} | ||
serverData={serverData} | ||
/> | ||
), | ||
}, | ||
{ | ||
title: ServerNameEnum.PROCESS as ServerServiceNameType, | ||
content: ( | ||
<ServerDetailServicesTabPanelProcess | ||
serverName={serverName} | ||
serverData={serverData} | ||
/> | ||
), | ||
}, | ||
{ | ||
title: ServerNameEnum.TCP as ServerServiceNameType, | ||
content: ( | ||
<ServerDetailServicesTabPanelTCP | ||
serverName={serverName} | ||
serverData={serverData} | ||
/> | ||
), | ||
}, | ||
{ | ||
title: ServerNameEnum.UPTIME as ServerServiceNameType, | ||
content: ( | ||
<ServerDetailServicesTabPanelUptime | ||
serverName={serverName} | ||
serverData={serverData} | ||
/> | ||
), | ||
}, | ||
], | ||
[serverName, serverData] | ||
); | ||
|
||
const activeServicesTabPanel = servicesTabPanel?.find( | ||
(service: servicesTabPanelType) => service.title === serverName | ||
); | ||
|
||
return <div>{/* <ServicesTabPanel /> */}</div>; | ||
return <div>{activeServicesTabPanel?.content}</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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from "react"; | ||
|
||
interface ServerDetailServicesTabPanelDiskType { | ||
serverName: | ||
| "disk" | ||
| "docker" | ||
| "uptime" | ||
| "memory" | ||
| "process" | ||
| "loadavg" | ||
| "tcp"; | ||
serverData: Object | []; | ||
} | ||
|
||
export default function ServerDetailServicesTabPanelDisk( | ||
props: ServerDetailServicesTabPanelDiskType | ||
) { | ||
return <div>{/* <ServicesTabPanel /> */}</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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from "react"; | ||
|
||
interface ServerDetailServicesTabPanelDockerType { | ||
serverName: | ||
| "disk" | ||
| "docker" | ||
| "uptime" | ||
| "memory" | ||
| "process" | ||
| "loadavg" | ||
| "tcp"; | ||
serverData: Object | []; | ||
} | ||
|
||
export default function ServerDetailServicesTabPanelDocker( | ||
props: ServerDetailServicesTabPanelDockerType | ||
) { | ||
return <div>{/* <ServicesTabPanel /> */}</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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from "react"; | ||
|
||
interface ServerDetailServicesTabPanelLoadAvgType { | ||
serverName: | ||
| "disk" | ||
| "docker" | ||
| "uptime" | ||
| "memory" | ||
| "process" | ||
| "loadavg" | ||
| "tcp"; | ||
serverData: Object | []; | ||
} | ||
|
||
export default function ServerDetailServicesTabPanelLoadAvg( | ||
props: ServerDetailServicesTabPanelLoadAvgType | ||
) { | ||
return <div>{/* <ServicesTabPanel /> */}</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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from "react"; | ||
|
||
interface ServerDetailServicesTabPanelMemoryType { | ||
serverName: | ||
| "disk" | ||
| "docker" | ||
| "uptime" | ||
| "memory" | ||
| "process" | ||
| "loadavg" | ||
| "tcp"; | ||
serverData: Object | []; | ||
} | ||
|
||
export default function ServerDetailServicesTabPanelMemory( | ||
props: ServerDetailServicesTabPanelMemoryType | ||
) { | ||
return <div>{/* <ServicesTabPanel /> */}</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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from "react"; | ||
|
||
interface ServerDetailServicesTabPanelProcessType { | ||
serverName: | ||
| "disk" | ||
| "docker" | ||
| "uptime" | ||
| "memory" | ||
| "process" | ||
| "loadavg" | ||
| "tcp"; | ||
serverData: Object | []; | ||
} | ||
|
||
export default function ServerDetailServicesTabPanelProcess( | ||
props: ServerDetailServicesTabPanelProcessType | ||
) { | ||
return <div>{/* <ServicesTabPanel /> */}</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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from "react"; | ||
import { ServerResponseType, ServerServiceNameType } from "./ServerType"; | ||
|
||
interface ServerDetailServicesTabPanelTCPType { | ||
serverName: ServerServiceNameType; | ||
serverData: ServerResponseType; | ||
} | ||
|
||
export default function ServerDetailServicesTabPanelTCP( | ||
props: ServerDetailServicesTabPanelTCPType | ||
) { | ||
return <div></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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from "react"; | ||
|
||
interface ServerDetailServicesTabPanelUptimeType { | ||
serverName: | ||
| "disk" | ||
| "docker" | ||
| "uptime" | ||
| "memory" | ||
| "process" | ||
| "loadavg" | ||
| "tcp"; | ||
serverData: Object | []; | ||
} | ||
|
||
export default function ServerDetailServicesTabPanelUptime( | ||
props: ServerDetailServicesTabPanelUptimeType | ||
) { | ||
return <div>{/* <ServicesTabPanel /> */}</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