From c54d998143aa9c6b23644718b8482256c86aefe9 Mon Sep 17 00:00:00 2001 From: Zion Emond Date: Fri, 3 Dec 2021 15:07:43 -0500 Subject: [PATCH 01/10] added buttons and some text --- .../AdminPanelLayout/ClusterPane.module.scss | 11 +++++++++++ src/components/AdminPanelLayout/ClusterPane.tsx | 12 +++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/components/AdminPanelLayout/ClusterPane.module.scss diff --git a/src/components/AdminPanelLayout/ClusterPane.module.scss b/src/components/AdminPanelLayout/ClusterPane.module.scss new file mode 100644 index 00000000..afc183ee --- /dev/null +++ b/src/components/AdminPanelLayout/ClusterPane.module.scss @@ -0,0 +1,11 @@ +@import "../../theme"; + +.cluster-pane { + Button { + float: right; + margin-left: 15px; + } + p { + padding-top: 65px; + } +} diff --git a/src/components/AdminPanelLayout/ClusterPane.tsx b/src/components/AdminPanelLayout/ClusterPane.tsx index 6722edbe..a5c32a5b 100644 --- a/src/components/AdminPanelLayout/ClusterPane.tsx +++ b/src/components/AdminPanelLayout/ClusterPane.tsx @@ -1,5 +1,15 @@ import React from 'react'; +import {Button} from 'react-bootstrap'; +import {Layout} from '../../pages/Layout/Layout'; +import styles from './ClusterPane.module.scss'; export const ClusterPane = () => ( - <>The cluster management panel is still under construction + +
+ + + +

------------------- <Cluster Name> -------------------

+
+
); From 6619810fcb51f9edeab5eef479ce52c6d1dd4d1e Mon Sep 17 00:00:00 2001 From: Zion Emond Date: Fri, 3 Dec 2021 15:54:06 -0500 Subject: [PATCH 02/10] stubbed out basic node component --- .../AdminPanelLayout/ClusterPane.tsx | 4 +- .../AdminPanelLayout/Node.module.scss | 10 +++++ src/components/AdminPanelLayout/Node.tsx | 45 +++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 src/components/AdminPanelLayout/Node.module.scss create mode 100644 src/components/AdminPanelLayout/Node.tsx diff --git a/src/components/AdminPanelLayout/ClusterPane.tsx b/src/components/AdminPanelLayout/ClusterPane.tsx index a5c32a5b..fd456688 100644 --- a/src/components/AdminPanelLayout/ClusterPane.tsx +++ b/src/components/AdminPanelLayout/ClusterPane.tsx @@ -2,6 +2,7 @@ import React from 'react'; import {Button} from 'react-bootstrap'; import {Layout} from '../../pages/Layout/Layout'; import styles from './ClusterPane.module.scss'; +import Node from './Node'; export const ClusterPane = () => ( @@ -9,7 +10,8 @@ export const ClusterPane = () => ( -

------------------- <Cluster Name> -------------------

+

------------------- CLUSTER NAME -------------------

+
); diff --git a/src/components/AdminPanelLayout/Node.module.scss b/src/components/AdminPanelLayout/Node.module.scss new file mode 100644 index 00000000..7421a4b8 --- /dev/null +++ b/src/components/AdminPanelLayout/Node.module.scss @@ -0,0 +1,10 @@ +@import "../../theme"; + +.node { + div { + border: 1px solid black; + } + p { + text-align: left; + } +} diff --git a/src/components/AdminPanelLayout/Node.tsx b/src/components/AdminPanelLayout/Node.tsx new file mode 100644 index 00000000..3271f1e3 --- /dev/null +++ b/src/components/AdminPanelLayout/Node.tsx @@ -0,0 +1,45 @@ +import React from 'react'; +import styles from './Node.module.scss'; +import {Layout} from '../../pages/Layout/Layout'; + +enum NodeStatus { + Good, + Issues, + Maintenance, + Offline +} + +let status = NodeStatus.Good; + +const Node = () => { + if (status !== NodeStatus.Offline) { + return ( + +
+

Node {}

+

Status: {}

+

_____________________

+

Current Deployed Labs: ##

+

Average CPU Usage: ##

+

Current CPU Usage: ##

+

Average RAM Usage: ##

+

Current RAM Usage: ##

+

Scheduled Maintenance:

+

Drive 1: ##, Drive 2: ##

+

Scheduled Maintenance:

+

Uptime: ##

+
+
+ ); + } + else { + return ( +
+

Server Offline!

+

Last known ip is

+
+ ); + } +}; + +export default Node; From a12498eb80dfbdbbe789cd5e022e960d577b3f36 Mon Sep 17 00:00:00 2001 From: Zion Emond Date: Wed, 5 Jan 2022 12:13:36 -0500 Subject: [PATCH 03/10] added colored circle that changes color based on node status --- .../AdminPanelLayout/ClusterPane.tsx | 2 +- .../AdminPanelLayout/Node.module.scss | 38 ++++++++++++++++ src/components/AdminPanelLayout/Node.tsx | 44 ++++++++++++++----- 3 files changed, 73 insertions(+), 11 deletions(-) diff --git a/src/components/AdminPanelLayout/ClusterPane.tsx b/src/components/AdminPanelLayout/ClusterPane.tsx index fd456688..3333cf0c 100644 --- a/src/components/AdminPanelLayout/ClusterPane.tsx +++ b/src/components/AdminPanelLayout/ClusterPane.tsx @@ -12,6 +12,6 @@ export const ClusterPane = () => (

------------------- CLUSTER NAME -------------------

- + ); diff --git a/src/components/AdminPanelLayout/Node.module.scss b/src/components/AdminPanelLayout/Node.module.scss index 7421a4b8..d7289913 100644 --- a/src/components/AdminPanelLayout/Node.module.scss +++ b/src/components/AdminPanelLayout/Node.module.scss @@ -3,8 +3,46 @@ .node { div { border: 1px solid black; + padding: 5px; + } + #wrapper { + border: 0px; + padding: 0px; } p { text-align: left; } + Button { + float: right; + margin: 5px; + } + h1 { + float: left; + padding-left: 20px; + } + h2 { + margin-top: 10px; + text-align: center; + } + span { + margin-left: 10px; + margin-top: 10px; + height: 30px; + width: 30px; + background-color: #bbb; + border-radius: 50%; + display: inline-block; + } + #good { + background-color: #009E0F; + } + #issues { + background-color: #FF9900; + } + #maintenance { + background-color: black; + } + #offline { + background-color: #CF2A27; + } } diff --git a/src/components/AdminPanelLayout/Node.tsx b/src/components/AdminPanelLayout/Node.tsx index 3271f1e3..ffdbdbaf 100644 --- a/src/components/AdminPanelLayout/Node.tsx +++ b/src/components/AdminPanelLayout/Node.tsx @@ -1,7 +1,9 @@ import React from 'react'; import styles from './Node.module.scss'; import {Layout} from '../../pages/Layout/Layout'; +import {Button} from 'react-bootstrap'; +// 0 is green, 1 is yellow, 2 is black, 4 is red enum NodeStatus { Good, Issues, @@ -9,16 +11,32 @@ enum NodeStatus { Offline } -let status = NodeStatus.Good; +// number for what node, number for status +interface NodeProps { + nodeNum: number; + statusNum: NodeStatus; +} -const Node = () => { - if (status !== NodeStatus.Offline) { +const Node = (props: NodeProps) => { + if (props.statusNum !== NodeStatus.Offline) { return (
-

Node {}

-

Status: {}

-

_____________________

+

Node {props.nodeNum}

+

Status:

+ {props.statusNum === NodeStatus.Good && + + } + {props.statusNum === NodeStatus.Issues && +
+ + +
+ } + {props.statusNum === NodeStatus.Maintenance && + + } +

__________________________________

Current Deployed Labs: ##

Average CPU Usage: ##

Current CPU Usage: ##

@@ -27,6 +45,7 @@ const Node = () => {

Scheduled Maintenance:

Drive 1: ##, Drive 2: ##

Scheduled Maintenance:

+

Uptime: ##

@@ -34,10 +53,15 @@ const Node = () => { } else { return ( -
-

Server Offline!

-

Last known ip is

-
+ +
+

Node {props.nodeNum}

+

Status:

+ +

Server Offline!

+

Last known ip is

+
+
); } }; From f7d7cb5e7a80a0aa277432f5574d1dd74e47fb6f Mon Sep 17 00:00:00 2001 From: Zion Emond Date: Tue, 1 Feb 2022 16:41:24 -0500 Subject: [PATCH 04/10] more example nodes --- src/components/AdminPanelLayout/ClusterPane.tsx | 3 +++ src/components/AdminPanelLayout/Node.module.scss | 1 + src/components/AdminPanelLayout/Node.tsx | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/AdminPanelLayout/ClusterPane.tsx b/src/components/AdminPanelLayout/ClusterPane.tsx index 3333cf0c..4682e74a 100644 --- a/src/components/AdminPanelLayout/ClusterPane.tsx +++ b/src/components/AdminPanelLayout/ClusterPane.tsx @@ -13,5 +13,8 @@ export const ClusterPane = () => (

------------------- CLUSTER NAME -------------------

+ + + ); diff --git a/src/components/AdminPanelLayout/Node.module.scss b/src/components/AdminPanelLayout/Node.module.scss index d7289913..0955c578 100644 --- a/src/components/AdminPanelLayout/Node.module.scss +++ b/src/components/AdminPanelLayout/Node.module.scss @@ -23,6 +23,7 @@ h2 { margin-top: 10px; text-align: center; + font-weight: bold; } span { margin-left: 10px; diff --git a/src/components/AdminPanelLayout/Node.tsx b/src/components/AdminPanelLayout/Node.tsx index ffdbdbaf..b496d853 100644 --- a/src/components/AdminPanelLayout/Node.tsx +++ b/src/components/AdminPanelLayout/Node.tsx @@ -42,7 +42,7 @@ const Node = (props: NodeProps) => {

Current CPU Usage: ##

Average RAM Usage: ##

Current RAM Usage: ##

-

Scheduled Maintenance:

+

Storage:

Drive 1: ##, Drive 2: ##

Scheduled Maintenance:

@@ -57,7 +57,7 @@ const Node = (props: NodeProps) => {

Node {props.nodeNum}

Status:

- +

Server Offline!

Last known ip is

From 8a02e71665363ce420527f05b6daa9d4b769b67e Mon Sep 17 00:00:00 2001 From: Zion Emond Date: Mon, 7 Feb 2022 11:51:01 -0500 Subject: [PATCH 05/10] added Maintenance Mode popup window --- .../AdminPanelLayout/ClusterPane.tsx | 60 ++++++++++++++----- .../MaintenancePopup.module.scss | 41 +++++++++++++ .../AdminPanelLayout/MaintenancePopup.tsx | 15 +++++ 3 files changed, 101 insertions(+), 15 deletions(-) create mode 100644 src/components/AdminPanelLayout/MaintenancePopup.module.scss create mode 100644 src/components/AdminPanelLayout/MaintenancePopup.tsx diff --git a/src/components/AdminPanelLayout/ClusterPane.tsx b/src/components/AdminPanelLayout/ClusterPane.tsx index 4682e74a..002ea79d 100644 --- a/src/components/AdminPanelLayout/ClusterPane.tsx +++ b/src/components/AdminPanelLayout/ClusterPane.tsx @@ -1,20 +1,50 @@ -import React from 'react'; +import React, {useState} from 'react'; import {Button} from 'react-bootstrap'; import {Layout} from '../../pages/Layout/Layout'; import styles from './ClusterPane.module.scss'; import Node from './Node'; +import MaintenancePopup from './MaintenancePopup'; -export const ClusterPane = () => ( - -
- - - -

------------------- CLUSTER NAME -------------------

-
- - - - -
-); + +export const ClusterPane = () => { + + const [isOpen, setIsOpen] = useState(false); + + const togglePopup = () => { + setIsOpen(!isOpen); + }; + + return ( +
+ + {isOpen && +

Maintenance Scheduler

+
+ + + + +
+ + } + handleClose={() => togglePopup()} + /> + } + + +

------------------- CLUSTER NAME -------------------

+
+ + + + +
); +}; diff --git a/src/components/AdminPanelLayout/MaintenancePopup.module.scss b/src/components/AdminPanelLayout/MaintenancePopup.module.scss new file mode 100644 index 00000000..57ded334 --- /dev/null +++ b/src/components/AdminPanelLayout/MaintenancePopup.module.scss @@ -0,0 +1,41 @@ +@import "../../theme"; + +.popup-box { + position: fixed; + background: #00000050; + width: 100%; + height: 100vh; + top: 0; + left: 0; +} + +.box { + position: relative; + width: 50%; + margin: 0 auto; + height: auto; + max-height: 70vh; + margin-top: calc(100vh - 85vh - 20px); + background: #fff; + border-radius: 4px; + padding: 20px; + border: 1px solid #999; + overflow: auto; + margin-right: 175px; +} + +.close-icon { + content: 'x'; + cursor: pointer; + position: fixed; + right: 165px; + top: 110px; + background: #ededed; + width: 25px; + height: 25px; + border-radius: 50%; + line-height: 20px; + text-align: center; + border: 1px solid #999; + font-size: 20px; +} diff --git a/src/components/AdminPanelLayout/MaintenancePopup.tsx b/src/components/AdminPanelLayout/MaintenancePopup.tsx new file mode 100644 index 00000000..448c5234 --- /dev/null +++ b/src/components/AdminPanelLayout/MaintenancePopup.tsx @@ -0,0 +1,15 @@ +import React from 'react'; +import styles from './MaintenancePopup.module.scss'; + +const MaintenancePopup = (props: { handleClose: () => void; content: React.ReactNode }) => { + return ( +
+
+ x + {props.content} +
+
+ ); +}; + +export default MaintenancePopup; From b92960d3653ad19c2236f30d02f2fdfbba3dbe36 Mon Sep 17 00:00:00 2001 From: Zion Emond Date: Mon, 7 Feb 2022 17:46:32 -0500 Subject: [PATCH 06/10] refactored node component to use bootstrap card component --- .../AdminPanelLayout/ClusterPane.tsx | 1 + .../AdminPanelLayout/Node.module.scss | 21 ------ src/components/AdminPanelLayout/Node.tsx | 65 ++++++++++--------- 3 files changed, 37 insertions(+), 50 deletions(-) diff --git a/src/components/AdminPanelLayout/ClusterPane.tsx b/src/components/AdminPanelLayout/ClusterPane.tsx index 002ea79d..8ba649ff 100644 --- a/src/components/AdminPanelLayout/ClusterPane.tsx +++ b/src/components/AdminPanelLayout/ClusterPane.tsx @@ -21,6 +21,7 @@ export const ClusterPane = () => { content={ <>

Maintenance Scheduler

+

cluster name