{"version":3,"sources":["components/Layout.js","components/Charts.js","components/Core.js","components/Authorize.js","App.js","registerServiceWorker.js","index.js"],"names":["Layout","color","dark","expand","className","fluid","this","props","children","Date","getFullYear","style","Component","displayName","name","Charts","RefreshComponent","console","log","getHeaterSettings","getTemperatures","setState","refreshNeeded","state","e","a","axios","get","params","then","res","setTemperature","data","hysteresis","powerLevel","heaterPowerLevel","heaterStateOn","stateOn","catch","err","quantity","quantityOfDownloadedTemperatures","paramsSerializer","qs","stringify","response","temperatures","lastTemperature","length","temperature","date","interval","setInterval","center","middle","md","value","width","height","margin","top","right","left","bottom","strokeDasharray","dataKey","type","domain","alwaysShow","y","label","stroke","gradient","size","fontSize","id","checked","readOnly","htmlFor","Core","onClick","nr","changeHeaterSettings","preventDefault","post","NotificationManager","success","error","target","onSubmit","onChange","changeValue","containerClass","outline","Authorize","authorizeUser","password","correct_password","icon","group","validate","library","add","faEnvelope","faKey","App","exact","path","component","marginTop","isLocalhost","Boolean","window","location","hostname","match","registerValidSW","swUrl","navigator","serviceWorker","register","registration","onupdatefound","installingWorker","installing","onstatechange","controller","baseUrl","document","getElementsByTagName","getAttribute","rootElement","getElementById","ReactDOM","render","basename","URL","process","origin","addEventListener","fetch","status","headers","indexOf","ready","unregister","reload","checkValidServiceWorker","registerServiceWorker"],"mappings":"gTAGaA,EAAb,uKAIQ,OACI,6BAEI,kBAAC,IAAD,CAAWC,MAAM,SAASC,MAAI,EAACC,OAAO,MAClC,kBAAC,IAAD,KACI,4BAAQC,UAAU,cAAlB,mCAIR,kBAAC,IAAD,CAAcC,OAAK,EAACD,UAAU,kBACzBE,KAAKC,MAAMC,UAGhB,kBAAC,IAAD,CAAWP,MAAM,SAASG,UAAU,qCAChC,yBAAKA,UAAU,qCACX,kBAAC,IAAD,CAAcC,OAAK,GAAnB,mBACsB,IAAII,MAAOC,cADjC,KACiD,4BAAQC,MAAO,CAAEV,MAAO,SAAxB,mCApBzE,GAA4BW,aAAfZ,EACFa,YAAcb,EAAOc,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A6C,kBAAmBb,UAAW,CAGzE,GADkB,IAAIkB,IAAIC,GAAwBzB,OAAOC,UAC3CyB,SAAW1B,OAAOC,SAASyB,OAIvC,OAGF1B,OAAO2B,iBAAiB,QAAQ,WAC9B,IAAMtB,EAAK,UAAMoB,GAAN,sBAEP3B,EAwCV,SAAkCO,GAEhCuB,MAAMvB,GACHxF,MAAK,SAAAgB,GAGkB,MAApBA,EAASgG,SACuD,IAAhEhG,EAASiG,QAAQnH,IAAI,gBAAgBoH,QAAQ,cAG7CzB,UAAUC,cAAcyB,MAAMnH,MAAK,SAAA4F,GACjCA,EAAawB,aAAapH,MAAK,WAC7BmF,OAAOC,SAASiC,eAKpB9B,EAAgBC,MAGnB/E,OAAM,WACLrB,QAAQC,IACN,oEA5DAiI,CAAwB9B,GAGxBD,EAAgBC,OCtBxB+B,K","file":"static/js/main.9e3afa03.chunk.js","sourcesContent":["import React, { Component } from 'react';\r\nimport { MDBNavbar, MDBNavbarBrand, MDBContainer, MDBFooter} from 'mdbreact';\r\n\r\nexport class Layout extends Component {\r\n static displayName = Layout.name;\r\n\r\n render() {\r\n return (\r\n
\r\n\r\n \r\n \r\n Temperature Telemetry Web App\r\n \r\n \r\n\r\n \r\n {this.props.children}\r\n \r\n \r\n \r\n
\r\n \r\n © Copyright {new Date().getFullYear()}: Ɓukasz Czepielik \r\n \r\n
\r\n
\r\n\r\n
\r\n );\r\n }\r\n}\r\n","import React, { Component } from 'react';\r\nimport { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ReferenceLine } from 'recharts';\r\nimport { Temperature } from 'react-environment-chart';\r\nimport { MDBBtn, MDBRow, MDBCol, MDBCard, MDBCardBody } from \"mdbreact\";\r\nimport qs from 'qs';\r\nimport axios from 'axios';\r\n\r\nexport class Charts extends Component {\r\n static displayName = Charts.name;\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n refreshNeeded: false,\r\n quantityOfDownloadedTemperatures: 50,\r\n\r\n setTemperature: 0,\r\n hysteresis: 0,\r\n heaterStateOn: false,\r\n lastTemperature: 0,\r\n\r\n temperatures: [\r\n {\r\n date: 'Page A', temperature: 22,\r\n },\r\n {\r\n date: 'Page B', temperature: 24,\r\n },\r\n ]\r\n }\r\n }\r\n\r\n RefreshComponent = () => {\r\n console.log(\"refreshed - downloaded new data\");\r\n\r\n this.getHeaterSettings();\r\n this.getTemperatures();\r\n\r\n this.setState({\r\n refreshNeeded: !this.state.refreshNeeded\r\n });\r\n }\r\n\r\n getHeaterSettings = async (e) => {\r\n await axios.get(\"/api/TemperatureTelemetry/GetHeaterSettings\",\r\n {\r\n params: {\r\n },\r\n }).then(res => {\r\n this.setState({\r\n setTemperature: res.data.setTemperature,\r\n hysteresis: res.data.hysteresis,\r\n powerLevel: res.data.heaterPowerLevel,\r\n heaterStateOn: res.data.stateOn\r\n });\r\n }).catch(err => {\r\n })\r\n };\r\n\r\n getTemperatures = async (e) => {\r\n await axios.get(\"/api/TemperatureTelemetry/GetTemperaturesMeasurements\",\r\n {\r\n params: {\r\n quantity: this.state.quantityOfDownloadedTemperatures\r\n },\r\n paramsSerializer: params => {\r\n return qs.stringify(params)\r\n }\r\n }).then(response => {\r\n this.setState({\r\n temperatures: response.data,\r\n lastTemperature: response.data[response.data.length-1].temperature\r\n });\r\n })\r\n .catch(err => {\r\n })\r\n };\r\n\r\n componentDidMount() {\r\n this.RefreshComponent();\r\n this.interval = setInterval(() => this.RefreshComponent(), 10000);\r\n }\r\n\r\n render() {\r\n return (\r\n \r\n \r\n \r\n \r\n

