Skip to content

Commit 9b2ff9a

Browse files
committed
Merged for final update
2 parents faabfd3 + 8a451c9 commit 9b2ff9a

19 files changed

+241
-96
lines changed

This is the Command for the window

Lines changed: 0 additions & 1 deletion
This file was deleted.

app/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useState } from 'react';
22
import Splash from './components/Splash';
33
import DashboardContainer from './containers/DashboardContainer';
4+
import './stylesheets/scrollBar.scss';
45

56
const App: React.FC = React.memo(() => {
67
const [firstVisit, setFirstVisit] = useState(true);

app/charts/LatencyChart.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const LatencyChart: React.FC<GraphsContainerProps> = React.memo(({ sizing, colou
7676
return (
7777
<Plot
7878
data={[...plotlyData]}
79+
config={{ displayModeBar: false }}
7980
layout={{
8081
title: 'Latency',
8182
...sizeSwitch,
@@ -95,7 +96,7 @@ const LatencyChart: React.FC<GraphsContainerProps> = React.memo(({ sizing, colou
9596
},
9697
xaxis: {
9798
title: 'Time',
98-
tickmode: 'linear',
99+
tickmode: 'auto',
99100
tick0: 0,
100101
dtick: 10,
101102
rangemode: 'nonnegative',

app/charts/MemoryChart.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ const MemoryChart: React.FC<GraphsContainerProps> = React.memo(({ sizing, colour
129129
return (
130130
<Plot
131131
data={[...plotlyData.flat()]}
132+
config={{ displayModeBar: false }}
132133
layout={{
133134
title: 'Memory Traces',
134135
...sizeSwitch,
@@ -143,13 +144,13 @@ const MemoryChart: React.FC<GraphsContainerProps> = React.memo(({ sizing, colour
143144
orientation: 'h',
144145
xanchor: 'center',
145146
x: 0.5,
146-
y: -1,
147+
y: 0,
147148
font: {
148149
size: 9,
149150
},
150151
},
151152
xaxis: {
152-
tickmode: 'linear',
153+
tickmode: 'auto',
153154
tick0: 0,
154155
dtick: 10,
155156
title: 'Time Elapsed (min)',

app/charts/ProcessesChart.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ const ProcessesChart: React.FC<GraphsContainerProps> = React.memo(({ sizing, col
136136
return (
137137
<Plot
138138
data={[...plotlyData.flat()]}
139+
config={{ displayModeBar: false }}
139140
layout={{
140141
title: 'Process Overview',
141142
...sizeSwitch,
@@ -156,6 +157,7 @@ const ProcessesChart: React.FC<GraphsContainerProps> = React.memo(({ sizing, col
156157
},
157158
},
158159
xaxis: {
160+
tickmode: 'auto',
159161
dtick: 10,
160162
title: 'Time Elapsed (min)',
161163
},

app/charts/SpeedChart.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const SpeedChart: React.FC<GraphsContainerProps> = React.memo(({ sizing, colourG
7272
x: data[0][0],
7373
y: dataArr[1],
7474
type: 'scatter',
75-
mode: 'lines+markers',
75+
mode: 'lines',
7676
marker: {
7777
color: hashedColor,
7878
},
@@ -84,6 +84,7 @@ const SpeedChart: React.FC<GraphsContainerProps> = React.memo(({ sizing, colourG
8484
return (
8585
<Plot
8686
data={[...plotlyData]}
87+
config={{ displayModeBar: false }}
8788
layout={{
8889
title: 'Speed Chart',
8990
...sizeSwitch,
@@ -94,7 +95,7 @@ const SpeedChart: React.FC<GraphsContainerProps> = React.memo(({ sizing, colourG
9495
},
9596
xaxis: {
9697
title: 'Time (EST)',
97-
tickmode: 'linear',
98+
tickmode: 'auto',
9899
dtick: 2,
99100
tickformat: '%H %M %p',
100101
rangemode: 'nonnegative',
@@ -112,7 +113,7 @@ const SpeedChart: React.FC<GraphsContainerProps> = React.memo(({ sizing, colourG
112113
showlegend: true,
113114
legend: {
114115
orientation: 'h',
115-
xanchor: 'center',
116+
xanchor: 'auto',
116117
x: 0.5,
117118
y: 5,
118119
},

app/charts/TemperatureChart.tsx

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,28 @@ interface SoloStyles {
1414
width: number;
1515
}
1616

17+
<<<<<<< HEAD
1718
const TemperatureChart: React.FC<GraphsContainerProps> = React.memo(
1819
({ sizing, colourGenerator }) => {
1920
const { healthData } = useContext(HealthContext);
2021
const [data, setData] = useState<Array<Array<string | (string | number)[]>>>([]);
22+
=======
23+
const TemperatureChart: React.FC<GraphsContainerProps> = React.memo(({ sizing }) => {
24+
const { healthData } = useContext(HealthContext);
25+
const [data, setData] = useState<Array<Array<string | (string | number)[]>>>([]);
26+
27+
useEffect(() => {
28+
if (healthData.length) {
29+
const tempArr: ((string | number)[] | string)[][] = [];
30+
// loop over each
31+
healthData.forEach(
32+
(service: { time: string[]; cputemp: (string | number)[]; service: string[] }) => {
33+
let timeArr: string[] = [];
34+
// perform this when we 'setTime'
35+
if (service.time !== undefined) {
36+
timeArr = service.time.map((el: any) => moment(el).format('kk:mm:ss'));
37+
}
38+
>>>>>>> will/style_tweaks
2139

2240
useEffect(() => {
2341
if (healthData.length) {
@@ -43,6 +61,7 @@ const TemperatureChart: React.FC<GraphsContainerProps> = React.memo(
4361

4462
const [solo, setSolo] = useState<SoloStyles | null>(null);
4563

64+
<<<<<<< HEAD
4665
setInterval(() => {
4766
if (solo !== soloStyle) {
4867
setSolo(soloStyle);
@@ -126,6 +145,79 @@ const TemperatureChart: React.FC<GraphsContainerProps> = React.memo(
126145
<div className="chart" data-testid="Temperature Chart">
127146
{createChart()}
128147
</div>
148+
=======
149+
setInterval(() => {
150+
if (solo !== soloStyle) {
151+
setSolo(soloStyle);
152+
}
153+
}, 20);
154+
155+
const createChart = () => {
156+
let plotlyData: {
157+
name: any;
158+
x: any;
159+
y: any;
160+
type: any;
161+
fillcolor: any;
162+
mode: any;
163+
showlegend: any;
164+
}[] = [];
165+
166+
plotlyData = data.map(dataArr => {
167+
// eslint-disable-next-line no-bitwise
168+
const randomColor = `#${(((1 << 24) * Math.random()) | 0).toString(16)}`;
169+
170+
return {
171+
name: dataArr[2],
172+
x: data[0][0],
173+
y: dataArr[1],
174+
fillcolor: randomColor,
175+
type: 'scatter',
176+
mode: 'lines',
177+
showlegend: true,
178+
};
179+
});
180+
181+
const sizeSwitch = sizing === 'all' ? all : solo;
182+
183+
return (
184+
<Plot
185+
data={[...plotlyData]}
186+
config={{ responsive: true, displayModeBar: false }}
187+
layout={{
188+
title: 'CPU Temperature',
189+
...sizeSwitch,
190+
font: {
191+
color: '#444d56',
192+
size: 11.5,
193+
family: 'Roboto',
194+
},
195+
paper_bgcolor: 'white',
196+
plot_bgcolor: 'white',
197+
legend: {
198+
orientation: 'h',
199+
xanchor: 'center',
200+
x: 0.5,
201+
y: 5,
202+
},
203+
xaxis: {
204+
title: 'Time (EST)',
205+
tickmode: 'auto',
206+
tickformat: '%H %M %p',
207+
mirror: false,
208+
ticks: 'outside',
209+
showline: true,
210+
},
211+
yaxis: {
212+
title: `Temperature (\xB0C)`,
213+
rangemode: 'nonnegative',
214+
mirror: false,
215+
ticks: 'outside',
216+
showline: true,
217+
},
218+
}}
219+
/>
220+
>>>>>>> will/style_tweaks
129221
);
130222
}
131223
);

app/charts/TrafficChart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const TrafficChart = React.memo(() => {
3333
showlegend: false,
3434
},
3535
]}
36+
config={{ displayModeBar: false }}
3637
layout={{
3738
title: 'Server Traffic',
3839
height: 300,

app/charts/sizeSwitch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ window.addEventListener('resize', () => {
1919
});
2020

2121
export const all = {
22-
height: 300,
23-
width: 300,
22+
height: 400,
23+
width: 400,
2424
};

app/components/Contact.tsx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ const Contact = React.memo(() => {
2121
Please feel free to provide any feedback, concerns, or comments.
2222
</p>
2323
<p style={currentMode}>
24+
<<<<<<< HEAD
2425
You can find issues the team is currently addressing &nbsp;
26+
=======
27+
You can find issues the team is currently working on{' '}
28+
>>>>>>> will/style_tweaks
2529
<a
2630
style={currentMode}
2731
id="issueLink"
@@ -38,38 +42,32 @@ const Contact = React.memo(() => {
3842
<div className="email-container">
3943
<form>
4044
<label style={currentMode} htmlFor="fname">
41-
First Name: &nbsp;
45+
First Name:
46+
<input type="text" id="fname" name="firstname" placeholder="Your name.." />
4247
</label>
43-
<input type="text" id="fname" name="firstname" placeholder="Your name.." />
44-
<br />
4548
<label style={currentMode} htmlFor="lname">
46-
Last Name: &nbsp;
49+
Last Name:{' '}
50+
<input type="text" id="lname" name="lastname" placeholder="Your last name.." />
4751
</label>
48-
<input type="text" id="lname" name="lastname" placeholder="Your last name.." />
49-
<br />
5052
<label style={currentMode} htmlFor="email">
51-
E-mail: &nbsp;
53+
E-mail:
54+
<input type="text" id="email" name="email" placeholder="Your e-mail address.." />
5255
</label>
53-
<input type="text" id="email" name="email" placeholder="Your e-mail address.." />
54-
<br />
5556
<label style={currentMode} htmlFor="subject">
56-
Subject: &nbsp;
57+
Subject:
58+
<input type="text" id="subject" name="subject" placeholder="Subject" />
5759
</label>
58-
<input type="text" id="subject" name="subject" placeholder="Subject" />
59-
<br />
6060
<label style={currentMode} id="messageLabel" htmlFor="message">
6161
Message:{' '}
6262
<span>
6363
<textarea id="message" name="message" placeholder="Write something.." />
6464
</span>
6565
</label>
6666

67-
<br />
6867
<label style={currentMode} htmlFor="myfile">
6968
Select a file:{' '}
69+
<input style={currentMode} type="file" id="myfile" name="myfile" accept="image/*" />
7070
</label>
71-
<input style={currentMode} type="file" id="myfile" name="myfile" accept="image/*" />
72-
<br />
7371
<input style={currentMode} id="contact-submit" type="submit" value="Submit" />
7472
</form>
7573
</div>

0 commit comments

Comments
 (0)