mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	zone page - pop up confirmation dialog before execute Delete Zone action.
This commit is contained in:
		
							parent
							
								
									639ddbb45c
								
							
						
					
					
						commit
						be031f455f
					
				| @ -866,52 +866,13 @@ function bindEventHandlerToDialogAddVlanForZone() { | |||||||
| 	}); | 	}); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /* |  | ||||||
| var secondarystorageActionMap = { |  | ||||||
|     "Delete Secondary Storage": {    |  | ||||||
|         isAsyncJob: false,    |  | ||||||
|         dialogBeforeActionFn: doDeleteSecondaryStorage,        |  | ||||||
|         inProcessText: "Deleting Secondary Storaget....", |  | ||||||
|         afterActionSeccessFn: function(json, id, $subgridItem) {                         |  | ||||||
|             $subgridItem.slideUp("slow", function() { |  | ||||||
|                 $(this).remove(); |  | ||||||
|             }); |  | ||||||
|         } |  | ||||||
|     }  |  | ||||||
| } |  | ||||||
| */ |  | ||||||
| 
 |  | ||||||
| /* |  | ||||||
| function doDeleteSecondaryStorage($actionLink, $subgridItem) {  |  | ||||||
|     var jsonObj = $subgridItem.data("jsonObj"); |  | ||||||
|         |  | ||||||
|     $("#dialog_confirmation") |  | ||||||
|     .text("Please confirm you want to delete the secondary storage")	 |  | ||||||
| 	.dialog('option', 'buttons', { 						 |  | ||||||
| 		"Confirm": function() {  |  | ||||||
| 		    var $thisDialog = $(this);	 |  | ||||||
| 			$thisDialog.dialog("close");       	                                              |  | ||||||
|           |  | ||||||
|             var name = $thisDialog.find("#name").val();	                 |  | ||||||
|               |  | ||||||
|             var id = jsonObj.id; |  | ||||||
|             var apiCommand = "command=deleteHost&id="+id;    	 |  | ||||||
|     	    doActionToSubgridItem(id, $actionLink, apiCommand, $subgridItem);				 |  | ||||||
| 		},  |  | ||||||
| 		"Cancel": function() {  |  | ||||||
| 			$(this).dialog("close");  |  | ||||||
| 		}  |  | ||||||
| 	}).dialog("open"); |  | ||||||
| } |  | ||||||
| */ |  | ||||||
| 
 |  | ||||||
| var zoneActionMap = { | var zoneActionMap = { | ||||||
|     "Edit Zone": { |     "Edit Zone": { | ||||||
|         dialogBeforeActionFn: doEditZone   |         dialogBeforeActionFn: doEditZone   | ||||||
|     }, |     }, | ||||||
|     "Delete Zone": {                   |     "Delete Zone": {                   | ||||||
|         api: "deleteZone",             |  | ||||||
|         isAsyncJob: false,        |         isAsyncJob: false,        | ||||||
|  |         dialogBeforeActionFn : doDeleteZone,   | ||||||
|         inProcessText: "Deleting Zone....", |         inProcessText: "Deleting Zone....", | ||||||
|         afterActionSeccessFn: function(json, $leftmenuItem1, id) {    |         afterActionSeccessFn: function(json, $leftmenuItem1, id) {    | ||||||
|             $leftmenuItem1.slideUp(function() { |             $leftmenuItem1.slideUp(function() { | ||||||
| @ -1035,6 +996,23 @@ function doEditZone2($actionLink, $detailsTab, $leftmenuItem1, $readonlyFields, | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | function doDeleteZone($actionLink, $detailsTab, $midmenuItem1) {        | ||||||
|  |     var jsonObj = $midmenuItem1.data("jsonObj"); | ||||||
|  | 	var id = jsonObj.id; | ||||||
|  | 		 | ||||||
|  | 	$("#dialog_confirmation") | ||||||
|  | 	.text("Please confirm you want to delete this zone") | ||||||
|  | 	.dialog('option', 'buttons', { 					 | ||||||
|  | 		"Confirm": function() { 			 | ||||||
|  | 			$(this).dialog("close");			 | ||||||
|  | 			var apiCommand = "command=deleteZone&id="+id; | ||||||
|  |             doActionToTab(id, $actionLink, apiCommand, $midmenuItem1, $detailsTab);	 | ||||||
|  | 		},  | ||||||
|  | 		"Cancel": function() {  | ||||||
|  | 			$(this).dialog("close");  | ||||||
|  | 		} | ||||||
|  | 	}).dialog("open"); | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| function bindAddClusterButtonOnZonePage($button, zoneId, zoneName) { | function bindAddClusterButtonOnZonePage($button, zoneId, zoneName) { | ||||||
|     $button.show(); |     $button.show(); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user