Visualization

\r\n\r\n \r\n\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n
\r\n Current Temperature

\r\n {this.state.lastTemperature} ℃\r\n
\r\n\r\n

\r\n\r\n \r\n Heater Status\r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n );\r\n }\r\n}\r\n","import React, { Component } from 'react';\r\nimport { NotificationManager } from 'react-notifications';\r\nimport { Charts } from './Charts';\r\nimport { MDBBtn, MDBInput, MDBFormInline, MDBRow, MDBCol, MDBCard, MDBCardBody } from \"mdbreact\";\r\nimport axios from 'axios';\r\n\r\nexport class Core extends Component {\r\n static displayName = Core.name;\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n refreshNeeded: false,\r\n\r\n setTemperature: 0,\r\n hysteresis: 0,\r\n powerLevel: 0\r\n }\r\n }\r\n\r\n changeValue(e) {\r\n console.log(e);\r\n this.setState({\r\n [e.target.name]: e.target.value\r\n });\r\n }\r\n\r\n onClick = nr => () => {\r\n console.log(nr);\r\n this.setState({\r\n powerLevel: nr\r\n });\r\n };\r\n\r\n RefreshComponent = () => {\r\n this.setState({\r\n refreshNeeded: !this.state.refreshNeeded\r\n });\r\n }\r\n\r\n componentDidMount() {\r\n this.getHeaterSettings();\r\n }\r\n\r\n getHeaterSettings = async () => {\r\n await axios.get(\"/api/TemperatureTelemetry/GetHeaterSettings\", null,\r\n {\r\n params: {\r\n }\r\n }).then(res => {\r\n console.log(res);\r\n console.log(this.state.powerLevel);\r\n this.setState({\r\n setTemperature: res.data.setTemperature,\r\n hysteresis: res.data.hysteresis,\r\n powerLevel: res.data.powerLevel\r\n });\r\n console.log(this.state.powerLevel);\r\n }).catch(err => {\r\n })\r\n };\r\n\r\n changeHeaterSettings = async (e) => {\r\n e.preventDefault();\r\n\r\n await axios.post(\"/api/TemperatureTelemetry/ChangeHeaterSettings\", null,\r\n {\r\n params: {\r\n setTemperature: this.state.setTemperature,\r\n hysteresis: this.state.hysteresis,\r\n powerLevel: this.state.powerLevel\r\n }\r\n }).then(res => {\r\n NotificationManager.success('Updated', 'Heater Settings');\r\n }).catch(err => {\r\n NotificationManager.error('Validation Error', 'Heater Settings');\r\n })\r\n };\r\n\r\n render() {\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n
this.changeHeaterSettings(e)}>\r\n

