You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ra...@apache.org on 2012/05/17 20:19:27 UTC
svn commit: r1339770 - in /incubator/ambari/branches/ambari-186: CHANGES.txt
hmc/js/manageServices.js hmc/js/selectServices.js
Author: ramya
Date: Thu May 17 18:19:27 2012
New Revision: 1339770
URL: http://svn.apache.org/viewvc?rev=1339770&view=rev
Log:
AMBARI-266. add select/unselect all buttons to the select services page
Modified:
incubator/ambari/branches/ambari-186/CHANGES.txt
incubator/ambari/branches/ambari-186/hmc/js/manageServices.js
incubator/ambari/branches/ambari-186/hmc/js/selectServices.js
Modified: incubator/ambari/branches/ambari-186/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/CHANGES.txt?rev=1339770&r1=1339769&r2=1339770&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/CHANGES.txt (original)
+++ incubator/ambari/branches/ambari-186/CHANGES.txt Thu May 17 18:19:27 2012
@@ -2,6 +2,9 @@ Ambari Change log
Release 0.x.x - unreleased
+ AMBARI-266. add select/unselect all buttons to the select services page
+ (Vinod via ramya)
+
AMBARI-256. Update hive config to enable authorization (ramya)
AMBARI-254. Parameterize zookeeper configs (ramya)
Modified: incubator/ambari/branches/ambari-186/hmc/js/manageServices.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/js/manageServices.js?rev=1339770&r1=1339769&r2=1339770&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/js/manageServices.js (original)
+++ incubator/ambari/branches/ambari-186/hmc/js/manageServices.js Thu May 17 18:19:27 2012
@@ -488,7 +488,7 @@ var fetchClusterServicesPollerResponseHa
}
if (clientOnlySoftwareMarkup != '') {
serviceManagementMarkup += '<div class="serviceManagementGroup"> Client-only software: <br/>';
- serviceManagementGroup += clientOnlySoftwareMarkup;
+ serviceManagementMarkup += clientOnlySoftwareMarkup;
serviceManagementMarkup += '</div>';
}
Modified: incubator/ambari/branches/ambari-186/hmc/js/selectServices.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/js/selectServices.js?rev=1339770&r1=1339769&r2=1339770&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/js/selectServices.js (original)
+++ incubator/ambari/branches/ambari-186/hmc/js/selectServices.js Thu May 17 18:19:27 2012
@@ -58,6 +58,11 @@ function renderServiceList(responseJson)
}
// divContent += coreContent + optionalContent + nonSelectableContent;
+ coreContent = '<div>' +
+ '<label class="checkbox" for="selectAllCheckBoxId" id="labelForSelectAllId">Select all</label>' +
+ '<input type="checkbox" name="selectAll" id="selectAllCheckBoxId"/>' +
+ '</div>' +
+ coreContent;
globalYui.one("#selectCoreServicesDynamicRenderDivId").setContent(coreContent);
globalYui.one("#selectOptionalServicesDynamicRenderDivId").setContent(optionalContent);
globalYui.one("#selectNonSelectableServicesDynamicRenderDivId").setContent(nonSelectableContent);
@@ -101,6 +106,42 @@ function generateSelectServiceCheckbox(s
}
globalYui.one('#selectServicesCoreDivId').delegate('click', function (e) {
+
+ // Select-all checkbox
+ if (this.get('id') == 'selectAllCheckBoxId') {
+ var node = globalYui.one("#selectAllCheckBoxId");
+ var labelNode = globalYui.one("#labelForSelectAllId");
+ if (node.get('checked')) {
+ labelNode.setContent("Deselect all");
+ setFormStatus("Selected all services", false);
+ } else {
+ labelNode.setContent("Select all");
+ setFormStatus("Deselected all optional services", false);
+ }
+ for (svcName in data['services']) {
+ if (!data['services'][svcName].attributes.noDisplay && !data['services'][svcName].attributes.mustInstall) {
+ var itemId = 'installService' + svcName + 'Id';
+ globalYui.one('#' + itemId).set('checked' , node.get('checked'));
+ // Forget about the history and set refCount explicitly
+ if (node.get('checked')) {
+ data['services'][svcName]['refCount'] = 1;
+ } else {
+ data['services'][svcName]['refCount'] = 0;
+ }
+ if (!data['services'][svcName].attributes.editable) {
+ var nonEditableNode = globalYui.one('#selectServicesEntry' + svcName + 'DivId');
+ if (node.get('checked')) {
+ nonEditableNode.setStyle('display', 'block');
+ } else {
+ nonEditableNode.setStyle('display', 'none');
+ }
+ }
+ }
+ }
+ return;
+ }
+ //// End of select-all checkbox
+
// globalYui.log(globalYui.Lang.dump(this));
var serviceName = this.getAttribute('name');
var buttonId = 'installService' + serviceName + 'Id';