mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	bug 4556: Security Group page - localize all actions.
This commit is contained in:
		
							parent
							
								
									2b4500e4d1
								
							
						
					
					
						commit
						ff29ecda67
					
				| @ -468,6 +468,12 @@ label.action.enable.static.NAT.processing=Enabling Static NAT.... | ||||
| label.action.disable.static.NAT=Disable Static NAT | ||||
| label.action.disable.static.NAT.processing=Disabling Static NAT.... | ||||
| 
 | ||||
| label.action.delete.security.group=Delete Security Group | ||||
| label.action.delete.security.group.processing=Deleting Security Group.... | ||||
| label.action.delete.ingress.rule=Delete Ingress Rule | ||||
| label.action.delete.ingress.rule.processing=Deleting Ingress Rule.... | ||||
| 
 | ||||
| 
 | ||||
| label.action.edit.account=Edit account | ||||
| label.action.resource.limits=Resource limits | ||||
| label.action.disable.account=Disable account | ||||
| @ -504,6 +510,9 @@ message.action.delete.snapshot=Please confirm you want to delete snapshot | ||||
| message.action.release.ip=Please confirm you want to release IP | ||||
| message.action.disable.static.NAT=Please confirm you want to disable static NAT | ||||
| 
 | ||||
| message.action.delete.security.group=Please confirm you want to delete security group | ||||
| message.action.delete.ingress.rule=Please confirm you want to delete ingress rule | ||||
| 
 | ||||
| message.edit.limits=Please specify limits to the following resources.  A "-1" indicates no limit to the amount of resources create. | ||||
| message.disable.account=Please confirm you want to disable this account.  By disabling the account, all users for this account will no longer have access to their cloud resources.  All running virtual machines will be immediately shut down.  | ||||
| message.lock.account=Please confirm you want to lock this account.  By locking the account, all users for this account will no longer be able to manage their cloud resources.  Existing resources can still be accessed. | ||||
|  | ||||
| @ -5,6 +5,18 @@ | ||||
| </c:if> | ||||
| <fmt:setBundle basename="resources/messages"/> | ||||
| 
 | ||||
| <script language="javascript"> | ||||
| dictionary = { 	 | ||||
| 	'label.action.edit.security.group' : '<fmt:message key="label.action.edit.security.group"/>', | ||||
| 	'label.action.delete.security.group' : '<fmt:message key="label.action.delete.security.group"/>', | ||||
| 	'label.action.delete.security.group.processing' : '<fmt:message key="label.action.delete.security.group.processing"/>', | ||||
| 	'message.action.delete.security.group' : '<fmt:message key="message.action.delete.security.group"/>', | ||||
| 	'label.action.delete.ingress.rule' : '<fmt:message key="label.action.delete.ingress.rule"/>', | ||||
| 	'label.action.delete.ingress.rule.processing' : '<fmt:message key="label.action.delete.ingress.rule.processing"/>', | ||||
| 	'message.action.delete.ingress.rule' : '<fmt:message key="message.action.delete.ingress.rule"/>'	 | ||||
| };	 | ||||
| </script> | ||||
| 
 | ||||
| <div class="main_title" id="right_panel_header"> | ||||
|      | ||||
|     <div class="main_titleicon"> | ||||
|  | ||||
| @ -339,71 +339,12 @@ function initAddIngressRuleDialog() { | ||||
|     });	  | ||||
| } | ||||
| 
 | ||||
| function doEditSecurityGroup($actionLink, $detailsTab, $midmenuItem1) {        | ||||
|     var $readonlyFields  = $detailsTab.find("#name, #displaytext, #tags, #domain"); | ||||
|     var $editFields = $detailsTab.find("#name_edit, #displaytext_edit, #domain_edit");  | ||||
|               | ||||
|     $readonlyFields.hide(); | ||||
|     $editFields.show();   | ||||
|     $detailsTab.find("#cancel_button, #save_button").show(); | ||||
|      | ||||
|     $detailsTab.find("#cancel_button").unbind("click").bind("click", function(event){     | ||||
|         $editFields.hide(); | ||||
|         $readonlyFields.show();    | ||||
|         $("#save_button, #cancel_button").hide();        | ||||
|         return false; | ||||
|     }); | ||||
|     $detailsTab.find("#save_button").unbind("click").bind("click", function(event){         | ||||
|         doEditsecurityGroup2($actionLink, $detailsTab, $midmenuItem1, $readonlyFields, $editFields);    | ||||
|         return false; | ||||
|     });    | ||||
| } | ||||
| 
 | ||||
