Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chronos npm microservices refactor #365

Closed
wants to merge 157 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
018bc83
dev env set up
sarhiri Apr 24, 2024
6b0d8bf
imports for new search bar component added
mdtagg Apr 25, 2024
8f6206f
Modularlized search bar component
mdtagg Apr 25, 2024
1f6f808
Dashboard icons extracted into seperate component
mdtagg Apr 25, 2024
f85b8db
search bar styles import added
mdtagg Apr 25, 2024
371b96f
extracted dashboard icons component
mdtagg Apr 25, 2024
f70d764
styles moved to repective compoents folders
mdtagg Apr 25, 2024
548ed0b
Applications card extracted into separate component
mdtagg Apr 25, 2024
f5c4584
styles moved to applicationsCard component
mdtagg Apr 25, 2024
1f0b31e
extracted from occupied component
mdtagg Apr 25, 2024
a63c7f8
stylesheets for Occupied component moved to Occupied
mdtagg Apr 25, 2024
5eddf77
stylesheets moved to Occupied folder
mdtagg Apr 25, 2024
c87a97c
import changed for occupied component
mdtagg Apr 25, 2024
c62f683
occupied folder added
mdtagg Apr 25, 2024
ceee56e
spacing added
mdtagg Apr 25, 2024
e855891
extracted svg into search bar component
mdtagg Apr 25, 2024
5863f13
spaces added
mdtagg Apr 26, 2024
2ac7c3e
added example state
mdtagg Apr 26, 2024
e573e05
added example button
mdtagg Apr 26, 2024
5e2a8a3
added styles for example button
mdtagg Apr 26, 2024
c9db5cb
deleted icons folder
mdtagg Apr 26, 2024
01ef0f9
Merge pull request #1 from oslabs-beta/modularization
sarhiri Apr 26, 2024
dcc33a1
Merge branch 'dev' of github.com:oslabs-beta/Chronos-MTSS into dev
sarhiri Apr 26, 2024
a6903d6
extracted styles from occupied component
mdtagg Apr 27, 2024
ac8d98b
mui styles now live in helper folder
mdtagg Apr 27, 2024
b173708
spacing removed
mdtagg Apr 27, 2024
401f04a
added types for new modal and set modal state to be imported to each …
mdtagg Apr 27, 2024
dfdc00e
Condensed modal states into single state
mdtagg Apr 27, 2024
57d1f73
Modal component refactor
mdtagg Apr 27, 2024
f918bf6
Merge pull request #2 from oslabs-beta/modularization
stephenhyang Apr 27, 2024
bcf52ac
Merge branch 'dev' of github.com:oslabs-beta/Chronos-MTSS into dev
sarhiri Apr 27, 2024
2630911
removed unused styles
mdtagg Apr 28, 2024
fbd0a9b
removed commented out code
mdtagg Apr 28, 2024
7697e43
Occupied component styling broken up and extracted to components
mdtagg Apr 28, 2024
b299a5f
removed redundant div and associated styles. Added padding to retain …
mdtagg Apr 28, 2024
1480d17
explanation for where connect db is function gets fired added
mdtagg Apr 28, 2024
3e0afbf
explanations added
mdtagg Apr 28, 2024
dae6b8b
explanations added
mdtagg Apr 28, 2024
70ff8d0
updated array destructured values with appropriate names
mdtagg Apr 28, 2024
cff8f92
start of modularizing modals
stephenhyang Apr 29, 2024
5f874ce
Merge pull request #3 from oslabs-beta/modularization
stephenhyang Apr 29, 2024
194185c
Merge pull request #4 from oslabs-beta/stateUpdate
stephenhyang Apr 29, 2024
9527960
initial search bar feature
sarhiri Apr 29, 2024
de6ccfc
Updated file paths for modularization changes
stephenhyang Apr 29, 2024
d2092a2
Merge branch 'dev' of github.com:oslabs-beta/Chronos-MTSS into dev
sarhiri Apr 29, 2024
970d048
Merge branch 'dev' into stephenfeature
stephenhyang Apr 29, 2024
3f5b941
Removed examples state from dashboard container
mdtagg Apr 30, 2024
fb76bf4
unused props removed from memoized componetns
mdtagg Apr 30, 2024
7593af1
console logs removed
mdtagg Apr 30, 2024
b2bdf1d
button removed from material UI not being used
mdtagg Apr 30, 2024
81825c9
styling added to example button
mdtagg Apr 30, 2024
14ac040
Merge pull request #5 from oslabs-beta/mvp
sarhiri Apr 30, 2024
bae3625
nav in graphs bar extracted into seperate component
mdtagg Apr 30, 2024
3b55a6e
extracted string to color function into helper folder
mdtagg Apr 30, 2024
1e2ee13
Metric containers now rendered through ternary
mdtagg Apr 30, 2024
a6f09a9
created About folder to modularizing About.tsx
tedpham3 Apr 30, 2024
e889a46
added modulized About, added Contact folder for next modulization
tedpham3 Apr 30, 2024
4db81c3
modularized addmodal and servicesmodal components
stephenhyang Apr 30, 2024
bafcdbf
light adjustments to structure of compoment
mdtagg Apr 30, 2024
855da62
completed Contact modularization
tedpham3 Apr 30, 2024
809958c
Merge pull request #6 from oslabs-beta/graphContainer/refactor
sarhiri Apr 30, 2024
e46be48
Modularized AddModal and ServicesModal components
stephenhyang Apr 30, 2024
0c47451
Merge pull request #8 from oslabs-beta/stephenfeature
mdtagg Apr 30, 2024
8f55a4d
premerge
tedpham3 Apr 30, 2024
618fd39
merged dev
tedpham3 Apr 30, 2024
72125a5
Merge pull request #9 from oslabs-beta/ted-module
mdtagg Apr 30, 2024
cc6d949
Merge branch 'dev' of github.com:oslabs-beta/Chronos-MTSS into dev
sarhiri Apr 30, 2024
7eb60c1
deleted unused files, moved some work in progress file in the folder,…
tedpham3 Apr 30, 2024
ba68df7
modularized header, define an interface in Header that describe all t…
tedpham3 Apr 30, 2024
d1ae658
added comments, removed console.log
mdtagg Apr 30, 2024
2c8157e
modularized AwsModal, deleted unnecessary code in other modals
stephenhyang Apr 30, 2024
5c51f61
modularized Setting, moved scss to its folder
tedpham3 Apr 30, 2024
dae52ca
modularized WindowBar, added its scss file
tedpham3 Apr 30, 2024
ac3ec98
Merge pull request #10 from oslabs-beta/stephenfeature
sarhiri Apr 30, 2024
00a7a20
Merge branch 'dev' of github.com:oslabs-beta/Chronos-MTSS into dev
sarhiri Apr 30, 2024
ccfb1ba
pre-pull dev
tedpham3 Apr 30, 2024
75fb379
pre merge
tedpham3 Apr 30, 2024
3833b31
Merge pull request #11 from oslabs-beta/ted-module
mdtagg Apr 30, 2024
8ebe547
Merge branch 'dev' of github.com:oslabs-beta/Chronos-MTSS into dev
sarhiri Apr 30, 2024
524cc1e
dev merge
mdtagg Apr 30, 2024
a028ae5
Merge pull request #12 from oslabs-beta/graphContainer/refactor
tedpham3 Apr 30, 2024
08f900e
Merge branch 'dev' into sofia
sarhiri Apr 30, 2024
c84e723
Merge branch 'dev' of github.com:oslabs-beta/Chronos-MTSS into dev
sarhiri Apr 30, 2024
343bdd9
Merge branch 'dev' of github.com:oslabs-beta/Chronos-MTSS into sofia
sarhiri Apr 30, 2024
205d793
Merge branch 'dev' into sofia
sarhiri Apr 30, 2024
83f3be7
Bug fix: Settings component
mdtagg May 1, 2024
16e06be
Merge pull request #13 from oslabs-beta/componentsrefactor
sarhiri May 1, 2024
9c1ce04
Merge branch 'dev' of github.com:oslabs-beta/Chronos-MTSS into dev
sarhiri May 1, 2024
9c87bb3
Merge branch 'dev' into sofia
sarhiri May 1, 2024
520d8b8
Bug fix: when graphs container loaded it did not have correct app tit…
mdtagg May 1, 2024
8ffa343
Merge pull request #14 from oslabs-beta/bug-fix
sarhiri May 1, 2024
c68dafa
Merge branch 'dev' of github.com:oslabs-beta/Chronos-MTSS into dev
sarhiri May 1, 2024
97de0f4
Merge branch 'dev' into sofia
sarhiri May 1, 2024
d258407
Bare minimum mvp working
mdtagg May 1, 2024
0e0e25c
Merge pull request #15 from oslabs-beta/mvp
sarhiri May 1, 2024
95b4775
Merge branch 'dev' of github.com:oslabs-beta/Chronos-MTSS into dev
sarhiri May 1, 2024
baccfe0
Merge branch 'dev' into sofia
sarhiri May 1, 2024
292585f
new button styling
sarhiri May 1, 2024
a7e362e
Merge pull request #16 from oslabs-beta/sofia
mdtagg May 1, 2024
5691e51
branch protection test
mdtagg May 1, 2024
ff9ae32
console log removed
mdtagg May 1, 2024
c0b6b77
Merge pull request #17 from oslabs-beta/mvp
sarhiri May 1, 2024
7044222
fixed example bug
mdtagg May 1, 2024
09a8717
Merge pull request #18 from oslabs-beta/branchFix
sarhiri May 1, 2024
a410461
branch protection test
mdtagg May 1, 2024
9703c7d
branch protection test
mdtagg May 1, 2024
4b0da1d
console log removed from branch test
mdtagg May 1, 2024
a60cd78
Exit example implemented
mdtagg May 2, 2024
2f33208
awscomtainer modularized
tedpham3 May 2, 2024
4cd02fc
moved scss file to AwsGraphContainer and DashboardContainer
tedpham3 May 2, 2024
ef2e600
modularized Inspect
tedpham3 May 2, 2024
7f881bf
MainContainer modularized
tedpham3 May 2, 2024
af08add
search bar function removed to facilitate rendering multiple components
mdtagg May 2, 2024
3337f85
Multple cards can now be added at once
mdtagg May 2, 2024
e0e538e
Moved search filter in occupied component
mdtagg May 3, 2024
aef3529
Modularized container, move every scss files to its own component, mo…
tedpham3 May 3, 2024
3fda80e
removed stylesheet for app, merge every global files into index.scss
tedpham3 May 3, 2024
6cccea8
Delete card functionality refactor
mdtagg May 3, 2024
0a0ed94
made Ifield data type any temporarily
mdtagg May 3, 2024
83d19e5
Merge pull request #19 from oslabs-beta/ted-modular
mdtagg May 3, 2024
0ec96c0
merged ted-modular branch
mdtagg May 3, 2024
5e8a6fd
resolved conflicts with ted-modular
mdtagg May 3, 2024
b75a750
Merge pull request #20 from oslabs-beta/feature/example
stephenhyang May 4, 2024
c60fc6e
added redux devTools, working on adding react devTools
stephenhyang May 4, 2024
ef1cb41
MUI updated package installed
sarhiri May 5, 2024
c8c5ccd
main MUI update, app working
sarhiri May 5, 2024
c607f6a
final MUI update before deleting old version. app not crashed
sarhiri May 5, 2024
047a49d
Fully updated MUI
sarhiri May 5, 2024
1382d3e
console logs added for traverseal of npm package
mdtagg May 6, 2024
832c4f1
console logs added
mdtagg May 6, 2024
1801909
console logs added
mdtagg May 6, 2024
94460b2
Ports changed to 5001
mdtagg May 6, 2024
77ce10f
changed port to 5001
mdtagg May 6, 2024
dcf2840
changed default ports to 5001
mdtagg May 6, 2024
35a35eb
Merge branch 'dev' into stephenfeature
stephenhyang May 6, 2024
bdf3b1c
Merge pull request #21 from oslabs-beta/MUI
mdtagg May 6, 2024
38b7b07
Merge branch 'dev' into stephenfeature
stephenhyang May 6, 2024
b48f4c3
working toward a solution for data presistance issue in mongo.health …
mdtagg May 9, 2024
5aa4ed2
added redux devtools to electron app, installed react devtools versio…
stephenhyang May 9, 2024
3730a14
console logs added to check execution order
mdtagg May 9, 2024
8adbc25
Health metrics function rewrite
mdtagg May 9, 2024
6328d2f
mongo.health rewrite
mdtagg May 9, 2024
bde42f8
updated serviceslink component with deconstructed props
stephenhyang May 9, 2024
0cb3058
Merge pull request #22 from oslabs-beta/stephenfeature
tedpham3 May 10, 2024
06a3f35
Filter modified to prevent mongo error
mdtagg May 10, 2024
d9b5017
Current metrics now used to determine how new metrics are added to db
mdtagg May 10, 2024
40f68b2
sample envs deleted
mdtagg May 10, 2024
3ceb4c0
personal helper function removed in favor of original
mdtagg May 10, 2024
51d8d98
Refactored mongo.health function further
mdtagg May 11, 2024
373ca45
added select all services button
stephenhyang May 11, 2024
53eafb6
Added comments to explain sections of code, removed inaccuratly descr…
mdtagg May 11, 2024
adcc071
Removed sections of code not in use, adjusted tabbing
mdtagg May 11, 2024
88a527d
Current metrics moved inside of health metrics function
mdtagg May 11, 2024
6d430d4
deconstructed props in all modal components
stephenhyang May 11, 2024
7762c3e
Grafana api key section commented out temporarily
mdtagg May 11, 2024
f2168fd
Merge pull request #24 from oslabs-beta/stephenfeature
mdtagg May 11, 2024
14b2319
Merge branch 'dev' into chronos-npm
sarhiri May 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __backend-tests__/chronosMethods.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { EcoTwoTone } = require('@material-ui/icons');
const { EcoTwoTone } = require('@mui/icons-material');
const Chronos = require('../chronos_npm_package/chronos.js');
const helpers = require('../chronos_npm_package/controllers/utilities.js');
const hpropagate = require('hpropagate');
Expand Down
6 changes: 3 additions & 3 deletions __backend-tests__/mockdbsetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ const connectDB = async () => {
useNewUrlParser: true,
useUnifiedTopology: true,
}).then((result) => {
console.log(result.connection.readyState)
console.log(result.connection.host)
// console.log(result.connection.readyState)
// console.log(result.connection.host)
}).catch((err) => {
console.log('Unable to connect to MongoMemoryServer')
// console.log('Unable to connect to MongoMemoryServer')
});
};

Expand Down
6 changes: 3 additions & 3 deletions app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import Splash from './components/Splash';
import DashboardContainer from './containers/DashboardContainer';
import './stylesheets/scrollBar.scss';
import Splash from './components/Splash/Splash';
import DashboardContainer from './containers/DashboardContainer/DashboardContainer';
import './index.scss';


// this is the fitness gram pacer test
Expand Down
1 change: 0 additions & 1 deletion app/assets/search.svg

This file was deleted.

136 changes: 0 additions & 136 deletions app/charts/GrafanaEventChart.tsx

This file was deleted.

196 changes: 196 additions & 0 deletions app/charts/GrafanaEventChart/GrafanaEventChart.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
import React, { useState } from 'react';
import { all, solo as soloStyle } from '../sizeSwitch';
import './styles.scss';

interface EventChartProps {
metricName: string;
token: string;
}

type TimeFrame = '5m' | '15m' | '30m' | '1h' | '2h' | '1d' | '2d';

/**
* @params {EventChartProps} props - the props object containing relevant data.
* @desc Handles k8s and container metrics. Memoized component to generate event chart with formatted data
* @returns {JSX.Element} The JSX element with the event chart.
*/
const GrafanaEventChart: React.FC<EventChartProps> = React.memo(props => {
const { metricName, token } = props;
const [graphType, setGraphType] = useState('timeseries');
const [type, setType] = useState(['timeserie']);
const [timeFrame, setTimeFrame] = useState('5m');

// console.log("graphType: ", graphType)
// console.log("type: ", type)
// console.log("inside GrafanaEventChart")

// console.log("metricName: ", metricName)
let uid = metricName.replace(/.*\/.*\//g, '');
if (uid.length >= 40) {
uid = metricName.slice(metricName.length - 39);
}

let parsedName = metricName.replace(/.*\/.*\//g, '');
// console.log("uid: ", uid)
// console.log("parsedName: ", parsedName)

const handleSelectionChange = async event => {
setType([...type, graphType]);
await fetch('http://localhost:1111/api/updateDashboard', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ graphType: event.target.value, metric: metricName, token: token }),
});
console.log('event.target.value: ', event.target.value);
setGraphType(event.target.value);
};

return (
<div className="chart" id="Grafana_Event_Chart">
<h2>{`${parsedName} --- ${graphType}`}</h2>
<div id="selection">
<label htmlFor="timeFrame">Graph Type: </label>
<select name="timeFrame" id="timeFrame" onChange={handleSelectionChange}>
<option value="timeseries">Time Series</option>
<option value="barchart">Bar Chart</option>
<option value="stat">Stat</option>
<option value="gauge">Gauge</option>
<option value="table">Table</option>
<option value="histogram">Histogram</option>
<option value="piechart">Pie Chart</option>
<option value="alertlist">Alert</option>
</select>

<label
htmlFor="graphType"
style={{
marginLeft: '20px',
}}
>
{' '}
Time Frame:{' '}
</label>
<select
name="graphType"
id="graphType"
onChange={e => setTimeFrame(e.target.value as TimeFrame)}
>
<option value={'5m'}>5 minutes</option>
<option value={'15m'}>15 minutes</option>
<option value={'30m'}>30 minutes</option>
<option value={'1h'}>1 hour</option>
<option value={'2h'}>2 hours</option>
<option value={'1d'}>1 day</option>
<option value={'2d'}>2 days</option>
</select>
</div>
{/* create chart using grafana iframe tag*/}
{/* {type[type.length - 1] !== graphType ?
<iframe src={`http://localhost:32000/d-solo/${uid}/${parsedName}?orgId=1&refresh=10s&from=now-5m&to=now&panelId=1`} width="650" height="400" ></iframe>
: <iframe src={`http://localhost:32000/d-solo/${uid}/${parsedName}?orgId=1&refresh=10s&from=now-5m&to=now&panelId=1`} width="650" height="400" ></iframe>} */}
{graphType === 'timeseries'
? TimeSeries(uid, parsedName, graphType, timeFrame)
: graphType === 'barchart'
? BarChart(uid, parsedName, graphType, timeFrame)
: graphType === 'stat'
? Stat(uid, parsedName, graphType, timeFrame)
: graphType === 'gauge'
? Gauge(uid, parsedName, graphType, timeFrame)
: graphType === 'table'
? Table(uid, parsedName, graphType, timeFrame)
: graphType === 'histogram'
? Histogram(uid, parsedName, graphType, timeFrame)
: graphType === 'piechart'
? PieChart(uid, parsedName, graphType, timeFrame)
: graphType === 'alertlist'
? AlertList(uid, parsedName, graphType, timeFrame)
: null}
</div>
);
});

