Updated Branches: refs/heads/trunk 263592518 -> 6a0da9632
AMBARI-2600. Add Quick Links (Web UI) for Oozie, Hue, Nagios, Ganglia. (Antonenko Alexander via yusaku) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/6a0da963 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/6a0da963 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/6a0da963 Branch: refs/heads/trunk Commit: 6a0da9632c99f99b1b4d594ebc0dfafe7d448e43 Parents: 2635925 Author: Yusaku Sako <[email protected]> Authored: Tue Jul 9 15:09:59 2013 -0700 Committer: Yusaku Sako <[email protected]> Committed: Tue Jul 9 15:09:59 2013 -0700 ---------------------------------------------------------------------- ambari-web/app/mappers/service_mapper.js | 72 ++++++++++++-------- ambari-web/app/messages.js | 1 - ambari-web/app/models/quick_links.js | 24 +++++++ .../templates/main/dashboard/service/oozie.hbs | 2 +- .../app/views/common/quick_view_link_view.js | 44 +++++++----- .../app/views/main/service/info/summary.js | 26 ------- 6 files changed, 95 insertions(+), 74 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6a0da963/ambari-web/app/mappers/service_mapper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mappers/service_mapper.js b/ambari-web/app/mappers/service_mapper.js index a459697..79c73af 100644 --- a/ambari-web/app/mappers/service_mapper.js +++ b/ambari-web/app/mappers/service_mapper.js @@ -160,37 +160,32 @@ App.servicesMapper = App.QuickDataMapper.create({ finalJson.rand = Math.random(); result.push(finalJson); App.store.load(App.HDFSService, finalJson); - } - else - if (item && item.ServiceInfo && item.ServiceInfo.service_name == "MAPREDUCE") { - finalJson = this.mapreduceMapper(item); - finalJson.rand = Math.random(); - result.push(finalJson); - App.store.load(App.MapReduceService, finalJson); + }else if (item && item.ServiceInfo && item.ServiceInfo.service_name == "MAPREDUCE") { + finalJson = this.mapreduceMapper(item); + finalJson.rand = Math.random(); + result.push(finalJson); + App.store.load(App.MapReduceService, finalJson); + }else if (item && item.ServiceInfo && item.ServiceInfo.service_name == "HBASE") { + finalJson = this.hbaseMapper(item); + finalJson.rand = Math.random(); + result.push(finalJson); + App.store.load(App.HBaseService, finalJson); + }else if (item && item.ServiceInfo && item.ServiceInfo.service_name == "FLUME") { + finalJson = this.flumeMapper(item); + finalJson.rand = Math.random(); + result.push(finalJson); + if(finalJson.nodeObjs){ + finalJson.nodeObjs.forEach(function(no){ + App.store.load(App.FlumeNode, no); + }); } - else - if (item && item.ServiceInfo && item.ServiceInfo.service_name == "HBASE") { - finalJson = this.hbaseMapper(item); - finalJson.rand = Math.random(); - result.push(finalJson); - App.store.load(App.HBaseService, finalJson); - } else - if (item && item.ServiceInfo && item.ServiceInfo.service_name == "FLUME") { - finalJson = this.flumeMapper(item); - finalJson.rand = Math.random(); - result.push(finalJson); - if(finalJson.nodeObjs){ - finalJson.nodeObjs.forEach(function(no){ - App.store.load(App.FlumeNode, no); - }); - } - App.store.load(App.FlumeService, finalJson); - } - else { - finalJson = this.parseIt(item, this.config); - finalJson.rand = Math.random(); - result.push(finalJson); - } + App.store.load(App.FlumeService, finalJson); + }else { + finalJson = this.parseIt(item, this.config); + finalJson.rand = Math.random(); + this.mapQuickLinks(finalJson, item); + result.push(finalJson); + } }, this); @@ -260,6 +255,23 @@ App.servicesMapper = App.QuickDataMapper.create({ console.log('out service mapper. Took ' + (new Date().getTime() - start) + 'ms'); }, + /** + * Map quick links to services:OOZIE,GANGLIA,NAGIOS,HUE + * @param finalJson + * @param item + */ + mapQuickLinks: function (finalJson, item){ + if(item && item.ServiceInfo && item.ServiceInfo.service_name == "OOZIE"){ + finalJson.quick_links = [19]; + }else if(item && item.ServiceInfo && item.ServiceInfo.service_name == "GANGLIA"){ + finalJson.quick_links = [20]; + }else if(item && item.ServiceInfo && item.ServiceInfo.service_name == "NAGIOS"){ + finalJson.quick_links = [21]; + }else if(item && item.ServiceInfo && item.ServiceInfo.service_name == "HUE"){ + finalJson.quick_links = [22]; + } + }, + hdfsMapper: function (item) { var finalConfig = jQuery.extend({}, this.config); // Change the JSON so that it is easy to map http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6a0da963/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 1dc3bda..cec7d8e 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -1170,7 +1170,6 @@ Em.I18n.translations = { 'dashboard.services.hive.clients':'Hive Clients', 'dashboard.services.hive.client':'Hive Client', - 'dashboard.services.oozie.webUi':'Oozie Web UI', 'dashboard.services.oozie.clients':'Oozie Clients', 'dashboard.services.oozie.client':'Oozie Client', http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6a0da963/ambari-web/app/models/quick_links.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/quick_links.js b/ambari-web/app/models/quick_links.js index 745e9be..04b33da 100644 --- a/ambari-web/app/models/quick_links.js +++ b/ambari-web/app/models/quick_links.js @@ -132,5 +132,29 @@ App.QuickLinks.FIXTURES = [ label:'Thread Stacks', url:'http://%@:60010/stacks', service_id: 'HBASE' + }, + { + id:19, + label:'Oozie Web UI', + url:'http://%@:11000/oozie', + service_id: 'OOZIE' + }, + { + id:20, + label:'Ganglia Web UI', + url:'http://%@/ganglia', + service_id: 'GANGLIA' + }, + { + id:21, + label:'Nagios Web UI', + url:'http://%@/nagios', + service_id: 'NAGIOS' + }, + { + id:22, + label:'Hue Web UI', + url:'http://%@/hue', + service_id: 'HUE' } ]; http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6a0da963/ambari-web/app/templates/main/dashboard/service/oozie.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/dashboard/service/oozie.hbs b/ambari-web/app/templates/main/dashboard/service/oozie.hbs index e0db00b..c0b3716 100644 --- a/ambari-web/app/templates/main/dashboard/service/oozie.hbs +++ b/ambari-web/app/templates/main/dashboard/service/oozie.hbs @@ -34,7 +34,7 @@ <a href="#" {{action filterHosts view.clients.component}}>{{view.clients.title}}</a>, - <a href="{{unbound view.webUi}}" target="_blank">{{t dashboard.services.oozie.webUi}}</a> + <a href="{{unbound view.webUi}}" target="_blank">{{t services.oozie.webUi}}</a> </div> </div> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6a0da963/ambari-web/app/views/common/quick_view_link_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js index bd4d818..7c14cdf 100644 --- a/ambari-web/app/views/common/quick_view_link_view.js +++ b/ambari-web/app/views/common/quick_view_link_view.js @@ -28,24 +28,32 @@ App.QuickViewLinks = Em.View.extend({ var components = this.get('content.hostComponents'); var host; - if (serviceName === 'HDFS') { - host = App.singleNodeInstall ? App.singleNodeAlias : components.findProperty('componentName', 'NAMENODE').get('host.publicHostName'); - } else if (serviceName === 'MAPREDUCE') { - host = App.singleNodeInstall ? App.singleNodeAlias : components.findProperty('componentName', 'JOBTRACKER').get('host.publicHostName'); - } else if (serviceName === 'HBASE') { - var component; - if (App.supports.multipleHBaseMasters) { - component = components.filterProperty('componentName', 'HBASE_MASTER').findProperty('haStatus', 'active'); - } else { - component = components.findProperty('componentName', 'HBASE_MASTER'); - } - if (component) { - if (App.singleNodeInstall) { - host = App.singleNodeAlias; + switch (serviceName) { + case "HDFS": + host = App.singleNodeInstall ? App.singleNodeAlias : components.findProperty('componentName', 'NAMENODE').get('host.publicHostName'); + break; + case "MAPREDUCE": + case "OOZIE": + case "GANGLIA": + case "NAGIOS": + case "HUE": + host = App.singleNodeInstall ? App.singleNodeAlias : components.findProperty('isMaster', true).get("host").get("publicHostName"); + break; + case "HBASE": + var component; + if (App.supports.multipleHBaseMasters) { + component = components.filterProperty('componentName', 'HBASE_MASTER').findProperty('haStatus', 'active'); } else { - host = component.get('host.publicHostName'); + component = components.findProperty('componentName', 'HBASE_MASTER'); } - } + if (component) { + if (App.singleNodeInstall) { + host = App.singleNodeAlias; + } else { + host = component.get('host.publicHostName'); + } + } + break; } if (!host) { return [ @@ -68,6 +76,10 @@ App.QuickViewLinks = Em.View.extend({ case "hdfs": case "mapreduce": case "hbase": + case "oozie": + case "ganglia": + case "nagios": + case "hue": return "_blank"; break; default: http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6a0da963/ambari-web/app/views/main/service/info/summary.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js index 19494a2..2645cfc 100644 --- a/ambari-web/app/views/main/service/info/summary.js +++ b/ambari-web/app/views/main/service/info/summary.js @@ -205,32 +205,6 @@ App.MainServiceInfoSummaryView = Em.View.extend({ "user":"hive" } }, - /** - * Get public host name (should be Master) for service - * @param {String} serviceName - GANGLIA, NAGIOS etc - * @return {*} - */ - getServer: function(serviceName) { - var service=this.get('controller.content'); - if(service.get("id") == serviceName) { - return (App.singleNodeInstall ? App.singleNodeAlias : service.get("hostComponents").findProperty('isMaster', true).get("host").get("publicHostName")); - } - else { - return ''; - } - }, - gangliaServer:function() { - return this.getServer("GANGLIA"); - }.property('controller.content'), - nagiosServer:function(){ - return this.getServer("NAGIOS"); - }.property('controller.content'), - oozieServer:function(){ - return this.getServer("OOZIE"); - }.property('controller.content'), - hueServer:function(){ - return this.getServer("HUE"); - }.property('controller.content'), /** * Array of the hostComponents for service
