Updated Branches: refs/heads/trunk 65ba892ae -> 8f2b1fe4c
AMBARI-3529. Yarn+MapReduce installing. (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/ecf65d23 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/ecf65d23 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/ecf65d23 Branch: refs/heads/trunk Commit: ecf65d2319014c181d6de183d2d6dd205a0942c6 Parents: 65ba892 Author: Oleg Nechiporenko <[email protected]> Authored: Wed Oct 16 19:53:33 2013 +0300 Committer: Oleg Nechiporenko <[email protected]> Committed: Wed Oct 16 20:00:55 2013 +0300 ---------------------------------------------------------------------- ambari-web/app/controllers/main/service.js | 2 +- ambari-web/app/router.js | 2 +- ambari-web/app/routes/add_service_routes.js | 24 ++++++++--------- ambari-web/app/views/main/service/menu.js | 33 ++++++++++++++++++++++-- 4 files changed, 44 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/ecf65d23/ambari-web/app/controllers/main/service.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service.js b/ambari-web/app/controllers/main/service.js index dbbccf0..570409f 100644 --- a/ambari-web/app/controllers/main/service.js +++ b/ambari-web/app/controllers/main/service.js @@ -25,7 +25,7 @@ App.MainServiceController = Em.ArrayController.extend({ return []; } return App.Service.find(); - }.property('App.router.clusterController.isLoaded'), + }.property('App.router.clusterController.isLoaded').volatile(), cluster: function () { if (!App.router.get('clusterController.isLoaded')) { http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/ecf65d23/ambari-web/app/router.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js index e1650f3..10ada9e 100644 --- a/ambari-web/app/router.js +++ b/ambari-web/app/router.js @@ -272,7 +272,7 @@ App.Router = Em.Router.extend({ if (!localStorage.getObject('ambari').app.user.admin || clusterStatusOnServer && (clusterStatusOnServer.clusterState === 'CLUSTER_STARTED_5' || clusterStatusOnServer.clusterState === 'ADD_HOSTS_COMPLETED_5' || clusterStatusOnServer.clusterState === 'STACK_UPGRADE_COMPLETED' || clusterStatusOnServer.clusterState === 'REASSIGN_MASTER_COMPLETED' || clusterStatusOnServer.clusterState === 'SECURITY_COMPLETED' || clusterStatusOnServer.clusterState === 'HIGH_AVAILABILITY_COMPLETED' - || clusterStatusOnServer.clusterState === 'HIGH_AVAILABILITY_DISABLED')) { + || clusterStatusOnServer.clusterState === 'HIGH_AVAILABILITY_DISABLED' || clusterStatusOnServer.clusterState === 'ADD_SERVICES_COMPLETED_5')) { return 'main.index'; } else if (clusterStatusOnServer && clusterStatusOnServer.wizardControllerName === App.router.get('addHostController.name')) { // if wizardControllerName == "addHostController", then it means someone closed the browser or the browser was crashed when we were last in Add Hosts wizard http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/ecf65d23/ambari-web/app/routes/add_service_routes.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/add_service_routes.js b/ambari-web/app/routes/add_service_routes.js index c217e9c..95242b9 100644 --- a/ambari-web/app/routes/add_service_routes.js +++ b/ambari-web/app/routes/add_service_routes.js @@ -31,7 +31,7 @@ module.exports = Em.Route.extend({ router.get('clusterController').requestHosts(hostsUrl, function () { console.log('Request for hosts, with disk_info parameter'); }); - App.ModalPopup.show({ + var popup = App.ModalPopup.show({ classNames: ['full-width-modal'], header:Em.I18n.t('services.add.header'), bodyClass: App.AddServiceView.extend({ @@ -43,19 +43,21 @@ module.exports = Em.Route.extend({ onPrimary:function () { this.hide(); - App.router.get('updateController').set('isWorking', true); App.router.transitionTo('main.services.index'); }, onClose: function() { - this.hide(); App.router.get('updateController').set('isWorking', true); + var self = this; + App.router.get('updateController').updateServiceMetric(function(){ + self.hide(); + }); App.router.transitionTo('main.services.index'); }, didInsertElement: function(){ this.fitHeight(); } }); - + addServiceController.set('popup',popup); App.clusterStatus.updateFromServer(); var currentClusterStatus = App.clusterStatus.get('value'); @@ -286,15 +288,11 @@ module.exports = Em.Route.extend({ }, back: Em.Router.transitionTo('step6'), complete: function (router, context) { - if (true) { // this function will be moved to installerController where it will validate - var addServiceController = router.get('addServiceController'); - App.router.get('updateController').updateAll(); - addServiceController.finish(); - $(context.currentTarget).parents("#modal").find(".close").trigger('click'); - - // We need to do recovery based on whether we are in Add Host or Installer wizard - addServiceController.saveClusterState('ADD_SERVICES_COMPLETED_5'); - } + var addServiceController = router.get('addServiceController'); + addServiceController.get('popup').onClose(); + addServiceController.finish(); + // We need to do recovery based on whether we are in Add Host or Installer wizard + addServiceController.saveClusterState('ADD_SERVICES_COMPLETED_5'); } }), http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/ecf65d23/ambari-web/app/views/main/service/menu.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/menu.js b/ambari-web/app/views/main/service/menu.js index c00cb3e..1d1f328 100644 --- a/ambari-web/app/views/main/service/menu.js +++ b/ambari-web/app/views/main/service/menu.js @@ -26,9 +26,38 @@ App.MainServiceMenuView = Em.CollectionView.extend({ } return true; }); - return items; - }.property('App.router.mainServiceController.content'), + return this.sortByOrder(this.get('servicesSortOrder'), items); + }.property('App.router.mainServiceController.content', 'App.router.mainServiceController.content.length'), + servicesSortOrder: [ + 'HDFS', + 'YARN', + 'MAPREDUCE', + 'MAPREDUCE2', + 'TEZ', + 'HBASE', + 'HIVE', + 'HCATALOG', + 'WEBHCAT', + 'FLUME', + 'OOZIE', + 'GANGLIA', + 'NAGIOS', + 'ZOOKEEPER', + 'PIG', + 'SQOOP', + 'HUE' + ], + sortByOrder: function (sortOrder, array) { + var sorted = []; + for (var i = 0; i < sortOrder.length; i++) + for (var j = 0; j < array.length; j++) { + if (sortOrder[i] == array[j].get('id')) { + sorted.push(array[j]); + } + } + return sorted; + }, didInsertElement:function () { App.router.location.addObserver('lastSetURL', this, 'renderOnRoute');