const TimeSeries = (uid, parsedName, graphType, timeFrame) => {
return (
<>
<iframe
src={`http://localhost:32000/d-solo/${uid}/${parsedName}?orgId=1&refresh=10s&from=now-${timeFrame}&to=now&panelId=1&${graphType}`}
width="800"
height="500"
></iframe>
<hr />
</>
);
};

const BarChart = (uid, parsedName, graphType, timeFrame) => {
return (
<iframe
src={`http://localhost:32000/d-solo/${uid}/${parsedName}?orgId=1&refresh=10s&from=now-${timeFrame}&to=now&panelId=1${graphType}`}
width="800"
height="500"
></iframe>
);
};

const Stat = (uid, parsedName, graphType, timeFrame) => {
return (
<iframe
src={`http://localhost:32000/d-solo/${uid}/${parsedName}?orgId=1&refresh=10s&from=now-${timeFrame}&to=now&panelId=1${graphType}`}
width="800"
height="500"
></iframe>
);
};

const Gauge = (uid, parsedName, graphType, timeFrame) => {
return (
<iframe
src={`http://localhost:32000/d-solo/${uid}/${parsedName}?orgId=1&refresh=10s&from=now-${timeFrame}&to=now&panelId=1${graphType}`}
width="800"
height="500"
></iframe>
);
};

