You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2012/12/09 15:21:45 UTC

svn commit: r1418969 [3/4] - in /incubator/ambari/branches/AMBARI-666/ambari-web: app/ app/controllers/ app/controllers/global/ app/controllers/main/ app/controllers/main/host/ app/controllers/main/service/ app/controllers/main/service/info/ app/contro...

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/menu.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/menu.js?rev=1418969&r1=1418968&r2=1418969&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/menu.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/menu.js Sun Dec  9 14:21:37 2012
@@ -25,18 +25,21 @@ var App = require('app');
 App.MainMenuView = Em.CollectionView.extend({
   tagName:'ul',
   classNames:['nav'],
-  content:[
-    { label:'Dashboard', routing:'dashboard', active:'active'},
-    { label:'Charts', routing:'charts'},
-    { label:'Services', routing:'services'},
-    { label:'Hosts', routing:'hosts'},
-    { label:'Apps', routing:'apps'},
-    { label:'Admin', routing:'admin'}
-  ],
-
-  /**
-   *    Adds observer on lastSetURL and calls navigation sync procedure
-   */
+  content:function(){
+    var result = [
+      { label:'Dashboard', routing:'dashboard', active:'active'},
+      { label:'Charts', routing:'charts'},
+      { label:'Services', routing:'services'},
+      { label:'Hosts', routing:'hosts'},
+      { label:'Apps', routing:'apps'}
+
+    ];
+      if(App.db.getUser().admin) result.push({ label:'Admin', routing:'admin'});
+    return result;
+  }.property(),
+    /**
+     *    Adds observer on lastSetURL and calls navigation sync procedure
+     */
   didInsertElement:function () {
     App.router.location.addObserver('lastSetURL', this, 'renderOnRoute');
     this.renderOnRoute();

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/configs.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/configs.js?rev=1418969&r1=1418968&r2=1418969&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/configs.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/configs.js Sun Dec  9 14:21:37 2012
@@ -23,6 +23,11 @@ App.MainServiceInfoConfigsView = Em.View
   didInsertElement: function () {
     var controller = this.get('controller');
     controller.loadStep();
+    var advanced = this.get('controller.selectedService.configCategories').filterProperty('name', 'Advanced');
+    if(advanced.length) advanced.objectAt(0).set('isAdvanced', true);
+  },
+  onToggleBlock: function(event){
+    $("#" + event.context).toggle('blind', 500);
   }
 });
 
@@ -30,12 +35,15 @@ App.ServiceConfigsByCategoryView = Ember
 
   content: null,
 
+
   category: null,
   serviceConfigs: null, // General, Advanced, NameNode, SNameNode, DataNode, etc.
 
   categoryConfigs: function () {
     return this.get('serviceConfigs').filterProperty('category', this.get('category.name'))
   }.property('serviceConfigs.@each').cacheable(),
-
-  layout: Ember.Handlebars.compile('<div class="accordion-body collapse in"><div class="accordion-inner">{{yield}}</div></div>')
+  didInsertElement: function(){
+    $("#Advanced").hide();
+  },
+  layout: Ember.Handlebars.compile('<div {{bindAttr id="view.category.name"}} class="accordion-body collapse in"><div class="accordion-inner">{{yield}}</div></div>')
 });
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/summary.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/summary.js?rev=1418969&r1=1418968&r2=1418969&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/summary.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/summary.js Sun Dec  9 14:21:37 2012
@@ -19,9 +19,8 @@ var App = require('app');
 
 App.MainServiceInfoSummaryView = Em.View.extend({
   templateName:function () {
-    var service = this.get('controller.content');
-    return require(service.get('isClients') ? 'templates/main/service/info/client_summary' : 'templates/main/service/info/summary');
-  }.property('controller.content'),
+    return require(this.get('service.isClients') ? 'templates/main/service/info/client_summary' : 'templates/main/service/info/summary');
+  }.property('service'),
   attributes:null,
   serviceStatus:{
     hdfs:false,
@@ -148,8 +147,8 @@ App.MainServiceInfoSummaryView = Em.View
     this.set('oldServiceName', serviceName);
     serviceName = serviceName.toLowerCase();
   }.observes('serviceName'),
-  
-  gangliaUrl: function () {
+
+  gangliaUrl:function () {
     var gangliaUrl = App.router.get('clusterController.gangliaUrl');
     var svcName = this.get('service.serviceName');
     if (svcName) {
@@ -169,7 +168,7 @@ App.MainServiceInfoSummaryView = Em.View
     }
     return gangliaUrl;
   }.property('App.router.clusterController.gangliaUrl', 'service.serviceName'),
-  
+
   didInsertElement:function () {
     // We have to make the height of the Alerts section
     // match the height of the Summary section.
@@ -186,7 +185,6 @@ App.MainServiceInfoSummaryView = Em.View
     }
   },
 
-
   clientHosts:App.Host.find(),
 
   clientHostsLength:function () {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/item.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/item.js?rev=1418969&r1=1418968&r2=1418969&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/item.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/item.js Sun Dec  9 14:21:37 2012
@@ -24,9 +24,9 @@ App.MainServiceItemView = Em.View.extend
     var options = [];
     var service = this.get('controller.content');
     switch(service.get('serviceName')) {
-      case 'HDFS':
-        options.push({action: 'runRebalancer', 'label': Em.I18n.t('services.service.actions.run.rebalancer')});
-        break;
+//      case 'HDFS':
+//        options.push({action: 'runRebalancer', 'label': Em.I18n.t('services.service.actions.run.rebalancer')});
+//        break;
       case 'HBASE':
         options.push({action: 'runCompaction', 'label': Em.I18n.t('services.service.actions.run.compaction')});
         break;

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/menu.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/menu.js?rev=1418969&r1=1418968&r2=1418969&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/menu.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/menu.js Sun Dec  9 14:21:37 2012
@@ -61,7 +61,7 @@ App.MainServiceMenuView = Em.CollectionV
   classNames:["nav", "nav-list", "nav-services"],
 
   itemViewClass:Em.View.extend({
-    classNameBindings:["active"],
+    classNameBindings:["active", "clients"],
     active:function () {
       return this.get('content.id') == this.get('parentView.activeServiceId') ? 'active' : '';
     }.property('parentView.activeServiceId'),
@@ -73,7 +73,10 @@ App.MainServiceMenuView = Em.CollectionV
       }
       return 0;
     }.property('App.router.clusterController.alerts'),
-
+    clients: function(){
+      var content = this.get('content');
+      return this.get('content.isClients') ? "clients" : "";
+    }.property("content"),
     templateName:require('templates/main/service/menu_item')
   })
 });
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/wizard/step5_view.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/wizard/step5_view.js?rev=1418969&r1=1418968&r2=1418969&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/wizard/step5_view.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/wizard/step5_view.js Sun Dec  9 14:21:37 2012
@@ -21,9 +21,9 @@ var App = require('app');
 
 App.WizardStep5View = Em.View.extend({
 
-  templateName: require('templates/wizard/step5'),
+  templateName:require('templates/wizard/step5'),
 
-  didInsertElement: function () {
+  didInsertElement:function () {
     var controller = this.get('controller');
     controller.loadStep();
 
@@ -39,39 +39,73 @@ App.WizardStep5View = Em.View.extend({
 });
 
 App.SelectHostView = Em.Select.extend({
-  content: [],
-  zId: null,
-  selectedHost: null,
-  serviceName: null,
-  attributeBindings: ['disabled'],
+  content:[],
+  zId:null,
+  selectedHost:null,
+  serviceName:null,
+  attributeBindings:['disabled'],
+
+  filterContent:function () {
+    this.get('content').sort(function (a, b) {
+      if (a.get('memory') == b.get('memory')) {
+        if (a.get('cpu') == b.get('cpu')) {
+
+//          try to compare as ipaddresses
+          if (a.get('host_name').ip2long() && b.get('host_name').ip2long()) {
+            return a.get('host_name').ip2long() - b.get('host_name').ip2long(); // hostname asc
+          }
+
+//          try to compare as strings
+          if (a.get('host_name') > b.get('host_name')) {
+            return 1;
+          }
+
+          if (b.get('host_name') > a.get('host_name')) {
+            return -1;
+          }
+
+          return 0;
+        }
+        return b.get('cpu') - a.get('cpu'); // cores desc
+      }
+
+      return b.get('memory') - a.get('memory'); // ram desc
+    });
+
+  }.observes('content'),
+
+  init:function () {
+    this._super();
+    this.propertyDidChange('content');
+  },
 
-  change: function () {
+  change:function () {
     this.get('controller').assignHostToMaster(this.get("serviceName"), this.get("value"), this.get("zId"));
   },
 
-  didInsertElement: function () {
+  didInsertElement:function () {
     this.set("value", this.get("selectedHost"));
   }
 });
 
 App.AddControlView = Em.View.extend({
-  componentName: null,
-  tagName: "span",
-  classNames: ["badge", "badge-important"],
-  template: Ember.Handlebars.compile('+'),
+  componentName:null,
+  tagName:"span",
+  classNames:["badge", "badge-important"],
+  template:Ember.Handlebars.compile('+'),
 
-  click: function () {
+  click:function () {
     this.get('controller').addZookeepers();
   }
 });
 
 App.RemoveControlView = Em.View.extend({
-  zId: null,
-  tagName: "span",
-  classNames: ["badge", "badge-important"],
-  template: Ember.Handlebars.compile('-'),
+  zId:null,
+  tagName:"span",
+  classNames:["badge", "badge-important"],
+  template:Ember.Handlebars.compile('-'),
 
-  click: function () {
+  click:function () {
     this.get('controller').removeZookeepers(this.get("zId"));
   }
 });