diff --git a/xCAT-UI/js/custom/customUtils.js b/xCAT-UI/js/custom/customUtils.js index 031f51d5e..cb97008ef 100644 --- a/xCAT-UI/js/custom/customUtils.js +++ b/xCAT-UI/js/custom/customUtils.js @@ -456,6 +456,29 @@ function appendProvisionSection(plugin, container) { * @returns Nothing */ function appendProvision4Url(container){ + // Get provision tab ID + var tabId = container.parents('.tab').attr('id'); + + // Create node fieldset + var nodeFS = $('
'); + var nodeLegend = $('Node'); + nodeFS.append(nodeLegend); + container.append(nodeFS); + + var nodeAttr = $('
'); + nodeFS.append($('
')); + nodeFS.append(nodeAttr); + + // Create image fieldset + var imgFS = $('
'); + var imgLegend = $('Image'); + imgFS.append(imgLegend); + container.append(imgFS); + + var imgAttr = $('
'); + imgFS.append($('
')); + imgFS.append(imgAttr); + var query = window.location.search; var args = query.substr(1).split('&'); var parms = new Object(); @@ -479,14 +502,15 @@ function appendProvision4Url(container){ if (parms['tftpserver']) tftpserver = parms['tftpserver']; - container.append('
'); - container.append('
'); - container.append('
'); - container.append( '
'); - container.append('
'); - container.append('
'); - container.append('
'); - container.append('
'); + nodeAttr.append('
'); + + imgAttr.append('
'); + imgAttr.append('
'); + imgAttr.append( '
'); + imgAttr.append('
'); + imgAttr.append('
'); + imgAttr.append('
'); + imgAttr.append('
'); return; } @@ -713,7 +737,7 @@ function createNodesTable(group, outId) { // Create table to hold nodes var nTable = $('
'); - var tHead = $(' Node '); + var tHead = $(' Node '); nTable.append(tHead); var tBody = $(''); nTable.append(tBody); @@ -730,7 +754,7 @@ function createNodesTable(group, outId) { outId.empty().append(nTable); - if (index > 10) + if (nodes.length > 10) outId.css('height', '300px'); else outId.css('height', 'auto'); @@ -760,4 +784,22 @@ function getCheckedByObj(obj) { } return str; +} + +/** + * Select all checkboxes in the table + * + * @param event + * Event on element + * @param obj + * Object triggering event + * @return Nothing + */ +function selectAll4Table(event, obj) { + // Get datatable ID + // This will ascend from + var tableObj = obj.parents('table').find('tbody'); + var status = obj.attr('checked'); + tableObj.find(' :checkbox').attr('checked', status); + event.stopPropagation(); } \ No newline at end of file