const Table = (uid, parsedName, graphType, timeFrame) => {
return (
<iframe
src={`http://localhost:32000/d-solo/${uid}/${parsedName}?orgId=1&refresh=10s&from=now-${timeFrame}&to=now&panelId=1${graphType}`}
width="800"
height="500"
></iframe>
);
};

const Histogram = (uid, parsedName, graphType, timeFrame) => {
return (
<iframe
src={`http://localhost:32000/d-solo/${uid}/${parsedName}?orgId=1&refresh=10s&from=now-${timeFrame}&to=now&panelId=1${graphType}`}
width="800"
height="500"
></iframe>
);
};

const PieChart = (uid, parsedName, graphType, timeFrame) => {
return (
<iframe
src={`http://localhost:32000/d-solo/${uid}/${parsedName}?orgId=1&refresh=10s&from=now-${timeFrame}&to=now&panelId=1${graphType}`}
width="800"
height="500"
></iframe>
);
};

const AlertList = (uid, parsedName, graphType, timeFrame) => {
return (
<iframe
src={`http://localhost:32000/d-solo/${uid}/${parsedName}?orgId=1&refresh=10s&from=now-${timeFrame}&to=now&panelId=1${graphType}`}
width="800"
height="500"
></iframe>
);
};
export default GrafanaEventChart;
2 changes: 1 addition & 1 deletion app/charts/RequestTypesChart.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useContext } from 'react';
import Plot from 'react-plotly.js';
import { CommsContext } from '../context/CommsContext';
import '../stylesheets/constants.scss';
import '../index.scss';

const RequestTypesChart: React.FC = React.memo(() => {
const { commsData } = useContext(CommsContext);
Expand Down
2 changes: 1 addition & 1 deletion app/charts/RouteChart.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { makeStyles } from '@material-ui/core/styles';
import { makeStyles } from '@mui/styles';
import React, { useContext } from 'react';
import Graph from 'react-graph-vis';
import { CommsContext } from '../context/CommsContext';
Expand Down
Loading
Loading