Matteo Scandolo | 6885608 | 2015-12-08 14:35:55 -0800 | [diff] [blame] | 1 | <!-- <pre>{{ vm | json}}</pre> --> |
| 2 | |
| 3 | <div class="row"> |
| 4 | <div class="col-xs-10"> |
| 5 | <h1>{{vm.name | uppercase}}</h1> |
| 6 | </div> |
| 7 | <div class="col-xs-2"> |
| 8 | <a ui-sref="ceilometerDashboard" class="btn btn-primary pull-right"> |
| 9 | <i class="glyphicon glyphicon-arrow-left"></i> Back to list |
| 10 | </a> |
| 11 | </div> |
| 12 | </div> |
Matteo Scandolo | 9824197 | 2015-12-08 17:41:46 -0800 | [diff] [blame] | 13 | <div class="row" ng-show="vm.loader"> |
| 14 | <div class="col-xs-12"> |
Matteo Scandolo | 7b80d84 | 2015-12-04 15:55:20 -0800 | [diff] [blame] | 15 | <div class="loader">Loading</div> |
| 16 | </div> |
Matteo Scandolo | 9824197 | 2015-12-08 17:41:46 -0800 | [diff] [blame] | 17 | </div> |
Matteo Scandolo | c8f18e6 | 2015-12-09 15:23:51 -0800 | [diff] [blame] | 18 | <section ng-if="!vm.loader && !vm.error"> |
| 19 | <div class="row"> |
| 20 | <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] | 21 | <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] | 22 | <button class="btn btn-success"> |
| 23 | <i class="glyphicon glyphicon-plus"></i> Add |
| 24 | </button> |
| 25 | </form> |
| 26 | <div class="col-xs-4 text-right"> |
| 27 | <a ng-click="vm.chartType = 'line'" class="btn" ng-class="{'btn-default': vm.chartType != 'bar', 'btn-primary': vm.chartType == 'line'}">Lines</a> |
| 28 | <a ng-click="vm.chartType = 'bar'" class="btn" ng-class="{'btn-default': vm.chartType != 'line', 'btn-primary': vm.chartType == 'bar'}">Bars</a> |
| 29 | </div> |
Matteo Scandolo | 9824197 | 2015-12-08 17:41:46 -0800 | [diff] [blame] | 30 | </div> |
Matteo Scandolo | c8f18e6 | 2015-12-09 15:23:51 -0800 | [diff] [blame] | 31 | <div class="row" ng-if="!vm.loader"> |
| 32 | <div class="col-xs-12"> |
| 33 | <canvas ng-if="vm.chartType === 'line'" id="line" class="chart chart-line" chart-data="vm.chart.data" chart-options="{datasetFill: false}" |
| 34 | chart-labels="vm.chart.labels" chart-legend="false" chart-series="vm.chart.series"> |
| 35 | </canvas> |
| 36 | <canvas ng-if="vm.chartType === 'bar'" id="bar" class="chart chart-bar" chart-data="vm.chart.data" |
| 37 | chart-labels="vm.chart.labels" chart-legend="false" chart-series="vm.chart.series"> |
| 38 | </canvas> |
| 39 | <!-- <pre>{{vm.chartMeters | json}}</pre> --> |
| 40 | </div> |
Matteo Scandolo | 7b80d84 | 2015-12-04 15:55:20 -0800 | [diff] [blame] | 41 | </div> |
Matteo Scandolo | c8f18e6 | 2015-12-09 15:23:51 -0800 | [diff] [blame] | 42 | <div class="row" ng-if="!vm.loader"> |
| 43 | <div class="col-xs-12"> |
Matteo Scandolo | e5d5ebd | 2015-12-14 14:42:28 -0800 | [diff] [blame] | 44 | <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] | 45 | {{meter.resource_name || meter.resource_id}} |
Matteo Scandolo | e5d5ebd | 2015-12-14 14:42:28 -0800 | [diff] [blame] | 46 | </a> |
Matteo Scandolo | c8f18e6 | 2015-12-09 15:23:51 -0800 | [diff] [blame] | 47 | </div> |
| 48 | </div> |
| 49 | </section> |
| 50 | <section ng-if="!vm.loader && vm.error"> |
| 51 | <div class="alert alert-danger"> |
| 52 | {{vm.error}} |
| 53 | </div> |
| 54 | </section> |