[PATCH conductor] BZ790833 Added confirmation to stopping deployment and stopping and restarting instances
jtomasek at redhat.com
jtomasek at redhat.com
Mon Feb 20 13:02:51 UTC 2012
From: Jiri Tomasek <jtomasek at redhat.com>
---
src/public/javascripts/application.js | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/src/public/javascripts/application.js b/src/public/javascripts/application.js
index 3d76c90..22439bb 100644
--- a/src/public/javascripts/application.js
+++ b/src/public/javascripts/application.js
@@ -143,6 +143,32 @@ $.extend(Conductor, {
});
},
+ multiStopValidation: function() {
+ $('#stop_button, #stop_selected_instances').live('click', function(e) {
+ if ($(".checkbox_table input[@type=radio]:checked").length == 0) {
+ alert('Please make a selection before clicking Stop button.');
+ e.preventDefault();
+ } else {
+ if (!confirm("Are you sure you want to proceed?")) {
+ e.preventDefault();
+ }
+ }
+ });
+ },
+
+ multiRebootValidation: function() {
+ $('#reboot_selected_instances').live('click', function(e) {
+ if ($(".checkbox_table input[@type=radio]:checked").length == 0) {
+ alert('Please make a selection before clicking Reboot button.');
+ e.preventDefault();
+ } else {
+ if (!confirm("Are you sure you want to proceed?")) {
+ e.preventDefault();
+ }
+ }
+ });
+ },
+
closeNotification: function() {
$('.control').click(function(e) {
e.preventDefault();
@@ -378,6 +404,8 @@ $(document).ready(function () {
Conductor.bind_pretty_toggle();
Conductor.multiDestroyValidation();
Conductor.multiRevokeValidation();
+ Conductor.multiStopValidation();
+ Conductor.multiRebootValidation();
Conductor.closeNotification();
Conductor.toggleCollapsible();
Conductor.selectAllCheckboxes();
--
1.7.7.6
More information about the aeolus-devel
mailing list