FE fixes on the sensors panel
This commit is contained in:
parent
b4bd1cb7bb
commit
79bfed3a1d
2 changed files with 30 additions and 4 deletions
|
@ -0,0 +1,24 @@
|
|||
#sensors-container {
|
||||
width: 80%;
|
||||
max-width: 60rem;
|
||||
margin: 3em auto;
|
||||
background: rgba(235,235,235,0.8);
|
||||
padding: 2em;
|
||||
border: 1px solid rgba(220,220,220,1.0);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.sensor-data {
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
.sensor-data:not(:last-child) {
|
||||
margin-bottom: .5rem;
|
||||
padding-bottom: .5rem;
|
||||
border-bottom: 1px solid rgba(220,220,220,1.0);
|
||||
}
|
||||
|
||||
.sensor-value {
|
||||
text-align: right;
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@ $(document).ready(function() {
|
|||
|
||||
for (var sensor of Object.keys(data)) {
|
||||
var $sensor = $container.find('[data-sensor-type=' + sensor + ']');
|
||||
var $sensorValue;
|
||||
var $value;
|
||||
|
||||
if ($sensor.length === 0) {
|
||||
$sensor = $('<div></div>')
|
||||
|
@ -19,15 +19,17 @@ $(document).ready(function() {
|
|||
.addClass('sensor-name six columns')
|
||||
.text(sensor);
|
||||
|
||||
$sensorValue = $('<div></div>')
|
||||
$value = $('<div></div>')
|
||||
.addClass('sensor-value six columns');
|
||||
|
||||
$name.appendTo($sensor);
|
||||
$value.appendTo($sensor);
|
||||
$sensor.appendTo($container);
|
||||
} else {
|
||||
$sensorValue = $sensor.find('.sensor-value');
|
||||
$value = $sensor.find('.sensor-value');
|
||||
}
|
||||
|
||||
$sensorValue.text(data[sensor]);
|
||||
$value.text(data[sensor]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue