Matteo Scandolo | d2044a4 | 2017-08-07 16:08:28 -0700 | [diff] [blame] | 1 | |
| 2 | <!-- |
| 3 | Copyright 2017-present Open Networking Foundation |
| 4 | |
| 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | you may not use this file except in compliance with the License. |
| 7 | You may obtain a copy of the License at |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | Unless required by applicable law or agreed to in writing, software |
| 12 | distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | --> |
| 17 | |
| 18 | |
Matteo Scandolo | 41f5c15 | 2015-12-09 17:09:55 -0800 | [diff] [blame] | 19 | <div ng-show="vm.loader" class="loader">Loading</div> |
| 20 | |
| 21 | <section ng-if="!vm.loader && !vm.error"> |
| 22 | |
| 23 | <div class="alert alert-danger" ng-if="vm.stats.length == 0"> |
| 24 | No result |
| 25 | </div> |
| 26 | |
| 27 | <table class="table" ng-if="vm.stats.length > 0"> |
| 28 | <tr> |
Matteo Scandolo | 6c51294 | 2015-12-17 16:50:16 -0800 | [diff] [blame] | 29 | <th> |
Matteo Scandolo | 999d3a1 | 2016-03-07 17:50:38 -0800 | [diff] [blame] | 30 | <a ng-click="(order == 'category') ? order = '-category' : order = 'category'">Type:</a> |
Matteo Scandolo | 6c51294 | 2015-12-17 16:50:16 -0800 | [diff] [blame] | 31 | </th> |
| 32 | <th> |
Matteo Scandolo | 999d3a1 | 2016-03-07 17:50:38 -0800 | [diff] [blame] | 33 | <a ng-click="(order == 'resource_name') ? order = '-resource_name' : order = 'resource_name'">Resource:</a> |
Matteo Scandolo | 6c51294 | 2015-12-17 16:50:16 -0800 | [diff] [blame] | 34 | </th> |
| 35 | <th> |
Matteo Scandolo | 999d3a1 | 2016-03-07 17:50:38 -0800 | [diff] [blame] | 36 | <a ng-click="(order == 'meter') ? order = '-meter' : order = 'meter'">Meter:</a> |
Matteo Scandolo | 6c51294 | 2015-12-17 16:50:16 -0800 | [diff] [blame] | 37 | </th> |
| 38 | <th> |
| 39 | Unit: |
| 40 | </th> |
| 41 | <th> |
| 42 | Value: |
| 43 | </th> |
Matteo Scandolo | 41f5c15 | 2015-12-09 17:09:55 -0800 | [diff] [blame] | 44 | </tr> |
Matteo Scandolo | 6c51294 | 2015-12-17 16:50:16 -0800 | [diff] [blame] | 45 | <!-- <tr> |
| 46 | <td> |
| 47 | <input type="text" ng-model="query.category"> |
| 48 | </td> |
| 49 | <td> |
| 50 | <input type="text" ng-model="query.resource_name"> |
| 51 | </td> |
| 52 | <td> |
| 53 | <input type="text" ng-model="query.meter"> |
| 54 | </td> |
| 55 | <td> |
| 56 | <input type="text" ng-model="query.unit"> |
| 57 | </td> |
| 58 | <td> |
| 59 | <input type="text" ng-model="query.value"> |
| 60 | </td> |
| 61 | </tr> --> |
| 62 | <tr ng-repeat="item in vm.stats | orderBy:order"> |
Matteo Scandolo | 6c6b928 | 2015-12-15 14:37:27 -0800 | [diff] [blame] | 63 | <td>{{item.category}}</td> |
Matteo Scandolo | 6c51294 | 2015-12-17 16:50:16 -0800 | [diff] [blame] | 64 | <td>{{item.resource_name}}</td> |
Matteo Scandolo | 41f5c15 | 2015-12-09 17:09:55 -0800 | [diff] [blame] | 65 | <td>{{item.meter}}</td> |
| 66 | <td>{{item.unit}}</td> |
| 67 | <td>{{item.value}}</td> |
| 68 | </tr> |
| 69 | </table> |
| 70 | </section> |
| 71 | |
| 72 | <section ng-if="!vm.loader && vm.error"> |
| 73 | <div class="alert alert-danger"> |
| 74 | {{vm.error}} |
| 75 | </div> |
| 76 | </section> |