Temperature Settings

\r\n\r\n \r\n Temperature Set this.changeValue(e)} value={this.state.setTemperature} />\r\n Hysteresis this.changeValue(e)} value={this.state.hysteresis} />\r\n\r\n \r\n Heater Power Level\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n
\r\n \r\n Update\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n \r\n\r\n
\r\n );\r\n }\r\n}","import React, { Component } from 'react';\r\nimport { NotificationManager } from 'react-notifications';\r\nimport { MDBRow, MDBCol, MDBInput, MDBBtn, MDBCard, MDBCardBody } from 'mdbreact';\r\nimport { Core } from './Core';\r\nimport axios from 'axios';\r\n\r\nexport class Authorize extends Component {\r\n static displayName = Authorize.name;\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state = {\r\n password: \"\",\r\n correct_password: false\r\n }\r\n }\r\n\r\n changeValue(e) {\r\n this.setState({\r\n [e.target.name]: e.target.value\r\n });\r\n }\r\n\r\n authorizeUser = async (e) => {\r\n e.preventDefault();\r\n\r\n await axios.post(\"/api/TemperatureTelemetry/CheckEnteredPassword\", null,\r\n {\r\n params: {\r\n password: this.state.password,\r\n }\r\n }).then(res => {\r\n this.setState({\r\n correct_password: true\r\n });\r\n NotificationManager.success('Authenticated', 'Verification');\r\n }).catch(err => {\r\n NotificationManager.error('Wrong password', 'Verification');\r\n })\r\n };\r\n\r\n render() {\r\n if (this.state.correct_password == true) {\r\n return (\r\n \r\n )\r\n }\r\n else {\r\n return (\r\n\r\n \r\n \r\n \r\n \r\n
this.authorizeUser(e)}>\r\n

Verification

\r\n
\r\n this.changeValue(e)}\r\n value={this.state.password}\r\n />\r\n
\r\n
\r\n \r\n Verify\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n )\r\n }\r\n }\r\n}\r\n","import React, { Component } from 'react';\r\nimport { Route } from 'react-router';\r\nimport { Layout } from './components/Layout';\r\nimport { Authorize } from './components/Authorize';\r\nimport { NotificationContainer } from 'react-notifications';\r\n\r\nimport './custom.css'\r\nimport '@fortawesome/fontawesome-free/css/all.min.css';\r\nimport 'bootstrap-css-only/css/bootstrap.min.css';\r\nimport 'mdbreact/dist/css/mdb.css';\r\n\r\nimport { library } from '@fortawesome/fontawesome-svg-core'\r\nimport { faEnvelope } from '@fortawesome/free-solid-svg-icons'\r\nimport { faKey } from '@fortawesome/free-solid-svg-icons'\r\n\r\nlibrary.add(faEnvelope)\r\nlibrary.add(faKey)\r\n\r\nexport default class App extends Component {\r\n static displayName = App.name;\r\n\r\n render () {\r\n return (\r\n \r\n \r\n\r\n
\r\n \r\n
\r\n
\r\n );\r\n }\r\n}\r\n","// In production, we register a service worker to serve assets from local cache.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\r\n// cached resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\r\n// This link also includes instructions on opting out of this behavior.\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.1/8 is considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\nexport default function register () {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Lets check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl);\r\n } else {\r\n // Is not local host. Just register service worker\r\n registerValidSW(swUrl);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW (swUrl) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the old content will have been purged and\r\n // the fresh content will have been added to the cache.\r\n // It's the perfect time to display a \"New content is\r\n // available; please refresh.\" message in your web app.\r\n console.log('New content is available; please refresh.');\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker (swUrl) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl)\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n if (\r\n response.status === 404 ||\r\n response.headers.get('content-type').indexOf('javascript') === -1\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister () {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister();\r\n });\r\n }\r\n}\r\n","import 'bootstrap/dist/css/bootstrap.css';\r\nimport React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { BrowserRouter } from 'react-router-dom';\r\nimport App from './App';\r\nimport registerServiceWorker from './registerServiceWorker';\r\nimport 'react-notifications/lib/notifications.css';\r\n\r\nconst baseUrl = document.getElementsByTagName('base')[0].getAttribute('href');\r\nconst rootElement = document.getElementById('root');\r\n\r\nReactDOM.render(\r\n \r\n \r\n ,\r\n rootElement);\r\n\r\nregisterServiceWorker();\r\n\r\n"],"sourceRoot":""}