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 | 6885608 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 19 | <!-- <pre>{{ vm | json}}</pre> --> |
| 20 | |
| 21 | <div class="row"> |
| 22 | <div class="col-xs-10"> |
| 23 | <h1>{{vm.name | uppercase}}</h1> |
| 24 | </div> |
| 25 | <div class="col-xs-2"> |
| 26 | <a ui-sref="ceilometerDashboard" class="btn btn-primary pull-right"> |
| 27 | <i class="glyphicon glyphicon-arrow-left"></i> Back to list |
| 28 | </a> |
| 29 | </div> |
| 30 | </div> |
Matteo Scandolo | 9824197 | 2015-12-08 17:41:46 -0800 | [diff] [blame] | 31 | <div class="row" ng-show="vm.loader"> |
| 32 | <div class="col-xs-12"> |
Matteo Scandolo | 7b80d84 | 2015-12-04 15:55:20 -0800 | [diff] [blame] | 33 | <div class="loader">Loading</div> |
| 34 | </div> |
Matteo Scandolo | 9824197 | 2015-12-08 17:41:46 -0800 | [diff] [blame] | 35 | </div> |
Matteo Scandolo | c8f18e6 | 2015-12-09 15:23:51 -0800 | [diff] [blame] | 36 | <section ng-if="!vm.loader && !vm.error"> |
Matteo Scandolo | 02f44d6 | 2016-09-19 17:17:58 -0700 | [diff] [blame] | 37 | <div class="row" ng-if="vm.chartType !== 'pie'"> |
Matteo Scandolo | c8f18e6 | 2015-12-09 15:23:51 -0800 | [diff] [blame] | 38 | <form class="form-inline col-xs-8" ng-submit="vm.addMeterToChart(vm.addMeterValue)"> |
Matteo Scandolo | e5d5ebd | 2015-12-14 14:42:28 -0800 | [diff] [blame] | 39 | <select ng-model="vm.addMeterValue" class="form-control" ng-options="resource.id as resource.name for resource in vm.sampleLabels"></select> |
Matteo Scandolo | c8f18e6 | 2015-12-09 15:23:51 -0800 | [diff] [blame] | 40 | <button class="btn btn-success"> |
| 41 | <i class="glyphicon glyphicon-plus"></i> Add |
| 42 | </button> |
| 43 | </form> |
| 44 | <div class="col-xs-4 text-right"> |
| 45 | <a ng-click="vm.chartType = 'line'" class="btn" ng-class="{'btn-default': vm.chartType != 'bar', 'btn-primary': vm.chartType == 'line'}">Lines</a> |
| 46 | <a ng-click="vm.chartType = 'bar'" class="btn" ng-class="{'btn-default': vm.chartType != 'line', 'btn-primary': vm.chartType == 'bar'}">Bars</a> |
| 47 | </div> |
Matteo Scandolo | 9824197 | 2015-12-08 17:41:46 -0800 | [diff] [blame] | 48 | </div> |
Matteo Scandolo | c8f18e6 | 2015-12-09 15:23:51 -0800 | [diff] [blame] | 49 | <div class="row" ng-if="!vm.loader"> |
| 50 | <div class="col-xs-12"> |
| 51 | <canvas ng-if="vm.chartType === 'line'" id="line" class="chart chart-line" chart-data="vm.chart.data" chart-options="{datasetFill: false}" |
| 52 | chart-labels="vm.chart.labels" chart-legend="false" chart-series="vm.chart.series"> |
| 53 | </canvas> |
| 54 | <canvas ng-if="vm.chartType === 'bar'" id="bar" class="chart chart-bar" chart-data="vm.chart.data" |
| 55 | chart-labels="vm.chart.labels" chart-legend="false" chart-series="vm.chart.series"> |
| 56 | </canvas> |
Matteo Scandolo | c8f18e6 | 2015-12-09 15:23:51 -0800 | [diff] [blame] | 57 | </div> |
Matteo Scandolo | 02f44d6 | 2016-09-19 17:17:58 -0700 | [diff] [blame] | 58 | <!-- PIE CHART --> |
| 59 | <div class="col-xs-8" ng-if="vm.chartType === 'pie'"> |
| 60 | <canvas id="pie" class="chart chart-pie" |
| 61 | chart-data="vm.chart.data" chart-labels="vm.chart.labels" chart-options="vm.chart.options"> |
| 62 | </canvas> |
| 63 | </div> |
| 64 | <div class="col-xs-4" ng-if="vm.chartType === 'pie'"> |
| 65 | <div class="row" ng-repeat="item in vm.chart.labels"> |
| 66 | <div class="col-xs-12"> |
| 67 | <span |
| 68 | class="btn btn-chart" |
| 69 | ng-style="{'background-color': vm.chartColors[$index]}"> |
| 70 | {{item}}: {{vm.chart.data[$index]}}% |
| 71 | </span> |
| 72 | </div> |
| 73 | </div> |
| 74 | </div> |
| 75 | <!-- END PIE CHART --> |
Matteo Scandolo | 7b80d84 | 2015-12-04 15:55:20 -0800 | [diff] [blame] | 76 | </div> |
Matteo Scandolo | c8f18e6 | 2015-12-09 15:23:51 -0800 | [diff] [blame] | 77 | <div class="row" ng-if="!vm.loader"> |
| 78 | <div class="col-xs-12"> |
Matteo Scandolo | e5d5ebd | 2015-12-14 14:42:28 -0800 | [diff] [blame] | 79 | <a ng-click="vm.removeFromChart(meter)" class="btn btn-chart" ng-style="{'background-color': vm.chartColors[$index]}" ng-repeat="meter in vm.chartMeters"> |
Matteo Scandolo | 6c6b928 | 2015-12-15 14:37:27 -0800 | [diff] [blame] | 80 | {{meter.resource_name || meter.resource_id}} |
Matteo Scandolo | e5d5ebd | 2015-12-14 14:42:28 -0800 | [diff] [blame] | 81 | </a> |
Matteo Scandolo | c8f18e6 | 2015-12-09 15:23:51 -0800 | [diff] [blame] | 82 | </div> |
| 83 | </div> |
| 84 | </section> |
| 85 | <section ng-if="!vm.loader && vm.error"> |
| 86 | <div class="alert alert-danger"> |
| 87 | {{vm.error}} |
| 88 | </div> |
| 89 | </section> |