diff --git a/config.js b/config.js index 6f2508fcd85..02ebf9691b4 100644 --- a/config.js +++ b/config.js @@ -1,6 +1,8 @@ /* elasticsearch: URL to your elasticsearch server +kibana_index: The default ES index to use for storing Kibana specific object + such as stored dashboards timeformat: Format for time in histograms (might go away) modules: Panel modules to load. In the future these will be inferred from your initial dashboard, though if you share dashboards you @@ -13,9 +15,11 @@ If you need to configure the default dashboard, please see dashboard.js */ var config = new Settings( { - elasticsearch: 'http://localhost:9200', + elasticsearch: 'http://demo.kibana.org', + kibana_index: "kibana-int", timeformat: 'mm/dd HH:MM:ss', modules: ['histogram','map','pie','table','stringquery','sort', - 'timepicker','text','fields','hits','dashcontrol'], + 'timepicker','text','fields','hits','dashcontrol', + 'column'], } ); diff --git a/js/controllers.js b/js/controllers.js index ebcfa3791e5..12dc6effb0e 100644 --- a/js/controllers.js +++ b/js/controllers.js @@ -65,6 +65,11 @@ angular.module('kibana.controllers', []) $scope.global_alert = [] } + $scope.edit_path = function(type) { + if(type) + return 'panels/'+type+'/editor.html'; + } + $scope.init(); }) diff --git a/js/filters.js b/js/filters.js index 6a7403baeb6..3679ddec1e3 100644 --- a/js/filters.js +++ b/js/filters.js @@ -2,4 +2,9 @@ /*global angular:true */ 'use strict'; -angular.module('kibana.filters', []) \ No newline at end of file +angular.module('kibana.filters', []) +.filter('stringSort', function() { + return function(input) { + return input.sort(); + } + }); \ No newline at end of file diff --git a/panels/column/editor.html b/panels/column/editor.html new file mode 100644 index 00000000000..e459cdec342 --- /dev/null +++ b/panels/column/editor.html @@ -0,0 +1,33 @@ +
+
+

Add Panel to Column

+ + Select Type +
+
+
+
+
+
+
+

Panels

