Sfoglia il codice sorgente

refactoring graphite panel

Torkel Ödegaard 11 anni fa
parent
commit
cf9a8a15cd

+ 3 - 3
src/app/panels/graphite/module.html

@@ -32,7 +32,7 @@
         </div>
         </div>
       </div>
       </div>
 
 
-      <div class="tab-content" ng-show="editorTabs[editor.index] == 'General'">
+<!--       <div class="tab-content" ng-show="editorTabs[editor.index] == 'General'">
         <div ng-include src="'app/partials/panelgeneral.html'"></div>
         <div ng-include src="'app/partials/panelgeneral.html'"></div>
 
 
         <div class="editor-row" ng-show="datasources.length > 0">
         <div class="editor-row" ng-show="datasources.length > 0">
@@ -44,8 +44,8 @@
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>
-
-      <div class="tab-content" ng-repeat="tab in panelMeta.fullEditorTabs" ng-show="editorTabs[editor.index] == tab.title">
+ -->
+      <div class="tab-content" 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>
 
 

+ 6 - 3
src/app/panels/graphite/module.js

@@ -38,9 +38,12 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
 
 
     $scope.panelMeta = {
     $scope.panelMeta = {
       modals : [],
       modals : [],
-      editorTabs: [],
 
 
-      fullEditorTabs : [
+      editorTabs : [
+        {
+          title: 'General',
+          src:'app/partials/panelgeneral.html'
+        },
         {
         {
           title:'Targets',
           title:'Targets',
           src:'app/panels/graphite/editor.html'
           src:'app/panels/graphite/editor.html'
@@ -221,7 +224,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
       $scope.fullscreen = false;
       $scope.fullscreen = false;
       $scope.options = false;
       $scope.options = false;
       $scope.editor = {index: 1};
       $scope.editor = {index: 1};
-      $scope.editorTabs = _.union(['General'],_.pluck($scope.panelMeta.fullEditorTabs,'title'));
+      $scope.editorTabs = _.pluck($scope.panelMeta.editorTabs,'title');
       $scope.hiddenSeries = {};
       $scope.hiddenSeries = {};
 
 
       $scope.datasources = datasourceSrv.listOptions();
       $scope.datasources = datasourceSrv.listOptions();