cloudStack - sync UI change from 2.2.10 branch to 2.2.y branch.

This commit is contained in:
Jessica Wang 2011-08-11 15:58:38 -07:00
parent 142c943cc9
commit e750ae728d
18 changed files with 108 additions and 138 deletions

View File

@ -173,13 +173,11 @@ var clusterActionMap = {
dialogBeforeActionFn : doDeleteCluster,
inProcessText: "label.action.delete.cluster.processing",
afterActionSeccessFn: function(json, $midmenuItem1, id) {
$midmenuItem1.slideUp("slow", function() {
$(this).remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
clusterClearRightPanel();
}
});
$midmenuItem1.remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
clusterClearRightPanel();
}
}
}
}

View File

@ -376,13 +376,11 @@ var diskOfferingActionMap = {
dialogBeforeActionFn : doDeleteDiskOffering,
inProcessText: "label.action.delete.disk.offering.processing",
afterActionSeccessFn: function(json, $midmenuItem1, id) {
$midmenuItem1.slideUp("slow", function() {
$(this).remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
diskOfferingClearRightPanel();
}
});
$midmenuItem1.remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
diskOfferingClearRightPanel();
}
}
}
}

View File

@ -717,13 +717,11 @@ var domainActionMap = {
asyncJobResponse: "deletedomainresponse",
inProcessText: "label.action.delete.domain.processing",
afterActionSeccessFn: function(json, $midmenuItem1, id) {
$midmenuItem1.slideUp(function() {
$(this).remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
domainJsonClearRightPanel();
}
});
$midmenuItem1.remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
domainJsonClearRightPanel();
}
}
}
}

View File

