Skip to content

Commit 52451b9

Browse files
authored
Merge pull request #77 from DerekQuoc/comments
Comments
2 parents 2594c53 + 7a54343 commit 52451b9

File tree

9 files changed

+37
-31
lines changed

9 files changed

+37
-31
lines changed

app/charts/ResponseCodesChart.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ const ResponseCodesChart: React.FC = React.memo(() => {
5050
// Record each status code frequencies
5151
commsData.forEach((obj: IObj) => {
5252
const status = obj.responsestatus;
53-
console.log(status);
54-
// if(status === 200) responseCodes['200-299'] += 1;
5553
if (status >= 500) {
5654
responseCodes['500-599'] += 1;
5755
} else if (status >= 400) {

app/charts/RouteChart.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import Graph from 'react-graph-vis';
55

66
const RouteChart = React.memo(() => {
77
const communicationsData = useContext(CommsContext).commsData;
8-
console.log(communicationsData);
98
// gather all communicationsData and sort them using matching correlatingid.
109
// resObj { key = correlatingid : value = array of objects{ microservice , time} }
1110
// resObj { key = correlatingid : value = array of objects{ microservice , time, functionName} }

app/components/Occupied.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,11 @@ const Occupied = React.memo(() => {
5454
const [searchTerm, setSearchTerm] = useState<string>('Search...');
5555
// Dynamic refs
5656
const delRef = useRef<any>([]);
57-
//check context from dashboard
5857
useEffect(() => {
5958
setServicesData([]);
6059
getApplications();
6160
}, []);
62-
console.log(mode);
61+
6362

6463
// Ask user for deletetion confirmation
6564
const confirmDelete = (event: ClickEvent, app: string, i: number) => {

app/components/Settings.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { DashboardContext } from '../context/DashboardContext';
77
// Need to add flag to turn off the splash at start
88
// Need to add flag to turn off getting started page
99
// Need to add flag to turn on/off live data (ideally persist on restart)
10-
// Need to add dark mode
1110

1211
//Typescript
1312
type ClickEvent = React.MouseEvent<HTMLElement>;

app/components/Styling.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ export const lightAndDark = {
1111
color: "#444d56",
1212
},
1313
darkModeHeader : {
14-
// backgroundColor: "#transparent",
1514
backgroundColor: "#181818",
1615
color: "white",
1716
},
1817
darkModeMain : {
19-
// backgroundImage: "url('../assets/mountain_longer.png')",
20-
// backgroundColor: "#transparent",
2118
backgroundColor: "#181818",
2219
backgroundSize: 'contain',
2320
flex: "1",

chronos_npm_package/chronos.js

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,16 @@ chronos.track = () => {
101101
}
102102
return null;
103103
};
104-
104+
/**
105+
* Wraps the gRPC server object to automatically write logs to user configed DB
106+
*
107+
* If the provided database is MongoDB, connection will be made to the Mongodb Atlas
108+
*
109+
* If the provided database is PostgreSQL, connection will be made to PostgreSQL client
110+
* @param {*} server
111+
* @param {*} proto
112+
* @param {*} methods
113+
*/
105114
chronos.ServerWrapper = (server, proto, methods) => {
106115
const { database } = userConfig;
107116
if (database.type === 'MongoDB') {
@@ -112,7 +121,16 @@ chronos.ServerWrapper = (server, proto, methods) => {
112121
}
113122
return null;
114123
};
115-
124+
/**
125+
* Wraps the gRPC client to automatically write logs to user configed DB
126+
*
127+
* If the provided database is MongoDB, connection will be made to the Mongodb Atlas
128+
*
129+
* If the provided database is PostgreSQL, connection will be made to PostgreSQL client
130+
*
131+
* @param {*} client
132+
* @param {*} service
133+
*/
116134
chronos.ClientWrapper = (client, service) => {
117135
const { database } = userConfig;
118136
if (database.type === 'MongoDB') {
@@ -124,6 +142,12 @@ chronos.ClientWrapper = (client, service) => {
124142
return null;
125143
};
126144

145+
/**
146+
* Allows the passthrough of metadata from gRPC server to gRPC client
147+
*
148+
* @param {*} client
149+
* @param {*} servere
150+
*/
127151
chronos.link = (client, server) => {
128152
client.metadata = server.metadataHolder;
129153
};

chronos_npm_package/controllers/helpers.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const helpers = {
55
* Sets the default interval to 5 seconds and dockerized to false
66
*/
77
validateInput(config) {
8-
let { microservice, database, interval, dockerized, connection } = config;
8+
const { microservice, database, interval, dockerized, connection } = config;
99

1010
// Validate all required fields exist and are valid input types
1111
if (!microservice || typeof microservice !== 'string') {
@@ -20,7 +20,9 @@ const helpers = {
2020
throw new Error('Invalid input "database URI": Please provide the URI to your database');
2121
}
2222
if (!database.connection || typeof database.connection !== 'string') {
23-
throw new Error('Invalid input "database connection type: Please provide the type of connection');
23+
throw new Error(
24+
'Invalid input "database connection type: Please provide the type of connection'
25+
);
2426
}
2527

2628
// Validate database type
@@ -32,7 +34,7 @@ const helpers = {
3234
if (database.connection !== 'REST' && database.connection !== 'gRPC') {
3335
throw new Error(
3436
`Invalid database connection "${database.connection}". Chronos only supports REST and gRPC.`
35-
)
37+
);
3638
}
3739

3840
// Default interval to one minute
@@ -55,7 +57,7 @@ const helpers = {
5557

5658
// Setup notifications for user
5759
notifications.forEach(obj => {
58-
const type = obj.type;
60+
const { type } = obj;
5961

6062
// Throw errors on unsupported notification methods
6163
if (!features.includes(type)) {

electron/Main.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
import { app, BrowserWindow } from 'electron';
2-
// import { REACT_DEVELOPER_TOOLS } from 'electron-devtools-installer';
3-
// const { default: installExtension } = require('electron-devtools-installer');
2+
43
import path from 'path';
54
import './routes/dashboard';
65
import './routes/data';
7-
// require('./routes/dashboard');
8-
// require('./routes/data');
9-
10-
// Install React Dev Tools
11-
// app.whenReady().then(() => {
12-
// installExtension(REACT_DEVELOPER_TOOLS)
13-
// .then((name: string) => console.log(`Added Extension: ${name}`))
14-
// .catch((err: Error) => console.log('An error occurred: ', err));
15-
// });
6+
167

178
// Declare variable to be used as the application window
189
let win: Electron.BrowserWindow;

electron/routes/data.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ let currentDatabaseType: string;
2121
*/
2222
ipcMain.on('connect', async (message: Electron.IpcMainEvent, index: number) => {
2323
try {
24-
// console.log('electron/routes/data.ts, ipcMain.on(connect): 1 Attempting to connect to DB');
2524

2625
// Extract databaseType and URI from settings.json at particular index
2726
// get index from application context
@@ -54,7 +53,7 @@ ipcMain.on('connect', async (message: Electron.IpcMainEvent, index: number) => {
5453
*/
5554
ipcMain.on('servicesRequest', async (message: Electron.IpcMainEvent) => {
5655
try {
57-
// console.log('electron/routes/data.ts, ipcMain.on(servicesRequest): 4 Requesting application microservices');
56+
5857

5958
let result: any;
6059

@@ -85,7 +84,7 @@ ipcMain.on('servicesRequest', async (message: Electron.IpcMainEvent) => {
8584
*/
8685
ipcMain.on('commsRequest', async (message: Electron.IpcMainEvent) => {
8786
try {
88-
// console.log(`Requesting communication data`)
87+
8988

9089
let result: any;
9190

@@ -118,7 +117,6 @@ ipcMain.on('commsRequest', async (message: Electron.IpcMainEvent) => {
118117
*/
119118
ipcMain.on('healthRequest', async (message: Electron.IpcMainEvent, service: string) => {
120119
try {
121-
// console.log(`Requesting microservice health for "${service}"`)
122120

123121
let result: any;
124122

@@ -161,7 +159,6 @@ ipcMain.on('healthRequest', async (message: Electron.IpcMainEvent, service: stri
161159
*/
162160
ipcMain.on('dockerRequest', async (message, service) => {
163161
try {
164-
// console.log(`Requesting container information for "${service}"`)
165162

166163
let result: any;
167164
// Mongo Database

0 commit comments

Comments
 (0)