Matteo Scandolo | 5dd9418 | 2015-12-09 17:09:55 -0800 | [diff] [blame] | 1 | <div ng-show="vm.loader" class="loader">Loading</div> |
| 2 | |
| 3 | <section ng-if="!vm.loader && !vm.error"> |
| 4 | |
| 5 | <div class="alert alert-danger" ng-if="vm.stats.length == 0"> |
| 6 | No result |
| 7 | </div> |
| 8 | |
| 9 | <table class="table" ng-if="vm.stats.length > 0"> |
| 10 | <tr> |
Matteo Scandolo | 1529046 | 2015-12-17 16:50:16 -0800 | [diff] [blame] | 11 | <th> |
Matteo Scandolo | 9a99833 | 2016-03-07 17:50:38 -0800 | [diff] [blame^] | 12 | <a ng-click="(order == 'category') ? order = '-category' : order = 'category'">Type:</a> |
Matteo Scandolo | 1529046 | 2015-12-17 16:50:16 -0800 | [diff] [blame] | 13 | </th> |
| 14 | <th> |
Matteo Scandolo | 9a99833 | 2016-03-07 17:50:38 -0800 | [diff] [blame^] | 15 | <a ng-click="(order == 'resource_name') ? order = '-resource_name' : order = 'resource_name'">Resource:</a> |
Matteo Scandolo | 1529046 | 2015-12-17 16:50:16 -0800 | [diff] [blame] | 16 | </th> |
| 17 | <th> |
Matteo Scandolo | 9a99833 | 2016-03-07 17:50:38 -0800 | [diff] [blame^] | 18 | <a ng-click="(order == 'meter') ? order = '-meter' : order = 'meter'">Meter:</a> |
Matteo Scandolo | 1529046 | 2015-12-17 16:50:16 -0800 | [diff] [blame] | 19 | </th> |
| 20 | <th> |
| 21 | Unit: |
| 22 | </th> |
| 23 | <th> |
| 24 | Value: |
| 25 | </th> |
Matteo Scandolo | 5dd9418 | 2015-12-09 17:09:55 -0800 | [diff] [blame] | 26 | </tr> |
Matteo Scandolo | 1529046 | 2015-12-17 16:50:16 -0800 | [diff] [blame] | 27 | <!-- <tr> |
| 28 | <td> |
| 29 | <input type="text" ng-model="query.category"> |
| 30 | </td> |
| 31 | <td> |
| 32 | <input type="text" ng-model="query.resource_name"> |
| 33 | </td> |
| 34 | <td> |
| 35 | <input type="text" ng-model="query.meter"> |
| 36 | </td> |
| 37 | <td> |
| 38 | <input type="text" ng-model="query.unit"> |
| 39 | </td> |
| 40 | <td> |
| 41 | <input type="text" ng-model="query.value"> |
| 42 | </td> |
| 43 | </tr> --> |
| 44 | <tr ng-repeat="item in vm.stats | orderBy:order"> |
Matteo Scandolo | d9e1c41 | 2015-12-15 14:37:27 -0800 | [diff] [blame] | 45 | <td>{{item.category}}</td> |
Matteo Scandolo | 1529046 | 2015-12-17 16:50:16 -0800 | [diff] [blame] | 46 | <td>{{item.resource_name}}</td> |
Matteo Scandolo | 5dd9418 | 2015-12-09 17:09:55 -0800 | [diff] [blame] | 47 | <td>{{item.meter}}</td> |
| 48 | <td>{{item.unit}}</td> |
| 49 | <td>{{item.value}}</td> |
| 50 | </tr> |
| 51 | </table> |
| 52 | </section> |
| 53 | |
| 54 | <section ng-if="!vm.loader && vm.error"> |
| 55 | <div class="alert alert-danger"> |
| 56 | {{vm.error}} |
| 57 | </div> |
| 58 | </section> |