ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rz...@apache.org
Subject ambari git commit: AMBARI-19324 - Ambai-web action to download all client configs (rzang)
Date Tue, 03 Jan 2017 19:35:50 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 2a85ec05e -> 46e5913ff


AMBARI-19324 - Ambai-web action to download all client configs (rzang)


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

Branch: refs/heads/branch-2.5
Commit: 46e5913ffc0d58d8b789925dc9522b746e6444e7
Parents: 2a85ec0
Author: Richard Zang <rzang@apache.org>
Authored: Tue Jan 3 11:30:37 2017 -0800
Committer: Richard Zang <rzang@apache.org>
Committed: Tue Jan 3 11:35:21 2017 -0800

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service.js                |  9 ++++++++-
 ambari-web/app/messages.js                                |  1 +
 .../main/host/details/support_client_configs_download.js  | 10 ++++++++--
 .../app/templates/main/service/all_services_actions.hbs   |  7 +++++++
 4 files changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/46e5913f/ambari-web/app/controllers/main/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service.js b/ambari-web/app/controllers/main/service.js
index 2677723..e4d751d 100644
--- a/ambari-web/app/controllers/main/service.js
+++ b/ambari-web/app/controllers/main/service.js
@@ -19,7 +19,7 @@
 var App = require('app');
 var misc = require('utils/misc');
 
-App.MainServiceController = Em.ArrayController.extend({
+App.MainServiceController = Em.ArrayController.extend(App.SupportClientConfigsDownload, {
 
   name: 'mainServiceController',
 
@@ -144,6 +144,13 @@ App.MainServiceController = Em.ArrayController.extend({
   },
 
   /**
+   * Download client configs for all services
+   */
+  downloadAllClientConfigs: function() {
+    this.downloadClientConfigsCall({downloadAll: true});
+  },
+
+  /**
    * Do request to server for "start|stop" all services
    * @param {string} state "STARTED|INSTALLED"
    * @param {object} query

http://git-wip-us.apache.org/repos/asf/ambari/blob/46e5913f/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 01382bd..a37b1c6 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2191,6 +2191,7 @@ Em.I18n.translations = {
   'services.service.startAll':'Start All',
   'services.service.stopAll':'Stop All',
   'services.service.restartAllRequired':'Restart All Required',
+  'services.service.downloadAllClientConfigs':'Download All Client Configs',
   'services.service.startAll.confirmMsg' : 'You are about to start all services',
   'services.service.stopAll.confirmMsg' : 'You are about to stop all services',
   'services.service.refreshAll.confirmMsg': '<p>You are about to restart {0}</p>'
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/46e5913f/ambari-web/app/mixins/main/host/details/support_client_configs_download.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/main/host/details/support_client_configs_download.js b/ambari-web/app/mixins/main/host/details/support_client_configs_download.js
index 6e7cd9b..58460f0 100644
--- a/ambari-web/app/mixins/main/host/details/support_client_configs_download.js
+++ b/ambari-web/app/mixins/main/host/details/support_client_configs_download.js
@@ -24,11 +24,14 @@ App.SupportClientConfigsDownload = Em.Mixin.create({
    * @param {{hostName: string, componentName: string, displayName: string, serviceName:
string}} data
    */
   downloadClientConfigsCall: function (data) {
-    var url = this._getUrl(data.hostName, data.serviceName, data.componentName);
+    var url = this._getUrl(data.hostName, data.serviceName, data.componentName, data.downloadAll);
     var newWindow = window.open(url);
     newWindow.focus();
   },
 
+  _getDownloadAllUrl: function () {
+    return App.get('apiPrefix') + '/clusters/' + App.router.getClusterName() + '/components?format=client_config_tar';
+  },
   /**
    *
    * @param {string|null} hostName
@@ -37,7 +40,10 @@ App.SupportClientConfigsDownload = Em.Mixin.create({
    * @returns {string}
    * @private
    */
-  _getUrl: function (hostName, serviceName, componentName) {
+  _getUrl: function (hostName, serviceName, componentName, downloadAll) {
+    if (downloadAll) {
+      return this._getDownloadAllUrl();
+    }
     var isForHost = !Em.isNone(hostName);
     return App.get('apiPrefix') + '/clusters/' + App.router.getClusterName() + '/' +
       (isForHost ? 'hosts/' + hostName + '/host_components/' : 'services/' + serviceName
+ '/components/') +

http://git-wip-us.apache.org/repos/asf/ambari/blob/46e5913f/ambari-web/app/templates/main/service/all_services_actions.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/all_services_actions.hbs b/ambari-web/app/templates/main/service/all_services_actions.hbs
index 081d3eb..80fd916 100644
--- a/ambari-web/app/templates/main/service/all_services_actions.hbs
+++ b/ambari-web/app/templates/main/service/all_services_actions.hbs
@@ -58,6 +58,13 @@
                         </a>
                     </li>
                 {{/isAuthorized}}
+                <li>
+                    <a href="#"
+                        {{action "downloadAllClientConfigs" target="view.serviceController"}}>
+                        <i {{bindAttr class=":icon-download-alt"}}></i>
+                        {{t services.service.downloadAllClientConfigs}}
+                    </a>
+                </li>
             </ul>
         </div>
     </div>


Mime
View raw message