diff options
author | Yusaku Sako <yusaku@apache.org> | 2012-12-09 14:40:20 +0000 |
---|---|---|
committer | Yusaku Sako <yusaku@apache.org> | 2012-12-09 14:40:20 +0000 |
commit | ec1abe07667f65636846fc42e5e1bd91d552acb2 (patch) | |
tree | 0327204e3d5dcd0362e2ad077a85edefa34cfa5e /ambari-web | |
parent | 6497697a1d6f0ba2b9fd58330c7f48b2dd95e306 (diff) |
AMBARI-1059. Refactor cluster management. (yusaku)
git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1418980 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'ambari-web')
29 files changed, 800 insertions, 508 deletions
diff --git a/ambari-web/app/assets/data/wizard/stack/hdp/version/1.2.0.json b/ambari-web/app/assets/data/wizard/stack/hdp/version/1.2.0.json new file mode 100644 index 0000000000..0689d4055f --- /dev/null +++ b/ambari-web/app/assets/data/wizard/stack/hdp/version/1.2.0.json @@ -0,0 +1,352 @@ +{ + "name" : "HDP", + "version" : "1.2.0", + "repositories" : [ { + "baseUrl" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP-1.2.0/repos/centos6", + "osType" : "centos6", + "repoId" : "HDP-1.2.0", + "repoName" : "HDP", + "mirrorsList" : null + }, { + "baseUrl" : null, + "osType" : "centos6", + "repoId" : "HDP-epel", + "repoName" : "HDP-epel", + "mirrorsList" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch" + }, { + "baseUrl" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP-1.2.0/repos/centos5", + "osType" : "centos5", + "repoId" : "HDP-1.2.0", + "repoName" : "HDP", + "mirrorsList" : null + }, { + "baseUrl" : null, + "osType" : "centos5", + "repoId" : "HDP-epel", + "repoName" : "HDP-epel", + "mirrorsList" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch" + }, { + "baseUrl" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP-1.2.0/repos/centos6", + "osType" : "redhat6", + "repoId" : "HDP-1.2.0", + "repoName" : "HDP", + "mirrorsList" : null + }, { + "baseUrl" : null, + "osType" : "redhat6", + "repoId" : "HDP-epel", + "repoName" : "HDP-epel", + "mirrorsList" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=$basearch" + }, { + "baseUrl" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP-1.2.0/repos/centos5", + "osType" : "redhat5", + "repoId" : "HDP-1.2.0", + "repoName" : "HDP", + "mirrorsList" : null + }, { + "baseUrl" : null, + "osType" : "redhat5", + "repoId" : "HDP-epel", + "repoName" : "HDP-epel", + "mirrorsList" : "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch" + }, { + "baseUrl" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP-1.2.0/repos/suse11", + "osType" : "suse11", + "repoId" : "HDP-1.2.0", + "repoName" : "HDP", + "mirrorsList" : null + }, { + "baseUrl" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP-UTILS-1.1.0.15/repos/suse11", + "osType" : "suse11", + "repoId" : "HDP-UTILS-1.1.0.15", + "repoName" : "HDP-UTILS", + "mirrorsList" : null + } ], + "services" : [ { + "name" : "TEMPLETON", + "version" : "0.1.4.1-1", + "user" : "root", + "comment" : "This is comment for TEMPLETON service", + "components" : [ { + "name" : "TEMPLETON_SERVER", + "category" : "MASTER", + "client" : false, + "master" : true + }, { + "name" : "TEMPLETON_CLIENT", + "category" : "CLIENT", + "client" : true, + "master" : false + } ], + "clientOnlyService" : false, + "clientComponent" : { + "name" : "TEMPLETON_CLIENT", + "category" : "CLIENT", + "client" : true, + "master" : false + } + }, { + "name" : "SQOOP", + "version" : "1.4.2.1-1", + "user" : "root", + "comment" : "Tool for transferring bulk data between Apache Hadoop and structured data stores such as relational databases", + "components" : [ { + "name" : "SQOOP", + "category" : "CLIENT", + "client" : true, + "master" : false + } ], + "clientOnlyService" : true, + "clientComponent" : { + "name" : "SQOOP", + "category" : "CLIENT", + "client" : true, + "master" : false + } + }, { + "name" : "NAGIOS", + "version" : "1.0", + "user" : "root", + "comment" : "Nagios Monitoring and Alerting system", + "components" : [ { + "name" : "NAGIOS_SERVER", + "category" : "MASTER", + "client" : false, + "master" : true + } ], + "clientOnlyService" : false, + "clientComponent" : { + "name" : "NAGIOS_SERVER", + "category" : "MASTER", + "client" : false, + "master" : true + } + }, { + "name" : "HDFS", + "version" : "1.1.0.1-1", + "user" : "root", + "comment" : "Apache Hadoop Distributed File System", + "components" : [ { + "name" : "NAMENODE", + "category" : "MASTER", + "client" : false, + "master" : true + }, { + "name" : "DATANODE", + "category" : "SLAVE", + "client" : false, + "master" : false + }, { + "name" : "SECONDARY_NAMENODE", + "category" : "MASTER", + "client" : false, + "master" : true + }, { + "name" : "HDFS_CLIENT", + "category" : "CLIENT", + "client" : true, + "master" : false + } ], + "clientOnlyService" : false, + "clientComponent" : { + "name" : "HDFS_CLIENT", + "category" : "CLIENT", + "client" : true, + "master" : false + } + }, { + "name" : "PIG", + "version" : "0.10.0.1-1", + "user" : "root", + "comment" : "Scripting platform for analyzing large datasets", + "components" : [ { + "name" : "PIG", + "category" : "CLIENT", + "client" : true, + "master" : false + } ], + "clientOnlyService" : true, + "clientComponent" : { + "name" : "PIG", + "category" : "CLIENT", + "client" : true, + "master" : false + } + }, { + "name" : "HBASE", + "version" : "0.94.2.1-1", + "user" : "mapred", + "comment" : "Non-relational distributed database and centralized service for configuration management & synchronization", + "components" : [ { + "name" : "HBASE_MASTER", + "category" : "MASTER", + "client" : false, + "master" : true + }, { + "name" : "HBASE_REGIONSERVER", + "category" : "SLAVE", + "client" : false, + "master" : false + }, { + "name" : "HBASE_CLIENT", + "category" : "CLIENT", + "client" : true, + "master" : false + } ], + "clientOnlyService" : false, + "clientComponent" : { + "name" : "HBASE_CLIENT", + "category" : "CLIENT", + "client" : true, + "master" : false + } + }, { + "name" : "ZOOKEEPER", + "version" : "3.4.5.1-1", + "user" : "root", + "comment" : "This is comment for ZOOKEEPER service", + "components" : [ { + "name" : "ZOOKEEPER_SERVER", + "category" : "MASTER", + "client" : false, + "master" : true + }, { + "name" : "ZOOKEEPER_CLIENT", + "category" : "CLIENT", + "client" : true, + "master" : false + } ], + "clientOnlyService" : false, + "clientComponent" : { + "name" : "ZOOKEEPER_CLIENT", + "category" : "CLIENT", + "client" : true, + "master" : false + } + }, { + "name" : "GANGLIA", + "version" : "1.0", + "user" : "root", + "comment" : "Ganglia Metrics Collection system", + "components" : [ { + "name" : "GANGLIA_SERVER", + "category" : "MASTER", + "client" : false, + "master" : true + }, { + "name" : "GANGLIA_MONITOR", + "category" : "SLAVE", + "client" : false, + "master" : false + }, { + "name" : "MONITOR_WEBSERVER", + "category" : "MASTER", + "client" : false, + "master" : true + } ], + "clientOnlyService" : false, + "clientComponent" : { + "name" : "GANGLIA_SERVER", + "category" : "MASTER", + "client" : false, + "master" : true + } + }, { + "name" : "HCATALOG", + "version" : "0.4.0.1-1", + "user" : "root", + "comment" : "This is comment for HCATALOG service", + "components" : [ { + "name" : "HCAT", + "category" : "CLIENT", + "client" : true, + "master" : false + } ], + "clientOnlyService" : true, + "clientComponent" : { + "name" : "HCAT", + "category" : "CLIENT", + "client" : true, + "master" : false + } + }, { + "name" : "HIVE", + "version" : "0.9.0.1-1", + "user" : "root", + "comment" : "Data warehouse system for ad-hoc queries & analysis of large datasets and table & storage management service", + "components" : [ { + "name" : "HIVE_SERVER", + "category" : "MASTER", + "client" : false, + "master" : true + }, { + "name" : "MYSQL_SERVER", + "category" : "MASTER", + "client" : false, + "master" : true + }, { + "name" : "HIVE_CLIENT", + "category" : "CLIENT", + "client" : true, + "master" : false + } ], + "clientOnlyService" : false, + "clientComponent" : { + "name" : "HIVE_CLIENT", + "category" : "CLIENT", + "client" : true, + "master" : false + } + }, { + "name" : "OOZIE", + "version" : "3.2.0.1-1", + "user" : "root", + "comment" : "System for workflow coordination and execution of Apache Hadoop jobs", + "components" : [ { + "name" : "OOZIE_SERVER", + "category" : "MASTER", + "client" : false, + "master" : true + }, { + "name" : "OOZIE_CLIENT", + "category" : "CLIENT", + "client" : true, + "master" : false + } ], + "clientOnlyService" : false, + "clientComponent" : { + "name" : "OOZIE_CLIENT", + "category" : "CLIENT", + "client" : true, + "master" : false + } + }, { + "name" : "MAPREDUCE", + "version" : "1.1.0.1-1", + "user" : "mapred", + "comment" : "Apache Hadoop Distributed Processing Framework", + "components" : [ { + "name" : "JOBTRACKER", + "category" : "MASTER", + "client" : false, + "master" : true + }, { + "name" : "TASKTRACKER", + "category" : "SLAVE", + "client" : false, + "master" : false + }, { + "name" : "MAPREDUCE_CLIENT", + "category" : "CLIENT", + "client" : true, + "master" : false + } ], + "clientOnlyService" : false, + "clientComponent" : { + "name" : "MAPREDUCE_CLIENT", + "category" : "CLIENT", + "client" : true, + "master" : false + } + } ] +}
\ No newline at end of file diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js index a80c6fee81..f8f1fcc062 100644 --- a/ambari-web/app/controllers/global/cluster_controller.js +++ b/ambari-web/app/controllers/global/cluster_controller.js @@ -345,8 +345,9 @@ App.ClusterController = Em.Controller.extend({ self.updateLoadStatus('users'); }); - //TODO: define dependencies and delete next line - self.updateLoadStatus('services'); + App.router.get('updateController').updateServiceMetric(function(){ + self.updateLoadStatus('services'); + }); setTimeout(function(){ self.set('updateStatus', true); diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js index f49a007562..4e18d223ab 100644 --- a/ambari-web/app/controllers/global/update_controller.js +++ b/ambari-web/app/controllers/global/update_controller.js @@ -77,33 +77,25 @@ App.UpdateController = Em.Controller.extend({ if (view) { existedGraphs.push(_graph); console.log('updated graph', _graph.name); - view.$(".chart-container").children().each(function (index, value) { - $(value).children().remove(); - }); view.loadData(); - //if graph opened as modal popup - if($(".modal-graph-line .modal-body #" + _graph.popupId + "-container-popup").length){ - view.$(".chart-container").children().each(function (index, value) { - $(value).children().remove(); - }); - $(".modal-graph-line .modal-body #" + _graph.popupId + "-container-popup").children().each(function (index, value) { - $(value).children().remove(); - }); - view.set('isPopup', true); + //if graph opened as modal popup update it to + if($(".modal-graph-line .modal-body #" + _graph.popupId + "-container-popup").length) { view.loadData(); } } }); this.set('graphs', existedGraphs); }, - updateServiceMetric:function(){ - + updateServiceMetric:function(callback){ + var self = this; + self.set('isUpdated', false); var servicesUrl = this.getUrl('/data/dashboard/services.json', '/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=*,components/host_components/*'); + var callback = callback || function(jqXHR, textStatus){ + self.set('isUpdated', true); + }; App.HttpClient.get(servicesUrl, App.servicesMapper, { - complete:function (jqXHR, textStatus) { - - } + complete: callback }); } diff --git a/ambari-web/app/controllers/main/service.js b/ambari-web/app/controllers/main/service.js index 1cf82fd10b..76f0c08619 100644 --- a/ambari-web/app/controllers/main/service.js +++ b/ambari-web/app/controllers/main/service.js @@ -20,7 +20,12 @@ var App = require('app'); App.MainServiceController = Em.ArrayController.extend({ name:'mainServiceController', - content: App.Service.find(), + content: function(){ + if(!App.router.get('clusterController.isLoaded')){ + return []; + } + return App.Service.find(); + }.property('App.router.clusterController.isLoaded'), additionalMenuItem:Em.Object.create({ id:'Clients', displayName:'Clients', isClients:true }), isAdmin: function(){ return App.db.getUser().admin; diff --git a/ambari-web/app/controllers/main/service/add_controller.js b/ambari-web/app/controllers/main/service/add_controller.js index 5015d8d1a8..6f66d49512 100644 --- a/ambari-web/app/controllers/main/service/add_controller.js +++ b/ambari-web/app/controllers/main/service/add_controller.js @@ -211,17 +211,18 @@ App.AddServiceController = Em.Controller.extend({ loadConfirmedHosts: function(){ var hosts = App.db.getHosts(); if(!hosts){ - var hosts = {}; - - App.Host.find().forEach(function(item){ - hosts[item.get('id')] = { - name: item.get('id'), - cpu: item.get('cpu'), - memory: item.get('memory'), - bootStatus: "success", - isInstalled: true - }; - }); + var hosts = {}; + + App.Host.find().forEach(function(item){ + hosts[item.get('id')] = { + name: item.get('id'), + cpu: item.get('cpu'), + memory: item.get('memory'), + bootStatus: "DONE", + isInstalled: true + }; + }); + App.db.setHosts(hosts); } this.set('content.hostsInfo', hosts); diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js index 2bf06980d0..ae1a0386cd 100644 --- a/ambari-web/app/controllers/wizard/step3_controller.js +++ b/ambari-web/app/controllers/wizard/step3_controller.js @@ -48,11 +48,6 @@ App.WizardStep3Controller = Em.Controller.extend({ this.startBootstrap(); } } else { - // TODO: assume manually bootstrapped hosts are all successful for now - this.get('hosts').forEach(function (_host) { - _host.set('bootStatus', 'DONE'); - _host.set('bootLog', 'Success'); - }); this.set('bootHosts', this.get('hosts')); this.isHostsRegistered(this.getHostInfo); } @@ -60,6 +55,7 @@ App.WizardStep3Controller = Em.Controller.extend({ clearStep: function () { this.hosts.clear(); + this.bootHosts.clear(); }, loadStep: function () { @@ -166,10 +162,12 @@ App.WizardStep3Controller = Em.Controller.extend({ }); //TODO: uncomment below code to hookup with @GET bootstrap API - /* - self.set('bootHosts',selectedHosts); - self.doBootstrap(); - */ + self.set('bootHosts', hosts); + if (self.get('content.hosts.manualInstall') !== true) { + self.doBootstrap(); + } else { + self.isHostsRegistered(self.getHostInfo); + } this.hide(); }, body: Em.I18n.t('installer.step3.hosts.retry.popup.body') @@ -237,7 +235,9 @@ App.WizardStep3Controller = Em.Controller.extend({ //TODO: uncomment following line after the hook up with the API call console.log('stopBootstrap() called'); // this.set('isSubmitDisabled',false); - this.startRegistration(); + Ember.run.later(this, function(){ + this.startRegistration(); + }, 1000); }, startRegistration: function () { @@ -255,7 +255,7 @@ App.WizardStep3Controller = Em.Controller.extend({ timeout: App.timeout, success: function (data) { var jsonData; - if (App.testMode) { + if (App.testMode === true) { jsonData = data; } else { jsonData = jQuery.parseJSON(data); @@ -276,7 +276,16 @@ App.WizardStep3Controller = Em.Controller.extend({ return; } } - if (hosts.length === jsonData.items.length) { + var flag = true; + hosts.forEach(function (_host) { + if (jsonData.items.someProperty('Hosts.host_name', _host.name)) { + _host.set('bootStatus', 'DONE'); + _host.set('bootLog', 'Success'); + } else { + flag = false; + } + }, this); + if (flag) { callback.apply(self); } else { self.registerErrPopup(Em.I18n.t('installer.step3.hostRegister.popup.header'), Em.I18n.t('installer.step3.hostRegister.popup.body')); @@ -284,7 +293,6 @@ App.WizardStep3Controller = Em.Controller.extend({ }, error: function () { console.log('Error: Getting registered host information from the server'); - self.stopBootstrap(); }, statusCode: require('data/statusCodes') }); diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js index 6babe58434..eb10b69295 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -43,7 +43,7 @@ App.WizardStep7Controller = Em.Controller.extend({ }.property('stepConfigs.@each.errorCount'), selectedServiceNames: function () { - return this.get('content.services').filterProperty('isSelected', true).mapProperty('serviceName'); + return this.get('content.services').filterProperty('isSelected', true).filterProperty('isInstalled', false).mapProperty('serviceName'); }.property('content.services').cacheable(), masterComponentHosts: function () { diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js index b6ef80954e..128c592ba1 100644 --- a/ambari-web/app/controllers/wizard/step8_controller.js +++ b/ambari-web/app/controllers/wizard/step8_controller.js @@ -734,6 +734,10 @@ App.WizardStep8Controller = Em.Controller.extend({ var clusterName = this.get('clusterInfo').findProperty('config_name', 'cluster').config_value; var url = App.apiPrefix + '/clusters/' + clusterName + '/hosts'; var data = this.createRegisterHostData(); + if(data.length == 0){ + return; + } + $.ajax({ type: 'POST', url: url, @@ -1079,6 +1083,8 @@ App.WizardStep8Controller = Em.Controller.extend({ return {config: {'global': 'version1', 'core-site': 'version1', 'hbase-site': 'version1'}}; case 'OOZIE': return {config: {'global': 'version1', 'core-site': 'version1', 'oozie-site': 'version1'}}; + default: + return {config: {'global': 'version1'}}; } } diff --git a/ambari-web/app/controllers/wizard/step9_controller.js b/ambari-web/app/controllers/wizard/step9_controller.js index 9d24fcf5b4..cc062c2b98 100644 --- a/ambari-web/app/controllers/wizard/step9_controller.js +++ b/ambari-web/app/controllers/wizard/step9_controller.js @@ -49,15 +49,18 @@ App.WizardStep9Controller = Em.Controller.extend({ navigateStep: function () { if (this.get('content.cluster.isCompleted') === false) { - this.loadStep(); if (this.get('content.cluster.status') === 'INSTALL FAILED') { + this.loadStep(); this.hosts.setEach('status', 'failed'); this.set('progress', '100'); this.set('isStepCompleted', true); //this.set('status', 'failed'); } else if (this.get('content.cluster.status') === 'START FAILED') { + this.hosts.setEach('status', 'info'); + this.set('isStepCompleted', false); this.launchStartServices(); } else { + this.loadStep(); this.startPolling(); } } else { @@ -288,7 +291,6 @@ App.WizardStep9Controller = Em.Controller.extend({ var progress = 0; var actionsPerHost = actions.length; var completedActions = actions.filterProperty('Tasks.status', 'COMPLETED').length - + actions.filterProperty('Tasks.status', 'IN_PROGRESS').length + actions.filterProperty('Tasks.status', 'FAILED').length + actions.filterProperty('Tasks.status', 'ABORTED').length + actions.filterProperty('Tasks.status', 'TIMEDOUT').length; @@ -421,7 +423,6 @@ App.WizardStep9Controller = Em.Controller.extend({ }, setTasksPerHost: function () { - console.log("In setTasksPerHost fo step9*****************"); var tasksData = this.get('polledData'); this.get('hosts').forEach(function (_host) { var tasksPerHost = tasksData.filterProperty('Tasks.host_name', _host.name); // retrieved from polled Data diff --git a/ambari-web/app/mappers/hosts_mapper.js b/ambari-web/app/mappers/hosts_mapper.js index 8cba70c463..5d20992d7e 100644 --- a/ambari-web/app/mappers/hosts_mapper.js +++ b/ambari-web/app/mappers/hosts_mapper.js @@ -17,6 +17,7 @@ App.hostsMapper = App.QuickDataMapper.create({ model: App.Host, + tmp_result:[], config: { id: 'Hosts.host_name', host_name: 'Hosts.host_name', @@ -59,6 +60,7 @@ App.hostsMapper = App.QuickDataMapper.create({ json.items.forEach(function (item) { var result = []; + self.tmp_result=[]; // Disk Usage if (item.metrics && item.metrics.disk && item.metrics.disk.disk_total && item.metrics.disk.disk_free) { @@ -80,26 +82,20 @@ App.hostsMapper = App.QuickDataMapper.create({ if(App.Host.find(item.Hosts.host_name).get("hostName") == item.Hosts.host_name){ // UPDATE - /* App.Host.find(item.Hosts.host_name).set("ip", item.Hosts.ip); - App.Host.find(item.Hosts.host_name).set("cpu", item.Hosts.cpu_count); - App.Host.find(item.Hosts.host_name).set("osArch", item.Hosts.os_arch); - App.Host.find(item.Hosts.host_name).set("osType", item.Hosts.os_type); - App.Host.find(item.Hosts.host_name).set("memory", item.Hosts.total_mem); - if(typeof item.Hosts.load !=="undefined"){ - App.Host.find(item.Hosts.host_name).set("loadOne", item.Hosts.load.load_one); - App.Host.find(item.Hosts.host_name).set("loadFive", item.Hosts.load.load_five); - App.Host.find(item.Hosts.host_name).set("loadFifteen", item.Hosts.load.load_fifteen); - } App.Host.find(item.Hosts.host_name).set("cpuUsage", item.cpu_usage); App.Host.find(item.Hosts.host_name).set("diskUsage", item.disk_usage); - App.Host.find(item.Hosts.host_name).set("memoryUsage", item.memory_usage);*/ + App.Host.find(item.Hosts.host_name).set("memoryUsage", item.memory_usage); - $.map(item.Hosts, function (e,a){ + self.tmp_result.push(this.parseIt(item, this.config)); + + $.map(self.tmp_result[0], function (e,a){ + //console.log(a, "------------------", self.tmp_result[0][a]) if(typeof(e) === "string" || typeof(e) === "number") { var modelName=self.parseName(a); - if(typeof(App.Host.find(item.Hosts.host_name).get(modelName)) !== "undefined"){ - App.Host.find(item.Hosts.host_name).set(modelName, item.Hosts[a]); + if(typeof(App.Host.find(self.tmp_result[0].host_name).get(modelName)) !== "undefined"){ + App.Host.find(self.tmp_result[0].host_name).set(modelName, self.tmp_result[0][a]); + // console.log(modelName, "------------------", self.tmp_result[0][a]) } } }) @@ -114,7 +110,6 @@ App.hostsMapper = App.QuickDataMapper.create({ } }, this); - // console.log(this.get('model'), result); } diff --git a/ambari-web/app/mappers/service_mapper.js b/ambari-web/app/mappers/service_mapper.js index fe7f8d053a..7a8c42c543 100644 --- a/ambari-web/app/mappers/service_mapper.js +++ b/ambari-web/app/mappers/service_mapper.js @@ -16,7 +16,6 @@ */ App.servicesMapper = App.QuickDataMapper.create({ - model:App.Service, servicesSortOrder: [ 'HDFS', 'MAPREDUCE', @@ -39,123 +38,230 @@ App.servicesMapper = App.QuickDataMapper.create({ } return sorted; }, - config:{ - id:'ServiceInfo.service_name', - service_name:'ServiceInfo.service_name', - work_status:'ServiceInfo.state', - $service_audit:[ 1, 2, 3 ], - $alerts:[ 1, 2, 3 ], - components_key:'components', - components_type:'array', - components:{ - item:'ServiceComponentInfo.component_name' + + model: App.Service, + config: { + id: 'ServiceInfo.service_name', + service_name: 'ServiceInfo.service_name', + work_status: 'ServiceInfo.state', + $service_audit: [ 1, 2, 3 ], + $alerts: [ 1, 2, 3 ], + components_key: 'components', + components_type: 'array', + components: { + item: 'ServiceComponentInfo.component_name' }, - host_components:'host_components' + host_components: 'host_components' }, - - hdfsConfig:{ - version:'nameNodeComponent.ServiceComponentInfo.Version', - name_node_id:'nameNodeComponent.host_components[0].HostRoles.host_name', - sname_node_id:'snameNodeComponent.host_components[0].HostRoles.host_name', - data_nodes:'data_nodes', - name_node_start_time:'nameNodeComponent.ServiceComponentInfo.StartTime', - jvm_memory_heap_used:'nameNodeComponent.host_components[0].metrics.jvm.memHeapUsedM', - jvm_memory_heap_committed:'nameNodeComponent.host_components[0].metrics.jvm.memHeapCommittedM', - live_data_nodes:'live_data_nodes', - dead_data_nodes:'dead_data_nodes', - decommision_data_nodes:'decommission_data_nodes', - capacity_used:'nameNodeComponent.ServiceComponentInfo.CapacityUsed', - capacity_total:'nameNodeComponent.ServiceComponentInfo.CapacityTotal', - dfs_total_blocks:'nameNodeComponent.ServiceComponentInfo.BlocksTotal', - dfs_corrupt_blocks:'nameNodeComponent.ServiceComponentInfo.CorruptBlocks', - dfs_missing_blocks:'nameNodeComponent.ServiceComponentInfo.MissingBlocks', - dfs_under_replicated_blocks:'nameNodeComponent.ServiceComponentInfo.UnderReplicatedBlocks', - dfs_total_files:'nameNodeComponent.ServiceComponentInfo.TotalFiles', - upgrade_status:'nameNodeComponent.ServiceComponentInfo.UpgradeFinalized', - safe_mode_status:'nameNodeComponent.ServiceComponentInfo.Safemode' + hdfsConfig: { + version: 'nameNodeComponent.ServiceComponentInfo.Version', + name_node_id: 'nameNodeComponent.host_components[0].HostRoles.host_name', + sname_node_id: 'snameNodeComponent.host_components[0].HostRoles.host_name', + data_nodes: 'data_nodes', + name_node_start_time: 'nameNodeComponent.ServiceComponentInfo.StartTime', + jvm_memory_heap_used: 'nameNodeComponent.host_components[0].metrics.jvm.memHeapUsedM', + jvm_memory_heap_committed: 'nameNodeComponent.host_components[0].metrics.jvm.memHeapCommittedM', + live_data_nodes: 'live_data_nodes', + dead_data_nodes: 'dead_data_nodes', + decommision_data_nodes: 'decommission_data_nodes', + capacity_used: 'nameNodeComponent.ServiceComponentInfo.CapacityUsed', + capacity_total: 'nameNodeComponent.ServiceComponentInfo.CapacityTotal', + dfs_total_blocks: 'nameNodeComponent.ServiceComponentInfo.BlocksTotal', + dfs_corrupt_blocks: 'nameNodeComponent.ServiceComponentInfo.CorruptBlocks', + dfs_missing_blocks: 'nameNodeComponent.ServiceComponentInfo.MissingBlocks', + dfs_under_replicated_blocks: 'nameNodeComponent.ServiceComponentInfo.UnderReplicatedBlocks', + dfs_total_files: 'nameNodeComponent.ServiceComponentInfo.TotalFiles', + upgrade_status: 'nameNodeComponent.ServiceComponentInfo.UpgradeFinalized', + safe_mode_status: 'nameNodeComponent.ServiceComponentInfo.Safemode' }, - - mapReduceConfig:{ - version:'jobTrackerComponent.ServiceComponentInfo.Version', - job_tracker_id:'jobTrackerComponent.host_components[0].HostRoles.host_name', - task_trackers:'task_trackers', - job_tracker_start_time:'jobTrackerComponent.ServiceComponentInfo.StartTime', - job_tracker_heap_used:'jobTrackerComponent.ServiceComponentInfo.HeapMemoryUsed', - job_tracker_heap_max:'jobTrackerComponent.ServiceComponentInfo.HeapMemoryMax', - alive_trackers:'alive_trackers', - black_list_trackers:'black_list_trackers', - gray_list_trackers:'gray_list_trackers', - map_slots:'map_slots', - reduce_slots:'reduce_slots', - jobs_submitted:'jobTrackerComponent.ServiceComponentInfo.jobtracker.jobs_submitted', - jobs_completed:'jobTrackerComponent.ServiceComponentInfo.jobtracker.jobs_completed', - map_slots_occupied:'jobTrackerComponent.ServiceComponentInfo.jobtracker.occupied_map_slots', - map_slots_reserved:'jobTrackerComponent.ServiceComponentInfo.jobtracker.reserved_map_slots', - reduce_slots_occupied:'jobTrackerComponent.ServiceComponentInfo.jobtracker.occupied_reduce_slots', - reduce_slots_reserved:'jobTrackerComponent.ServiceComponentInfo.jobtracker.reserved_reduce_slots', - maps_running:'jobTrackerComponent.ServiceComponentInfo.jobtracker.running_maps', - maps_waiting:'jobTrackerComponent.ServiceComponentInfo.jobtracker.waiting_maps', - reduces_running:'jobTrackerComponent.ServiceComponentInfo.jobtracker.running_reduces', - reduces_waiting:'jobTrackerComponent.ServiceComponentInfo.jobtracker.waiting_reduces', - trackers_decommisioned:'jobTrackerComponent.host_components[0].metrics.mapred.jobtracker.trackers_decommissioned' + mapReduceConfig: { + version: 'jobTrackerComponent.ServiceComponentInfo.Version', + job_tracker_id: 'jobTrackerComponent.host_components[0].HostRoles.host_name', + task_trackers: 'task_trackers', + job_tracker_start_time: 'jobTrackerComponent.ServiceComponentInfo.StartTime', + job_tracker_heap_used: 'jobTrackerComponent.ServiceComponentInfo.HeapMemoryUsed', + job_tracker_heap_max: 'jobTrackerComponent.ServiceComponentInfo.HeapMemoryMax', + alive_trackers: 'alive_trackers', + black_list_trackers: 'black_list_trackers', + gray_list_trackers: 'gray_list_trackers', + map_slots: 'map_slots', + reduce_slots: 'reduce_slots', + jobs_submitted: 'jobTrackerComponent.ServiceComponentInfo.jobtracker.jobs_submitted', + jobs_completed: 'jobTrackerComponent.ServiceComponentInfo.jobtracker.jobs_completed', + map_slots_occupied: 'jobTrackerComponent.ServiceComponentInfo.jobtracker.occupied_map_slots', + map_slots_reserved: 'jobTrackerComponent.ServiceComponentInfo.jobtracker.reserved_map_slots', + reduce_slots_occupied: 'jobTrackerComponent.ServiceComponentInfo.jobtracker.occupied_reduce_slots', + reduce_slots_reserved: 'jobTrackerComponent.ServiceComponentInfo.jobtracker.reserved_reduce_slots', + maps_running: 'jobTrackerComponent.ServiceComponentInfo.jobtracker.running_maps', + maps_waiting: 'jobTrackerComponent.ServiceComponentInfo.jobtracker.waiting_maps', + reduces_running: 'jobTrackerComponent.ServiceComponentInfo.jobtracker.running_reduces', + reduces_waiting: 'jobTrackerComponent.ServiceComponentInfo.jobtracker.waiting_reduces', + trackers_decommisioned: 'jobTrackerComponent.host_components[0].metrics.mapred.jobtracker.trackers_decommissioned' + }, + hbaseConfig: { + version: 'masterComponent.ServiceComponentInfo.Version', + master_id: 'masterComponent.host_components[0].HostRoles.host_name', + region_servers: 'region_servers', + master_start_time: 'masterComponent.ServiceComponentInfo.MasterStartTime', + master_active_time: 'masterComponent.ServiceComponentInfo.MasterActiveTime', + average_load: 'masterComponent.ServiceComponentInfo.AverageLoad', + regions_in_transition: 'regions_in_transition', + revision: 'masterComponent.ServiceComponentInfo.Revision', + heap_memory_used: 'masterComponent.ServiceComponentInfo.HeapMemoryUsed', + heap_memory_max: 'masterComponent.ServiceComponentInfo.HeapMemoryMax' }, - hbaseConfig:{ - version:'masterComponent.ServiceComponentInfo.Version', - master_id:'masterComponent.host_components[0].HostRoles.host_name', - region_servers:'region_servers', - master_start_time:'masterComponent.ServiceComponentInfo.MasterStartTime', - master_active_time:'masterComponent.ServiceComponentInfo.MasterActiveTime', - average_load:'masterComponent.ServiceComponentInfo.AverageLoad', - regions_in_transition:'regions_in_transition', - revision:'masterComponent.ServiceComponentInfo.Revision', - heap_memory_used:'masterComponent.ServiceComponentInfo.HeapMemoryUsed', - heap_memory_max:'masterComponent.ServiceComponentInfo.HeapMemoryMax' + model2: App.Component, + config2: { + id: 'ServiceComponentInfo.component_name', + component_name: 'ServiceComponentInfo.component_name', + service_id: 'ServiceComponentInfo.service_name', + work_status: 'host_components[0].HostRoles.state', + host_id: 'host_components[0].HostRoles.host_name', + $decommissioned: false }, - model2:App.Component, - config2:{ - id:'ServiceComponentInfo.component_name', - component_name:'ServiceComponentInfo.component_name', - service_id:'ServiceComponentInfo.service_name', - work_status:'host_components[0].HostRoles.state', - host_id:'host_components[0].HostRoles.host_name', - $decommissioned:false + model3: App.HostComponent, + config3: { + id: 'id', + work_status: 'HostRoles.state', + component_name: 'HostRoles.component_name', + host_id: 'HostRoles.host_name', + service_id: 'component[0].ServiceComponentInfo.service_name' }, - model3:App.HostComponent, - config3:{ - id:'id', - work_status:'HostRoles.state', - component_name:'HostRoles.component_name', - host_id:'HostRoles.host_name', - service_id:'component[0].ServiceComponentInfo.service_name' + + map: function (json) { + if (!this.get('model')) { + return; + } + + if (json.items) { + var result = []; + json.items.forEach(function (item) { + var finalConfig = jQuery.extend({}, this.config); + var finalJson = []; + item.host_components = []; + if (this.get('model').find(item.ServiceInfo.service_name).get('isLoaded')) { + this.update(item); + return; + } + item.components.forEach(function (component) { + component.host_components.forEach(function (host_component) { + host_component.id = host_component.HostRoles.component_name + "_" + host_component.HostRoles.host_name; + item.host_components.push(host_component.id); + }, this) + }, this); + + if (item && item.ServiceInfo && item.ServiceInfo.service_name == "HDFS") { + // Change the JSON so that it is easy to map + finalJson = this.hdfsMapper(item); + result.push(finalJson); + App.store.load(App.HDFSService, finalJson); + } else if (item && item.ServiceInfo && item.ServiceInfo.service_name == "MAPREDUCE") { + finalJson = this.mapreduceMapper(item); + result.push(finalJson); + App.store.load(App.MapReduceService, finalJson); + } else if (item && item.ServiceInfo && item.ServiceInfo.service_name == "HBASE") { + finalJson = this.hbaseMapper(item); + result.push(finalJson); + App.store.load(App.HBaseService, finalJson); + } else { + result.push(this.parseIt(item, this.config)); + } + }, this); + + + result = this.sortByOrder(this.get('servicesSortOrder'), result); + App.store.loadMany(this.get('model'), result); + + result = []; + json.items.forEach(function (item) { + item.components.forEach(function (component) { + result.push(this.parseIt(component, this.config2)); + }, this) + }, this); + + App.store.loadMany(this.get('model2'), result); + + result = []; + json.items.forEach(function (item) { + item.components.forEach(function (component) { + component.host_components.forEach(function (host_component) { + result.push(this.parseIt(host_component, this.config3)); + }, this) + }, this) + }, this); + App.store.loadMany(this.get('model3'), result); + } }, - update: function(service){ - switch(service.ServiceInfo.service_name){ + update: function (service) { + var finalJson; + switch (service.ServiceInfo.service_name) { case 'HDFS': - this.hdfsMapper(service); + finalJson = this.hdfsMapper(service); + App.HDFSService.find().map(function (e) { + e.set("version", finalJson.version); + e.set("nameNodeStartTime", finalJson.name_node_start_time); + e.set("jvmMemoryHeapCommitted", finalJson.jvm_memory_heap_committed); + e.set("jvmMemoryHeapUsed", finalJson.jvm_memory_heap_used); + e.set("capacityUsed", finalJson.capacity_used); + e.set("capacityTotal", finalJson.capacity_total); + e.set("dfsTotalBlocks", finalJson.dfs_total_blocks); + e.set("dfsCorruptBlocks", finalJson.dfs_corrupt_blocks); + e.set("dfsMissingBlocks", finalJson.dfs_missing_blocks); + e.set("dfsUnderReplicatedBlocks", finalJson.dfs_under_replicated_blocks); + e.set("dfsTotalFiles", finalJson.dfs_total_files); + e.set("upgradeStatus", finalJson.upgrade_status); + e.set("safeModeStatus", finalJson.safe_mode_status); + }); break; case 'MAPREDUCE': - this.mapreduceMapper(service); + finalJson = this.mapreduceMapper(service); + App.MapReduceService.find().map(function (e) { + e.set("version", finalJson.version); + e.set("jobTrackerStartTime", 1111111); + e.set("jobTrackerHeapUsed", finalJson.job_tracker_heap_used); + e.set("jobTrackerHeapMax", finalJson.job_tracker_heap_max); + e.set("mapSlots", finalJson.map_slots); + e.set("reduceSlots", finalJson.reduce_slots); + e.set("jobsSubmitted", finalJson.jobs_submitted); + e.set("jobsCompleted", finalJson.jobs_completed); + e.set("mapSlotsOccupied", finalJson.map_slots_occupied); + e.set("mapSlotsReserved", finalJson.map_slots_reserved); + e.set("reduceSlotsOccupied", finalJson.reduce_slots_occupied); + e.set("reduceSlotsReserved", finalJson.reduce_slots_reserved); + e.set("mapsRunning", finalJson.maps_running); + e.set("mapsWaiting", finalJson.maps_waiting); + e.set("reducesRunning", finalJson.reduces_running); + e.set("reducesWaiting", finalJson.reduces_waiting); + e.set("trackersDecommisioned", finalJson.trackers_decommisioned); + }) break; case 'HBASE': - this.hbaseMapper(service); + finalJson = this.hbaseMapper(service); + App.HBaseService.find().map(function (e) { + e.set("version", finalJson.version); + e.set("masterStartTime", finalJson.master_start_time); + e.set("masterActiveTime", finalJson.master_active_time); + e.set("averageLoad", finalJson.average_load); + e.set("regionsInTransition", finalJson.regions_in_transition); + e.set("revision", finalJson.revision); + e.set("heapMemoryUsed", finalJson.heap_memory_used); + e.set("heapMemoryMax", finalJson.heap_memory_max); + }) break; default : this.otherMapper(service); } }, - otherMapper:function(item){ - var result=[]; - if(App.Service.find(item.ServiceInfo.service_name).get("serviceName") == item.ServiceInfo.service_name ) - { - return; + otherMapper: function (item) { + var result = []; + if (App.Service.find(item.ServiceInfo.service_name).get("serviceName") == item.ServiceInfo.service_name) { + //update other service } - result.push(this.parseIt(item, this.config)); - App.store.loadMany(App.Service, result); }, - hdfsMapper:function(item){ - var result=[]; + hdfsMapper: function (item) { + var result = []; var finalConfig = jQuery.extend({}, this.config); // Change the JSON so that it is easy to map var hdfsConfig = this.hdfsConfig; @@ -198,26 +304,11 @@ App.servicesMapper = App.QuickDataMapper.create({ var finalJson = this.parseIt(item, finalConfig); finalJson.quick_links = [1, 2, 3, 4]; - - App.HDFSService.find().map(function(e){ - e.set("version",finalJson.version); - e.set("nameNodeStartTime",finalJson.name_node_start_time); - e.set("jvmMemoryHeapCommitted",finalJson.jvm_memory_heap_committed); - e.set("capacityUsed",finalJson.capacity_used); - e.set("capacityTotal",finalJson.capacity_total); - e.set("dfsTotalBlocks",finalJson.dfs_total_blocks); - e.set("dfsCorruptBlocks",finalJson.dfs_corrupt_blocks); - e.set("dfsMissingBlocks",finalJson.dfs_missing_blocks); - e.set("dfsUnderReplicatedBlocks",finalJson.dfs_under_replicated_blocks); - e.set("dfsTotalFiles",finalJson.dfs_total_files); - e.set("upgradeStatus",finalJson.upgrade_status); - e.set("safeModeStatus",finalJson.safe_mode_status); - }) - + return finalJson; }, - mapreduceMapper:function(item){ + mapreduceMapper: function (item) { // Change the JSON so that it is easy to map - var result=[]; + var result = []; var finalConfig = jQuery.extend({}, this.config); var mapReduceConfig = this.mapReduceConfig; item.components.forEach(function (component) { @@ -271,40 +362,11 @@ App.servicesMapper = App.QuickDataMapper.create({ // Map finalJson = this.parseIt(item, finalConfig); finalJson.quick_links = [5, 6, 7, 8, 9, 10, 11, 12]; - - if(App.MapReduceService.find().get("content").length<1) - { - result.push(finalJson); - App.store.load(App.MapReduceService, finalJson); - App.store.loadMany(App.Service, result); - }else - { - App.MapReduceService.find().map(function(e){ - e.set("version",finalJson.version); - e.set("jobTrackerStartTime",finalJson.job_tracker_start_time); - e.set("jobTrackerHeapUsed",finalJson.job_tracker_heap_used); - e.set("jobTrackerHeapMax",finalJson.job_tracker_heap_max); - e.set("mapSlots",finalJson.map_slots); - e.set("reduceSlots",finalJson.reduce_slots); - e.set("jobsSubmitted",finalJson.jobs_submitted); - e.set("jobsCompleted",finalJson.jobs_completed); - e.set("mapSlotsOccupied",finalJson.map_slots_occupied); - e.set("mapSlotsReserved",finalJson.map_slots_reserved); - e.set("reduceSlotsOccupied",finalJson.reduce_slots_occupied); - e.set("reduceSlotsReserved",finalJson.reduce_slots_reserved); - e.set("mapsRunning",finalJson.maps_running); - e.set("mapsWaiting",finalJson.maps_waiting); - e.set("reducesRunning",finalJson.reduces_running); - e.set("reducesWaiting",finalJson.reduces_waiting); - e.set("trackersDecommisioned",finalJson.trackers_decommisioned); - }) - } - - + return finalJson; }, - hbaseMapper:function(item){ + hbaseMapper: function (item) { // Change the JSON so that it is easy to map - var result=[]; + var result = []; var finalConfig = jQuery.extend({}, this.config); var hbaseConfig = this.hbaseConfig; item.components.forEach(function (component) { @@ -328,201 +390,6 @@ App.servicesMapper = App.QuickDataMapper.create({ // Map finalJson = this.parseIt(item, finalConfig); finalJson.quick_links = [13, 14, 15, 16, 17, 18]; - - if(App.HBaseService.find().get("content").length<1) - { - result.push(finalJson); - App.store.load(App.HBaseService, finalJson); - App.store.loadMany(App.Service, result); - }else - { - App.HBaseService.find().map(function(e){ - e.set("version",finalJson.version); - e.set("masterStartTime",finalJson.master_start_time); - e.set("masterActiveTime",finalJson.master_active_time); - e.set("averageLoad",finalJson.average_load); - e.set("regionsInTransition",finalJson.regions_in_transition); - e.set("revision",finalJson.revision); - e.set("heapMemoryUsed",finalJson.heap_memory_used); - e.set("heapMemoryMax",finalJson.heap_memory_max); - }) - } - }, - map:function (json) { - if (!this.get('model')) { - return; - } - - if (json.items) { - var result = []; - json.items.forEach(function (item) { - var finalConfig = jQuery.extend({}, this.config); - item.host_components = []; - if(this.get('model').find(item.ServiceInfo.service_name).get('isLoaded')){ - this.update(item); - return; - } - item.components.forEach(function (component) { - component.host_components.forEach(function (host_component) { - host_component.id = host_component.HostRoles.component_name + "_" + host_component.HostRoles.host_name; - item.host_components.push(host_component.id); - }, this) - }, this); - - if (item && item.ServiceInfo && item.ServiceInfo.service_name == "HDFS") { - // Change the JSON so that it is easy to map - var hdfsConfig = this.hdfsConfig; - item.components.forEach(function (component) { - if (component.ServiceComponentInfo && component.ServiceComponentInfo.component_name == "NAMENODE") { - item.nameNodeComponent = component; - finalConfig = jQuery.extend(finalConfig, hdfsConfig); - // Get the live, dead & decommision nodes from string json - var liveNodesJson = App.parseJSON(component.ServiceComponentInfo.LiveNodes); - var deadNodesJson = App.parseJSON(component.ServiceComponentInfo.DeadNodes); - var decommisionNodesJson = App.parseJSON(component.ServiceComponentInfo.DecomNodes); - item.live_data_nodes = []; - item.dead_data_nodes = []; - item.decommision_data_nodes = []; - for (var ln in liveNodesJson) { - item.live_data_nodes.push(ln); - } - for (var dn in deadNodesJson) { - item.dead_data_nodes.push(dn); - } - for (var dcn in decommisionNodesJson) { - item.decommision_data_nodes.push(dcn); - } - } - if (component.ServiceComponentInfo && component.ServiceComponentInfo.component_name == "SECONDARY_NAMENODE") { - item.snameNodeComponent = component; - } - if (component.ServiceComponentInfo && component.ServiceComponentInfo.component_name == "DATANODE") { - if (!item.data_nodes) { - item.data_nodes = []; - } - if (component.host_components) { - component.host_components.forEach(function (hc) { - item.data_nodes.push(hc.HostRoles.host_name); - }); - } - } - }); - // Map - var finalJson = this.parseIt(item, finalConfig); - finalJson.quick_links = [1, 2, 3, 4]; - result.push(finalJson); - App.store.load(App.HDFSService, finalJson); - } else if (item && item.ServiceInfo && item.ServiceInfo.service_name == "MAPREDUCE") { - // Change the JSON so that it is easy to map - var mapReduceConfig = this.mapReduceConfig; - item.components.forEach(function (component) { - if (component.ServiceComponentInfo && component.ServiceComponentInfo.component_name == "JOBTRACKER") { - item.jobTrackerComponent = component; - finalConfig = jQuery.extend(finalConfig, mapReduceConfig); - // Get the live, gray & black nodes from string json - item.map_slots = 0; - item.reduce_slots = 0; - var liveNodesJson = App.parseJSON(component.ServiceComponentInfo.AliveNodes); - var grayNodesJson = App.parseJSON(component.ServiceComponentInfo.GrayListedNodes); - var blackNodesJson = App.parseJSON(component.ServiceComponentInfo.BlackListedNodes); - item.alive_trackers = []; - item.gray_list_trackers = []; - item.black_list_trackers = []; - if (liveNodesJson != null) { - liveNodesJson.forEach(function (nj) { - item.alive_trackers.push(nj.hostname); - if (nj.slots && nj.slots.map_slots) - item.map_slots += nj.slots.map_slots; - if (nj.slots && nj.slots.map_slots_used) - item.map_slots_used += nj.slots.map_slots_used; - if (nj.slots && nj.slots.reduce_slots) - item.reduce_slots += nj.slots.reduce_slots; - if (nj.slots && nj.slots.reduce_slots_used) - item.reduce_slots_used += nj.slots.reduce_slots_used; - }); - } - if (grayNodesJson != null) { - grayNodesJson.forEach(function (nj) { - item.gray_list_trackers.push(nj.hostname); - }); - } - if (blackNodesJson != null) { - blackNodesJson.forEach(function (nj) { - item.black_list_trackers.push(nj.hostname); - }); - } - } - if (component.ServiceComponentInfo && component.ServiceComponentInfo.component_name == "TASKTRACKER") { - if (!item.task_trackers) { - item.task_trackers = []; - } - if (component.host_components) { - component.host_components.forEach(function (hc) { - item.task_trackers.push(hc.HostRoles.host_name); - }); - } - } - }); - // Map - finalJson = this.parseIt(item, finalConfig); - finalJson.quick_links = [5, 6, 7, 8, 9, 10, 11, 12]; - result.push(finalJson); - App.store.load(App.MapReduceService, finalJson); - } else if (item && item.ServiceInfo && item.ServiceInfo.service_name == "HBASE") { - // Change the JSON so that it is easy to map - var hbaseConfig = this.hbaseConfig; - item.components.forEach(function (component) { - if (component.ServiceComponentInfo && component.ServiceComponentInfo.component_name == "HBASE_MASTER") { - item.masterComponent = component; - finalConfig = jQuery.extend(finalConfig, hbaseConfig); - var regionsArray = App.parseJSON(component.ServiceComponentInfo.RegionsInTransition); - item.regions_in_transition = regionsArray == null ? 0 : regionsArray.length; - } - if (component.ServiceComponentInfo && component.ServiceComponentInfo.component_name == "HBASE_REGIONSERVER") { - if (!item.region_servers) { - item.region_servers = []; - } - if (component.host_components) { - component.host_components.forEach(function (hc) { - item.region_servers.push(hc.HostRoles.host_name); - }); - } - } - }); - // Map - finalJson = this.parseIt(item, finalConfig); - finalJson.quick_links = [13, 14, 15, 16, 17, 18]; - result.push(finalJson); - App.store.load(App.HBaseService, finalJson); - } else { - result.push(this.parseIt(item, this.config)); - } - }, this); - - - - - result = this.sortByOrder(this.get('servicesSortOrder'), result); - App.store.loadMany(this.get('model'), result); - - result = []; - json.items.forEach(function (item) { - item.components.forEach(function (component) { - result.push(this.parseIt(component, this.config2)); - }, this) - }, this); - - App.store.loadMany(this.get('model2'), result); - - result = []; - json.items.forEach(function (item) { - item.components.forEach(function (component) { - component.host_components.forEach(function (host_component) { - result.push(this.parseIt(host_component, this.config3)); - }, this) - }, this) - }, this); - App.store.loadMany(this.get('model3'), result); - } + return finalJson; } });
\ No newline at end of file diff --git a/ambari-web/app/routes/add_host_routes.js b/ambari-web/app/routes/add_host_routes.js index 675f325c38..459ede8731 100644 --- a/ambari-web/app/routes/add_host_routes.js +++ b/ambari-web/app/routes/add_host_routes.js @@ -182,8 +182,12 @@ module.exports = Em.Route.extend({ var addHostController = router.get('addHostController'); var wizardStep9Controller = router.get('wizardStep9Controller'); if (!wizardStep9Controller.get('isSubmitDisabled')) { + if (wizardStep9Controller.get('content.cluster.status') !== 'START FAILED') { addHostController.installServices(); addHostController.setInfoForStep9(); + } else { + wizardStep9Controller.set('content.cluster.isCompleted', false); + } wizardStep9Controller.navigateStep(); } }, @@ -219,7 +223,7 @@ module.exports = Em.Route.extend({ }), backToHostsList: function (router, event) { - router.transitionTo('hosts'); + router.transitionTo('hosts.index'); }, gotoStep1: Em.Router.transitionTo('step1'), diff --git a/ambari-web/app/routes/add_service_routes.js b/ambari-web/app/routes/add_service_routes.js index 0c036f3890..c47d56d42f 100644 --- a/ambari-web/app/routes/add_service_routes.js +++ b/ambari-web/app/routes/add_service_routes.js @@ -183,8 +183,12 @@ module.exports = Em.Route.extend({ var addServiceController = router.get('addServiceController'); var wizardStep9Controller = router.get('wizardStep9Controller'); if (!wizardStep9Controller.get('isSubmitDisabled')) { + if (wizardStep9Controller.get('content.cluster.status') !== 'START FAILED') { addServiceController.installServices(true); addServiceController.setInfoForStep9(); + } else { + wizardStep9Controller.set('content.cluster.isCompleted', false); + } wizardStep9Controller.navigateStep(); } }, diff --git a/ambari-web/app/routes/installer.js b/ambari-web/app/routes/installer.js index 53960e6487..63a20a06cd 100644 --- a/ambari-web/app/routes/installer.js +++ b/ambari-web/app/routes/installer.js @@ -275,8 +275,12 @@ module.exports = Em.Route.extend({ var installerController = router.get('installerController'); var wizardStep9Controller = router.get('wizardStep9Controller'); if (!wizardStep9Controller.get('isSubmitDisabled')) { + if (wizardStep9Controller.get('content.cluster.status') !== 'START FAILED') { installerController.installServices(true); installerController.setInfoForStep9(); + } else { + wizardStep9Controller.set('content.cluster.isCompleted', false); + } wizardStep9Controller.navigateStep(); } }, diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js index 37cef14951..6622ba4219 100644 --- a/ambari-web/app/routes/main.js +++ b/ambari-web/app/routes/main.js @@ -92,67 +92,70 @@ module.exports = Em.Route.extend({ hosts:Em.Route.extend({ route:'/hosts', - connectOutlets:function (router, context) { - router.get('mainController').connectOutlet('mainHost'); - }, + index:Ember.Route.extend({ + route:'/', + connectOutlets:function (router, context) { + router.get('mainController').connectOutlet('mainHost'); + } + }), - showDetails:function (router, event) { - router.get('mainHostDetailsController').setBack(true); - router.transitionTo('hostDetails.summary', event.context) - }, + hostDetails:Em.Route.extend({ + route:'/:host_id', + connectOutlets:function (router, host) { + router.get('mainController').connectOutlet('mainHostDetails', host); + }, - addHost:function (router) { - router.transitionTo('hostAdd'); - } + index:Ember.Route.extend({ + route:'/', + redirectsTo:'summary' + }), - }), + summary:Em.Route.extend({ + route:'/summary', + connectOutlets:function (router, context) { + router.get('mainHostDetailsController').connectOutlet('mainHostSummary'); + } + }), - hostAdd:require('routes/add_host_routes'), + metrics:Em.Route.extend({ + route:'/metrics', + connectOutlets:function (router, context) { + router.get('mainHostDetailsController').connectOutlet('mainHostMetrics'); + } + }), - hostDetails:Em.Route.extend({ - route:'/hosts/:host_id', - connectOutlets:function (router, host) { - router.get('mainController').connectOutlet('mainHostDetails', host); - }, + audit:Em.Route.extend({ + route:'/audit', + connectOutlets:function (router, context) { + router.get('mainHostDetailsController').connectOutlet('mainHostAudit'); + } + }), - index:Ember.Route.extend({ - route:'/', - redirectsTo:'summary' + hostNavigate:function (router, event) { + var parent = event.view._parentView; + parent.deactivateChildViews(); + event.view.set('active', "active"); + router.transitionTo(event.context); + } }), backToHostsList:function (router, event) { - router.transitionTo('hosts'); + router.transitionTo('hosts.index'); }, - summary:Em.Route.extend({ - route:'/summary', - connectOutlets:function (router, context) { - router.get('mainHostDetailsController').connectOutlet('mainHostSummary'); - } - }), - - metrics:Em.Route.extend({ - route:'/metrics', - connectOutlets:function (router, context) { - router.get('mainHostDetailsController').connectOutlet('mainHostMetrics'); - } - }), - - audit:Em.Route.extend({ - route:'/audit', - connectOutlets:function (router, context) { - router.get('mainHostDetailsController').connectOutlet('mainHostAudit'); - } - }), + showDetails:function (router, event) { + router.get('mainHostDetailsController').setBack(true); + router.transitionTo('hostDetails.summary', event.context) + }, - hostNavigate:function (router, event) { - var parent = event.view._parentView; - parent.deactivateChildViews(); - event.view.set('active', "active"); - router.transitionTo(event.context); + addHost:function (router) { + router.transitionTo('hostAdd'); } + }), + hostAdd:require('routes/add_host_routes'), + admin:Em.Route.extend({ route:'/admin', enter: function(){ diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less index 4cf8c3d254..5c7f7be75b 100644 --- a/ambari-web/app/styles/application.less +++ b/ambari-web/app/styles/application.less @@ -321,6 +321,9 @@ h1 { } .accordion-group { margin-bottom: 20px; + .control-label { + text-align: left; + } .control-group { margin: 10px 0; } @@ -328,6 +331,16 @@ h1 { margin-bottom: 0; } } + .accordion-group.Advanced { + .control-label { + float: none; + text-align: left; + width: auto; + } + .controls { + margin-left: 0; + } + } .badge { margin-left: 4px; } diff --git a/ambari-web/app/templates/main/service/info/configs.hbs b/ambari-web/app/templates/main/service/info/configs.hbs index eb52de46b9..d1ee8e35a0 100644 --- a/ambari-web/app/templates/main/service/info/configs.hbs +++ b/ambari-web/app/templates/main/service/info/configs.hbs @@ -138,19 +138,11 @@ {{#each category in selectedService.configCategories}} <div class="accordion-group"> - {{#if category.isAdvanced}} <div class="accordion-heading"> <a class="accordion-toggle" {{action "onToggleBlock" category.name target="view"}}> {{category.name}} </a> </div> - {{else}} - <div class="accordion-heading"> - <a class="accordion-toggle"> - {{category.name}} - </a> - </div> - {{/if}} {{#unless category.isForSlaveComponent}} {{#view App.ServiceConfigsByCategoryView categoryBinding="category" serviceConfigsBinding="selectedService.configs"}} diff --git a/ambari-web/app/templates/main/service/menu_item.hbs b/ambari-web/app/templates/main/service/menu_item.hbs index aeee6a24be..cc5a03b6dc 100644 --- a/ambari-web/app/templates/main/service/menu_item.hbs +++ b/ambari-web/app/templates/main/service/menu_item.hbs @@ -17,10 +17,9 @@ }} <a href="#/main/services/{{unbound view.content.id}}/summary"> - {{#if view.content.isClients}} - {{else}} + {{#unless view.content.isClients}} {{view App.MainDashboardServiceHealthView class="service-health" serviceBinding="view.content"}} - {{/if}} + {{/unless}} <span>{{unbound view.content.displayName}}</span> {{#if view.alertsCount}} <span class="label operations-count"> diff --git a/ambari-web/app/templates/wizard/step7.hbs b/ambari-web/app/templates/wizard/step7.hbs index 82d62f3137..d47d645251 100644 --- a/ambari-web/app/templates/wizard/step7.hbs +++ b/ambari-web/app/templates/wizard/step7.hbs @@ -36,8 +36,8 @@ <div class="accordion"> {{#each category in selectedService.configCategories}} - <div class="accordion-group"> - <div class="accordion-heading"> + <div class="accordion-group {{unbound category.name}}"> + <div class="accordion-heading" {{action "onToggleBlock" category.name target="view"}}> <a class="accordion-toggle"> {{category.name}} </a> diff --git a/ambari-web/app/views/common/chart/linear_time.js b/ambari-web/app/views/common/chart/linear_time.js index 69cede611f..317664e597 100644 --- a/ambari-web/app/views/common/chart/linear_time.js +++ b/ambari-web/app/views/common/chart/linear_time.js @@ -247,7 +247,20 @@ App.ChartLinearTimeView = Ember.View.extend({ _refreshGraph: function (jsonData) { var seriesData = this.transformToSeries(jsonData); if (seriesData instanceof Array && seriesData.length>0) { - this.draw(seriesData); + //if graph opened as modal popup + var popup_path = $(".modal-graph-line .modal-body #" + this.id + "-container" + this.get('popupSuffix')); + if(popup_path.length) { + popup_path.children().each(function () { + $(this).children().remove(); + }); + this.set('isPopup', true); + } + else { + $("#" + this.id + "-container").children().each(function (index, value) { + $(value).children().remove(); + }); + } + this.draw(seriesData); } else { this._showMessage('info', 'No Data', 'There was no data available.'); diff --git a/ambari-web/app/views/main/charts/heatmap.js b/ambari-web/app/views/main/charts/heatmap.js index 69532c845c..eea87092ad 100644 --- a/ambari-web/app/views/main/charts/heatmap.js +++ b/ambari-web/app/views/main/charts/heatmap.js @@ -22,6 +22,8 @@ App.MainChartsHeatmapView = Em.View.extend({ templateName: require('templates/main/charts/heatmap'), didInsertElement: function(){ this._super(); + // set default metric + this.set('controller.selectedMetric', this.get('controller.allMetrics')[0].get('items')[0]); $("#heatmapDetailsBlock").hide(); } });
\ No newline at end of file diff --git a/ambari-web/app/views/main/dashboard.js b/ambari-web/app/views/main/dashboard.js index 7ecddea01f..45055ea958 100644 --- a/ambari-web/app/views/main/dashboard.js +++ b/ambari-web/app/views/main/dashboard.js @@ -24,11 +24,30 @@ App.MainDashboardView = Em.View.extend({ this.services(); }, content:[], - services:function () { + updateServices: function(){ + var services = App.Service.find(); + services.forEach(function (item) { + var view; + switch (item.get('serviceName')) { + case "HDFS": + view = this.get('content').filterProperty('viewName', App.MainDashboardServiceHdfsView); + view.objectAt(0).set('model', App.HDFSService.find(item.get('id'))); + break; + case "MAPREDUCE": + view = this.get('content').filterProperty('viewName', App.MainDashboardServiceMapreduceView); + view.objectAt(0).set('model', App.MapReduceService.find(item.get('id'))); + break; + case "HBASE": + view = this.get('content').filterProperty('viewName', App.MainDashboardServiceHbaseView); + view.objectAt(0).set('model', App.HBaseService.find(item.get('id'))); + } + }, this); + }.observes('App.router.updateController.isUpdate'), + services: function () { + var services = App.Service.find(); if (this.get('content').length > 0) { - return false; + return false } - var services = App.Service.find(); services.forEach(function (item) { var vName; var item2; @@ -57,14 +76,13 @@ App.MainDashboardView = Em.View.extend({ default: vName = Em.View; } - this.get('content').pushObject({ - viewName:vName, - model:item2 || item - }) + this.get('content').pushObject(Em.Object.create({ + viewName: vName, + model: item2 + })) }, this); + }, - }.observes('App.router.updateController.isUpdated'), - gangliaUrl: function () { return App.router.get('clusterController.gangliaUrl') + "/?r=hour&cs=&ce=&m=&s=by+name&c=HDPSlaves&tab=m&vn="; }.property('App.router.clusterController.gangliaUrl') diff --git a/ambari-web/app/views/main/dashboard/service/hbase.js b/ambari-web/app/views/main/dashboard/service/hbase.js index 9a2ff3fa3b..b4a313702a 100644 --- a/ambari-web/app/views/main/dashboard/service/hbase.js +++ b/ambari-web/app/views/main/dashboard/service/hbase.js @@ -28,11 +28,11 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({ var heapString = heapUsed>0 ? heapUsed.bytesToSize(1, "parseFloat") : 0; var heapMaxString = heapMax>0 ? heapMax.bytesToSize(1, "parseFloat") : 0; return this.t('dashboard.services.hbase.masterServerHeap.summary').format(heapString, heapMaxString, percent.toFixed(1)); - }.property('service'), + }.property('service.heapMemoryUsed', 'service.heapMemoryMax'), summaryHeader: function () { return this.t("dashboard.services.hbase.summary").format(this.get('service.regionServers.length'), this.get('service.averageLoad')); - }.property('service'), + }.property('service.regionServers', 'service.averageLoad'), hbaseMasterWebUrl: function () { return "http://" + this.get('service').get('master').get('publicHostName') + ":60010"; @@ -40,19 +40,19 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({ averageLoad: function () { return this.t('dashboard.services.hbase.averageLoadPerServer').format(this.get('service.averageLoad')); - }.property("service"), + }.property("service.averageLoad"), masterStartedTime: function () { var uptime = this.get('service').get('masterStartTime'); var formatted = (new Date().getTime() - uptime).toDaysHoursMinutes(); return this.t('dashboard.services.uptime').format(formatted.d, formatted.h, formatted.m); - }.property("service"), + }.property("service.masterStartTime"), masterActivatedTime: function () { var uptime = this.get('service').get('masterActiveTime'); var formatted = (new Date().getTime() - uptime).toDaysHoursMinutes(); return this.t('dashboard.services.uptime').format(formatted.d, formatted.h, formatted.m); - }.property("service"), + }.property("service.masterActiveTime"), regionServerComponent: function () { return App.Component.find().findProperty('componentName', 'HBASE_REGIONSERVER'); diff --git a/ambari-web/app/views/main/dashboard/service/hdfs.js b/ambari-web/app/views/main/dashboard/service/hdfs.js index 518aade85c..a9a2d053a6 100644 --- a/ambari-web/app/views/main/dashboard/service/hdfs.js +++ b/ambari-web/app/views/main/dashboard/service/hdfs.js @@ -21,12 +21,11 @@ var App = require('app'); App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({ templateName:require('templates/main/dashboard/service/hdfs'), serviceName:'HDFS', - Chart:App.ChartPieView.extend({ service: null, data:function () { return [ this.get('service.capacityUsed'), this.get('service.capacityTotal') ]; - }.property('service') + }.property('service.capacityUsed', 'service.capacityTotal') }), nodeUptime:function () { @@ -48,7 +47,7 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({ memCommitted.bytesToSize(1, 'parseFloat'), percent.toFixed(1)); - }.property('service'), + }.property('service.jvmMemoryHeapUsed', 'service.jvmMemoryHeapCommitted'), summaryHeader:function () { var text = this.t("dashboard.services.hdfs.summary"); @@ -58,16 +57,23 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({ var total = svc.get('capacityTotal') + 0; var used = svc.get('capacityUsed') + 0; var percentRemaining = (100-Math.round((used*100)/total)).toFixed(1); + if(percentRemaining == "NaN") + { + percentRemaining = "n/a "; + } return text.format(liveCount, totalCount, percentRemaining); - }.property('service'), + }.property('service.liveDataNodes', 'service.dataNodes', 'service.capacityUsed', 'service.capacityTotal'), capacity:function () { var text = this.t("dashboard.services.hdfs.capacityUsed"); var total = this.get('service').get('capacityTotal') + 0; var used = this.get('service').get('capacityUsed') + 0; var percent = Math.round((used*100)/total).toFixed(1); + if(percent == "NaN"){ + percent = "n/a "; + } return text.format(used.bytesToSize(1), total.bytesToSize(1), percent); - }.property('service'), + }.property('service.capacityUsed', 'service.capacityTotal'), dataNodeComponent: function(){ return App.Component.find().findProperty('componentName', 'DATANODE'); diff --git a/ambari-web/app/views/main/dashboard/service/mapreduce.js b/ambari-web/app/views/main/dashboard/service/mapreduce.js index 9b35edb411..42f0c348ff 100644 --- a/ambari-web/app/views/main/dashboard/service/mapreduce.js +++ b/ambari-web/app/views/main/dashboard/service/mapreduce.js @@ -44,7 +44,7 @@ App.MainDashboardServiceMapreduceView = App.MainDashboardServiceView.extend({ var waitingCount = svc.get('mapsWaiting') + svc.get('reducesWaiting'); var template = this.t('dashboard.services.mapreduce.summary'); return template.format(liveCount, allCount, runningCount, waitingCount); - }.property('service'), + }.property('service.aliveTrackers', 'service.taskTrackers','service.mapsRunning', 'service.mapsWaiting', 'service.reducesRunning', 'service.reducesWaiting'), trackersSummary: function () { var svc = this.get('service'); @@ -52,52 +52,56 @@ App.MainDashboardServiceMapreduceView = App.MainDashboardServiceView.extend({ var totalCount = svc.get('taskTrackers').get('length'); var template = this.t('dashboard.services.mapreduce.trackersSummary'); return template.format(liveCount, totalCount); - }.property('service'), + }.property('service.aliveTrackers', 'service.taskTrackers'), trackersHeapSummary: function () { var heapUsed = this.get('service').get('jobTrackerHeapUsed') || 90; var heapMax = this.get('service').get('jobTrackerHeapMax') || 90; var percent = heapMax > 0 ? 100 * heapUsed / heapMax : 0; return this.t('dashboard.services.mapreduce.jobTrackerHeapSummary').format(heapUsed.bytesToSize(1, "parseFloat"), heapMax.bytesToSize(1, "parseFloat"), percent.toFixed(1)); - }.property('service'), + }.property('service.jobTrackerHeapUsed', 'service.jobTrackerHeapMax'), jobsSummary: function () { var svc = this.get('service'); var template = this.t('dashboard.services.mapreduce.jobsSummary'); return template.format(svc.get('jobsSubmitted'), svc.get('jobsCompleted')); - }.property('service'), + }.property('service.jobsSubmitted', 'service.jobsCompleted'), mapSlotsSummary: function () { var svc = this.get('service'); var template = this.t('dashboard.services.mapreduce.mapSlotsSummary'); return template.format(svc.get('mapSlotsOccupied'), svc.get('mapSlotsReserved')); - }.property('service'), + }.property('service.mapSlotsOccupied', 'service.mapSlotsReserved'), reduceSlotsSummary: function () { var svc = this.get('service'); var template = this.t('dashboard.services.mapreduce.reduceSlotsSummary'); return template.format(svc.get('reduceSlotsOccupied'), svc.get('reduceSlotsReserved')); - }.property('service'), + }.property('service.reduceSlotsOccupied', 'service.reduceSlotsReserved'), mapTasksSummary: function () { var svc = this.get('service'); var template = this.t('dashboard.services.mapreduce.tasksSummary'); return template.format(svc.get('mapsRunning'), svc.get('mapsWaiting')); - }.property('service'), + }.property('service.mapsRunning', 'service.mapsWaiting'), reduceTasksSummary: function () { var svc = this.get('service'); var template = this.t('dashboard.services.mapreduce.tasksSummary'); return template.format(svc.get('reducesRunning'), svc.get('reducesWaiting')); - }.property('service'), + }.property('service.reducesRunning', 'service.reducesWaiting'), slotsCapacitySummary: function () { var mapSlots = this.get('service').get('mapSlots'); var reduceSlots = this.get('service').get('reduceSlots'); var liveNodeCount = this.get('service').get('aliveTrackers').get('length'); - var avg = (mapSlots + reduceSlots) / liveNodeCount; + if(liveNodeCount != 0){ + var avg = (mapSlots + reduceSlots) / liveNodeCount; + }else{ + avg = "n/a "; + } return this.t('dashboard.services.mapreduce.slotCapacitySummary').format(mapSlots, reduceSlots, avg); - }.property('service'), + }.property('service.mapSlots', 'service.reduceSlots', 'service.aliveTrackers'), taskTrackerComponent: function () { return App.Component.find().findProperty('componentName', 'TASKTRACKER'); diff --git a/ambari-web/app/views/main/service/info/configs.js b/ambari-web/app/views/main/service/info/configs.js index 6c935ede6c..f939e81c09 100644 --- a/ambari-web/app/views/main/service/info/configs.js +++ b/ambari-web/app/views/main/service/info/configs.js @@ -23,8 +23,6 @@ App.MainServiceInfoConfigsView = Em.View.extend({ 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); diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js index 9c4bc5d4ea..8ec29a0353 100644 --- a/ambari-web/app/views/main/service/info/summary.js +++ b/ambari-web/app/views/main/service/info/summary.js @@ -201,7 +201,9 @@ App.MainServiceInfoSummaryView = Em.View.extend({ var components = this.get('clientComponents'); var names = []; components.forEach(function (component) { - names.push(component.get('displayName')); + if (names.indexOf(component.get('displayName')) == -1) { + names.push(component.get('displayName')); + } }); return names.length ? names.join(', ') : false; diff --git a/ambari-web/app/views/main/service/menu.js b/ambari-web/app/views/main/service/menu.js index 56c1c42b7c..9c75b5582f 100644 --- a/ambari-web/app/views/main/service/menu.js +++ b/ambari-web/app/views/main/service/menu.js @@ -20,14 +20,11 @@ var App = require('app'); App.MainServiceMenuView = Em.CollectionView.extend({ content:function () { - var items = App.router.get('mainServiceController.content').toArray(); - - var itemsToRemove = ['PIG', 'SQOOP']; - - items.forEach(function (item) { - if (itemsToRemove.indexOf(item.get('serviceName')) != -1) { - items.removeObject(item); + var items = App.router.get('mainServiceController.content').filter(function(item){ + if(['PIG', 'SQOOP'].contains(item.get('id'))){ + return false; } + return true; }); items.push(App.router.get('mainServiceController.additionalMenuItem')); diff --git a/ambari-web/app/views/wizard/step7_view.js b/ambari-web/app/views/wizard/step7_view.js index 7c6a3e1044..e02b3ade44 100644 --- a/ambari-web/app/views/wizard/step7_view.js +++ b/ambari-web/app/views/wizard/step7_view.js @@ -26,6 +26,9 @@ App.WizardStep7View = Em.View.extend({ didInsertElement: function () { var controller = this.get('controller'); controller.loadStep(); + }, + onToggleBlock: function(event){ + $("#" + event.context).toggle('blind', 500); } }); @@ -46,8 +49,10 @@ App.WizardStep7.ServiceConfigsByCategoryView = Ember.View.extend({ 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>') }); App.WizardStep7.ServiceConfigTab = Ember.View.extend({ |