diff --git a/src/app/controllers/inspectCtrl.js b/src/app/controllers/inspectCtrl.js new file mode 100644 index 00000000000..466f0aae1ec --- /dev/null +++ b/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(); + } + }; + }); + +}); \ No newline at end of file diff --git a/src/app/controllers/row.js b/src/app/controllers/row.js index 846095f4556..87b3ad5ce64 100644 --- a/src/app/controllers/row.js +++ b/src/app/controllers/row.js @@ -124,6 +124,13 @@ function (angular, app, _) { */ 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 diff --git a/src/app/directives/kibanaPanel.js b/src/app/directives/kibanaPanel.js index 2f271547d9e..a0db34ef38b 100644 --- a/src/app/directives/kibanaPanel.js +++ b/src/app/directives/kibanaPanel.js @@ -16,10 +16,10 @@ function (angular, $, _) { var panelHeader = '