mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +01:00
bug 6873: CloudStack UI - Enable/Disable Cluster/Pod/Zone action: only refresh allocationstate grid row and action menu after action succeeds.
This commit is contained in:
parent
43c3c775f2
commit
db6264cd43
@ -64,12 +64,6 @@ function clusterJsonToDetailsTab() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
clusterJsonToDetailsTab2(jsonObj);
|
|
||||||
}
|
|
||||||
|
|
||||||
function clusterJsonToDetailsTab2(jsonObj) {
|
|
||||||
var $midmenuItem1 = $("#right_panel_content").data("$midmenuItem1");
|
|
||||||
|
|
||||||
var $thisTab = $("#right_panel_content").find("#tab_content_details");
|
var $thisTab = $("#right_panel_content").find("#tab_content_details");
|
||||||
$thisTab.find("#grid_header_title").text(fromdb(jsonObj.name));
|
$thisTab.find("#grid_header_title").text(fromdb(jsonObj.name));
|
||||||
$thisTab.find("#id").text(fromdb(jsonObj.id));
|
$thisTab.find("#id").text(fromdb(jsonObj.id));
|
||||||
@ -81,6 +75,13 @@ function clusterJsonToDetailsTab2(jsonObj) {
|
|||||||
$thisTab.find("#allocationstate").text(fromdb(jsonObj.allocationstate));
|
$thisTab.find("#allocationstate").text(fromdb(jsonObj.allocationstate));
|
||||||
|
|
||||||
//actions ***
|
//actions ***
|
||||||
|
clusterBuildActionMenu(jsonObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
function clusterBuildActionMenu(jsonObj) {
|
||||||
|
var $midmenuItem1 = $("#right_panel_content").data("$midmenuItem1");
|
||||||
|
var $thisTab = $("#right_panel_content").find("#tab_content_details");
|
||||||
|
|
||||||
var $actionLink = $thisTab.find("#action_link");
|
var $actionLink = $thisTab.find("#action_link");
|
||||||
bindActionLink($actionLink);
|
bindActionLink($actionLink);
|
||||||
|
|
||||||
@ -118,7 +119,8 @@ var clusterActionMap = {
|
|||||||
inProcessText: "label.action.enable.cluster.processing",
|
inProcessText: "label.action.enable.cluster.processing",
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
var jsonObj = json.updateclusterresponse.cluster;
|
var jsonObj = json.updateclusterresponse.cluster;
|
||||||
clusterJsonToDetailsTab2(jsonObj);
|
$("#right_panel_content").find("#tab_content_details").find("#allocationstate").text(fromdb(jsonObj.allocationstate));
|
||||||
|
clusterBuildActionMenu(jsonObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
@ -128,7 +130,8 @@ var clusterActionMap = {
|
|||||||
inProcessText: "label.action.disable.cluster.processing",
|
inProcessText: "label.action.disable.cluster.processing",
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
var jsonObj = json.updateclusterresponse.cluster;
|
var jsonObj = json.updateclusterresponse.cluster;
|
||||||
clusterJsonToDetailsTab2(jsonObj);
|
$("#right_panel_content").find("#tab_content_details").find("#allocationstate").text(fromdb(jsonObj.allocationstate));
|
||||||
|
clusterBuildActionMenu(jsonObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
|
|||||||
@ -116,35 +116,33 @@ function podJsonToDetailsTab() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
podJsonToDetailsTab2(jsonObj);
|
|
||||||
}
|
|
||||||
|
|
||||||
function podJsonToDetailsTab2(jsonObj) {
|
|
||||||
var $leftmenuItem1 = $("#right_panel_content").data("$leftmenuItem1");
|
|
||||||
|
|
||||||
var $thisTab = $("#right_panel_content #tab_content_details");
|
var $thisTab = $("#right_panel_content #tab_content_details");
|
||||||
$thisTab.find("#tab_container").hide();
|
$thisTab.find("#tab_container").hide();
|
||||||
$thisTab.find("#tab_spinning_wheel").show();
|
$thisTab.find("#tab_spinning_wheel").show();
|
||||||
|
|
||||||
$thisTab.find("#id").text(fromdb(jsonObj.id));
|
$thisTab.find("#id").text(fromdb(jsonObj.id));
|
||||||
$thisTab.find("#grid_header_title").text(fromdb(jsonObj.name));
|
$thisTab.find("#grid_header_title").text(fromdb(jsonObj.name));
|
||||||
|
|
||||||
$thisTab.find("#name").text(fromdb(jsonObj.name));
|
$thisTab.find("#name").text(fromdb(jsonObj.name));
|
||||||
$thisTab.find("#name_edit").val(fromdb(jsonObj.name));
|
$thisTab.find("#name_edit").val(fromdb(jsonObj.name));
|
||||||
|
|
||||||
$thisTab.find("#netmask").text(fromdb(jsonObj.netmask));
|
$thisTab.find("#netmask").text(fromdb(jsonObj.netmask));
|
||||||
$thisTab.find("#netmask_edit").val(fromdb(jsonObj.netmask));
|
$thisTab.find("#netmask_edit").val(fromdb(jsonObj.netmask));
|
||||||
|
|
||||||
$thisTab.find("#ipRange").text(getIpRange(jsonObj.startip, jsonObj.endip));
|
$thisTab.find("#ipRange").text(getIpRange(jsonObj.startip, jsonObj.endip));
|
||||||
$thisTab.find("#startIpRange_edit").val(fromdb(jsonObj.startip));
|
$thisTab.find("#startIpRange_edit").val(fromdb(jsonObj.startip));
|
||||||
$thisTab.find("#endIpRange_edit").val(fromdb(jsonObj.endip));
|
$thisTab.find("#endIpRange_edit").val(fromdb(jsonObj.endip));
|
||||||
|
|
||||||
$thisTab.find("#gateway").text(fromdb(jsonObj.gateway));
|
$thisTab.find("#gateway").text(fromdb(jsonObj.gateway));
|
||||||
$thisTab.find("#gateway_edit").val(fromdb(jsonObj.gateway));
|
$thisTab.find("#gateway_edit").val(fromdb(jsonObj.gateway));
|
||||||
|
|
||||||
$thisTab.find("#allocationstate").text(fromdb(jsonObj.allocationstate));
|
$thisTab.find("#allocationstate").text(fromdb(jsonObj.allocationstate));
|
||||||
|
|
||||||
//actions ***
|
//actions ***
|
||||||
|
podBuildActionMenu(jsonObj);
|
||||||
|
|
||||||
|
$thisTab.find("#tab_spinning_wheel").hide();
|
||||||
|
$thisTab.find("#tab_container").show();
|
||||||
|
}
|
||||||
|
|
||||||
|
function podBuildActionMenu(jsonObj) {
|
||||||
|
var $leftmenuItem1 = $("#right_panel_content").data("$leftmenuItem1");
|
||||||
|
var $thisTab = $("#right_panel_content #tab_content_details");
|
||||||
|
|
||||||
var $actionLink = $thisTab.find("#action_link");
|
var $actionLink = $thisTab.find("#action_link");
|
||||||
bindActionLink($actionLink);
|
bindActionLink($actionLink);
|
||||||
|
|
||||||
@ -158,9 +156,6 @@ function podJsonToDetailsTab2(jsonObj) {
|
|||||||
buildActionLinkForTab("label.action.disable.pod", podActionMap, $actionMenu, $leftmenuItem1, $thisTab);
|
buildActionLinkForTab("label.action.disable.pod", podActionMap, $actionMenu, $leftmenuItem1, $thisTab);
|
||||||
|
|
||||||
buildActionLinkForTab("label.action.delete.pod", podActionMap, $actionMenu, $leftmenuItem1, $thisTab);
|
buildActionLinkForTab("label.action.delete.pod", podActionMap, $actionMenu, $leftmenuItem1, $thisTab);
|
||||||
|
|
||||||
$thisTab.find("#tab_spinning_wheel").hide();
|
|
||||||
$thisTab.find("#tab_container").show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function podJsonToNetworkTab() {
|
function podJsonToNetworkTab() {
|
||||||
@ -1107,7 +1102,8 @@ var podActionMap = {
|
|||||||
inProcessText: "label.action.enable.pod.processing",
|
inProcessText: "label.action.enable.pod.processing",
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
var jsonObj = json.updatepodresponse.pod;
|
var jsonObj = json.updatepodresponse.pod;
|
||||||
podJsonToDetailsTab2(jsonObj);
|
$("#right_panel_content").find("#tab_content_details").find("#allocationstate").text(fromdb(jsonObj.allocationstate));
|
||||||
|
podBuildActionMenu(jsonObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
@ -1117,7 +1113,8 @@ var podActionMap = {
|
|||||||
inProcessText: "label.action.disable.pod.processing",
|
inProcessText: "label.action.disable.pod.processing",
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
var jsonObj = json.updatepodresponse.pod;
|
var jsonObj = json.updatepodresponse.pod;
|
||||||
podJsonToDetailsTab2(jsonObj);
|
$("#right_panel_content").find("#tab_content_details").find("#allocationstate").text(fromdb(jsonObj.allocationstate));
|
||||||
|
podBuildActionMenu(jsonObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
,
|
,
|
||||||
|
|||||||
@ -128,39 +128,29 @@ function zoneJsonToDetailsTab() {
|
|||||||
|
|
||||||
if(jsonObj.networktype == "Basic")
|
if(jsonObj.networktype == "Basic")
|
||||||
$("#tab_network, #tab_content_details #vlan_container, #guestcidraddress_container").hide();
|
$("#tab_network, #tab_content_details #vlan_container, #guestcidraddress_container").hide();
|
||||||
|
|
||||||
else if(jsonObj.networktype == "Advanced")
|
else if(jsonObj.networktype == "Advanced")
|
||||||
$("#tab_network, #tab_content_details #vlan_container, #guestcidraddress_container").show();
|
$("#tab_network, #tab_content_details #vlan_container, #guestcidraddress_container").show();
|
||||||
|
|
||||||
zoneJsonToDetailsTab2(jsonObj);
|
|
||||||
}
|
|
||||||
|
|
||||||
function zoneJsonToDetailsTab2(jsonObj) {
|
|
||||||
var $leftmenuItem1 = $("#right_panel_content").data("$leftmenuItem1");
|
|
||||||
|
|
||||||
var $thisTab = $("#right_panel_content").find("#tab_content_details");
|
|
||||||
$thisTab.find("#tab_container").hide();
|
$thisTab.find("#tab_container").hide();
|
||||||
$thisTab.find("#tab_spinning_wheel").show();
|
$thisTab.find("#tab_spinning_wheel").show();
|
||||||
|
|
||||||
$thisTab.find("#id").text(fromdb(jsonObj.id));
|
$thisTab.find("#id").text(fromdb(jsonObj.id));
|
||||||
$thisTab.find("#grid_header_title").text(fromdb(jsonObj.name));
|
$thisTab.find("#grid_header_title").text(fromdb(jsonObj.name));
|
||||||
|
|
||||||
$thisTab.find("#name").text(fromdb(jsonObj.name));
|
$thisTab.find("#name").text(fromdb(jsonObj.name));
|
||||||
$thisTab.find("#name_edit").val(fromdb(jsonObj.name));
|
$thisTab.find("#name_edit").val(fromdb(jsonObj.name));
|
||||||
|
|
||||||
$thisTab.find("#dns1").text(fromdb(jsonObj.dns1));
|
$thisTab.find("#dns1").text(fromdb(jsonObj.dns1));
|
||||||
$thisTab.find("#dns1_edit").val(fromdb(jsonObj.dns1));
|
$thisTab.find("#dns1_edit").val(fromdb(jsonObj.dns1));
|
||||||
|
|
||||||
$thisTab.find("#dns2").text(fromdb(jsonObj.dns2));
|
$thisTab.find("#dns2").text(fromdb(jsonObj.dns2));
|
||||||
$thisTab.find("#dns2_edit").val(fromdb(jsonObj.dns2));
|
$thisTab.find("#dns2_edit").val(fromdb(jsonObj.dns2));
|
||||||
|
|
||||||
$thisTab.find("#internaldns1").text(fromdb(jsonObj.internaldns1));
|
$thisTab.find("#internaldns1").text(fromdb(jsonObj.internaldns1));
|
||||||
$thisTab.find("#internaldns1_edit").val(fromdb(jsonObj.internaldns1));
|
$thisTab.find("#internaldns1_edit").val(fromdb(jsonObj.internaldns1));
|
||||||
|
|
||||||
$thisTab.find("#internaldns2").text(fromdb(jsonObj.internaldns2));
|
$thisTab.find("#internaldns2").text(fromdb(jsonObj.internaldns2));
|
||||||
$thisTab.find("#internaldns2_edit").val(fromdb(jsonObj.internaldns2));
|
$thisTab.find("#internaldns2_edit").val(fromdb(jsonObj.internaldns2));
|
||||||
|
|
||||||
$thisTab.find("#networktype").text(fromdb(jsonObj.networktype));
|
$thisTab.find("#networktype").text(fromdb(jsonObj.networktype));
|
||||||
|
setBooleanReadField(jsonObj.securitygroupsenabled, $thisTab.find("#securitygroupsenabled"));
|
||||||
|
$thisTab.find("#guestcidraddress").text(fromdb(jsonObj.guestcidraddress));
|
||||||
|
$thisTab.find("#guestcidraddress_edit").val(fromdb(jsonObj.guestcidraddress));
|
||||||
|
$thisTab.find("#domain").text(fromdb(jsonObj.domain));
|
||||||
|
$thisTab.find("#allocationstate").text(fromdb(jsonObj.allocationstate));
|
||||||
if(jsonObj.networktype == "Advanced") {
|
if(jsonObj.networktype == "Advanced") {
|
||||||
var vlan = jsonObj.vlan;
|
var vlan = jsonObj.vlan;
|
||||||
$thisTab.find("#vlan").text(fromdb(vlan));
|
$thisTab.find("#vlan").text(fromdb(vlan));
|
||||||
@ -177,16 +167,17 @@ function zoneJsonToDetailsTab2(jsonObj) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setBooleanReadField(jsonObj.securitygroupsenabled, $thisTab.find("#securitygroupsenabled"));
|
|
||||||
|
|
||||||
$thisTab.find("#guestcidraddress").text(fromdb(jsonObj.guestcidraddress));
|
|
||||||
$thisTab.find("#guestcidraddress_edit").val(fromdb(jsonObj.guestcidraddress));
|
|
||||||
|
|
||||||
$thisTab.find("#domain").text(fromdb(jsonObj.domain));
|
|
||||||
|
|
||||||
$thisTab.find("#allocationstate").text(fromdb(jsonObj.allocationstate));
|
|
||||||
|
|
||||||
//actions ***
|
//actions ***
|
||||||
|
zoneBuildActionMenu(jsonObj);
|
||||||
|
|
||||||
|
$thisTab.find("#tab_spinning_wheel").hide();
|
||||||
|
$thisTab.find("#tab_container").show();
|
||||||
|
}
|
||||||
|
|
||||||
|
function zoneBuildActionMenu(jsonObj) {
|
||||||
|
var $leftmenuItem1 = $("#right_panel_content").data("$leftmenuItem1");
|
||||||
|
var $thisTab = $("#right_panel_content").find("#tab_content_details");
|
||||||
|
|
||||||
var $actionLink = $thisTab.find("#action_link");
|
var $actionLink = $thisTab.find("#action_link");
|
||||||
bindActionLink($actionLink);
|
bindActionLink($actionLink);
|
||||||
|
|
||||||
@ -200,9 +191,6 @@ function zoneJsonToDetailsTab2(jsonObj) {
|
|||||||
buildActionLinkForTab("label.action.disable.zone", zoneActionMap, $actionMenu, $leftmenuItem1, $thisTab);
|
buildActionLinkForTab("label.action.disable.zone", zoneActionMap, $actionMenu, $leftmenuItem1, $thisTab);
|
||||||
|
|
||||||
buildActionLinkForTab("label.action.delete.zone", zoneActionMap, $actionMenu, $leftmenuItem1, $thisTab);
|
buildActionLinkForTab("label.action.delete.zone", zoneActionMap, $actionMenu, $leftmenuItem1, $thisTab);
|
||||||
|
|
||||||
$thisTab.find("#tab_spinning_wheel").hide();
|
|
||||||
$thisTab.find("#tab_container").show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function zoneClearDetailsTab() {
|
function zoneClearDetailsTab() {
|
||||||
@ -389,7 +377,8 @@ var zoneActionMap = {
|
|||||||
inProcessText: "label.action.enable.zone.processing",
|
inProcessText: "label.action.enable.zone.processing",
|
||||||
afterActionSeccessFn: function(json, $leftmenuItem1, id) {
|
afterActionSeccessFn: function(json, $leftmenuItem1, id) {
|
||||||
var jsonObj = json.updatezoneresponse.zone;
|
var jsonObj = json.updatezoneresponse.zone;
|
||||||
zoneJsonToDetailsTab2(jsonObj);
|
$("#right_panel_content").find("#tab_content_details").find("#allocationstate").text(fromdb(jsonObj.allocationstate));
|
||||||
|
zoneBuildActionMenu(jsonObj);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"label.action.disable.zone": {
|
"label.action.disable.zone": {
|
||||||
@ -398,7 +387,8 @@ var zoneActionMap = {
|
|||||||
inProcessText: "label.action.disable.zone.processing",
|
inProcessText: "label.action.disable.zone.processing",
|
||||||
afterActionSeccessFn: function(json, $leftmenuItem1, id) {
|
afterActionSeccessFn: function(json, $leftmenuItem1, id) {
|
||||||
var jsonObj = json.updatezoneresponse.zone;
|
var jsonObj = json.updatezoneresponse.zone;
|
||||||
zoneJsonToDetailsTab2(jsonObj);
|
$("#right_panel_content").find("#tab_content_details").find("#allocationstate").text(fromdb(jsonObj.allocationstate));
|
||||||
|
zoneBuildActionMenu(jsonObj);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"label.action.delete.zone": {
|
"label.action.delete.zone": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user