diff --git a/app/actions/eon_detail_actions.js b/app/actions/eon_detail_actions.js
index 7b22368..fd4d015 100644
--- a/app/actions/eon_detail_actions.js
+++ b/app/actions/eon_detail_actions.js
@@ -89,14 +89,33 @@ export function RESPONSE_tmuxPipe(lines, state) {
regexKeys = Object.keys(regex);
regexKeys.forEach((key) => {
- // console.log(key);
- if ((m = regex[key].exec(lines)) !== null) {
- // console.log(m);
- if (key === 'PROCESS') {
- payload[m[1]] = m[3];
- } else if (key === 'VEHICLE_CONNECTION') {
- payload.vehicleConnection = m[0];
- }
+ switch (key) {
+ case "THERMAL":
+ // console.warn("Parsing:",key);
+ while ((m = regex[key].exec(lines)) !== null) {
+ if (m.index === regex.lastIndex) {
+ regex.lastIndex++;
+ }
+ // console.warn(m[1],m[2]);
+ payload[m[1]] = m[2].replace(/\"/g,'');
+ }
+ break;
+ case "PROCESS":
+ // console.warn("Parsing:",key);
+ while ((m = regex[key].exec(lines)) !== null) {
+ if (m.index === regex.lastIndex) {
+ regex.lastIndex++;
+ }
+ // console.warn(m[1],m[3]);
+ payload[m[1]] = m[3].replace(/\"/g,'');
+ }
+ break;
+ case "VEHICLE_CONNECTION":
+ // console.warn("Parsing:",key);
+ if ((m = regex[key].exec(lines)) !== null) {
+ payload.vehicleConnection = m[0];
+ }
+ break;
}
});
diff --git a/app/components/EonDetail/Styles.css b/app/components/EonDetail/Styles.scss
similarity index 59%
rename from app/components/EonDetail/Styles.css
rename to app/components/EonDetail/Styles.scss
index 7ac617b..19c2b57 100644
--- a/app/components/EonDetail/Styles.css
+++ b/app/components/EonDetail/Styles.scss
@@ -1,5 +1,7 @@
.eon_bar {
position:relative;
+ margin-top:40px;
+ margin-bottom:30px;
}
.loading_overlay {
position:absolute;
@@ -12,8 +14,8 @@
position:absolute;
top:50%;
left:50%;
- height:75px;
- width:75px;
+ height:85px;
+ width:85px;
transform:translate(-50%,-50%);
/* width:100%;
@@ -24,32 +26,59 @@
.add_field {
border:0;
}
+.title,.subtext,.subsubtext {
+ text-align:center;
+ margin: 0;
+}
.title {
font-weight:400;
- text-align:center;
}
.subtext {
font-weight:200;
- text-align:center;
}
.disconnect_button {
margin-top:10px;
margin-bottom:10px;
+ position:absolute;
+ top:0;
+ left:0;
+ width:200px;
}
.subsubtext {
font-weight:200;
- text-align:center;
font-weight:200;
color:#555;
}
+.connection {
+ background-color:rgba(#FFF,0.2);
+ padding:10px;
+ border-radius:100px;
+ width:50%;
+ margin:0 auto;
+
+ span {
+ display:block;
+ text-align:center;
+ }
+
+ .connection_message {
+ font-size:18px;
+ font-weight:200;
+ line-height:20px;
+ }
+ .connection_label {
+ font-size:10px;
+ line-height:15px;
+ }
+}
.state_list {
display:table;
width:100%;
}
.state_spinner {
- height: 20px;
- width: 20px;
+ height: 100%;
+ width: 100%;
}
.state_spinner img {
width:100%;
@@ -58,6 +87,12 @@
.state_item {
display:table-row;
}
+.state_loading_icon_wrap {
+ width: 16px;
+ height: 16px;
+ position: relative;
+ display: block;
+}
.state_label,.state_status {
display:table-cell;
@@ -74,6 +109,6 @@
.state_status {
/* color:#28a745; */
}
-.state_status.started {
+.state_status_started {
color:#28a745;
}
\ No newline at end of file
diff --git a/app/components/EonDetail/index.js b/app/components/EonDetail/index.js
index b9c17ae..29d0072 100644
--- a/app/components/EonDetail/index.js
+++ b/app/components/EonDetail/index.js
@@ -2,12 +2,15 @@ import React, { Component } from 'react';
import { Link } from 'react-router-dom';
const app = require('electron').remote.app
import routes from '../../constants/routes.json';
-import styles from './Styles.css';
+import styles from './Styles.scss';
import PropTypes from 'prop-types';
import processInfo from '../../constants/processes.json';
+import thermalInfo from '../../constants/thermal.json';
+import vehicleConnectionStatuses from '../../constants/vehicle_connection_statuses.json';
import Layout from '../Layout';
import LoadingIndicator from '../LoadingIndicator';
import ConnectedTime from './ConnectedTime';
+import ReactResizeDetector from 'react-resize-detector';
const propTypes = {
install: PropTypes.func,
@@ -28,11 +31,35 @@ const propTypes = {
logmessaged: PropTypes.string,
controlsd: PropTypes.string,
gpsd: PropTypes.string,
- vehicleConnection: PropTypes.string
+ vehicleConnection: PropTypes.string,
+ logMonoTime: PropTypes.string,
+ thermal: PropTypes.string,
+ cpu0: PropTypes.string,
+ cpu1: PropTypes.string,
+ cpu2: PropTypes.string,
+ cpu3: PropTypes.string,
+ mem: PropTypes.string,
+ gpu: PropTypes.string,
+ bat: PropTypes.string,
+ freeSpace: PropTypes.string,
+ batteryPercent: PropTypes.string,
+ batteryStatus: PropTypes.string,
+ fanSpeed: PropTypes.string,
+ started: PropTypes.string,
+ usbOnline: PropTypes.string,
+ startedTs: PropTypes.string,
+ thermalStatus: PropTypes.string,
+ batteryCurrent: PropTypes.string,
+ batteryVoltage: PropTypes.string
};
class EonDetail extends Component {
-
+ constructor(props) {
+ super(props);
+ this.state = {
+ processesAndThermalsHeight: 0
+ }
+ }
componentDidMount() {
if (this.props.eon && this.props.pipeTmux) {
this.props.pipeTmux();
@@ -41,7 +68,7 @@ class EonDetail extends Component {
this.tmuxTimeout = setTimeout(() => {
if (!this.props.tmuxAttached) {
console.warn("Could not connect to tmux...");
- this.props.history.push(routes.EON_DETAIL);
+ this.props.history.push(routes.EON_LIST);
}
}, 3000);
@@ -56,12 +83,45 @@ class EonDetail extends Component {
// console.warn(this);
this.props.install();
}
+ onResize = (width,height) => {
+ console.log("width:",width);
+ console.log("height:",height);
+ let newHeight = height-400;
+ console.log("thermalsHeight:",newHeight);
+ this.setState({
+ processesAndThermalsHeight: newHeight
+ });
+ }
render() {
- const processKeys = Object.keys(processInfo);
+ const vehicleConnection = vehicleConnectionStatuses[this.props.vehicleConnection] || {
+ "label": "Checking vehicle status..."
+ };
+ const processKeys = Object.keys(processInfo).sort();
+ const thermalKeys = Object.keys(thermalInfo).sort();
if (!this.props.tmuxAttached) {
return