+ + + + + + + + + + + + + + + + +
TitleTypeHeightDeleteMove
{{app.title}}{{app.type}}
+
+
+
\ No newline at end of file diff --git a/panels/column/module.html b/panels/column/module.html new file mode 100644 index 00000000000..9b68bec19fb --- /dev/null +++ b/panels/column/module.html @@ -0,0 +1,17 @@ + + + +
+ +
+
+ × + Oops! {{panel.error}} +
+
+ +
+
+
+
+
\ No newline at end of file diff --git a/panels/column/module.js b/panels/column/module.js new file mode 100644 index 00000000000..f55d46dde08 --- /dev/null +++ b/panels/column/module.js @@ -0,0 +1,76 @@ +angular.module('kibana.column', []) +.controller('column', function($scope, $rootScope) { + // Set and populate defaults + var _d = { + panels : [ + ] + } + _.defaults($scope.panel,_d); + + $scope.init = function(){ + $scope.reset_panel(); + } + + $scope.toggle_row = function(panel) { + panel.collapse = panel.collapse ? false : true; + if (!panel.collapse) { + $timeout(function() { + $scope.send_render(); + }); + } + } + + $scope.send_render = function() { + $scope.$broadcast('render'); + } + + $scope.add_panel = function(panel) { + $scope.panel.panels.push(panel); + } + + $scope.reset_panel = function(type) { + $scope.new_panel = { + loading: false, + error: false, + sizeable: false, + span: 12, + height: "150px", + editable: true, + group: ['default'], + type: type, + }; + }; + +}) +.directive('columnEdit', function($compile,$timeout) { + return { + scope : { + new_panel:"=panel", + row:"=", + config:"=", + dashboards:"=", + type:"=type" + }, + link: function(scope, elem, attrs, ctrl) { + scope.$on('render', function () { + + // Make sure the digest has completed and populated the attributes + $timeout(function() { + // Create a reference to the new_panel as panel so that the existing + // editors work with our isolate scope + scope.panel = scope.new_panel + var template = '
' + + if(!(_.isUndefined(scope.type)) && scope.type != "") + template = template+'
'; + //var new_elem = $compile(angular.element(template))(scope)) + elem.html($compile(angular.element(template))(scope)); + }) + }) + } + } +}).filter('withoutColumn', function() { + return function() { + return _.without(config.modules,'column'); + }; +}); \ No newline at end of file diff --git a/panels/column/panelgeneral.html b/panels/column/panelgeneral.html new file mode 100644 index 00000000000..404499b7828 --- /dev/null +++ b/panels/column/panelgeneral.html @@ -0,0 +1,14 @@ +
+
+ +
+
+ +
+
+ +
+
+ +
+
\ No newline at end of file diff --git a/panels/dashcontrol/editor.html b/panels/dashcontrol/editor.html index d6199f93595..ad304bc15a9 100644 --- a/panels/dashcontrol/editor.html +++ b/panels/dashcontrol/editor.html @@ -1,4 +1,4 @@ -
+
Allow saving to
diff --git a/panels/dashcontrol/module.html b/panels/dashcontrol/module.html index 60f2241c920..fe2faf2faa8 100644 --- a/panels/dashcontrol/module.html +++ b/panels/dashcontrol/module.html @@ -1,4 +1,4 @@ - + diff --git a/panels/dashcontrol/module.js b/panels/dashcontrol/module.js index 5408718fe5d..71b3d075ea8 100644 --- a/panels/dashcontrol/module.js +++ b/panels/dashcontrol/module.js @@ -245,9 +245,6 @@ angular.module('kibana.dashcontrol', []) return false } - $scope.init(); - - }) .directive('dashUpload', function(timer, eventBus){ return { diff --git a/panels/fields/editor.html b/panels/fields/editor.html index f9e894600ee..7666d542adb 100644 --- a/panels/fields/editor.html +++ b/panels/fields/editor.html @@ -1,4 +1,4 @@ -
+
Popup Position
diff --git a/panels/fields/module.html b/panels/fields/module.html index 8a8cbceedd4..015c4541609 100644 --- a/panels/fields/module.html +++ b/panels/fields/module.html @@ -1,4 +1,4 @@ - +
  • diff --git a/panels/fields/module.js b/panels/fields/module.js index 6496b991df6..d67445ca8e0 100644 --- a/panels/fields/module.js +++ b/panels/fields/module.js @@ -64,5 +64,4 @@ angular.module('kibana.fields', []) return _.indexOf($scope.active,field) > -1 ? ['label','label-info'] : ''; } - $scope.init(); }) \ No newline at end of file diff --git a/panels/histogram/editor.html b/panels/histogram/editor.html index 0a416c73896..4a25c61a474 100644 --- a/panels/histogram/editor.html +++ b/panels/histogram/editor.html @@ -1,4 +1,4 @@ -
    +
    Label
    diff --git a/panels/histogram/module.html b/panels/histogram/module.html index 5c28be632fc..743260ca7c8 100644 --- a/panels/histogram/module.html +++ b/panels/histogram/module.html @@ -1,3 +1,3 @@ - -
    + +
    \ No newline at end of file diff --git a/panels/histogram/module.js b/panels/histogram/module.js index 4858202219b..493a470ab63 100644 --- a/panels/histogram/module.js +++ b/panels/histogram/module.js @@ -7,6 +7,7 @@ angular.module('kibana.histogram', []) interval: secondsToHms(calculate_interval($scope.from,$scope.to,40,0)/1000), show : ['bars','y-axis','x-axis','legend'], fill : 3, + height : $scope.panel.height || $scope.row.height, timezone: 'browser', // browser, utc or a standard timezone group : "default", } @@ -128,9 +129,6 @@ angular.module('kibana.histogram', []) $scope.get_data(); } - // Ready, init - $scope.init(); - }) .directive('histogram', function() { return { @@ -173,7 +171,7 @@ angular.module('kibana.histogram', []) // Populate element. Note that jvectormap appends, does not replace. scripts.wait(function(){ // Populate element - $.plot(elem, scope.data, { + try { $.plot(elem, scope.data, { legend: { show: show.legend, position: "nw", @@ -206,6 +204,9 @@ angular.module('kibana.histogram', []) hoverable: true, } }) + } catch(e) { + console.log(e) + } }) function tt(x, y, contents) { diff --git a/panels/hits/editor.html b/panels/hits/editor.html index 437e7a16dd4..e8719de08fb 100644 --- a/panels/hits/editor.html +++ b/panels/hits/editor.html @@ -1,4 +1,4 @@ -
    +
    The hits panel shows a simple count of how many records match your filtered query. If multiple queries are sent from a single panel the first query will be displayed
    diff --git a/panels/hits/module.html b/panels/hits/module.html index a12cf9479e2..09f0bd0c283 100644 --- a/panels/hits/module.html +++ b/panels/hits/module.html @@ -1,3 +1,3 @@ - +

    {{hits}}

    \ No newline at end of file diff --git a/panels/hits/module.js b/panels/hits/module.js index c5ac3f6e48f..35b740012b8 100644 --- a/panels/hits/module.js +++ b/panels/hits/module.js @@ -56,6 +56,4 @@ angular.module('kibana.hits', []) $scope.get_data(); } - $scope.init(); - }) diff --git a/panels/map/editor.html b/panels/map/editor.html index b83a614b290..31d28888db9 100644 --- a/panels/map/editor.html +++ b/panels/map/editor.html @@ -1,10 +1,16 @@ -
    +
    The map panel uses 2 letter country or US state codes to plot concentrations on a map. Darker terroritories mean more records matched that area. If multiple queries are sent from a single panel the first query will be displayed
    +
    + +
    Field
    + + +
    Query
    @@ -12,13 +18,6 @@
    -
    -
    -
    Field
    - - -
    -
    Map
    diff --git a/panels/map/module.html b/panels/map/module.html index 2a94a5672b1..7ca54ab8b96 100644 --- a/panels/map/module.html +++ b/panels/map/module.html @@ -1,3 +1,3 @@ - -
    + +
    \ No newline at end of file diff --git a/panels/map/module.js b/panels/map/module.js index 900059d51f1..f43839fd55f 100644 --- a/panels/map/module.js +++ b/panels/map/module.js @@ -8,6 +8,7 @@ angular.module('kibana.map', []) colors : ['#C8EEFF', '#0071A4'], size : 100, exclude : [], + height : $scope.panel.height || $scope.row.height, group : "default", } _.defaults($scope.panel,_d) @@ -63,8 +64,6 @@ angular.module('kibana.map', []) $scope.get_data(); } - $scope.init() - }) .directive('map', function() { return { diff --git a/panels/pie/editor.html b/panels/pie/editor.html index 0b7f182d5c8..6db55109d39 100644 --- a/panels/pie/editor.html +++ b/panels/pie/editor.html @@ -1,4 +1,4 @@ -
    +
    diff --git a/panels/pie/module.html b/panels/pie/module.html index 8cd087de001..38bda51a41c 100644 --- a/panels/pie/module.html +++ b/panels/pie/module.html @@ -1,3 +1,3 @@ - -
    + +
    \ No newline at end of file diff --git a/panels/pie/module.js b/panels/pie/module.js index 4dc96777021..56bc4402301 100644 --- a/panels/pie/module.js +++ b/panels/pie/module.js @@ -4,6 +4,7 @@ angular.module('kibana.pie', []) // Set and populate defaults var _d = { query : { field:"_all", query:"*", goal: 1}, + height : $scope.panel.height || $scope.row.height, size : 10, exclude : [], donut : false, @@ -178,10 +179,7 @@ angular.module('kibana.pie', []) $scope.panel.index = _.isUndefined(time.index) ? $scope.panel.index : time.index $scope.get_data(); } - - // Ready, init - $scope.init() - + }) .directive('pie', function() { return { diff --git a/panels/sort/module.html b/panels/sort/module.html index 0fdc9ff5520..7053faf9cbf 100644 --- a/panels/sort/module.html +++ b/panels/sort/module.html @@ -1,4 +1,4 @@ - + diff --git a/panels/sort/module.js b/panels/sort/module.js index e20c9ecf4da..064f43beafe 100644 --- a/panels/sort/module.js +++ b/panels/sort/module.js @@ -25,6 +25,4 @@ angular.module('kibana.sort', []) $scope.panel.sort[1] = $scope.panel.sort[1] == 'asc' ? 'desc' : 'asc'; $scope.set_sort(); } - - $scope.init(); }) \ No newline at end of file diff --git a/panels/stringquery/editor.html b/panels/stringquery/editor.html index a381af3037b..3ac30f6298f 100644 --- a/panels/stringquery/editor.html +++ b/panels/stringquery/editor.html @@ -1,4 +1,4 @@ -
    +
    diff --git a/panels/stringquery/module.html b/panels/stringquery/module.html index 662ef1fd75c..344e6691e15 100644 --- a/panels/stringquery/module.html +++ b/panels/stringquery/module.html @@ -1,4 +1,4 @@ - +
    diff --git a/panels/stringquery/module.js b/panels/stringquery/module.js index 23a993ea67e..95b0d3deed4 100644 --- a/panels/stringquery/module.js +++ b/panels/stringquery/module.js @@ -58,5 +58,4 @@ angular.module('kibana.stringquery', []) $scope.panel.query.splice(index,1); } - $scope.init(); }); \ No newline at end of file diff --git a/panels/table/editor.html b/panels/table/editor.html index c78c3de9e8a..7b48a1fa493 100644 --- a/panels/table/editor.html +++ b/panels/table/editor.html @@ -1,4 +1,4 @@ -
    +
    Query
    diff --git a/panels/table/module.html b/panels/table/module.html index 2954058258f..37198de031e 100644 --- a/panels/table/module.html +++ b/panels/table/module.html @@ -1,5 +1,5 @@ - -
    + +
    diff --git a/panels/table/module.js b/panels/table/module.js index b524f1dd414..55805537830 100644 --- a/panels/table/module.js +++ b/panels/table/module.js @@ -6,6 +6,7 @@ angular.module('kibana.table', []) query : "*", size : 100, offset : 0, + height : $scope.panel.height || $scope.row.height, sort : ['@timestamp','desc'], group : "default", style : {}, @@ -137,6 +138,4 @@ angular.module('kibana.table', []) $scope.get_data(); } - $scope.init(); - }); \ No newline at end of file diff --git a/panels/text/editor.html b/panels/text/editor.html index 9ad880192fc..add058a6232 100644 --- a/panels/text/editor.html +++ b/panels/text/editor.html @@ -1,4 +1,4 @@ -
    +
    diff --git a/panels/text/module.html b/panels/text/module.html index 1b287cbbafe..72a8ef2e6f5 100644 --- a/panels/text/module.html +++ b/panels/text/module.html @@ -1,3 +1,3 @@ - +

    \ No newline at end of file diff --git a/panels/text/module.js b/panels/text/module.js index b08d629a534..50fc776746c 100644 --- a/panels/text/module.js +++ b/panels/text/module.js @@ -11,7 +11,7 @@ angular.module('kibana.text', []) $scope.init = function() { } - $scope.init(); + }) .filter('newlines', function(){ return function (input) { diff --git a/panels/timepicker/editor.html b/panels/timepicker/editor.html index 0dc1f72f361..76b243a8d98 100644 --- a/panels/timepicker/editor.html +++ b/panels/timepicker/editor.html @@ -1,4 +1,4 @@ -
    +
    Default Mode
    diff --git a/panels/timepicker/module.html b/panels/timepicker/module.html index a184bff70fa..ad89ef0f5fc 100644 --- a/panels/timepicker/module.html +++ b/panels/timepicker/module.html @@ -1,4 +1,4 @@ - +
    diff --git a/panels/timepicker/module.js b/panels/timepicker/module.js index 0437ab274df..d00a3867751 100644 --- a/panels/timepicker/module.js +++ b/panels/timepicker/module.js @@ -271,7 +271,4 @@ angular.module('kibana.timepicker', []) } } - // Great, every function is ready, init. - $scope.init(); - }) \ No newline at end of file diff --git a/partials/dashboard.html b/partials/dashboard.html index 2303a7fdb20..2cfcaabd788 100644 --- a/partials/dashboard.html +++ b/partials/dashboard.html @@ -1,7 +1,7 @@
    -
    +
    diff --git a/partials/paneleditor.html b/partials/paneleditor.html index fd1572f83cf..e2ac1ad9a9d 100644 --- a/partials/paneleditor.html +++ b/partials/paneleditor.html @@ -9,9 +9,9 @@

    {{panel.type}} panel settings

    -
    No additional settings are available for this type of panel.
    +
    No additional settings are available for this type of panel.
    \ No newline at end of file diff --git a/partials/panelgeneral.html b/partials/panelgeneral.html index de30c7c5bf1..f5826829beb 100644 --- a/partials/panelgeneral.html +++ b/partials/panelgeneral.html @@ -5,7 +5,7 @@
    -
    +
    diff --git a/partials/roweditor.html b/partials/roweditor.html index 92dee236d77..d3db98b8025 100644 --- a/partials/roweditor.html +++ b/partials/roweditor.html @@ -17,12 +17,12 @@

    New Panel

    - + Select Type
    - +

    @@ -40,7 +40,7 @@
    - +
    {{panel.title}} {{panel.type}}