bug 6511: both user and admin will display the vm name the same way to avoid confusion

- fixed other issues with renaming vm instance
This commit is contained in:
will 2010-10-11 16:25:04 -07:00
parent 73c3d2c0c9
commit 557dca0370
2 changed files with 6 additions and 14 deletions

View File

@ -744,13 +744,9 @@ function showInstancesTab(p_domainId, p_account) {
data: "command=updateVirtualMachine&id="+vmId+"&displayName="+encodeURIComponent(name)+"&response=json",
dataType: "json",
success: function(json) {
if (isAdmin()) {
var systemName = vmInstance.data("systemName");
name = systemName + "(" + name + ")";
vmInstance.find("#vm_name").text(name);
} else {
vmInstance.find("#vm_name").text(name);
}
var systemName = vmInstance.data("systemName");
name = systemName + "(" + name + ")";
vmInstance.find("#vm_name").html("<strong>Name:</strong> " + name);
vmInstance.data("name", name);
},
error: function(XMLHttpResponse) {

View File

@ -494,14 +494,10 @@ function getVmName(p_vmName, p_vmDisplayname) {
if(p_vmDisplayname == null)
return sanitizeXSS(p_vmName);
var vmName = null;
if (isAdmin()) {
if (p_vmDisplayname != p_vmName) {
vmName = p_vmName + "(" + sanitizeXSS(p_vmDisplayname) + ")";
} else {
vmName = p_vmName;
}
if (p_vmDisplayname != p_vmName) {
vmName = p_vmName + "(" + sanitizeXSS(p_vmDisplayname) + ")";
} else {
vmName = sanitizeXSS(p_vmDisplayname);
vmName = p_vmName;
}
return vmName;
}