Skip to content

Commit 4f8c54c

Browse files
committed
AWSGraphsContainer remodularization
1 parent 794b813 commit 4f8c54c

5 files changed

Lines changed: 50 additions & 39 deletions

File tree

app/containers/AWSGraphsContainer/AWSGraphsContainer.tsx

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ import { Typography } from '@mui/material';
55
import { AwsContext } from '../../context/AwsContext';
66
import './styles.scss';
77
import { useLocation } from 'react-router-dom';
8-
import EC2GraphsComponent from './EC2GraphsComponent';
9-
import ECSGraphsComponent from './ECSGraphsComponent';
10-
import EKSGraphsComponent from './EKSGraphsComponent';
8+
import AwsEC2Graphs from '../../components/AwsEC2Graphs';
9+
import ClusterTable from '../../components/ClusterTable';
10+
import AwsECSClusterGraphs from '../../components/AwsECSClusterGraphs';
1111

1212
const AwsGraphsContainer = () => {
1313
const { app, appIndex, setIntervalID, intervalID } = useContext(ApplicationContext);
1414
const { user } = useContext(DashboardContext);
15-
const { awsAppInfo, fetchAwsData, fetchAwsEcsData, fetchAwsEksData, fetchAwsAppInfo } =
16-
useContext(AwsContext);
15+
const { awsAppInfo, fetchAwsData, fetchAwsEcsData, fetchAwsEksData, fetchAwsAppInfo } = useContext(AwsContext);
1716
const { state } = useLocation();
1817
const { typeOfService } = state;
1918
const [awsLive, setAwsLive] = React.useState(false);
@@ -59,18 +58,44 @@ const AwsGraphsContainer = () => {
5958

6059
return (
6160
<div className="AWS-container">
61+
6262
<div className="AWS-header">
63-
<Typography variant="h3">{app}</Typography>
63+
<Typography
64+
variant="h3"
65+
>
66+
{app}
67+
</Typography>
6468
<p>Metrics for AWS Service</p>
65-
<button onClick={() => setAwsLive(!awsLive)}>
69+
<button
70+
onClick={() => setAwsLive(!awsLive)}
71+
>
6672
{awsLive ? 'Stop Live Update' : 'Start Live Update'}
6773
</button>
6874
</div>
75+
6976
{typeOfService === 'AWS/ECS' && (
70-
<ECSGraphsComponent region={awsAppInfo.region} typeOfService={typeOfService} />
77+
<div className="cluster-table">
78+
<ClusterTable
79+
typeOfService={typeOfService}
80+
region={awsAppInfo.region}
81+
/>
82+
<AwsECSClusterGraphs />
83+
</div>
7184
)}
72-
{typeOfService === 'AWS/EC2' && <EC2GraphsComponent />}
73-
{typeOfService === 'AWS/EKS' && <EKSGraphsComponent awsEksData={awsAppInfo.awsUrl} />}
85+
86+
{typeOfService === 'AWS/EC2' &&
87+
<div className="cluster-table">
88+
<AwsEC2Graphs />
89+
</div>
90+
}
91+
92+
{typeOfService === 'AWS/EKS' &&
93+
<iframe
94+
src={`${awsAppInfo.awsUrl}?orgId=1&refresh=10s&theme=light&kiosk`}
95+
width="1300"
96+
height="1300"
97+
></iframe>
98+
}
7499
</div>
75100
);
76101
};

app/containers/AWSGraphsContainer/EC2GraphsComponent.tsx

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

app/containers/AWSGraphsContainer/ECSGraphsComponent.tsx

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

app/containers/AWSGraphsContainer/EKSGraphsComponent.tsx

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

examples/microservices/sample.env

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Database type being used to store Chronos metrics
2+
CHRONOS_DB=MongoDB
3+
# Database connection string for Chronos to write metric to
4+
CHRONOS_URI=mongodb://127.0.0.1:27017/Chronos_Microservices
5+
6+
# Database connection strings for each microservice
7+
MONGO_URI_AUTH=mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5
8+
MONGO_URI_ITEMS=mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5
9+
MONGO_URI_INVENTORY=mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5
10+
MONGO_URI_ORDERS=mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+2.2.5
11+
12+
# this is the secret for auth service to sign/verify json web tokens
13+
JWT_KEY=thisStringDoesNotMatterItJustNeedsToBeDefined
14+
# this is time til expiration for the json web token
15+
JWT_LIFETIME=1d

0 commit comments

Comments
 (0)