Explorar o código

working on inspector

Torkel Ödegaard %!s(int64=11) %!d(string=hai) anos
pai
achega
58ef61a0bb

+ 62 - 0
src/app/controllers/inspectCtrl.js

@@ -0,0 +1,62 @@
+define([
+  'angular'
+],
+function (angular) {
+  'use strict';
+
+  var module = angular.module('kibana.controllers');
+
+  module.controller('InspectCtrl', function($scope) {
+
+    $scope.init = function () {
+
+      if ($scope.inspector_info) {
+        $scope.init_model($scope.inspector_info);
+      }
+
+    };
+
+    $scope.init_model = function(info) {
+      if (info.error) {
+        console.log(info.error);
+        if (info.error.config && info.error.config.data) {
+          $scope.request_parameters = info.error.config.data.split('&');
+        }
+
+        if (info.error.data) {
+          if (info.error.data.indexOf('DOCTYPE') !== -1) {
+            $scope.response_html = info.error.data;
+          }
+        }
+      }
+    };
+
+  });
+
+  angular
+    .module('kibana.directives')
+    .directive('iframeContent', function($parse) {
+      return {
+        restrict: 'A',
+        link: function($scope, elem, attrs) {
+          var getter = $parse(attrs.iframeContent), value = getter($scope);
+
+          $scope.$on("$destroy",function() {
+            elem.remove();
+          });
+
+          var iframe = document.createElement('iframe');
+          iframe.width = '100%';
+          iframe.height = '400px';
+          iframe.style.border = 'none';
+          iframe.src = 'about:blank';
+          elem.append(iframe);
+
+          iframe.contentWindow.document.open('text/html', 'replace');
+          iframe.contentWindow.document.write(value);
+          iframe.contentWindow.document.close();
+        }
+      };
+    });
+
+});

+ 7 - 0
src/app/controllers/row.js

@@ -124,6 +124,13 @@ function (angular, app, _) {
          */
          */
         type    : type
         type    : type
       };
       };
+
+      if (!$scope.row.height) {
+        $scope.row.height = "200px";
+      }
+      else if($scope.row.height.indexOf('px') === -1) {
+        $scope.row.height = $scope.row.height + 'px';
+      }
     };
     };
 
 
     /** @scratch /panels/2
     /** @scratch /panels/2

+ 2 - 2
src/app/directives/kibanaPanel.js

@@ -16,10 +16,10 @@ function (angular, $, _) {
       var panelHeader =
       var panelHeader =
       '<div class="panel-header">'+
       '<div class="panel-header">'+
         '<div class="row-fluid">' +
         '<div class="row-fluid">' +
-          '<div class="span12 alert-error panel-error" ng-if="panel.error">' +
+          '<div class="span12 alert-error panel-error small" ng-if="panel.error">' +
             '<a class="close" ng-click="panel.error=false">&times;</a>' +
             '<a class="close" ng-click="panel.error=false">&times;</a>' +
             '<span><i class="icon-exclamation-sign"></i> <strong>Oops!</strong> {{panel.error}} </span>' +
             '<span><i class="icon-exclamation-sign"></i> <strong>Oops!</strong> {{panel.error}} </span>' +
-            '<span class="pointer" config-modal="app/partials/inspector.html"> &nbsp;&nbsp; (inspect)</span>' +
+            '<span class="pointer panel-error-inspector-link" config-modal="app/partials/inspector.html">View details</span>' +
           '</div>' +
           '</div>' +
         '</div>\n' +
         '</div>\n' +
 
 

+ 2 - 0
src/app/panels/graphite/module.js

@@ -261,8 +261,10 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
       return $scope.datasource.query(graphiteQuery)
       return $scope.datasource.query(graphiteQuery)
         .then($scope.dataHandler)
         .then($scope.dataHandler)
         .then(null, function(err) {
         .then(null, function(err) {
+          $scope.panelMeta.loading = false;
           $scope.inspector_info = { error: err };
           $scope.inspector_info = { error: err };
           $scope.panel.error = err.message || "Graphite HTTP Request Error";
           $scope.panel.error = err.message || "Graphite HTTP Request Error";
+          $scope.render([]);
         });
         });
     };
     };
 
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
src/css/bootstrap.dark.min.css


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
src/css/bootstrap.light.min.css


+ 6 - 1
src/css/less/overrides.less

@@ -112,7 +112,12 @@ code, pre {
 
 
 .panel-error {
 .panel-error {
   color: @white;
   color: @white;
-  padding: 3px 10px 0px 10px;
+  padding: 5px 10px 0px 10px;
+}
+
+.panel-error-inspector-link {
+  float: right;
+  margin-right: 10px;
 }
 }
 
 
 
 

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio