Skip to content

Commit 56d8197

Browse files
committed
Merge branch 'master' into ApplicationsUpdate
2 parents aa41b84 + 739de90 commit 56d8197

17 files changed

Lines changed: 235 additions & 57 deletions

app/components/About.tsx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,35 @@
11
import React from 'react';
22

33
const About: React.FC = () => {
4-
return <div className="home">Hello this is the About</div>;
4+
return (
5+
<div className="home">
6+
<h1>About</h1>
7+
<p>
8+
The Chronos Team has always had passion for Open Source endeavors that would greatly benefit
9+
the developer community.
10+
</p>
11+
<p>
12+
With many existing paid options being difficult to use and expensive to operate, Chronos was
13+
born...
14+
</p>
15+
<p>
16+
Chronos is an all-in-one network and health monitoring tool for your application or
17+
microservice, containerized or not!
18+
</p>
19+
<p>Insert snippets from the github readme on how to use it</p>
20+
<h1>Team</h1>
21+
<div>
22+
<span>Michael </span>
23+
<span>Greg </span>
24+
<span>Ronelle </span>
25+
<span>Todd </span>
26+
</div>
27+
<h1>History</h1>
28+
<div>
29+
<span>Maybe have past teams put what they want here</span>
30+
</div>
31+
</div>
32+
);
533
};
634

735
export default About;

app/components/Applications.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ const Applications = () => {
3232
};
3333

