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"> |
Matteo Scandolo | 02f44d6 | 2016-09-19 17:17:58 -0700 | [diff] [blame^] | 19 | <div class="row" ng-if="vm.chartType !== 'pie'"> |
Matteo Scandolo | c8f18e6 | 2015-12-09 15:23:51 -0800 | [diff] [blame] | 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> |
Matteo Scandolo | c8f18e6 | 2015-12-09 15:23:51 -0800 | [diff] [blame] | 39 | </div> |
Matteo Scandolo | 02f44d6 | 2016-09-19 17:17:58 -0700 | [diff] [blame^] | 40 | <!-- PIE CHART --> |
| 41 | <div class="col-xs-8" ng-if="vm.chartType === 'pie'"> |
| 42 | <canvas id="pie" class="chart chart-pie" |
| 43 | chart-data="vm.chart.data" chart-labels="vm.chart.labels" chart-options="vm.chart.options"> |
| 44 | </canvas> |
| 45 | </div> |
| 46 | <div class="col-xs-4" ng-if="vm.chartType === 'pie'"> |
| 47 | <div class="row" ng-repeat="item in vm.chart.labels"> |
| 48 | <div class="col-xs-12"> |
| 49 | <span |
| 50 | class="btn btn-chart" |
| 51 | ng-style="{'background-color': vm.chartColors[$index]}"> |
| 52 | {{item}}: {{vm.chart.data[$index]}}% |
| 53 | </span> |
| 54 | </div> |
| 55 | </div> |
| 56 | </div> |
| 57 | <!-- END PIE CHART --> |
Matteo Scandolo | 7b80d84 | 2015-12-04 15:55:20 -0800 | [diff] [blame] | 58 | </div> |
Matteo Scandolo | c8f18e6 | 2015-12-09 15:23:51 -0800 | [diff] [blame] | 59 | <div class="row" ng-if="!vm.loader"> |
| 60 | <div class="col-xs-12"> |
Matteo Scandolo | e5d5ebd | 2015-12-14 14:42:28 -0800 | [diff] [blame] | 61 | <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] | 62 | {{meter.resource_name || meter.resource_id}} |
Matteo Scandolo | e5d5ebd | 2015-12-14 14:42:28 -0800 | [diff] [blame] | 63 | </a> |
Matteo Scandolo | c8f18e6 | 2015-12-09 15:23:51 -0800 | [diff] [blame] | 64 | </div> |
| 65 | </div> |
| 66 | </section> |
| 67 | <section ng-if="!vm.loader && vm.error"> |
| 68 | <div class="alert alert-danger"> |
| 69 | {{vm.error}} |
| 70 | </div> |
| 71 | </section> |