mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-15 18:12:35 +01:00
bug 7116: host page, zone page - clean up the confirmation dialogs to use a single dialog (i.e. "dialog_confirmation").
This commit is contained in:
parent
f04b457508
commit
958e7fe8df
@ -118,10 +118,6 @@ please.confirm.you.want.to.lock.account.that.will.prevent.account.access.to.the.
|
||||
please.confirm.you.want.to.enable.account = Please confirm you want to enable account.
|
||||
please.select.an.available.zone.to.associate.your.new.ip.with..acquiring.additional.ip.may.cost.you.an.additional.dollars.per.month. = Please select an availability zone to associate your new IP with. Acquiring additional IP may cost you an additional dollars per month.
|
||||
please.restart.your.management.server.for.your.new.settings.to.take.effect = Please RESTART your management server for your new settings to take effect
|
||||
enabling.maintenance.mode.will.cause.a.live.migration.of.all.running.instances.on.this.host.to.any.available.host = Enabling maintenance mode will cause a live migration of all running instances on this host to any available host.
|
||||
please.confirm.you.want.to.cancel.maintenance.for.the.host = Please confirm you want to cancel maintenance for the host
|
||||
please.confirm.you.want.to.force.a.reconnection.for.the.host = Please confirm you want to force a reconnection for the host
|
||||
please.confirm.you.want.to.remove.the.host.from.the.management.server = Please confirm you want to remove the host from the management server
|
||||
Please.choose.a.OS.preference.for.this.host..Virtual.machines.will.always.be.allocated.to.hosts.with.an.OS.preference.that.matches.with.the.OS.type.of.the.template.chosen.for.the.virtual.machine.before.choosing.other.hosts. = Please choose a OS preference for this host. Virtual machines will always be allocated to hosts with an OS preference that matches with the OS type of the template chosen for the virtual machine before choosing other hosts.
|
||||
please.confirm.you.want.to.delete.the.primary.storage = Please confirm you want to delete the primary storage
|
||||
please.confirm.you.want.to.delete.the.secondary.storage = Please confirm you want to delete the secondary storage
|
||||
|
||||
@ -918,27 +918,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- dialogs -->
|
||||
<div id="dialog_confirmation_enable_maintenance" title="Confirmation" style="display: none">
|
||||
<p>
|
||||
<%=t.t("enabling.maintenance.mode.will.cause.a.live.migration.of.all.running.instances.on.this.host.to.any.available.host")%>
|
||||
</p>
|
||||
</div>
|
||||
<div id="dialog_confirmation_cancel_maintenance" title="Confirmation" style="display: none">
|
||||
<p>
|
||||
<%=t.t("please.confirm.you.want.to.cancel.maintenance.for.the.host")%>
|
||||
</p>
|
||||
</div>
|
||||
<div id="dialog_confirmation_force_reconnect" title="Confirmation" style="display: none">
|
||||
<p>
|
||||
<%=t.t("please.confirm.you.want.to.force.a.reconnection.for.the.host")%>
|
||||
</p>
|
||||
</div>
|
||||
<div id="dialog_confirmation_remove_host" title="Confirmation" style="display: none">
|
||||
<p>
|
||||
<%=t.t("please.confirm.you.want.to.remove.the.host.from.the.management.server")%>
|
||||
</p>
|
||||
</div>
|
||||
<!-- Update OS Preference Dialog -->
|
||||
<div id="dialog_update_os" title="Update OS Preference" style="display: none">
|
||||
<p>
|
||||
|
||||
@ -563,12 +563,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- Add VLAN IP Range Dialog for zone (end) -->
|
||||
<div id="dialog_confirmation_delete_secondarystorage" title="Confirmation" style="display: none">
|
||||
<p>
|
||||
<%=t.t("please.confirm.you.want.to.delete.the.secondary.storage")%>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Add Host Dialog in zone page (begin) -->
|
||||
<div id="dialog_add_host_in_zone_page" title="Add Host" style="display: none">
|
||||
|
||||
@ -66,17 +66,13 @@ function hostToRightPanel($midmenuItem1) {
|
||||
}
|
||||
|
||||
function afterLoadHostJSP() {
|
||||
initDialog("dialog_add_host");
|
||||
initDialog("dialog_confirmation_enable_maintenance");
|
||||
initDialog("dialog_confirmation_cancel_maintenance");
|
||||
initDialog("dialog_confirmation_force_reconnect");
|
||||
initDialog("dialog_confirmation_remove_host");
|
||||
initDialog("dialog_add_host");
|
||||
initDialog("dialog_update_os");
|
||||
|
||||
// switch between different tabs
|
||||
var tabArray = [$("#tab_details"), $("#tab_primarystorage"), $("#tab_instance"), $("#tab_router"), $("#tab_systemvm"), $("#tab_statistics")];
|
||||
var tabContentArray = [$("#tab_content_details"), $("#tab_content_primarystorage"), $("#tab_content_instance"), $("#tab_content_router"), $("#tab_content_systemvm"), $("#tab_content_statistics")];
|
||||
var afterSwitchFnArray = [hostJsonToDetailsTab, hostJsonToPrimaryStorageTab, hostJsonToInstanceTab, hostJsonToRouterTab, hostJsonToSystemvmTab, hostJsonToStatisticsTab];
|
||||
var tabArray = [$("#tab_details"), $("#tab_instance"), $("#tab_router"), $("#tab_systemvm"), $("#tab_statistics")];
|
||||
var tabContentArray = [$("#tab_content_details"), $("#tab_content_instance"), $("#tab_content_router"), $("#tab_content_systemvm"), $("#tab_content_statistics")];
|
||||
var afterSwitchFnArray = [hostJsonToDetailsTab, hostJsonToInstanceTab, hostJsonToRouterTab, hostJsonToSystemvmTab, hostJsonToStatisticsTab];
|
||||
switchBetweenDifferentTabs(tabArray, tabContentArray, afterSwitchFnArray);
|
||||
|
||||
hostRefreshDataBinding();
|
||||
@ -197,174 +193,6 @@ function hostJsonToDetailsTab() {
|
||||
$thisTab.find("#tab_container").show();
|
||||
}
|
||||
|
||||
function hostJsonToPrimaryStorageTab() {
|
||||
var $midmenuItem1 = $("#right_panel_content").data("$midmenuItem1");
|
||||
if($midmenuItem1 == null)
|
||||
return;
|
||||
|
||||
var jsonObj = $midmenuItem1.data("jsonObj");
|
||||
if(jsonObj == null)
|
||||
return;
|
||||
|
||||
var $thisTab = $("#right_panel_content #tab_content_primarystorage");
|
||||
$thisTab.find("#tab_container").hide();
|
||||
$thisTab.find("#tab_spinning_wheel").show();
|
||||
|
||||
$.ajax({
|
||||
cache: false,
|
||||
data: createURL("command=listStoragePools&clusterid="+jsonObj.clusterid),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var items = json.liststoragepoolsresponse.storagepool;
|
||||
var $container = $thisTab.find("#tab_container").empty();
|
||||
if(items != null && items.length > 0) {
|
||||
var $template = $("#primarystorage_tab_template");
|
||||
for(var i=0; i<items.length;i++) {
|
||||
var $newTemplate = $template.clone(true);
|
||||
hostPrimaryStorageJSONToTemplate(items[i], $newTemplate);
|
||||
$container.append($newTemplate.show());
|
||||
}
|
||||
}
|
||||
$thisTab.find("#tab_spinning_wheel").hide();
|
||||
$thisTab.find("#tab_container").show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function hostJsonClearPrimaryStorageTab() {
|
||||
var $thisTab = $("#right_panel_content").find("#tab_content_primarystorage");
|
||||
$thisTab.find("#tab_container").empty();
|
||||
}
|
||||
|
||||
function hostPrimaryStorageJSONToTemplate(jsonObj, $template) {
|
||||
$template.data("jsonObj", jsonObj);
|
||||
$template.attr("id", "host_primarystorage_"+jsonObj.id).data("hostPrimarystorageId", jsonObj.id);
|
||||
$template.find("#grid_header_title").text(fromdb(jsonObj.name));
|
||||
$template.find("#id").text(fromdb(jsonObj.id));
|
||||
$template.find("#name").text(fromdb(jsonObj.name));
|
||||
|
||||
setHostStateInRightPanel(fromdb(jsonObj.state), $template.find("#state"));
|
||||
|
||||
$template.find("#zonename").text(fromdb(jsonObj.zonename));
|
||||
$template.find("#podname").text(fromdb(jsonObj.podname));
|
||||
$template.find("#clustername").text(fromdb(jsonObj.clustername));
|
||||
var storageType = "ISCSI Share";
|
||||
if (jsonObj.type == 'NetworkFilesystem')
|
||||
storageType = "NFS Share";
|
||||
$template.find("#type").text(fromdb(storageType));
|
||||
$template.find("#ipaddress").text(fromdb(jsonObj.ipaddress));
|
||||
$template.find("#path").text(fromdb(jsonObj.path));
|
||||
$template.find("#disksizetotal").text(convertBytes(jsonObj.disksizetotal));
|
||||
$template.find("#disksizeallocated").text(convertBytes(jsonObj.disksizeallocated));
|
||||
|
||||
$template.find("#tags").text(fromdb(jsonObj.tags));
|
||||
|
||||
var $actionLink = $template.find("#primarystorage_action_link");
|
||||
$actionLink.bind("mouseover", function(event) {
|
||||
$(this).find("#primarystorage_action_menu").show();
|
||||
return false;
|
||||
});
|
||||
$actionLink.bind("mouseout", function(event) {
|
||||
$(this).find("#primarystorage_action_menu").hide();
|
||||
return false;
|
||||
});
|
||||
|
||||
var $actionMenu = $actionLink.find("#primarystorage_action_menu");
|
||||
$actionMenu.find("#action_list").empty();
|
||||
|
||||
buildActionLinkForSubgridItem("Enable Maintenance Mode", hostPrimarystorageActionMap, $actionMenu, $template);
|
||||
buildActionLinkForSubgridItem("Cancel Maintenance Mode", hostPrimarystorageActionMap, $actionMenu, $template);
|
||||
buildActionLinkForSubgridItem("Delete Primary Storage", hostPrimarystorageActionMap, $actionMenu, $template);
|
||||
}
|
||||
|
||||
var hostPrimarystorageActionMap = {
|
||||
"Enable Maintenance Mode": {
|
||||
isAsyncJob: true,
|
||||
asyncJobResponse: "prepareprimarystorageformaintenanceresponse",
|
||||
dialogBeforeActionFn: doEnableMaintenanceModeForPrimaryStorageInHostPage,
|
||||
inProcessText: "Enabling Maintenance Mode....",
|
||||
afterActionSeccessFn: function(json, id, $subgridItem) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.storagepool;
|
||||
hostPrimaryStorageJSONToTemplate(item, $subgridItem);
|
||||
$subgridItem.find("#after_action_info").text("We are actively enabling maintenance. Please refresh periodically for an updated status.");
|
||||
}
|
||||
},
|
||||
"Cancel Maintenance Mode": {
|
||||
isAsyncJob: true,
|
||||
asyncJobResponse: "cancelprimarystoragemaintenanceresponse",
|
||||
dialogBeforeActionFn: doCancelMaintenanceModeForPrimaryStorageInHostPage,
|
||||
inProcessText: "Cancelling Maintenance Mode....",
|
||||
afterActionSeccessFn: function(json, id, $subgridItem) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.storagepool;
|
||||
hostPrimaryStorageJSONToTemplate(item, $subgridItem);
|
||||
$subgridItem.find("#after_action_info").text("We are actively cancelling your scheduled maintenance. Please refresh periodically for an updated status.");
|
||||
}
|
||||
},
|
||||
"Delete Primary Storage": {
|
||||
isAsyncJob: false,
|
||||
dialogBeforeActionFn: doDeletePrimaryStorageInHostPage,
|
||||
inProcessText: "Deleting Primary Storage....",
|
||||
afterActionSeccessFn: function(json, id, $subgridItem) {
|
||||
$subgridItem.slideUp("slow", function() {
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function doEnableMaintenanceModeForPrimaryStorageInHostPage($actionLink, $subgridItem) {
|
||||
var jsonObj = $subgridItem.data("jsonObj");
|
||||
|
||||
$("#dialog_confirmation")
|
||||
.text("Warning: placing the primary storage into maintenance mode will cause all VMs using volumes from it to be stopped. Do you want to continue?")
|
||||
.dialog("option", "buttons", {
|
||||
"OK": function() {
|
||||
$(this).dialog("close");
|
||||
var id = jsonObj.id;
|
||||
var apiCommand = "command=enableStorageMaintenance&id="+id;
|
||||
doActionToSubgridItem(id, $actionLink, apiCommand, $subgridItem);
|
||||
},
|
||||
"Cancel": function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}).dialog("open");
|
||||
}
|
||||
|
||||
function doCancelMaintenanceModeForPrimaryStorageInHostPage($actionLink, $subgridItem) {
|
||||
var jsonObj = $subgridItem.data("jsonObj");
|
||||
|
||||
$("#dialog_confirmation")
|
||||
.text("Please confirm you want to cancel maintenace")
|
||||
.dialog("option", "buttons", {
|
||||
"OK": function() {
|
||||
$(this).dialog("close");
|
||||
var id = jsonObj.id;
|
||||
var apiCommand = "command=cancelStorageMaintenance&id="+id;
|
||||
doActionToSubgridItem(id, $actionLink, apiCommand, $subgridItem);
|
||||
},
|
||||
"Cancel": function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}).dialog("open");
|
||||
}
|
||||
|
||||
function doDeletePrimaryStorageInHostPage($actionLink, $subgridItem) {
|
||||
var jsonObj = $subgridItem.data("jsonObj");
|
||||
|
||||
$("#dialog_confirmation_delete_primarystorage")
|
||||
.dialog("option", "buttons", {
|
||||
"OK": function() {
|
||||
$(this).dialog("close");
|
||||
var id = jsonObj.id;
|
||||
var apiCommand = "command=deleteStoragePool&id="+id;
|
||||
doActionToSubgridItem(id, $actionLink, apiCommand, $subgridItem);
|
||||
},
|
||||
"Cancel": function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}).dialog("open");
|
||||
}
|
||||
|
||||
function hostJsonToInstanceTab() {
|
||||
var $midmenuItem1 = $("#right_panel_content").data("$midmenuItem1");
|
||||
if($midmenuItem1 == null)
|
||||
@ -585,8 +413,7 @@ function hostSystemvmJSONToTemplate(jsonObj, template) {
|
||||
}
|
||||
|
||||
function hostClearRightPanel() {
|
||||
hostClearDetailsTab();
|
||||
hostJsonClearPrimaryStorageTab();
|
||||
hostClearDetailsTab();
|
||||
hostJsonClearInstanceTab();
|
||||
hostJsonClearRouterTab();
|
||||
hostJsonClearSystemvmTab();
|
||||
@ -702,7 +529,8 @@ var hostActionMap = {
|
||||
function doEnableMaintenanceMode($actionLink, $detailsTab, $midmenuItem1){
|
||||
var jsonObj = $midmenuItem1.data("jsonObj");
|
||||
|
||||
$("#dialog_confirmation_enable_maintenance")
|
||||
$("#dialog_confirmation")
|
||||
.text("Enabling maintenance mode will cause a live migration of all running instances on this host to any available host.")
|
||||
.dialog("option", "buttons", {
|
||||
"OK": function() {
|
||||
$(this).dialog("close");
|
||||
@ -719,7 +547,8 @@ function doEnableMaintenanceMode($actionLink, $detailsTab, $midmenuItem1){
|
||||
function doCancelMaintenanceMode($actionLink, $detailsTab, $midmenuItem1){
|
||||
var jsonObj = $midmenuItem1.data("jsonObj");
|
||||
|
||||
$("#dialog_confirmation_cancel_maintenance")
|
||||
$("#dialog_confirmation")
|
||||
.text("Please confirm you want to cancel maintenance for the host")
|
||||
.dialog("option", "buttons", {
|
||||
"OK": function() {
|
||||
$(this).dialog("close");
|
||||
@ -736,7 +565,8 @@ function doCancelMaintenanceMode($actionLink, $detailsTab, $midmenuItem1){
|
||||
function doForceReconnect($actionLink, $detailsTab, $midmenuItem1){
|
||||
var jsonObj = $midmenuItem1.data("jsonObj");
|
||||
|
||||
$("#dialog_confirmation_force_reconnect")
|
||||
$("#dialog_confirmation")
|
||||
.text("Please confirm you want to force a reconnection for the host")
|
||||
.dialog("option", "buttons", {
|
||||
"OK": function() {
|
||||
$(this).dialog("close");
|
||||
@ -753,7 +583,8 @@ function doForceReconnect($actionLink, $detailsTab, $midmenuItem1){
|
||||
function doRemoveHost($actionLink, $detailsTab, $midmenuItem1){
|
||||
var jsonObj = $midmenuItem1.data("jsonObj");
|
||||
|
||||
$("#dialog_confirmation_remove_host")
|
||||
$("#dialog_confirmation")
|
||||
.text("Please confirm you want to remove the host from the management server")
|
||||
.dialog("option", "buttons", {
|
||||
"OK": function() {
|
||||
$(this).dialog("close");
|
||||
|
||||
@ -25,8 +25,7 @@
|
||||
initDialog("dialog_add_external_cluster_in_zone_page", 320);
|
||||
initDialog("dialog_add_pod", 370);
|
||||
initDialog("dialog_add_vlan_for_zone");
|
||||
initDialog("dialog_add_secondarystorage");
|
||||
initDialog("dialog_confirmation_delete_secondarystorage");
|
||||
initDialog("dialog_add_secondarystorage");
|
||||
initDialog("dialog_add_host_in_zone_page");
|
||||
initDialog("dialog_add_pool_in_zone_page");
|
||||
|
||||
@ -886,7 +885,8 @@ var secondarystorageActionMap = {
|
||||
function doDeleteSecondaryStorage($actionLink, $subgridItem) {
|
||||
var jsonObj = $subgridItem.data("jsonObj");
|
||||
|
||||
$("#dialog_confirmation_delete_secondarystorage")
|
||||
$("#dialog_confirmation")
|
||||
.text("Please confirm you want to delete the secondary storage")
|
||||
.dialog('option', 'buttons', {
|
||||
"Confirm": function() {
|
||||
var $thisDialog = $(this);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user