Просмотр исходного кода

ignore empty custom metrics setting

Mitsuhiro Tanda 10 лет назад
Родитель
Сommit
d815d06c1c

+ 5 - 1
public/app/plugins/datasource/cloudwatch/datasource.js

@@ -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 });
         })
       )

+ 1 - 1
public/app/plugins/datasource/cloudwatch/partials/config.html

@@ -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>