diff --git a/ui/scripts/cloud.core.cluster.js b/ui/scripts/cloud.core.cluster.js index 090672fa6ed..19027d12cd4 100644 --- a/ui/scripts/cloud.core.cluster.js +++ b/ui/scripts/cloud.core.cluster.js @@ -91,6 +91,8 @@ function clusterClearDetailsTab() { $thisTab.find("#name").text(""); $thisTab.find("#zonename").text(""); $thisTab.find("#podname").text(""); + $thisTab.find("#hypervisortype").text(""); + $thisTab.find("#clustertype").text(""); //actions *** var $actionMenu = $thisTab.find("#action_link #action_menu"); @@ -101,7 +103,8 @@ function clusterClearDetailsTab() { var clusterActionMap = { "Delete Cluster": { api: "deleteCluster", - isAsyncJob: false, + isAsyncJob: false, + dialogBeforeActionFn : doDeleteCluster, inProcessText: "Deleting Cluster....", afterActionSeccessFn: function(json, $midmenuItem1, id) { $midmenuItem1.slideUp("slow", function() { @@ -114,3 +117,21 @@ var clusterActionMap = { } } } + +function doDeleteCluster($actionLink, $detailsTab, $midmenuItem1) { + var jsonObj = $midmenuItem1.data("jsonObj"); + var id = jsonObj.id; + + $("#dialog_confirmation") + .text("Please confirm you want to delete this cluster") + .dialog('option', 'buttons', { + "Confirm": function() { + $(this).dialog("close"); + var apiCommand = "command=deleteCluster&id="+id; + doActionToTab(id, $actionLink, apiCommand, $midmenuItem1, $detailsTab); + }, + "Cancel": function() { + $(this).dialog("close"); + } + }).dialog("open"); +} \ No newline at end of file