blob: 7d8fb5e24643a5c07b2ad7f3e5923fdddf29d669 [file] [log] [blame]
Matteo Scandolod2044a42017-08-07 16:08:28 -07001
2<!--
3Copyright 2017-present Open Networking Foundation
4
5Licensed under the Apache License, Version 2.0 (the "License");
6you may not use this file except in compliance with the License.
7You may obtain a copy of the License at
8
9http://www.apache.org/licenses/LICENSE-2.0
10
11Unless required by applicable law or agreed to in writing, software
12distributed under the License is distributed on an "AS IS" BASIS,
13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14See the License for the specific language governing permissions and
15limitations under the License.
16-->
17
18
Matteo Scandolo68856082015-12-08 14:35:55 -080019<!-- <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 Scandolo98241972015-12-08 17:41:46 -080031<div class="row" ng-show="vm.loader">
32 <div class="col-xs-12">
Matteo Scandolo7b80d842015-12-04 15:55:20 -080033 <div class="loader">Loading</div>
34 </div>
Matteo Scandolo98241972015-12-08 17:41:46 -080035</div>
Matteo Scandoloc8f18e62015-12-09 15:23:51 -080036<section ng-if="!vm.loader && !vm.error">
Matteo Scandolo02f44d62016-09-19 17:17:58 -070037 <div class="row" ng-if="vm.chartType !== 'pie'">
Matteo Scandoloc8f18e62015-12-09 15:23:51 -080038 <form class="form-inline col-xs-8" ng-submit="vm.addMeterToChart(vm.addMeterValue)">
Matteo Scandoloe5d5ebd2015-12-14 14:42:28 -080039 <select ng-model="vm.addMeterValue" class="form-control" ng-options="resource.id as resource.name for resource in vm.sampleLabels"></select>
Matteo Scandoloc8f18e62015-12-09 15:23:51 -080040 <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 Scandolo98241972015-12-08 17:41:46 -080048 </div>
Matteo Scandoloc8f18e62015-12-09 15:23:51 -080049 <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 Scandoloc8f18e62015-12-09 15:23:51 -080057 </div>
Matteo Scandolo02f44d62016-09-19 17:17:58 -070058 <!-- 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 Scandolo7b80d842015-12-04 15:55:20 -080076 </div>
Matteo Scandoloc8f18e62015-12-09 15:23:51 -080077 <div class="row" ng-if="!vm.loader">
78 <div class="col-xs-12">
Matteo Scandoloe5d5ebd2015-12-14 14:42:28 -080079 <a ng-click="vm.removeFromChart(meter)" class="btn btn-chart" ng-style="{'background-color': vm.chartColors[$index]}" ng-repeat="meter in vm.chartMeters">
Matteo Scandolo6c6b9282015-12-15 14:37:27 -080080 {{meter.resource_name || meter.resource_id}}
Matteo Scandoloe5d5ebd2015-12-14 14:42:28 -080081 </a>
Matteo Scandoloc8f18e62015-12-09 15:23:51 -080082 </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>