Skip to content

Commit 6095bbb

Browse files
committed
Merge branch 'master' into ApplicationsUpdate
2 parents 6e8192f + fd7673f commit 6095bbb

7 files changed

Lines changed: 150 additions & 65 deletions

File tree

__tests__/app/containers/GraphsContainer.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import React from 'react';
22
import { configure, shallow, render } from 'enzyme';
33

44
import GraphsContainer from '../../../app/containers/GraphsContainer'
5-
// import SpeedChart from '../../../app/charts/speed-chart'
5+
import SpeedChart from '../../../app/charts/SpeedChart'
66

7-
xdescribe('<GraphsContainer />', () => {
8-
it('should render graphs')
9-
})
7+
// xdescribe('<GraphsContainer />', () => {
8+
// it('should render graphs')
9+
// })
1010

1111
// xdescribe('<GraphsContainer />', () => {
1212
// it('should', () => {

app/charts/DockerChart.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ interface IContainer {
2424
*/
2525
const DockerStatsChart = () => {
2626
const { dockerData } = useContext(DockerContext);
27+
2728
const {
2829
containername,
2930
containerid,

app/components/Contact.tsx

Lines changed: 52 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,59 @@
11
import React from 'react';
2+
import '../stylesheets/Contact.css';
23

34
const Contact: React.FC = () => {
45
return (
5-
<div className="home">
6-
<div>
7-
<h1>Contact Us!</h1>
8-
<p>The Chronos Team is always looking for any feedback or suggestions for Chronos.</p>
9-
<p>
10-
You can find issues the team is currently working on&nbsp;
11-
<a href="https://github.com/open-source-labs/Chronos/issues" target="_blank">
12-
here
13-
</a>
14-
.
15-
</p>
16-
<p>
17-
If you would like your voice heard, fill out the form and we will get back to you ASAP!
18-
</p>
19-
</div>
20-
<div>
21-
<form>
22-
<label htmlFor="fname">First Name</label>
23-
<input type="text" id="fname" name="firstname" placeholder="Your name.." />
24-
<br />
25-
<label htmlFor="lname">Last Name</label>
26-
<input type="text" id="lname" name="lastname" placeholder="Your last name.." />
27-
<br />
28-
<label htmlFor="email">E-mail</label>
29-
<input type="text" id="email" name="email" placeholder="Your e-mail address.." />
30-
<br />
31-
<label htmlFor="subject">Subject</label>
32-
<input type="text" id="subject" name="subject" placeholder="Subject" />
33-
<br />
34-
<label htmlFor="message">Message</label>
35-
<textarea
36-
id="message"
37-
name="message"
38-
placeholder="Write something.." /*style="height:200px"*/
39-
></textarea>
40-
<br />
41-
<label htmlFor="myfile">Select a file: </label>
42-
<input type="file" id="myfile" name="myfile" accept="image/*"></input>
43-
<br />
44-
<input type="submit" value="Submit" />
45-
</form>
6+
<div className="contact">
7+
<div className="contact-border">
8+
<div className="contact-container">
9+
<div className="contact-blurb">
10+
<h1>Contact Us!</h1>
11+
<br />
12+
<p>The Chronos Team is always looking for any feedback or suggestions for Chronos.</p>
13+
<p>
14+
You can find issues the team is currently working on&nbsp;
15+
<a href="https://github.com/open-source-labs/Chronos/issues" target="_blank">
16+
here
17+
</a>
18+
.
19+
</p>
20+
<p>
21+
If you would like your voice heard, fill out the form and we will get back to you
22+
ASAP!
23+
</p>
24+
</div>
25+
<div className="chronos-contact-container">
26+
<img src={'../assets/chronos-v4.png'} alt="Chronos logo" />
27+
</div>
28+
</div>
29+
<div className="email-container">
30+
<form>
31+
<label htmlFor="fname">First Name: &nbsp;</label>
32+
<input type="text" id="fname" name="firstname" placeholder="Your name.." />
33+
<br />
34+
<label htmlFor="lname">Last Name: &nbsp;</label>
35+
<input type="text" id="lname" name="lastname" placeholder="Your last name.." />
36+
<br />
37+
<label htmlFor="email">E-mail: &nbsp;</label>
38+
<input type="text" id="email" name="email" placeholder="Your e-mail address.." />
39+
<br />
40+
<label htmlFor="subject">Subject: &nbsp;</label>
41+
<input type="text" id="subject" name="subject" placeholder="Subject" />
42+
<br />
43+
<label htmlFor="message">Message: </label>
44+
<br />
45+
<textarea
46+
id="message"
47+
name="message"
48+
placeholder="Write something.." /*style="height:200px"*/
49+
></textarea>
50+
<br />
51+
<label htmlFor="myfile">Select a file: </label>
52+
<input type="file" id="myfile" name="myfile" accept="image/*"></input>
53+
<br />
54+
<input id="contact-submit" type="submit" value="Submit" />
55+
</form>
56+
</div>
4657
</div>
4758
</div>
4859
);

app/context/DockerContext.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ const DockerContextProvider: React.FC = ({ children }) => {
2525
}
2626

2727
// Fetches all data related to a particular app
28-
const fetchDockerData = (service: string) => {
28+
const fetchDockerData = (service: string) => {
2929
ipcRenderer.send('dockerRequest', service);
3030

3131
ipcRenderer.on('dockerResponse', (event: Electron.Event, data: any) => {
3232
// Parse result
3333
const result: IContainer[] = JSON.parse(data);
34+
3435
console.log('Number of data points (docker):', result.length);
3536
// Display single data point
3637
const newDockerData = result[0] || {};

app/stylesheets/Contact.css

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
.contact {
2+
background-color: #f4f4f4;
3+
height: 100%;
4+
display: flex;
5+
justify-content: flex-start;
6+
}
7+
.contact-border {
8+
width: 120vh;
9+
margin: 10vh 20vh;
10+
background-color: rgb(245, 237, 237);
11+
border-radius: 10px;
12+
border: 1px solid black;
13+
z-index: 0;
14+
display: flex;
15+
flex-direction: row;
16+
padding-top: 50px;
17+
padding-left: 40px;
18+
}
19+
.contact-container {
20+
padding: 20px;
21+
margin-right: 0;
22+
height: 70vh;
23+
justify-content: left;
24+
width: 45%;
25+
min-width: 30vh;
26+
line-height: 3vh;
27+
}
28+
.contact-blurb {
29+
padding-left: 2vh;
30+
font-size: 20px;
31+
}
32+
.email-container {
33+
flex-direction: row;
34+
margin: 0 0;
35+
margin-left: 20vh;
36+
width: 50vh;
37+
min-width: 20vh;
38+
line-height: 5vh;
39+
font-size: 20px;
40+
}
41+
.email-container textarea {
42+
font-size: 15px;
43+
width: 30vh;
44+
height: 20vh;
45+
}
46+
.email-container input {
47+
font-size: 15px;
48+
}
49+
.chronos-contact-container {
50+
height: 20vh;
51+
width: 40vh;
52+
}
53+
.chronos-contact-container img {
54+
margin-top: 5vh;
55+
height: 20vh;
56+
width: 40vh;
57+
}
58+
.email-container input[type='text'] {
59+
width: 20vh;
60+
}
61+
.email-container #email {
62+
width: 23.5vh;
63+
}
64+
.email-container #subject {
65+
width: 22.5vh;
66+
}
67+
68+
#myfile {
69+
font-size: 17px;
70+
}
71+
72+
#contact-submit {
73+
font-size: 16px;
74+
width: 9vh;
75+
}
76+
77+
#contact-submit:hover {
78+
font-size: 13px;
79+
background-color: cyan;
80+
padding: 3px 7px;
81+
border-radius: 4px;
82+
border-color: #313639;
83+
}

electron/models/DockerModel.ts

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
1-
import mongoose, { Schema, Document } from 'mongoose';
2-
3-
export interface IDock extends Document {
4-
containername: string;
5-
containerid: string;
6-
platform: string;
7-
starttime: string;
8-
memoryusage: number;
9-
memorylimit: number;
10-
memorypercent: number;
11-
cpupercent: number;
12-
networkreceived: number;
13-
networksent: number;
14-
processcount: number;
15-
restartcount: number;
16-
}
1+
import mongoose from 'mongoose';
2+
const { Schema } = mongoose;
173

184
const DockerSchema = new Schema({
195
containername: {
@@ -66,4 +52,7 @@ const DockerSchema = new Schema({
6652
},
6753
});
6854

69-
export default mongoose.model<IDock>('containerinfos', DockerSchema);
55+
56+
const DockerModelFunc = (serviceName: any) => mongoose.model<any>(`${serviceName}-containerinfos`, DockerSchema);
57+
58+
export default DockerModelFunc;

electron/routes/data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ ipcMain.on('dockerRequest', async (message, service) => {
159159
// Mongo Database
160160
if (currentDatabaseType === 'MongoDB') {
161161
// Get document count
162-
let num = await DockerModelFunc.countDocuments();
162+
let num = await DockerModelFunc(service).countDocuments();
163163

164164
//Get last 50 documents. If less than 50 documents, get all
165165
num = Math.max(num, 50);
166-
result = await DockerModelFunc.find().skip(num - 50);
166+
result = await DockerModelFunc(service).find().skip(num - 50);
167167
}
168168

169169
// SQL Database

0 commit comments

Comments
 (0)