From ac6f715d198b0303c40c3850d5985ad4c5a3c5dd Mon Sep 17 00:00:00 2001 From: phamt Date: Mon, 24 Oct 2011 20:27:16 +0000 Subject: [PATCH] Switch to softoff for zVM plugin. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10875 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/service/service.js | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/xCAT-UI/js/service/service.js b/xCAT-UI/js/service/service.js index 592db0432..6a23ea84d 100644 --- a/xCAT-UI/js/service/service.js +++ b/xCAT-UI/js/service/service.js @@ -1008,26 +1008,48 @@ function setUserNodes(data) { /** * Power on a given node * - * @param node + * @param tgtNodes * Node to power on or off * @param power2 * Power node to given state * @return Nothing */ -function powerNode(node, power2) { +function powerNode(tgtNodes, power2) { // Show power loader var nodesDTId = 'userNodesDT'; var powerCol = $('#' + nodesDTId + '_wrapper .dataTables_scrollHead .datatable thead tr th:eq(3)'); powerCol.find('img').show(); + var nodes = tgtNodes.split(','); + for (var n in nodes) { + // Get hardware that was selected + var hw = getUserNodeAttr(nodes[n], 'mgt'); + + // Change to power softoff (to gracefully shutdown) + switch (hw) { + case "blade": + break; + case "hmc": + break; + case "ipmi": + break; + case "zvm": + if (power2 == 'off') { + power2 = 'softoff'; + } + + break; + } + } + $.ajax({ url : 'lib/srv_cmd.php', dataType : 'json', data : { cmd : 'rpower', - tgt : node, + tgt : tgtNodes, args : power2, - msg : node + msg : tgtNodes }, success : updatePowerStatus @@ -1074,6 +1096,10 @@ function updatePowerStatus(data) { alert(rsp[i]); } } + + var powerCol = $('#' + nodesDTId + '_wrapper .dataTables_scrollHead .datatable thead tr th:eq(3)'); + powerCol.find('img').hide(); + adjustColumnSize(nodesDTId); } /**