ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject ambari git commit: AMBARI-8312 Create popup with hosts for stack versions detail page and other functionality for managing hosts. (ababiichuk)
Date Fri, 14 Nov 2014 13:41:51 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 3c7ec34cb -> ef42c32b4


AMBARI-8312 Create popup with hosts for stack versions detail page and other functionality
for managing hosts. (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ef42c32b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ef42c32b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ef42c32b

Branch: refs/heads/trunk
Commit: ef42c32b4431bdb92cf20e9af121692646041bc3
Parents: 3c7ec34
Author: aBabiichuk <ababiichuk@cybervisiontech.com>
Authored: Thu Nov 13 19:22:18 2014 +0200
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
Committed: Fri Nov 14 15:21:33 2014 +0200

----------------------------------------------------------------------
 .../stack_versions/stack_versions_controller.js | 28 ++++++++++++++++++++
 ambari-web/app/controllers/main/host.js         | 21 +++++++++++++++
 ambari-web/app/messages.js                      |  3 +++
 .../stack_versions/stack_version_details.hbs    | 14 +++++++---
 .../admin/stack_versions/stack_versions.hbs     |  8 ++++--
 5 files changed, 69 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ef42c32b/ambari-web/app/controllers/main/admin/stack_versions/stack_versions_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/stack_versions/stack_versions_controller.js
b/ambari-web/app/controllers/main/admin/stack_versions/stack_versions_controller.js
index 7286f58..8cae2e6 100644
--- a/ambari-web/app/controllers/main/admin/stack_versions/stack_versions_controller.js
+++ b/ambari-web/app/controllers/main/admin/stack_versions/stack_versions_controller.js
@@ -58,6 +58,34 @@ App.MainStackVersionsController = Em.ArrayController.extend({
 
   getUrl: function () {
     return App.get('testMode') ? this.get('mockUrl') : this.get('realUrl');
+  },
+
+  filterHostsByStack: function (version, state) {
+    if (!version || !state)
+      return;
+    App.router.get('mainHostController').filterByStack(version, state);
+    App.router.get('mainHostController').set('showFilterConditionsFirstLoad', true);
+    App.router.transitionTo('hosts.index');
+  },
+
+  showHosts: function(event) {
+    var self = this;
+    var status = event.currentTarget.title.toCapital();
+    var version = event.contexts[0];
+    var hosts = event.contexts[1];
+    return App.ModalPopup.show({
+      bodyClass: Ember.View.extend({
+        title: Em.I18n.t('admin.stackVersions.hosts.popup.title').format(version, status,
hosts.length),
+        template: Em.Handlebars.compile('<h4>{{view.title}}</h4><span class="limited-height-2">'+
hosts.join('<br/>') + '</span>')
+      }),
+      header: Em.I18n.t('admin.stackVersions.hosts.popup.header').format(status),
+      primary: Em.I18n.t('admin.stackVersions.hosts.popup.primary'),
+      secondary: Em.I18n.t('common.close'),
+      onPrimary: function() {
+        this.hide();
+        self.filterHostsByStack(version, status);
+      }
+    });
   }
 
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef42c32b/ambari-web/app/controllers/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host.js b/ambari-web/app/controllers/main/host.js
index b2daba0..dd40d3a 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -516,6 +516,27 @@ App.MainHostController = Em.ArrayController.extend({
     App.db.setFilterConditions(this.get('name'), [filterForComponent]);
   },
 
+  /**
+   * Filter hosts by stack version and state
+   * @param {String} version
+   * @param {String} state
+   */
+  filterByStack: function (version, state) {
+    if (!version || !state)
+      return;
+    var column = 11;
+
+    var filterForStack = {
+      iColumn: column,
+      value: {
+        version: version,
+        status: state.toUpperCase()
+      },
+      type: 'sub-resource'
+    };
+    App.db.setFilterConditions(this.get('name'), [filterForStack]);
+  },
+
   showAlertsPopup: function (event) {
     var host = event.context;
     App.router.get('mainAlertsController').loadAlerts(host.get('hostName'), "HOST");

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef42c32b/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 94382b0..43d360c 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1194,6 +1194,9 @@ Em.I18n.translations = {
   'admin.stackVersions.datails.hosts.btn.installing': "Installing...",
   'admin.stackVersions.datails.hosts.btn.nothing': "Nothing to Install",
   'admin.stackVersions.datails.hosts.btn.na': "Status not available",
+  'admin.stackVersions.hosts.popup.header': "Version Status: {0}",
+  'admin.stackVersions.hosts.popup.title': "{0} Version is {1} on {2} hosts:",
+  'admin.stackVersions.hosts.popup.primary': "Go to Hosts",
 
   'admin.stackUpgrade.title': "Stack and upgrade",
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef42c32b/ambari-web/app/templates/main/admin/stack_versions/stack_version_details.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/stack_versions/stack_version_details.hbs
b/ambari-web/app/templates/main/admin/stack_versions/stack_version_details.hbs
index a76631e..065bea3 100644
--- a/ambari-web/app/templates/main/admin/stack_versions/stack_version_details.hbs
+++ b/ambari-web/app/templates/main/admin/stack_versions/stack_version_details.hbs
@@ -44,11 +44,19 @@
         <div class="span8">
           <div class="row-fluid">
             <div class="span3">{{t admin.stackVersions.datails.installed.on}}</div>
-            <div class="span6">{{content.installedHosts.length}}/{{totalHostCount}}</div>
+            <div class="span6">
+              <a href="#" title='installed' {{action showHosts controller.content.version
controller.content.currentHosts target="App.router.mainStackVersionsController"}}>
+                <span>{{content.installedHosts.length}}/{{totalHostCount}}</span>
+              </a>
+            </div>
           </div>
           <div class="row-fluid">
             <div class="span3">{{t admin.stackVersions.datails.current.on}}</div>
-            <div class="span6">{{content.currentHosts.length}}/{{totalHostCount}}</div>
+            <div class="span6">
+              <a href="#" title='current' {{action showHosts controller.content.version
controller.content.currentHosts target="App.router.mainStackVersionsController"}}>
+                <span>{{content.currentHosts.length}}/{{totalHostCount}}</span>
+              </a>
+            </div>
           </div>
         </div>
         <div class="span4">
@@ -90,7 +98,7 @@
                 {{repo.type}}
               </td>
               <td>
-                {{view Ember.TextField valueBinding="repo.baseurl" className="disabled"}}
+                {{view Ember.TextField valueBinding="repo.baseurl" disabled="disabled"}}
               </td>
             </tr>
           {{/each}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/ef42c32b/ambari-web/app/templates/main/admin/stack_versions/stack_versions.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/stack_versions/stack_versions.hbs b/ambari-web/app/templates/main/admin/stack_versions/stack_versions.hbs
index 2fb3e0b..017b0f7 100644
--- a/ambari-web/app/templates/main/admin/stack_versions/stack_versions.hbs
+++ b/ambari-web/app/templates/main/admin/stack_versions/stack_versions.hbs
@@ -56,10 +56,14 @@
               </div>
             </td>
             <td>
-              <span>{{view.content.installedHosts.length}}</span>
+              <a href="#" title='installed' {{action showHosts view.content.version view.content.installedHosts
target="controller"}}>
+                <span>{{view.content.installedHosts.length}}</span>
+              </a>
             </td>
             <td>
-              <span>{{view.content.currentHosts.length}}</span>
+              <a href="#" title='current' {{action showHosts view.content.version view.content.currentHosts
target="controller"}}>
+                <span>{{view.content.currentHosts.length}}</span>
+              </a>
             </td>
           {{/view}}
         {{/each}}


Mime
View raw message