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

Fixed issue where panels would register twice. This breaks nice adding of new panels, working on it now

Rashid Khan 13 лет назад
Родитель
Сommit
d8f2d412cd

+ 4 - 0
js/controllers.js

@@ -96,6 +96,10 @@ angular.module('kibana.controllers', [])
     }
     }
   }
   }
 
 
+  $scope.send_render = function() {
+    $scope.$broadcast('render');
+  }
+
   $scope.add_panel = function(row,panel) {
   $scope.add_panel = function(row,panel) {
     console.log(panel)
     console.log(panel)
     $scope.row.panels.push(panel);
     $scope.row.panels.push(panel);

+ 1 - 0
js/services.js

@@ -21,6 +21,7 @@ angular.module('kibana.services', [])
   // addressed to the scope in question and runs the registered function if it
   // addressed to the scope in question and runs the registered function if it
   // is.
   // is.
   this.register = function(scope,type,fn) {
   this.register = function(scope,type,fn) {
+    console.log('registered:' + type + " for " + scope.panel.title + " " + scope.$id)
     scope.$on(type,function(event,packet){
     scope.$on(type,function(event,packet){
       var _id     = scope.$id;
       var _id     = scope.$id;
       var _to     = packet.to;
       var _to     = packet.to;

+ 1 - 1
panels/histogram/editor.html

@@ -1,4 +1,4 @@
-<div class="row-fluid" ng-controller="histogram">  
+<div class="row-fluid">  
   <div class="span3">
   <div class="span3">
     <form style="margin-bottom: 0px">
     <form style="margin-bottom: 0px">
       <h6>Label</h6>
       <h6>Label</h6>

+ 3 - 1
panels/histogram/module.html

@@ -1,3 +1,5 @@
 <kibana-panel ng-controller='histogram' style="height:{{row.height}}">
 <kibana-panel ng-controller='histogram' style="height:{{row.height}}">
-  <div histogram params="{{panel}}" style="height:{{row.height}}"></div>
+  <div>
+    <div histogram params="{{panel}} clearfix" style="height:{{row.height}}"></div>
+  </div>
 </kibana-panel>         
 </kibana-panel>         

+ 1 - 1
panels/map/editor.html

@@ -1,4 +1,4 @@
-  <div class="row-fluid" ng-controller="map">    
+  <div class="row-fluid">    
     <div class="span6">
     <div class="span6">
       <form class="input-append">
       <form class="input-append">
         <h6>Query</h6>
         <h6>Query</h6>

+ 1 - 1
panels/pie/editor.html

@@ -1,4 +1,4 @@
-<div class="row-fluid" ng-switch="panel.mode" ng-controller="pie">
+<div class="row-fluid" ng-switch="panel.mode">
   <div ng-switch-when="terms">
   <div ng-switch-when="terms">
     <div class="row-fluid">    
     <div class="row-fluid">    
       <div class="span4">
       <div class="span4">

+ 1 - 1
panels/table/editor.html

@@ -1,4 +1,4 @@
-  <div class="row-fluid" ng-controller="table">    
+  <div class="row-fluid">    
     <div class="span12">
     <div class="span12">
       <form class="input-append">
       <form class="input-append">
         <h5>Query</h5>
         <h5>Query</h5>

+ 1 - 1
panels/text/editor.html

@@ -1,4 +1,4 @@
-<div ng-controller="text">
+<div>
   <label class="small">Font Size</label> <select class="input-mini" ng-model="panel.style['font-size']" ng-options="f for f in ['6pt','7pt','8pt','10pt','12pt','14pt','16pt','18pt','20pt','24pt','28pt','32pt','36pt','42pt','48pt','52pt','60pt','72pt']"></select>
   <label class="small">Font Size</label> <select class="input-mini" ng-model="panel.style['font-size']" ng-options="f for f in ['6pt','7pt','8pt','10pt','12pt','14pt','16pt','18pt','20pt','24pt','28pt','32pt','36pt','42pt','48pt','52pt','60pt','72pt']"></select>
   <label class=small>Content</label>
   <label class=small>Content</label>
   <textarea ng-model="panel.content" rows="6" style="width:95%"></textarea>
   <textarea ng-model="panel.content" rows="6" style="width:95%"></textarea>

+ 1 - 1
panels/timepicker/editor.html

@@ -1,4 +1,4 @@
-  <div class="row-fluid" ng-controller="timepicker">    
+  <div class="row-fluid">    
     <div class="span3">
     <div class="span3">
       <h6>Default Mode</h6>
       <h6>Default Mode</h6>
       <select style="width:85%" ng-model="panel.mode" ng-options="f for f in ['relative','absolute','since']"></select>
       <select style="width:85%" ng-model="panel.mode" ng-options="f for f in ['relative','absolute','since']"></select>

+ 1 - 1
partials/paneleditor.html

@@ -13,5 +13,5 @@
   
   
 </div>
 </div>
 <div class="modal-footer">
 <div class="modal-footer">
-  <button type="button" class="btn btn-success" ng-click="dismiss()">Close</button>
+  <button type="button" class="btn btn-success" ng-click="dismiss();$broadcast('render')">Close</button>
 </div>
 </div>

+ 1 - 1
partials/roweditor.html

@@ -45,5 +45,5 @@
   </div>
   </div>
 </div>
 </div>
 <div class="modal-footer">
 <div class="modal-footer">
-  <button type="button" class="btn btn-success" ng-click="dismiss();reset_panel();">Close</button>
+  <button type="button" class="btn btn-success" ng-click="dismiss();reset_panel();send_render()">Close</button>
 </div>
 </div>