mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	new UI - instance page - show different submenu at left navigation based on user role (admin, non-admin).
This commit is contained in:
		
							parent
							
								
									d4dfc6770b
								
							
						
					
					
						commit
						cecf4f9a5e
					
				| @ -89,17 +89,7 @@ $(document).ready(function() { | ||||
| 		instanceBuildSubMenu(); | ||||
| 		return false; | ||||
| 	});	 | ||||
|     /* | ||||
|     $("#leftmenu_instance_group_header").bind("click", function(event) {   | ||||
|         showMiddleMenu(); | ||||
|         clearMiddleMenu();           | ||||
|         enableMultipleSelectionInMidMenu();  //multiple-selection is needeed for actions like start VM, stop VM, reboot VM.
 | ||||
|         var $arrowIcon = $(this).find("#arrow_icon");         | ||||
|         clickInstanceGroupHeader($arrowIcon); | ||||
|         return false; | ||||
|     }); | ||||
|     */ | ||||
|      | ||||
|          | ||||
|     $("#leftmenu_domain").bind("click", function(event) { | ||||
| 		selectLeftMenu($(this), true); | ||||
| 		hideMiddleMenu();		 | ||||
|  | ||||
| @ -20,27 +20,31 @@ var $instanceSubMenuContainer; | ||||
| function instanceBuildSubMenu() {     | ||||
|     $instanceSubMenuContainer = $("#leftmenu_instance_expandedbox").empty();     | ||||
|    | ||||
|     instanceBuildSubMenu2("My Instances", ("listVirtualMachines&domainid="+g_domainid+"&account="+g_account)); | ||||
|     instanceBuildSubMenu2("All Instances", "listVirtualMachines");    | ||||
|      | ||||
|     instanceBuildSubMenu2("Running Instances", "listVirtualMachines&state=Running"); | ||||
|     instanceBuildSubMenu2("Stopped Instances", "listVirtualMachines&state=Stopped"); | ||||
|     instanceBuildSubMenu2("Destoryed Instances", "listVirtualMachines&state=Destroyed"); | ||||
|      | ||||
|      | ||||
|     $.ajax({ | ||||
|         cache: false, | ||||
|         data: createURL("command=listInstanceGroups"),	        | ||||
|         dataType: "json", | ||||
|         success: function(json) {	             | ||||
|             var instancegroups = json.listinstancegroupsresponse.instancegroup;	        	 | ||||
|         	if(instancegroups!=null && instancegroups.length>0) {            | ||||
| 	            for(var i=0; i < instancegroups.length; i++) {		                 | ||||
| 	                instanceBuildSubMenu2(instancegroups[i].name, ("listVirtualMachines&groupid="+instancegroups[i].id));    | ||||
|     if (isAdmin() || isDomainAdmin()) { | ||||
|         instanceBuildSubMenu2("My Instances", ("listVirtualMachines&domainid="+g_domainid+"&account="+g_account)); | ||||
|         instanceBuildSubMenu2("All Instances", "listVirtualMachines");            | ||||
|         instanceBuildSubMenu2("Running Instances", "listVirtualMachines&state=Running"); | ||||
|         instanceBuildSubMenu2("Stopped Instances", "listVirtualMachines&state=Stopped"); | ||||
|         instanceBuildSubMenu2("Destoryed Instances", "listVirtualMachines&state=Destroyed"); | ||||
|     } 	 | ||||
|     else if(isUser()) {	         | ||||
|         instanceBuildSubMenu2("All Instances", "listVirtualMachines");            | ||||
|         instanceBuildSubMenu2("Running Instances", "listVirtualMachines&state=Running"); | ||||
|         instanceBuildSubMenu2("Stopped Instances", "listVirtualMachines&state=Stopped");         | ||||
|         $.ajax({ | ||||
|             cache: false, | ||||
|             data: createURL("command=listInstanceGroups"),	        | ||||
|             dataType: "json", | ||||
|             success: function(json) {	             | ||||
|                 var instancegroups = json.listinstancegroupsresponse.instancegroup;	        	 | ||||
|         	    if(instancegroups!=null && instancegroups.length>0) {            | ||||
| 	                for(var i=0; i < instancegroups.length; i++) {		                 | ||||
| 	                    instanceBuildSubMenu2(instancegroups[i].name, ("listVirtualMachines&groupid="+instancegroups[i].id));    | ||||
| 	                } | ||||
| 	            } | ||||
| 	        } | ||||
|         } | ||||
|     });   | ||||
|             } | ||||
|         });   | ||||
|     }     | ||||
| } | ||||
| 
 | ||||
| function instanceBuildSubMenu2(label, commandString) {    | ||||
| @ -643,39 +647,6 @@ function afterLoadInstanceJSP() { | ||||
|     });         | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| /* | ||||
| function clickInstanceGroupHeader($arrowIcon) {      | ||||
| 	if($arrowIcon.hasClass("expanded_close") == true) { | ||||
|         $arrowIcon.removeClass("expanded_close").addClass("expanded_open");             | ||||
|         appendInstanceGroup(-1, noGroupName); | ||||
|          | ||||
|         $.ajax({ | ||||
| 	        cache: false, | ||||
| 	        data: createURL("command=listInstanceGroups"),	        | ||||
| 	        dataType: "json", | ||||
| 	        success: function(json) {	             | ||||
| 	            var instancegroups = json.listinstancegroupsresponse.instancegroup;	        	 | ||||
| 	        	if(instancegroups!=null && instancegroups.length>0) {            | ||||
| 		            for(var i=0; i < instancegroups.length; i++) {		             | ||||
| 		        	    appendInstanceGroup(instancegroups[i].id, fromdb(instancegroups[i].name)); | ||||
| 		            } | ||||
| 		        } | ||||
| 	        } | ||||
|         });   | ||||
|     } | ||||
|     else if($arrowIcon.hasClass("expanded_open") == true) { | ||||
|         $arrowIcon.removeClass("expanded_open").addClass("expanded_close");             | ||||
|         $("#leftmenu_instance_group_container").empty();    | ||||
|     }	 | ||||
| }   | ||||
| */ | ||||
| 
 | ||||
| //***** VM Detail (begin) ******************************************************************************
 | ||||
| var noGroupName = "default";              | ||||
|         | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user