36 lines
1.1 KiB
Plaintext
36 lines
1.1 KiB
Plaintext
<div id="power_view">
|
|
<div class="btn-group">
|
|
<button
|
|
rt-if="this.props.house"
|
|
rt-repeat="month in this.props.house.availableMonths()"
|
|
data-value="{month}"
|
|
key="data-month-{month}"
|
|
class="btn-warning btn btn-sm"
|
|
rt-class="{active: month === this.props.house.current_month}"
|
|
onClick="{this.setMonth}">{month}</button>
|
|
</div>
|
|
<div class="alert alert-warning" rt-if="this.state.loading_data">
|
|
Retrieving power data for the {this.props.house.name} household...
|
|
</div>
|
|
<div id="power_date_setter"></div>
|
|
<table rt-if="this.props.view === 'table'" class="table">
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th>Time</th>
|
|
<th>Consumption (W)</th>
|
|
<th>Production (W)</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr rt-repeat="power_datum in this.props.house.power_data" key="{power_datum.scoped_id}">
|
|
<td>{power_datum.data.id}</td>
|
|
<td>{power_datum.time_to_s}</td>
|
|
<td>{power_datum.consumption_to_s}</td>
|
|
<td>{power_datum.production_to_s}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div rt-if="this.props.view === 'graph'" id="power_graph"></div>
|
|
</div>
|