@ -586,13 +586,11 @@ var hostActionMap = {
dialogBeforeActionFn: doRemoveHost,
inProcessText: "label.action.remove.host.processing",
afterActionSeccessFn: function(json, $midmenuItem1, id) {
$midmenuItem1.slideUp("slow", function() {
$(this).remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
hostClearRightPanel();
}
});
$midmenuItem1.remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
hostClearRightPanel();
}
}
},
"label.action.update.OS.preference": {

View File

@ -596,6 +596,7 @@ $(document).ready(function() {
g_timezoneoffset = null;
g_timezone = null;
g_supportELB = null;
g_firewallRuleUiEnabled = null;
$.cookie('JSESSIONID', null);
$.cookie('sessionKey', null);
@ -607,6 +608,7 @@ $(document).ready(function() {
$.cookie('timezoneoffset', null);
$.cookie('timezone', null);
$.cookie('supportELB', null);
$.cookie('firewallRuleUiEnabled', null);
$("body").stopTime();
@ -706,7 +708,10 @@ $(document).ready(function() {
*/
g_supportELB = json.listcapabilitiesresponse.capability.supportELB;
$.cookie('supportELB', g_supportELB, { expires: 1});
g_firewallRuleUiEnabled = json.listcapabilitiesresponse.capability.firewallRuleUiEnabled;
$.cookie('firewallRuleUiEnabled', g_firewallRuleUiEnabled, { expires: 1});
if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) {
g_userPublicTemplateEnabled = ""+json.listcapabilitiesresponse.capability.userpublictemplateenabled;
$.cookie('userpublictemplateenabled', g_userPublicTemplateEnabled, { expires: 1});
@ -803,6 +808,9 @@ $(document).ready(function() {
if(g_supportELB == null)
g_supportELB = $.cookie("supportELB");
if(g_firewallRuleUiEnabled == null)
g_firewallRuleUiEnabled = $.cookie("firewallRuleUiEnabled");
$.ajax({
data: createURL("command=listCapabilities"),

View File

@ -2202,33 +2202,23 @@ function vmJsonToStatisticsTab() {
}
var $thisTab = $("#right_panel_content #tab_content_statistics");
/*
var $barChartContainer = $thisTab.find("#cpu_barchart");
var cpuNumber = ((jsonObj.cpunumber==null)? "":jsonObj.cpunumber.toString());
$barChartContainer.find("#cpunumber").text(cpuNumber);
var cpuSpeed = ((jsonObj.cpuspeed==null)? "":convertHz(jsonObj.cpuspeed)) ;
$barChartContainer.find("#cpuspeed").text(cpuSpeed);
$barChartContainer.find("#bar_chart").removeClass().addClass("db_barbox").css("width", "0%");
$barChartContainer.find("#percentused").text("");
if(jsonObj.cpuused!=null)
drawBarChart($barChartContainer, jsonObj.cpuused);
*/
$thisTab.find("#cpunumber").text(fromdb(jsonObj.cpunumber));
$thisTab.find("#cpuspeed").text(convertHz(jsonObj.cpuspeed));
$thisTab.find("#percentused").text(jsonObj.cpuused);
var networkKbsRead = ((jsonObj.networkkbsread==null)? "":convertBytes(jsonObj.networkkbsread * 1024));
$thisTab.find("#networkkbsread").text(networkKbsRead);
if(networkKbsRead == 0)
$thisTab.find("#networkkbsread").text("N/A");
else
$thisTab.find("#networkkbsread").text(networkKbsRead);
var networkKbsWrite = ((jsonObj.networkkbswrite==null)? "":convertBytes(jsonObj.networkkbswrite * 1024));
$thisTab.find("#networkkbswrite").text(networkKbsWrite);
if(networkKbsWrite == 0)
$thisTab.find("#networkkbswrite").text("N/A");
else
$thisTab.find("#networkkbswrite").text(networkKbsWrite);
}
function vmJsonClearStatisticsTab() {

View File

@ -65,7 +65,6 @@ function ipGetSearchParams() {
return moreCriteria.join("");
}
var firewallTabIsShownInAdvancedZone = true;
function afterLoadIpJSP() {
//***** switch between different tabs (begin) ********************************************************************
var tabArray = [$("#tab_details"), $("#tab_firewall"), $("#tab_port_range"), $("#tab_port_forwarding"), $("#tab_load_balancer"), $("#tab_vpn")];
@ -463,7 +462,7 @@ function afterLoadIpJSP() {
array1.push("&endPort="+endPort);
array1.push("&protocol="+protocol);
if(firewallTabIsShownInAdvancedZone == true)
if(g_firewallRuleUiEnabled == true)
array1.push("&openfirewall=false");
$.ajax({
@ -604,7 +603,7 @@ function afterLoadIpJSP() {
var virtualMachineId = $createPortForwardingRow.find("#vm").val();
array1.push("&virtualmachineid=" + virtualMachineId);
if(firewallTabIsShownInAdvancedZone == true)
if(g_firewallRuleUiEnabled == true)
array1.push("&openfirewall=false");
$.ajax({
@ -710,7 +709,7 @@ function afterLoadIpJSP() {
var algorithm = createLoadBalancerRow.find("#algorithm_select").val();
array1.push("&algorithm="+algorithm);
if(firewallTabIsShownInAdvancedZone == true)
if(g_firewallRuleUiEnabled == true)
array1.push("&openfirewall=false");
$.ajax({
@ -838,7 +837,7 @@ function ipToRightPanel($midmenuItem1) {
$("#tab_details").click();
if(ipObj.isstaticnat == true) {
if(firewallTabIsShownInAdvancedZone == true) {
if(g_firewallRuleUiEnabled == true) {
$("#tab_port_range").hide();
}
else {
@ -850,7 +849,7 @@ function ipToRightPanel($midmenuItem1) {
$("#tab_port_range").hide();
if(ipObj.forvirtualnetwork == true) { //(public network)
if(isIpManageable(ipObj.domainid, ipObj.account) == true) {
if(firewallTabIsShownInAdvancedZone == true)
if(g_firewallRuleUiEnabled == true)
$("#tab_firewall").show();
else
$("#tab_firewall").hide();
@ -1167,8 +1166,8 @@ function showEnableVPNDialog($thisTab) {
array1.push("&account="+ipObj.account);
array1.push("&domainid="+ipObj.domainid);
array1.push("&zoneid="+ipObj.zoneid);
if(firewallTabIsShownInAdvancedZone == true)
array1.push("&openfirewall=false");
if(g_firewallRuleUiEnabled == true)
array1.push("&openfirewall=true");
$.ajax({
data: createURL("command=createRemoteAccessVpn"+array1.join("")),
@ -1719,14 +1718,11 @@ var ipActionMap = {
dialogBeforeActionFn : doReleaseIp,
inProcessText: "label.action.release.ip.processing",
afterActionSeccessFn: function(json, $midmenuItem1, id) {
$midmenuItem1.slideUp("slow", function(){
$(this).remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
ipClearRightPanel();
}
});
$midmenuItem1.remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
ipClearRightPanel();
}
}
},
"label.action.enable.static.NAT": {

View File

@ -1527,6 +1527,7 @@ var g_enableLogging = false;
var g_timezoneoffset = null;
var g_timezone = null;
var g_supportELB = null;
var g_firewallRuleUiEnabled = null; //true or false
// capabilities
var g_directAttachSecurityGroupsEnabled = "false";
@ -1535,8 +1536,6 @@ function getDirectAttachSecurityGroupsEnabled() { return g_directAttachSecurityG
var g_userPublicTemplateEnabled = "true";
function getUserPublicTemplateEnabled() { return g_userPublicTemplateEnabled; }
var g_supportELB = null;
//keyboard keycode
var keycode_Enter = 13;

View File

@ -1519,13 +1519,11 @@ var directNetworkActionMap = {
dialogBeforeActionFn : doDeleteDirectNetwork,
inProcessText: "label.action.delete.network.processing",
afterActionSeccessFn: function(json, $midmenuItem1, id) {
$midmenuItem1.slideUp("slow", function() {
$(this).remove();
if(id.toString() == $("#right_panel_content").find("#direct_network_page").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
directNetworkClearRightPanel();
}
});
$midmenuItem1.remove();
if(id.toString() == $("#right_panel_content").find("#direct_network_page").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
directNetworkClearRightPanel();
}
}
}
}

View File

@ -350,6 +350,8 @@ function podClearDetailsTab() {
$thisTab.find("#gateway").text("");
$thisTab.find("#gateway_edit").val("");
$thisTab.find("#allocationstate").text("");
}
function getIpRange(startip, endip) {
@ -1132,13 +1134,11 @@ var podActionMap = {
dialogBeforeActionFn : doDeletePod,
inProcessText: "label.action.delete.pod.processing",
afterActionSeccessFn: function(json, $midmenuItem1, id) {
$midmenuItem1.slideUp("slow", function() {
$(this).remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
podClearRightPanel();
}
});
$midmenuItem1.remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
podClearRightPanel();
}
}
}
}

View File

@ -278,13 +278,11 @@ var primarystorageActionMap = {
dialogBeforeActionFn: doDeletePrimaryStorage,
inProcessText: "label.action.delete.primary.storage.processing",
afterActionSeccessFn: function(json, $midmenuItem1, id) {
$midmenuItem1.slideUp("slow", function() {
$(this).remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
primarystorageClearRightPanel();
}
});
$midmenuItem1.remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
primarystorageClearRightPanel();
}
}
}
}

View File

@ -168,13 +168,11 @@ var secondaryStorageActionMap = {
dialogBeforeActionFn: doDeleteSecondaryStorage,
inProcessText: "label.action.delete.secondary.storage.processing",
afterActionSeccessFn: function(json, $midmenuItem1, id) {
$midmenuItem1.slideUp("slow", function() {
$(this).remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
secondaryStorageClearRightPanel();
}
});
$midmenuItem1.remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
secondaryStorageClearRightPanel();
}
}
}
}

View File

@ -588,13 +588,11 @@ var securityGroupActionMap = {
dialogBeforeActionFn : doDeleteSecurityGroup,
inProcessText: "Deleting Security Group....",
afterActionSeccessFn: function(json, $midmenuItem1, id) {
$midmenuItem1.slideUp("slow", function() {
$(this).remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
securityGroupClearRightPanel();
}
});
$midmenuItem1.remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
securityGroupClearRightPanel();
}
}
}
}

View File

@ -391,13 +391,11 @@ var serviceOfferingActionMap = {
dialogBeforeActionFn : doDeleteServiceOffering,
inProcessText: "label.action.delete.service.offering.processing",
afterActionSeccessFn: function(json, $midmenuItem1, id) {
$midmenuItem1.slideUp("slow", function() {
$(this).remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
serviceOfferingClearRightPanel();
}
});
$midmenuItem1.remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
serviceOfferingClearRightPanel();
}
}
}
}

View File

@ -198,7 +198,8 @@ function snapshotClearDetailsTab() {
var $thisTab = $("#right_panel_content #tab_content_details");
$thisTab.find("#id").text("");
$thisTab.find("#name").text("");
$thisTab.find("#volume_name").text("");
$thisTab.find("#volume_name").text("");
$thisTab.find("#state").text("");
$thisTab.find("#interval_type").text("");
$thisTab.find("#account").text("");
$thisTab.find("#domain").text("");
@ -220,13 +221,11 @@ var snapshotActionMap = {
dialogBeforeActionFn : doSnapshotDelete,
inProcessText: "label.action.delete.snapshot.processing",
afterActionSeccessFn: function(json, $midmenuItem1, id){
$midmenuItem1.slideUp("slow", function() {
$(this).remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
snapshotClearRightPanel();
}
});
$midmenuItem1.remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
snapshotClearRightPanel();
}
}
}
,

View File

@ -401,13 +401,11 @@ var systemServiceOfferingActionMap = {
dialogBeforeActionFn : doDeleteSystemServiceOffering,
inProcessText: "label.action.delete.service.offering.processing",
afterActionSeccessFn: function(json, $midmenuItem1, id) {
$midmenuItem1.slideUp("slow", function() {
$(this).remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
systemServiceOfferingClearRightPanel();
}
});
$midmenuItem1.remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
systemServiceOfferingClearRightPanel();
}
}
}
}

View File

@ -449,7 +449,9 @@ function volumeJsonToDetailsTab(){
buildActionLinkForTab("label.action.take.snapshot", volumeActionMap, $actionMenu, $midmenuItem1, $thisTab); //show take snapshot
buildActionLinkForTab("label.action.recurring.snapshot", volumeActionMap, $actionMenu, $midmenuItem1, $thisTab); //show Recurring Snapshot
buildActionLinkForTab("label.action.download.volume", volumeActionMap, $actionMenu, $midmenuItem1, $thisTab);
if(jsonObj.state != "Allocated")
buildActionLinkForTab("label.action.download.volume", volumeActionMap, $actionMenu, $midmenuItem1, $thisTab);
if(jsonObj.state != "Creating" && jsonObj.state != "Corrupted" && jsonObj.name != "attaching") {
if(jsonObj.type=="ROOT") {
@ -601,13 +603,11 @@ var volumeActionMap = {
dialogBeforeActionFn : doDeleteVolume,
inProcessText: "label.action.delete.volume.processing",
afterActionSeccessFn: function(json, $midmenuItem1, id) {
$midmenuItem1.slideUp("slow", function() {
$(this).remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
volumeClearRightPanel();
}
});
$midmenuItem1.remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
volumeClearRightPanel();
}
}
},
"label.action.take.snapshot": {

View File

@ -396,13 +396,11 @@ var zoneActionMap = {
dialogBeforeActionFn : doDeleteZone,
inProcessText: "label.action.delete.zone.processing",
afterActionSeccessFn: function(json, $leftmenuItem1, id) {
$leftmenuItem1.slideUp(function() {
$(this).remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
zoneJsonClearRightPanel();
}
});
$leftmenuItem1.remove();
if(id.toString() == $("#right_panel_content").find("#tab_content_details").find("#id").text()) {
clearRightPanel();
zoneJsonClearRightPanel();
}
}
}
}