| function doEditSecurityGroup2($actionLink, $detailsTab, $midmenuItem1, $readonlyFields, $editFields) {      | ||||
|     var jsonObj = $midmenuItem1.data("jsonObj"); | ||||
|     var id = jsonObj.id; | ||||
|      | ||||
|     // validate values   
 | ||||
|     var isValid = true;					 | ||||
|     isValid &= validateString("Name", $detailsTab.find("#name_edit"), $detailsTab.find("#name_edit_errormsg"), true);		 | ||||
|     isValid &= validateString("Display Text", $detailsTab.find("#displaytext_edit"), $detailsTab.find("#displaytext_edit_errormsg"), true);				 | ||||
|     if (!isValid)  | ||||
|         return;	 | ||||
|       | ||||
|     var array1 = [];     | ||||
|     var name = $detailsTab.find("#name_edit").val(); | ||||
|     array1.push("&name="+todb(name)); | ||||
|      | ||||
|     var displaytext = $detailsTab.find("#displaytext_edit").val(); | ||||
|     array1.push("&displayText="+todb(displaytext)); | ||||
| 	 | ||||
| 	var tags = $detailsTab.find("#tags_edit").val(); | ||||
| 	array1.push("&tags="+todb(tags));	 | ||||
| 	 | ||||
| 	var domainid = $detailsTab.find("#domain_edit").val(); | ||||
| 	array1.push("&domainid="+todb(domainid));	 | ||||
| 	 | ||||
| 	$.ajax({ | ||||
| 	    data: createURL("command=updatesecurityGroup&id="+id+array1.join("")), | ||||
| 		dataType: "json", | ||||
| 		success: function(json) {			     | ||||
| 		    var jsonObj = json.updatesecurityGroupresponse.securityGroup;    | ||||
| 		    securityGroupToMidmenu(jsonObj, $midmenuItem1); | ||||
| 		    securityGroupToRightPanel($midmenuItem1);	 | ||||
| 		     | ||||
| 		    $editFields.hide();       | ||||
|             $readonlyFields.show();        | ||||
|             $("#save_button, #cancel_button").hide();     	   | ||||
| 		} | ||||
| 	}); | ||||
| } | ||||
| 
 | ||||
| function doDeleteSecurityGroup($actionLink, $detailsTab, $midmenuItem1) {        | ||||
|     var jsonObj = $midmenuItem1.data("jsonObj"); | ||||
| 	var id = jsonObj.id; | ||||
| 		 | ||||
| 	$("#dialog_confirmation") | ||||
| 	.text("Please confirm you want to delete this security group") | ||||
| 	.text(dictionary["message.action.delete.security.group"]) | ||||
| 	.dialog('option', 'buttons', { 					 | ||||
| 		"Confirm": function() { 			 | ||||
| 			$(this).dialog("close");			 | ||||
| @ -563,17 +504,17 @@ function securityGroupIngressRuleJSONToTemplate(jsonObj, $template) { | ||||
| 	var $actionMenu = $actionLink.find("#ingressrule_action_menu"); | ||||
|     $actionMenu.find("#action_list").empty();	 | ||||
|          | ||||
|     buildActionLinkForSubgridItem("Delete Ingress Rule", securityGroupIngressRuleActionMap, $actionMenu, $template);	 | ||||
|     buildActionLinkForSubgridItem("label.action.delete.ingress.rule", securityGroupIngressRuleActionMap, $actionMenu, $template);	 | ||||
|      | ||||
|     return $template;    | ||||
| }  | ||||
| 
 | ||||
| var securityGroupIngressRuleActionMap = {       | ||||
|     "Delete Ingress Rule": {       | ||||
|     "label.action.delete.ingress.rule": {       | ||||
|         isAsyncJob: true, | ||||
|         asyncJobResponse: "revokesecuritygroupingress", | ||||
| 		dialogBeforeActionFn : doDeleteIngressRule, | ||||
|         inProcessText: "Deleting Ingress Rule....", | ||||
|         inProcessText: "label.action.delete.ingress.rule.processing", | ||||
|         afterActionSeccessFn: function(json, id, $subgridItem) {                  | ||||
|             $subgridItem.slideUp("slow", function() { | ||||
|                 $(this).remove(); | ||||
| @ -584,7 +525,7 @@ var securityGroupIngressRuleActionMap = { | ||||
| 
 | ||||
| function doDeleteIngressRule($actionLink, $subgridItem) { | ||||
| 	$("#dialog_info")	 | ||||
| 	.text("Please confirm you want to delete this ingress rule") | ||||
| 	.text(dictionary["message.action.delete.ingress.rule"]) | ||||
|     .dialog('option', 'buttons', { 						 | ||||
| 	    "Confirm": function() {  | ||||
| 		    $(this).dialog("close"); 	 | ||||
| @ -662,10 +603,7 @@ function securityGroupClearDetailsTab() { | ||||
|     $actionMenu.find("#action_list").append($("#no_available_actions").clone().show()); | ||||
| } | ||||
| 
 | ||||
| var securityGroupActionMap = {    | ||||
|     "Edit Security Group": { | ||||
|         dialogBeforeActionFn: doEditSecurityGroup | ||||
|     },    | ||||
| var securityGroupActionMap = {        | ||||
|     "Delete Security Group": {                | ||||
|         api: "deleteSecurityGroup",      | ||||
|         isAsyncJob: false,   | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user