ignore empty custom metrics setting

This commit is contained in:
Mitsuhiro Tanda 2015-08-24 22:13:53 +09:00
parent c0c8465ec2
commit d815d06c1c
2 changed files with 6 additions and 2 deletions

View File

@ -176,7 +176,11 @@ function (angular, _, kbn) {
/* load custom metrics definitions */
var self = this;
$q.all(
_.map(datasource.jsonData.customMetricsAttributes, function(u) {
_.chain(datasource.jsonData.customMetricsAttributes)
.reject(function(u) {
return _.isEmpty(u);
})
.map(function(u) {
return $http({ method: 'GET', url: u });
})
)

View File

@ -43,7 +43,7 @@
Custom Metrics Attributes
</li>
<li>
<input type="text" class="tight-form-input input-xlarge" ng-model='current.jsonData.customMetricsAttributes[0]' ng-init="current.jsonData.customMetricsAttributes = current.jsonData.customMetricsAttributes || []" placeholder="" required></input>
<input type="text" class="tight-form-input input-xlarge" ng-model='current.jsonData.customMetricsAttributes[0]' ng-init="current.jsonData.customMetricsAttributes = current.jsonData.customMetricsAttributes || []" placeholder=""></input>
</li>
</ul>
<div class="clearfix"></div>