Browse Source

column panel documentation

Rashid Khan 12 years ago
parent
commit
38520b0387
2 changed files with 26 additions and 5 deletions
  1. 17 0
      panels/column/module.js
  2. 9 5
      panels/timepicker/module.js

+ 17 - 0
panels/column/module.js

@@ -1,3 +1,20 @@
+/*
+
+  ## Column
+
+  The column panel is sort of a hack to allow you to put multiple, veritcal, 
+  panels next to a bigger panel. Note that it has no group, and setting a group
+  for the panel itself will do nothing
+
+  ### Parameters
+  * panels :: an array of panel objects. All of their spans should be set to 12
+
+  ### Group Events
+  #### Sends
+  * time :: Object Includes from, to and index
+
+*/
+
 angular.module('kibana.column', [])
 .controller('column', function($scope, $rootScope) {
   // Set and populate defaults

+ 9 - 5
panels/timepicker/module.js

@@ -12,6 +12,7 @@ a pattern
 * timefield :: The field in which time is stored in the document.
 * index :: Index pattern to match. Literals should be double quoted. Default: '_all'
 * defaultindex :: Index to failover to if index not found
+* index_interval :: Time between timestamped indices (can be 'none') for static index
 * refresh: Object containing refresh parameters
   * enable :: true/false, enable auto refresh by default. Default: false
   * interval :: Seconds between auto refresh. Default: 30
@@ -21,7 +22,7 @@ a pattern
 #### Sends
 * time :: Object Includes from, to and index
 #### Receives
-* get_time :: Receives an object containing a uniqueid, broadcasts to it.
+* get_time :: Receives an object containing a $id, broadcasts back to it.
 
 */
 angular.module('kibana.timepicker', [])
@@ -167,8 +168,8 @@ angular.module('kibana.timepicker', [])
     $scope.time_apply();
   }
 
-  $scope.time_check = function(){
-
+  // 
+  $scope.time_calc = function(){
     // If time picker is defined (on initialization)
     if(!(_.isUndefined($scope.timepicker))) {
       var from = $scope.panel.mode === 'relative' ? time_ago($scope.panel.timespan) :
@@ -198,7 +199,7 @@ angular.module('kibana.timepicker', [])
 
   $scope.time_apply = function() {      
     // Update internal time object
-    $scope.time = $scope.time_check();
+    $scope.time = $scope.time_calc();
     $scope.time.field = $scope.panel.timefield
 
     // Get indices for the time period, then broadcast time range and index list
@@ -213,7 +214,9 @@ angular.module('kibana.timepicker', [])
       eventBus.broadcast($scope.$id,$scope.panel.group,'time',$scope.time)
     }
 
-    // Update panel's string representation of the time object
+    // Update panel's string representation of the time object.Don't update if
+    // we're in relative mode since we dont want to store the time object in the
+    // json for relative periods
     if($scope.panel.mode !== 'relative') {
       $scope.panel.time = { 
         from : $scope.time.from.format("mm/dd/yyyy HH:MM:ss"),
@@ -276,6 +279,7 @@ angular.module('kibana.timepicker', [])
   // this is stupid, but there is otherwise no good way to ensure that when
   // I extract the date from an object that I'm get the UTC date. Stupid js.
   // I die a little inside every time I call this function.
+  // Update: I just read this again. I died a little more inside.
   function fake_utc(date) {
     return new Date(date.getTime() + date.getTimezoneOffset() * 60000);
   }