|
|
|
@ -13,6 +13,7 @@ var SensorWidget = React.createClass({
|
|
|
|
|
title: React.PropTypes.string,
|
|
|
|
|
lastReading: React.PropTypes.object,
|
|
|
|
|
avgs: React.PropTypes.object,
|
|
|
|
|
sums: React.PropTypes.object,
|
|
|
|
|
plotData: React.PropTypes.array,
|
|
|
|
|
axisLineVal: React.PropTypes.number,
|
|
|
|
|
axisLineMax: React.PropTypes.number,
|
|
|
|
@ -25,7 +26,8 @@ var SensorWidget = React.createClass({
|
|
|
|
|
className,
|
|
|
|
|
fetching, fetched,
|
|
|
|
|
title,
|
|
|
|
|
lastReading, avgs,
|
|
|
|
|
lastReading,
|
|
|
|
|
avgs, sums,
|
|
|
|
|
plotData,
|
|
|
|
|
axisLineVal, axisLineMax, axisLineMin,
|
|
|
|
|
unit } = this.props;
|
|
|
|
@ -66,8 +68,21 @@ var SensorWidget = React.createClass({
|
|
|
|
|
</div>
|
|
|
|
|
<div className='metrics'>
|
|
|
|
|
<ul className='metrics__list'>
|
|
|
|
|
<li><strong>{avgs !== null ? numDisplay(avgs.today, 1, unit) : '--'}</strong> ∅ heute</li>
|
|
|
|
|
<li><strong>{avgs !== null ? numDisplay(avgs.yesterday, 1, unit) : '--'}</strong> ∅ gestern</li>
|
|
|
|
|
{sums ? (<div>
|
|
|
|
|
<li><strong>{numDisplay(sums.today, 1, unit)}</strong> ∑ heute</li>
|
|
|
|
|
<li><strong>{numDisplay(sums.yesterday, 1, unit)}</strong> ∑ gestern</li>
|
|
|
|
|
</div>
|
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
|
|
{avgs ? (<div>
|
|
|
|
|
<li><strong>{numDisplay(avgs.today, 1, unit)}</strong> ∅ heute</li>
|
|
|
|
|
<li><strong>{numDisplay(avgs.yesterday, 1, unit)}</strong> ∅ gestern</li>
|
|
|
|
|
</div>) : null}
|
|
|
|
|
|
|
|
|
|
{!(avgs || sums) ? (<div>
|
|
|
|
|
<li><strong>--</strong></li>
|
|
|
|
|
<li><strong>--</strong></li>
|
|
|
|
|
</div>) : null}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|