diff --git a/xCAT-UI/js/custom/customUtils.js b/xCAT-UI/js/custom/customUtils.js index 965f170de..fc709a452 100644 --- a/xCAT-UI/js/custom/customUtils.js +++ b/xCAT-UI/js/custom/customUtils.js @@ -401,16 +401,8 @@ function createProvision(plugin, container){ }); } - //image,nic,master,tftp,nfs,option - showStr = '
' + - '
' + - '
' + - '
' + - '
' + - '
' + - '
'; - - container.append(showStr); + //option + container.append('
'); //add the provision button var provisionBtn = createButton('Provision'); @@ -473,6 +465,9 @@ function createProvWithUrl(){ var index = 0; var temparray; var showstr = ''; + var master = ''; + var tftpserver = ''; + var nfsserver = ''; for (index = 0; index < argarray.length; index++){ temparray = argarray[index].split('='); temphash[temparray[0]] = temparray[1]; @@ -483,6 +478,25 @@ function createProvWithUrl(){ showstr += '
'; + showstr += '
' + + '
' + + '
' ; + + if (temphash['master']){ + master = temphash['master']; + } + + if (temphash['nfsserver']){ + nfsserver = temphash['nfsserver']; + } + + if (temphash['tftpserver']){ + tftpserver = temphash['tftpserver']; + } + + showstr += '
'; + showstr += '
'; + showstr += '
'; return showstr; } @@ -519,7 +533,14 @@ function createProvNonurl(plugin){ } strArch += ''; - return strGroup + strNodes + strArch; + //add the static input part + strSta = '
' + + '
' + + '
' + + '
' + + '
' + + '
'; + return strGroup + strNodes + strArch + strSta; } /** diff --git a/xCAT-UI/js/nodes/nodes.js b/xCAT-UI/js/nodes/nodes.js index e190273ee..eaa6c50d2 100644 --- a/xCAT-UI/js/nodes/nodes.js +++ b/xCAT-UI/js/nodes/nodes.js @@ -87,8 +87,19 @@ function loadNodesPage() { success : function(data){ loadGroups(data); - // triggle the first group click event - $('#groups .groupdiv div').eq(0).trigger('click'); + var cookiegroup = $.cookie('selectgrouponnodes'); + if (cookiegroup){ + + $('#groups .groupdiv div').each(function(){ + if ($(this).text() == cookiegroup){ + $(this).trigger('click'); + return false; + } + }); + }else{ + // triggle the first group click event + $('#groups .groupdiv div').eq(0).trigger('click'); + } } }); } @@ -241,6 +252,9 @@ function loadGroups(data) { $(this).addClass('selectgroup'); drawNodesArea(thisGroup,'',thisGroup); + + //save the selected groups into cookie + $.cookie('selectgrouponnodes', thisGroup, { expires: 7 }); }); // Make a link to add nodes @@ -968,6 +982,9 @@ function loadNodes(data) { success: showChdefOutput }); + + //save the data into global origAttrs + origAttrs[node][attrName] = value; return value; }, { @@ -3216,6 +3233,9 @@ function jumpProvision(tgtnodes){ var index = 0; var archtype = ''; var errormessage = ''; + var master = ''; + var tftpserver = ''; + var nfsserver = ''; var diaDiv = $('
'); // check the first node's arch type for (index in nodeArray){ @@ -3265,7 +3285,19 @@ function jumpProvision(tgtnodes){ return; } - window.location.href = 'provision.php?nodes=' + tgtnodes + '&arch=' + archtype; + if (origAttrs[nodeName]['xcatmaster']){ + master = origAttrs[nodeName]['xcatmaster']; + } + + if (origAttrs[nodeName]['tftpserver']){ + tftpserver = origAttrs[nodeName]['tftpserver']; + } + + if (origAttrs[nodeName]['nfsserver']){ + nfsserver = origAttrs[nodeName]['nfsserver']; + } + window.location.href = 'provision.php?nodes=' + tgtnodes + '&arch=' + archtype + '&master=' + master + + '&tftpserver=' + tftpserver + '&nfsserver=' + nfsserver; } /** * Adjust datatable column size