@@ -4,6 +4,7 @@ import HealthInformationContext from '../context/DetailsContext';
44import ServiceDetails from './ServiceDetails.jsx' ;
55import Modal from './Modal.jsx' ;
66import routeChart from '../assets/routeChart.png'
7+ import chartModal from '../assets/chartModal.png'
78
89const { ipcRenderer } = window . require ( 'electron' ) ;
910
@@ -40,11 +41,42 @@ const ServiceOverview = (props) => {
4041 // Hook used to set the Modal Component title. The "alt" attribute
4142 // is grabbed from the onClick event via event.path[0].alt
4243 const [ chartTitle , setChartTitle ] = useState ( ) ;
43-
44- const routeButtonProperty = { id : 'routes' , alt : 'Route Trace' , src : routeChart } ;
44+
45+ //route button AND traffic button property
46+ const routeButtonProperty = { traffic : { id : 'Traffic' , alt : 'Microservice Traffic' , src : chartModal } , routes : { id : 'Routes' , alt : 'Route Trace' , src : routeChart } } ;
47+
48+ //declare routes array to display routes when modal is toggled
4549 const routes = [ ] ;
50+ //declare traffic array to display traffic when modal is toggled
51+ const traffic = [ ] ;
52+
53+ //push traffic component logic traffic
54+ traffic . push (
55+
56+ < div className = "healthChartContainer" >
57+ < input
58+ onClick = { ( ) => {
59+ setChartTitle ( event . path [ 0 ] . alt ) ;
60+ setModalChart ( event . path [ 0 ] . id ) ;
61+ toggleModalDisplay ( ! modalDisplay ) ;
62+ } }
63+ type = "image"
64+ id = { routeButtonProperty . traffic . id }
65+ src = { routeButtonProperty . traffic . src }
66+ width = "60px"
67+ alt = { routeButtonProperty . traffic . alt }
68+ />
69+ < br />
70+ < div style = { { color :'white' , paddingLeft :'7px' } } >
71+ { routeButtonProperty . traffic . id }
72+ </ div >
73+ </ div >
74+
75+ ) ;
76+
77+ //push routes component logic traffic
4678 routes . push (
47- < div >
79+
4880 < div className = "healthChartContainer" >
4981 < input
5082 onClick = { ( ) => {
@@ -53,17 +85,17 @@ const ServiceOverview = (props) => {
5385 toggleModalDisplay ( ! modalDisplay ) ;
5486 } }
5587 type = "image"
56- id = { routeButtonProperty . id }
57- src = { routeButtonProperty . src }
88+ id = { routeButtonProperty . routes . id }
89+ src = { routeButtonProperty . routes . src }
5890 width = "60px"
59- alt = { routeButtonProperty . alt }
91+ alt = { routeButtonProperty . routes . alt }
6092 />
6193 < br />
6294 < div style = { { color :'white' , paddingLeft :'7px' } } >
63- { routeButtonProperty . id }
95+ { routeButtonProperty . routes . id }
6496 </ div >
6597 </ div >
66- </ div > ,
98+
6799 ) ;
68100
69101 // Filters data received from IPC to the communications database to create a list of the services tracked in the provided database,
@@ -144,10 +176,9 @@ const ServiceOverview = (props) => {
144176 < div >
145177 < h1 className = 'overviewTitle' > Microservices Overview</ h1 >
146178 </ div >
147- < div />
148179 < div className = "servicesList" > { serviceList ( ) } </ div >
149- { /* adding the route tracer button */ }
150- < h3 > Trace Last Route </ h3 >
180+ < br />
181+ < h1 > Microservices Communications </ h1 >
151182 { modalDisplay ? (
152183 < Modal
153184 chartTitle = { chartTitle }
@@ -159,7 +190,10 @@ const ServiceOverview = (props) => {
159190 } }
160191 />
161192 ) : null }
162- { routes }
193+ < div id = "routeAndTrafficDisplay" >
194+ { routes }
195+ { traffic }
196+ </ div >
163197 </ div >
164198 ) ;
165199} ;
0 commit comments