Torkel Ödegaard 12 лет назад
Родитель
Сommit
24dd2fa166

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

@@ -58,6 +58,12 @@ function (angular, app, _) {
         $scope.row.panels.push(panel);
         $scope.row.panels.push(panel);
       };
       };
 
 
+      $scope.remove_panel_from_row = function(row, panel) {
+        if (confirm('Are you sure you want to remove this ' + panel.type + ' panel?')) {
+          row.panels = _.without(row.panels,panel);
+        }
+      };
+
       /** @scratch /panels/0
       /** @scratch /panels/0
        * [[panels]]
        * [[panels]]
        * = Panels
        * = Panels

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

@@ -15,8 +15,7 @@ function (angular) {
 
 
 
 
           '<span class="extra row-button" ng-show="panel.editable != false">' +
           '<span class="extra row-button" ng-show="panel.editable != false">' +
-            '<span confirm-click="row.panels = _.without(row.panels,panel)" '+
-            'confirmation="Are you sure you want to remove this {{panel.type}} panel?" class="pointer">'+
+            '<span ng-click="remove_panel_from_row(row,panel)" class="pointer">'+
             '<i class="icon-remove pointer" bs-tooltip="\'Remove\'"></i></span>'+
             '<i class="icon-remove pointer" bs-tooltip="\'Remove\'"></i></span>'+
           '</span>' +
           '</span>' +
 
 

+ 1 - 5
src/app/panels/graphite/module.html

@@ -112,7 +112,7 @@
       </span>
       </span>
   </span>
   </span>
 
 
-  <div class="fluid-row panel-full-edit-mode-controls" ng-show="inEditMode" style="margin-top: 20px;">
+  <div class="fluid-row panel-full-edit-mode-controls" ng-show="inEditMode" style="margin: 20px;">
       <div ng-model="editor.index" bs-tabs>
       <div ng-model="editor.index" bs-tabs>
         <div ng-repeat="tab in setEditorTabs(panelMeta)" data-title="{{tab}}">
         <div ng-repeat="tab in setEditorTabs(panelMeta)" data-title="{{tab}}">
         </div>
         </div>
@@ -128,9 +128,5 @@
       <div ng-repeat="tab in panelMeta.editorTabs" ng-show="editorTabs[editor.index] == tab.title">
       <div ng-repeat="tab in panelMeta.editorTabs" ng-show="editorTabs[editor.index] == tab.title">
         <div ng-include src="tab.src"></div>
         <div ng-include src="tab.src"></div>
       </div>
       </div>
-
-      <div class="modal-footer">
-        <button type="button" class="btn btn-danger" ng-click="closeEditMode()">Close</button>
-    </div>
   </div>
   </div>
 </div>
 </div>

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

@@ -225,6 +225,15 @@ function (angular, app, $, _, kbn, moment, timeSeries, graphiteSrv) {
       }
       }
     };
     };
 
 
+    $scope.remove_panel_from_row = function(row, panel) {
+      if ($scope.inEditMode) {
+        $rootScope.$emit('fullEditMode', false);
+      }
+      else {
+        $scope.$parent.remove_panel_from_row(row, panel);
+      }
+    };
+
     $scope.closeEditMode = function() {
     $scope.closeEditMode = function() {
       $rootScope.$emit('fullEditMode', false);
       $rootScope.$emit('fullEditMode', false);
     };
     };

+ 10 - 10
src/app/panels/graphite/styleEditor.html

@@ -14,38 +14,38 @@
       <label class="small">Selectable</label><input type="checkbox" ng-model="panel.interactive" ng-checked="panel.interactive">
       <label class="small">Selectable</label><input type="checkbox" ng-model="panel.interactive" ng-checked="panel.interactive">
     </div>
     </div>
     <div class="editor-option">
     <div class="editor-option">
-      <label class="small">xAxis</label><input type="checkbox" ng-model="panel['x-axis']" ng-checked="panel['x-axis']"></div>
+      <label class="small">xAxis</label><input type="checkbox" ng-model="panel['x-axis']" ng-checked="panel['x-axis']" ng-change="render()"></div>
     <div class="editor-option">
     <div class="editor-option">
-      <label class="small">yAxis</label><input type="checkbox" ng-model="panel['y-axis']" ng-checked="panel['y-axis']"></div>
+      <label class="small">yAxis</label><input type="checkbox" ng-model="panel['y-axis']" ng-checked="panel['y-axis']" ng-change="render()"></div>
     <div class="editor-option" ng-show="panel.lines">
     <div class="editor-option" ng-show="panel.lines">
       <label class="small">Line Fill</label>
       <label class="small">Line Fill</label>
-      <select class="input-mini" ng-model="panel.fill" ng-options="f for f in [0,1,2,3,4,5,6,7,8,9,10]"></select>
+      <select class="input-mini" ng-model="panel.fill" ng-options="f for f in [0,1,2,3,4,5,6,7,8,9,10]" ng-change="render()"></select>
     </div>
     </div>
     <div class="editor-option" ng-show="panel.lines">
     <div class="editor-option" ng-show="panel.lines">
       <label class="small">Line Width</label>
       <label class="small">Line Width</label>
-      <select class="input-mini" ng-model="panel.linewidth" ng-options="f for f in [0,1,2,3,4,5,6,7,8,9,10]"></select>
+      <select class="input-mini" ng-model="panel.linewidth" ng-options="f for f in [0,1,2,3,4,5,6,7,8,9,10]" ng-change="render()"></select>
     </div>
     </div>
     <div class="editor-option" ng-show="panel.points">
     <div class="editor-option" ng-show="panel.points">
       <label class="small">Point Radius</label>
       <label class="small">Point Radius</label>
-      <select class="input-mini" ng-model="panel.pointradius" ng-options="f for f in [1,2,3,4,5,6,7,8,9,10]"></select>
+      <select class="input-mini" ng-model="panel.pointradius" ng-options="f for f in [1,2,3,4,5,6,7,8,9,10]" ng-change="render()"></select>
     </div>
     </div>
     <div class="editor-option">
     <div class="editor-option">
       <label class="small">Y Format <tip>Y-axis formatting</tip></label>
       <label class="small">Y Format <tip>Y-axis formatting</tip></label>
-      <select class="input-small" ng-model="panel.y_format" ng-options="f for f in ['none','short','bytes']"></select>
+      <select class="input-small" ng-model="panel.y_format" ng-options="f for f in ['none','short','bytes']" ng-change="render()"></select>
     </div>
     </div>
   </div>
   </div>
   <div class="section">
   <div class="section">
     <h5>Multiple Series</h5>
     <h5>Multiple Series</h5>
     <div class="editor-option">
     <div class="editor-option">
-      <label class="small">Stack</label><input type="checkbox" ng-model="panel.stack" ng-checked="panel.stack">
+      <label class="small">Stack</label><input type="checkbox" ng-model="panel.stack" ng-checked="panel.stack" ng-change="render()">
     </div>
     </div>
     <div class="editor-option" ng-show="panel.stack">
     <div class="editor-option" ng-show="panel.stack">
       <label style="white-space:nowrap" class="small">Percent <tip>Stack as a percentage of total</tip></label>
       <label style="white-space:nowrap" class="small">Percent <tip>Stack as a percentage of total</tip></label>
-      <input type="checkbox"  ng-model="panel.percentage" ng-checked="panel.percentage">
+      <input type="checkbox"  ng-model="panel.percentage" ng-checked="panel.percentage" ng-change="render()">
     </div>
     </div>
     <div class="editor-option" ng-show="panel.stack">
     <div class="editor-option" ng-show="panel.stack">
       <label class="small">Stacked Values <tip>How should the values in stacked charts to be calculated?</tip></label>
       <label class="small">Stacked Values <tip>How should the values in stacked charts to be calculated?</tip></label>
-      <select class="input-small" ng-model="panel.tooltip.value_type" ng-options="f for f in ['cumulative','individual']"></select>
+      <select class="input-small" ng-model="panel.tooltip.value_type" ng-options="f for f in ['cumulative','individual']" ng-change="render()"></select>
     </div>
     </div>
   </div>
   </div>
 </div>
 </div>
@@ -54,7 +54,7 @@
   <div class="section">
   <div class="section">
     <h5>Header<h5>
     <h5>Header<h5>
     <div class="editor-option">
     <div class="editor-option">
-      <label class="small">Zoom</label><input type="checkbox" ng-model="panel.zoomlinks" ng-checked="panel.zoomlinks" />
+      <label class="small">Zoom</label><input type="checkbox" ng-model="panel.zoomlinks" ng-checked="panel.zoomlinks"  />
     </div>
     </div>
     <div class="editor-option">
     <div class="editor-option">
       <label class="small">View</label><input type="checkbox" ng-model="panel.options" ng-checked="panel.options" />
       <label class="small">View</label><input type="checkbox" ng-model="panel.options" ng-checked="panel.options" />