Skip to content

Commit 06d7c79

Browse files
committed
Styling Updates
2 parents 9ce8003 + f239c91 commit 06d7c79

30 files changed

Lines changed: 355 additions & 422 deletions

Chronos Slide Deck Notes.rtf

Lines changed: 0 additions & 110 deletions
This file was deleted.

app/AComp/Extras.jsx

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,34 @@
11
import React from 'react';
2+
import '../stylesheets/overviewSubmit.css';
23

34
const Extras = (props) => {
45
const { AddClick, DeleteClick, RefreshClick } = props;
56
return (
6-
<>
7-
<div className="left-bottom">
8-
<button
9-
className="overviewSubmitBtn"
10-
type="submit"
11-
key="BackToStart"
12-
onClick={AddClick}
13-
>
14-
Add Database
15-
</button>
16-
<button
17-
className="overviewSubmitBtn"
18-
type="submit"
19-
key="goToDeletePage"
20-
onClick={DeleteClick}
21-
>
22-
Delete Database
23-
</button>
24-
</div>
25-
<div className="left-bottom">
26-
<button
27-
className="overviewSubmitBtn"
28-
type="submit"
29-
onClick={RefreshClick}
30-
>
31-
Refresh overview
32-
</button>
33-
</div>
34-
</>
7+
<div className="left-bottom">
8+
<button
9+
className="overviewSubmitBtn"
10+
type="submit"
11+
key="BackToStart"
12+
onClick={AddClick}
13+
>
14+
Add Database
15+
</button>
16+
<button
17+
className="overviewSubmitBtn"
18+
type="submit"
19+
key="goToDeletePage"
20+
onClick={DeleteClick}
21+
>
22+
Delete Database
23+
</button>
24+
<button
25+
className="overviewSubmitBtn"
26+
type="submit"
27+
onClick={RefreshClick}
28+
>
29+
Refresh overview
30+
</button>
31+
</div>
3532
);
3633
};
3734

app/AComp/Microservices.jsx

Lines changed: 20 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,27 @@
1-
import React, { useContext, useState, useEffect } from 'react';
2-
import OverviewContext from '../context/OverviewContext';
3-
import HealthInformationContext from '../context/DetailsContext';
4-
import ServiceDetails from '../components/ServiceDetails.jsx';
1+
import React from 'react';
2+
import '../stylesheets/Microservices.css';
53

6-
const { ipcRenderer } = window.require('electron');
74

85
const Microservices = (props) => {
9-
const { index, setDetails } = props;
10-
// Overview state used to create service buttons
11-
const [overviewState, setOverviewState] = useState([]);
12-
13-
// Contexts have data added to them following successful IPC return. Data is later used to create charts.
14-
const serviceComponents = useContext(OverviewContext);
15-
16-
useEffect(() => {
17-
// IPC communication used to initiate query for information on microservices.
18-
ipcRenderer.send('overviewRequest', index);
19-
// IPC listener responsible for retrieving infomation from asynchronous main process message.
20-
ipcRenderer.on('overviewResponse', (event, data) => {
21-
// Adds to state and context.
22-
// console.log(JSON.parse(data));
23-
setOverviewState(Object.values(JSON.parse(data)));
24-
serviceComponents.overviewData = JSON.parse(data);
25-
});
26-
}, []);
27-
28-
// Holds the buttons generated for unique services.
29-
const componentButtons = [];
30-
31-
// Tracks which services already have button created.
32-
const serviceCache = {};
33-
// Contexts have data added to them following successful IPC return. Data is later used to create charts.
34-
const healthdata = useContext(HealthInformationContext);
35-
36-
for (let i = 0; i < overviewState.length; i += 1) {
37-
const element = overviewState[i];
38-
// If SQL
39-
if (element.currentmicroservice) {
40-
if (!(element.currentmicroservice in serviceCache)) {
41-
const button = (
42-
<button
43-
className="servicesBtn"
44-
currentMicroservice={element.currentmicroservice}
45-
type="button"
46-
key={`serviceItem${index}${i}`}
47-
onClick={() => {
48-
// IPC communication used to initiate query for information on microservice health information.
49-
ipcRenderer.send('detailsRequest', index);
50-
51-
// IPC listener responsible for retrieving infomation from asynchronous main process message.
52-
ipcRenderer.on('detailsResponse', (event, data) => {
53-
// Adds returned data to context
54-
healthdata.detailData = Object.values(JSON.parse(data));
55-
// Updates state. Triggers rerender.
56-
setDetails(
57-
<ServiceDetails service={element.currentmicroservice} />
58-
);
59-
});
60-
}}
61-
>
62-
{element.currentmicroservice}
63-
</button>
64-
);
65-
componentButtons.push(button);
66-
serviceCache[element.currentmicroservice] = true;
67-
}
68-
} else if (element.currentMicroservice) {
69-
// If Mongo
70-
if (element.currentMicroservice) {
71-
if (!(element.currentMicroservice in serviceCache)) {
72-
const button = (
73-
<button
74-
className="servicesBtn"
75-
type="button"
76-
key={`serviceItem${index}${i}`}
77-
onClick={() => {
78-
ipcRenderer.send('detailsRequest', index);
79-
80-
// IPC listener responsible for retrieving infomation from asynchronous main process message.
81-
ipcRenderer.on('detailsResponse', (event, data) => {
82-
// Adds returned data to context.
83-
healthdata.detailData = Object.values(JSON.parse(data));
84-
// Updates state. Triggers rerender.
85-
setDetails(
86-
<ServiceDetails service={element.currentMicroservice} />
87-
);
88-
});
89-
}}
90-
>
91-
{element.currentMicroservice}
92-
</button>
93-
);
94-
componentButtons.push(button);
95-
serviceCache[element.currentMicroservice] = true;
96-
}
97-
}
98-
}
99-
}
100-
// If there's no data, return 'No data present', else return microservices button
101-
if (componentButtons.length === 0) {
102-
return <p>Loading</p>;
6+
const { context, Click, isclicked } = props;
7+
const buttonStore = [];
8+
for (let i = 0; i < context.length; i += 1) {
9+
buttonStore.push(
10+
<button
11+
className="microserviceBtn"
12+
id={i}
13+
type="button"
14+
key={`${i}${context[i]}`}
15+
onClick={Click}
16+
isclicked={isclicked}
17+
>
18+
{context[i]}
19+
</button>
20+
);
10321
}
104-
return componentButtons;
22+
return (
23+
buttonStore
24+
);
10525
};
10626

10727
export default Microservices;

0 commit comments

Comments
 (0)