11import React , { useState } from 'react' ;
22import Modal from './Modal.jsx' ;
3- import pieChart from '../assets/pieChart.png'
4- import memoryChart from '../assets/memoryChart.png'
5- import tempChart from '../assets/tempChart.png'
6- import speedChart from '../assets/speedChart.png'
7- import latencyChart from '../assets/latencyChart.png'
8- import processingChart from '../assets/processingChart.png'
3+ import pieChart from '../assets/pieChart.png' ;
4+ import memoryChart from '../assets/memoryChart.png' ;
5+ import tempChart from '../assets/tempChart.png' ;
6+ import speedChart from '../assets/speedChart.png' ;
7+ import latencyChart from '../assets/latencyChart.png' ;
8+ import processingChart from '../assets/processingChart.png' ;
99
1010// Renders charts created with health and communication data for a selected database.
1111const ServiceDetails = ( props ) => {
12-
1312 // Renders health info detail buttons
14- const { service } = props ;
13+ const { service } = props ;
1514 // Hook used to toggle whether or not the Modal component renders
1615 const [ modalDisplay , toggleModalDisplay ] = useState ( false ) ;
1716 // Hook used to set the chart that the Modal displays. The
@@ -26,14 +25,14 @@ const ServiceDetails = (props) => {
2625 // { id: 'request', alt: 'Request Data', src: 'https://st2.depositphotos.com/3894705/9581/i/950/depositphotos_95816620-stock-photo-round-button-shows-speedometer.jpg' },
2726
2827 const buttonProperties = [
29- { id : 'request' , alt : 'Request Data' , src : pieChart } ,
30- { id : 'response' , alt : 'Response Data' , src : pieChart } ,
31- // { id: 'routes', alt: 'Route Trace', src: 'https://st2.depositphotos.com/3894705/9581/i/950/depositphotos_95816620-stock-photo-round-button-shows-speedometer.jpg' },
32- { id : 'speed' , alt : 'Speed Data' , src : speedChart } ,
33- { id : 'processes' , alt : 'Processes Data' , src : processingChart } ,
34- { id : 'latency' , alt : 'Latency Data' , src : latencyChart } ,
35- { id : 'temperature' , alt : 'Temperature Data' , src : tempChart } ,
36- { id : 'memory' , alt : 'Memory Data' , src : memoryChart } ,
28+ { id : 'request' , alt : 'Request Data' , src : 'app/assets/ pieChart.png' } ,
29+ { id : 'response' , alt : 'Response Data' , src : 'app/assets/ pieChart.png' } ,
30+ // { id: 'routes', alt: 'Route Trace', src: 'https://st2.depositphotos.com/3894705/9581/i/950/depositphotos_95816620-stock-photo-round-button-shows-speedometer.jpg' },
31+ { id : 'speed' , alt : 'Speed Data' , src : 'app/assets/ speedChart.png' } ,
32+ { id : 'processes' , alt : 'Processes Data' , src : 'app/assets/ processingChart.png' } ,
33+ { id : 'latency' , alt : 'Latency Data' , src : 'app/assets/ latencyChart.png' } ,
34+ { id : 'temperature' , alt : 'Temperature Data' , src : 'app/assets/ tempChart.png' } ,
35+ { id : 'memory' , alt : 'Memory Data' , src : 'app/assets/ memoryChart.png' } ,
3736 ] ;
3837
3938 // Create the Health Info buttons and their associated properties. Each time a button is clicked,
@@ -42,30 +41,31 @@ const ServiceDetails = (props) => {
4241 const healthInfoButtons = [ ] ;
4342 for ( let i = 0 ; i < buttonProperties . length ; i += 1 ) {
4443 healthInfoButtons . push (
45- < div >
46- < div className = "healthChartContainer" >
47- < input
48- onClick = { ( ) => {
49- setChartTitle ( event . path [ 0 ] . alt ) ;
50- setModalChart ( event . path [ 0 ] . id ) ;
51- toggleModalDisplay ( ! modalDisplay ) ;
52- } }
53- service = { service }
54- type = "image"
55- id = { buttonProperties [ i ] . id }
56- src = { buttonProperties [ i ] . src }
57- width = "60px"
58- alt = { buttonProperties [ i ] . alt }
59- />
60- < br />
61- < div style = { { color :'white' , paddingLeft :'7px' } } >
62- { buttonProperties [ i ] . id }
44+ < div >
45+ < div className = "healthChartContainer" >
46+ < input
47+ onClick = { ( ) => {
48+ setChartTitle ( event . path [ 0 ] . alt ) ;
49+ setModalChart ( event . path [ 0 ] . id ) ;
50+ toggleModalDisplay ( ! modalDisplay ) ;
51+ } }
52+ service = { service }
53+ type = "image"
54+ id = { buttonProperties [ i ] . id }
55+ src = { buttonProperties [ i ] . src }
56+ width = "60px"
57+ alt = { buttonProperties [ i ] . alt }
58+ />
59+ < br />
60+ < div style = { { color : 'white' , paddingLeft : '7px' } } >
61+ { buttonProperties [ i ] . id }
62+ </ div >
6363 </ div >
64- </ div >
6564 </ div > ,
6665 ) ;
6766 }
6867
68+
6969 return (
7070 < div id = "serviceDetailsContainer" >
7171 { modalDisplay ? (
@@ -83,7 +83,7 @@ const ServiceDetails = (props) => {
8383 < h3 id = "microserviceHealthTitle" > Microservice Health</ h3 >
8484 < div id = "healthGrid" >
8585 { healthInfoButtons }
86- </ div >
86+ </ div >
8787 </ div >
8888 ) ;
8989} ;
0 commit comments