From 557a88de5f1863a17af623077c513630986a21fa Mon Sep 17 00:00:00 2001 From: phamt Date: Tue, 21 Sep 2010 01:35:08 +0000 Subject: [PATCH] Update back-end code fore "Add node" link git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7548 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/nodes/nodes.js | 188 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 180 insertions(+), 8 deletions(-) diff --git a/xCAT-UI/js/nodes/nodes.js b/xCAT-UI/js/nodes/nodes.js index 7be200132..4890b2593 100644 --- a/xCAT-UI/js/nodes/nodes.js +++ b/xCAT-UI/js/nodes/nodes.js @@ -154,8 +154,9 @@ function loadGroups(data) { // Create link to add nodes var addNodeLink = $('Add node'); addNodeLink.bind('click', function(event) { - var nodeForm = '
' - + '
' + // Create form to give node range, group, and hardware management + var mgtForm = '
' + + '
' + '
' + '
' + '' + + '' + '
' + '
'; + + // Create form for ipmi plugin + var ipmiForm = '
' + + '
Under contruction
' + + '
'; + + // Create form for blade plugin + var bladeForm = '
' + + '
Under contruction
' + + '
'; + + // Create form for hmc plugin + var hmcForm = '
' + + '
Under contruction
' + + '
'; + + // Create form for ivm plugin + var ivmForm = '
' + + '
Under contruction
' + + '
'; + + // Create form for fsp plugin + var fspForm = '
' + + '
Under contruction
' + + '
'; + + // Create form for zvm plugin + var zvmForm = '
' + + '
' + + '
' + + '
'; - $.prompt(nodeForm, { - callback : addNode, - buttons : { - Ok : true, - Cancel : false + var states = { + mgt : { + html : mgtForm, + buttons : { + Ok : true, + Cancel : false + }, + focus : 1, + prefix : 'cleanblue', + submit : function(v, m, f) { + if (!v) { + return true; + } else { + // Get the hardware management selected + var mgt = f.mgt; + switch(mgt) { + case "blade": + $.prompt.goToState("blade"); + break; + case "fsp": + $.prompt.goToState("fsp"); + break; + case "hmc": + $.prompt.goToState("hmc"); + break; + case "ipmi": + $.prompt.goToState("ipmi"); + break; + case "ivm": + $.prompt.goToState("ivm"); + break; + case "zvm": + $.prompt.goToState("zvm"); + break; + } + + return false; + } // End of else + } // End of submit }, + + // Show blade form + blade : { + html : bladeForm, + callback : addNode, + buttons : { + Ok : true, + Cancel : false + }, + focus : 1, + prefix : 'cleanblue', + submit : function(v, m, f) { + if (v) { + return true; + } + } + }, + + // Show fsp form + fsp : { + html : fspForm, + callback : addNode, + buttons : { + Ok : true, + Cancel : false + }, + focus : 1, + prefix : 'cleanblue', + submit : function(v, m, f) { + if (v) { + return true; + } + } + }, + + // Show hmc form + hmc : { + html : hmcForm, + callback : addNode, + buttons : { + Ok : true, + Cancel : false + }, + focus : 1, + prefix : 'cleanblue', + submit : function(v, m, f) { + if (v) { + return true; + } + } + }, + + // Show ipmi form + ipmi : { + html : ipmiForm, + callback : addNode, + buttons : { + Ok : true, + Cancel : false + }, + focus : 1, + prefix : 'cleanblue', + submit : function(v, m, f) { + if (v) { + return true; + } + } + }, + + // Show ivm form + ivm : { + html : ivmForm, + callback : addNode, + buttons : { + Ok : true, + Cancel : false + }, + focus : 1, + prefix : 'cleanblue', + submit : function(v, m, f) { + if (v) { + return true; + } + } + }, + + // Show zvm form + zvm : { + html : zvmForm, + callback : addNode, + buttons : { + Ok : true, + Cancel : false + }, + focus : 1, + prefix : 'cleanblue', + submit : function(v, m, f) { + if (v) { + return true; + } + } + } + }; + + $.prompt(states, { prefix : 'cleanblue' }); + }); $('#groups').append(addNodeLink); }