You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2014/08/28 19:50:04 UTC
[29/45] git commit: Revert "AMBARI-6967. Admin View: default login
behavior (route to Admin View, Cluster Dashboard,
or Views Landing page). (yusaku)"
Revert "AMBARI-6967. Admin View: default login behavior (route to Admin View, Cluster Dashboard, or Views Landing page). (yusaku)"
This reverts commit e1634809f0c4c6a6acfe1b2672b4ddfcaf2d5e92.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/af67390b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/af67390b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/af67390b
Branch: refs/heads/branch-alerts-dev
Commit: af67390b9ca47bd6b34a54638c9f5cc8323017fd
Parents: e163480
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Wed Aug 27 23:56:32 2014 -0700
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Wed Aug 27 23:56:32 2014 -0700
----------------------------------------------------------------------
.../controllers/global/cluster_controller.js | 44 ++++++++++++++++++++
1 file changed, 44 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/af67390b/ambari-web/app/controllers/global/cluster_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js
index bc09b0a..246ad8b 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -347,6 +347,50 @@ App.ClusterController = Em.Controller.extend({
}, callback)
},
+ loadAmbariViews: function () {
+ App.ajax.send({
+ name: 'views.info',
+ sender: this,
+ success: 'loadAmbariViewsSuccess'
+ });
+ },
+
+ loadAmbariViewsSuccess: function (data) {
+ if (data.items.length) {
+ App.ajax.send({
+ name: 'views.instances',
+ sender: this,
+ success: 'loadViewInstancesSuccess'
+ });
+ } else {
+ this.set('ambariViews', []);
+ }
+ },
+
+ loadViewInstancesSuccess: function (data) {
+ this.set('ambariViews', []);
+ var self = this;
+ data.items.forEach(function (view) {
+ view.versions.forEach(function (version) {
+ version.instances.forEach(function (instance) {
+ var current_instance = Em.Object.create({
+ iconPath: instance.ViewInstanceInfo.icon_path || "/img/ambari-view-default.png",
+ label: instance.ViewInstanceInfo.label || version.ViewVersionInfo.label || instance.ViewInstanceInfo.view_name,
+ visible: instance.ViewInstanceInfo.visible || false,
+ version: instance.ViewInstanceInfo.version,
+ description: instance.ViewInstanceInfo.description || Em.I18n.t('views.main.instance.noDescription'),
+ viewName: instance.ViewInstanceInfo.view_name,
+ instanceName: instance.ViewInstanceInfo.instance_name,
+ href: instance.ViewInstanceInfo.context_path
+ });
+ if( current_instance.visible){
+ self.get('ambariViews').pushObject(current_instance);
+ }
+ }, this);
+ }, this);
+ }, this);
+ },
+
/**
*
* @param callback