3434
// Handle clicks on Application cards
35-
const handleClick = (app: string, i: number) => {
35+
const handleClick = (selectedApp: string, i: number) => {
3636
setIndex(i);
37-
setApp(app);
37+
setApp(selectedApp);
38+
console.log('handle', selectedApp);
3839
setOpen(true);
3940
};
4041

@@ -68,7 +69,7 @@ const Applications = () => {
6869

6970
return (
7071
<>
71-
{applications.map((app: string, i: number | any | string | undefined) => (
72+
{applications.map((app: string[], i: number | any | string | undefined) => (
7273
<Grid item xs={6} key={i}>
7374
<div id="card-hover">
7475
<Card

app/components/Contact.tsx

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,51 @@
11
import React from 'react';
22

33
const Contact: React.FC = () => {
4-
return <div className="home">Hello this is the Contact</div>;
4+
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>
46+
</div>
47+
</div>
48+
);
549
};
650

751
export default Contact;

app/components/Copyright.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface CopyrightProps {}
66
const Copyright = () => (
77
<Typography variant="body2" color="textSecondary" align="center">
88
{'Copyright © '}
9-
<Link color="inherit" href="https://chronoslany.com/">
9+
<Link color="inherit" href="https://chronoslany.com/" target="_blank">
1010
Team Chronos
1111
</Link>{' '}
1212
{new Date().getFullYear()}

app/components/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ApplicationContext } from '../context/ApplicationContext';
55
import '../stylesheets/Header.scss';
66

77
export interface HeaderProps {
8-
app: string;
8+
app: string[];
99
service: string;
1010
live: boolean;
1111
setLive: React.Dispatch<React.SetStateAction<boolean>>;

app/components/Settings.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ import React from 'react';
55
// Need to add flag to turn on/off live data (ideally persist on restart)
66
// Need to add dark mode
77
const Settings: React.FC = () => {
8-
return <div className="home">Hello this is the Settings</div>;
8+
return (
9+
<div className="home">
10+
<h1>Currently under construction, coming soon!</h1>
11+
<p>Contact the Chronos Team for anything you'd like to see!</p>
12+
</div>
13+
);
914
};
1015

1116
export default Settings;

app/containers/GraphsContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import RouteTrace from '../charts/RouteTrace';
1818
import '../stylesheets/GraphsContainer.scss';
1919

2020
export interface Params {
21-
app: string;
21+
app: any;
2222
service: string;
2323
}
2424

app/containers/MainContainer.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { Route, Switch } from 'react-router-dom';
33

44
// import GraphsContainer from './Archived';
55
import Home from '../components/Home';
6+
import About from '../components/About';
7+
import Contact from '../components/Contact';
8+
import Settings from '../components/Settings';
69
import Copyright from '../components/Copyright';
710
import Occupied from '../components/Occupied';
811
import GraphsContainer from './GraphsContainer';
@@ -13,6 +16,9 @@ const MainContainer = () => (
1316
<div className="main-routes">
1417
<Switch>
1518
<Route exact path="/" component={Home} />
19+
<Route exact path="/about" component={About} />
20+
<Route exact path="/contact" component={Contact} />
21+
<Route exact path="/settings" component={Settings} />
1622
<Route exact path="/applications" component={Occupied} />
1723
<Route exact path="/applications/:app/:service" component={GraphsContainer} />
1824
<Route path="*" render={() => <h1>Not found</h1>} />

app/context/DashboardContext.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ interface IFields {
1313
database: string;
1414
URI: string;
1515
name: string;
16+
description: string;
1617
}
1718

1819
export const DashboardContext = createContext<any>(null);
@@ -39,8 +40,11 @@ const DashboardContextProvider = ({ children }: Props) => {
3940
* of applications
4041
*/
4142
const addApp = (fields: IFields) => {
42-
const { database, URI, name } = fields;
43-
const result = ipcRenderer.sendSync('addApp', JSON.stringify([name, database, URI]));
43+
const { database, URI, name, description } = fields;
44+
const result = ipcRenderer.sendSync(
45+
'addApp',
46+
JSON.stringify([name, database, URI, description])
47+
);
4448
setApplications(result);
4549
};
4650

app/modals/AddModal.tsx

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ interface IFields {
66
database: string;
77
URI: string;
88
name: string;
9+
description: string;
910
}
1011

1112
interface IDashboard {
@@ -16,7 +17,7 @@ interface AddModalProps {
1617
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
1718
}
1819

19-
type InputElement = React.ChangeEvent<HTMLSelectElement | HTMLInputElement>;
20+
type InputElement = React.ChangeEvent<HTMLSelectElement | HTMLInputElement | HTMLTextAreaElement>;
2021
type FormElement = React.FormEvent<HTMLFormElement>;
2122

2223
const AddModal: React.FC<AddModalProps> = ({ setOpen }) => {
@@ -25,6 +26,7 @@ const AddModal: React.FC<AddModalProps> = ({ setOpen }) => {
2526
database: 'SQL',
2627
URI: '',
2728
name: '',
29+
description: '',
2830
});
2931

3032
// Submit form data and save to database
@@ -43,23 +45,24 @@ const AddModal: React.FC<AddModalProps> = ({ setOpen }) => {
4345
});
4446
};
4547

46-
const { database, URI, name } = fields;
48+
const { database, URI, name, description } = fields;
4749
return (
4850
<div className="add-container">
4951
<div className="add-header">
5052
<h2>Add an Application</h2>
5153
<p>Enter the database information used to track the service</p>
5254
</div>
5355
<form onSubmit={handleSubmit}>
54-
<div className="input-field">
55-
<label htmlFor="db-type">Type</label>
56+
<p>Required*</p>
57+
<div>
58+
<label htmlFor="db-type">Type<span>*</span></label>
5659
<select id="db-type" name="database" value={database} onChange={e => handleChange(e)}>
5760
<option value="SQL">SQL</option>
5861
<option value="MongoDB">MongoDB</option>
5962
</select>
6063
</div>
61-
<div className="input-field">
62-
<label htmlFor="db-uri">URI</label>
64+
<div>
65+
<label htmlFor="db-uri">URI<span>*</span></label>
6366
<input
6467
id="db-uri"
6568
name="URI"
@@ -69,8 +72,8 @@ const AddModal: React.FC<AddModalProps> = ({ setOpen }) => {
6972
required
7073
/>
7174
</div>
72-
<div className="input-field">
73-
<label htmlFor="db-name">Name</label>
75+
<div>
76+
<label htmlFor="db-name">Name<span>*</span></label>
7477
<input
7578
id="db-name"
7679
type="text"
@@ -81,6 +84,16 @@ const AddModal: React.FC<AddModalProps> = ({ setOpen }) => {
8184
required
8285
/>
8386
</div>
87+
<div>
88+
<label htmlFor="db-desc">Description</label>
89+
<textarea
90+
id="db-desc"
91+
name="db-desc"
92+
value={description}
93+
onChange={e => handleChange(e)}
94+
placeholder="Add a short description"
95+
/>
96+
</div>
8497
<button>Submit</button>
8598
</form>
8699
</div>

0 commit comments

Comments
 (0)