Changed nodeset tab to accept osimage argument. Allow z/VM identities to be specified in directory entry. Allow an admin username to log into the main xCAT UI.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16123 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -5271,8 +5271,12 @@ function createZProvisionNew(inst) { | ||||
|         var thisUserId = $('#' + thisTabId + ' input[name=userId]:visible'); | ||||
|         var pos = thisUserEntry.val().indexOf('USER ' + thisUserId.val().toUpperCase()); | ||||
|         if (pos < 0) { | ||||
|             errMsg = errMsg + 'The directory entry does not contain the correct user ID.<br>'; | ||||
|             ready = false; | ||||
|         	 | ||||
|         	pos = thisUserEntry.val().indexOf('IDENTITY ' + thisUserId.val().toUpperCase()); | ||||
|             if (pos < 0) { | ||||
|             	errMsg = errMsg + 'The directory entry does not contain the correct user/identity ID.<br>'; | ||||
|             	ready = false; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         // If no operating system is specified, create only user entry | ||||
|   | ||||
| @@ -2109,18 +2109,6 @@ function updateStatusBar(data) { | ||||
|         if (prg.html().indexOf('Error') > -1) { | ||||
|             failed = true; | ||||
|         } | ||||
|  | ||||
|         // Update data table | ||||
|         var rowPos; | ||||
|         for (var i in tgts) { | ||||
|             if (!failed) { | ||||
|                 // Get row containing the node link and delete it | ||||
|                 rowPos = findRow(tgts[i], '#' + nodesTableId, 1); | ||||
|                 dTable.fnDeleteRow(rowPos); | ||||
|             } | ||||
|         } | ||||
|          | ||||
|         adjustColumnSize(nodesTableId); | ||||
|     } else if (cmd == 'xdsh') { | ||||
|         // Hide loader | ||||
|         $('#' + statBarId).find('img').hide(); | ||||
|   | ||||
| @@ -68,21 +68,7 @@ function loadNodesetPage(tgtNodes) { | ||||
|     // Create target node or group | ||||
|     var tgt = $('<div><label>Target node range:</label><input type="text" name="target" value="' + tgtNodes + '" title="The node or node range to set the boot state for"/></div>'); | ||||
|     vmAttr.append(tgt); | ||||
|  | ||||
|     // Create boot method drop down | ||||
|     var method = $('<div></div>'); | ||||
|     var methodLabel = $('<label>Boot method:</label>'); | ||||
|     var methodSelect = $('<select id="bootMethod" name="bootMethod" title="The method for node deployment"></select>'); | ||||
|     methodSelect.append('<option value="boot">boot</option>' | ||||
|         + '<option value="install">install</option>' | ||||
|         + '<option value="iscsiboot">iscsiboot</option>' | ||||
|         + '<option value="netboot">netboot</option>' | ||||
|         + '<option value="statelite">statelite</option>' | ||||
|     ); | ||||
|     method.append(methodLabel); | ||||
|     method.append(methodSelect); | ||||
|     imageAttr.append(method); | ||||
|  | ||||
|      | ||||
|     // Create boot type drop down | ||||
|     var type = $('<div></div>'); | ||||
|     var typeLabel = $('<label>Boot type:</label>'); | ||||
| @@ -94,58 +80,24 @@ function loadNodesetPage(tgtNodes) { | ||||
|     type.append(typeLabel); | ||||
|     type.append(typeSelect); | ||||
|     imageAttr.append(type); | ||||
|  | ||||
|     // Create operating system input | ||||
|      | ||||
|     // Create operating system image input | ||||
|     var os = $('<div></div>'); | ||||
|     var osLabel = $('<label>Operating system:</label>'); | ||||
|     var osInput = $('<input type="text" name="os" title="You must give the operating system of this node or node range, e.g. rhel5.5"/>'); | ||||
|     osInput.one('focus', function(){ | ||||
|         var tmp = $.cookie('osvers'); | ||||
|         if (tmp) { | ||||
|             // Turn on auto complete | ||||
|             $(this).autocomplete({ | ||||
|                 source: tmp.split(',') | ||||
|             }); | ||||
|     var osLabel = $('<label>Operating system image:</label>'); | ||||
|     var osSelect = $('<select name="os" title="The operating system image to be installed on this node"></select>'); | ||||
|     osSelect.append($('<option value=""></option>')); | ||||
|      | ||||
|     var imageNames = $.cookie('imagenames').split(','); | ||||
|     if (imageNames) { | ||||
|         imageNames.sort(); | ||||
|         for (var i in imageNames) { | ||||
|             osSelect.append($('<option value="' + imageNames[i] + '">' + imageNames[i] + '</option>')); | ||||
|         } | ||||
|     }); | ||||
|     } | ||||
|     os.append(osLabel); | ||||
|     os.append(osInput); | ||||
|     os.append(osSelect); | ||||
|     imageAttr.append(os); | ||||
|  | ||||
|     // Create architecture input | ||||
|     var arch = $('<div></div>'); | ||||
|     var archLabel = $('<label>Architecture:</label>'); | ||||
|     var archInput = $('<input type="text" name="arch" title="You must give the architecture of this node or node range, e.g. s390x"/>'); | ||||
|     archInput.one('focus', function(){ | ||||
|         var tmp = $.cookie('osarchs'); | ||||
|         if (tmp) { | ||||
|             // Turn on auto complete | ||||
|             $(this).autocomplete({ | ||||
|                 source: tmp.split(',') | ||||
|             }); | ||||
|         } | ||||
|     }); | ||||
|     arch.append(archLabel); | ||||
|     arch.append(archInput); | ||||
|     imageAttr.append(arch); | ||||
|  | ||||
|     // Create profiles input | ||||
|     var profile = $('<div></div>'); | ||||
|     var profileLabel = $('<label>Profile:</label>'); | ||||
|     var profileInput = $('<input type="text" name="profile" title="You must give the profile for this node or node range.  The typical default profile is: compute."/>'); | ||||
|     profileInput.one('focus', function(){ | ||||
|         tmp = $.cookie('profiles'); | ||||
|         if (tmp) { | ||||
|             // Turn on auto complete | ||||
|             $(this).autocomplete({ | ||||
|                 source: tmp.split(',') | ||||
|             }); | ||||
|         } | ||||
|     }); | ||||
|     profile.append(profileLabel); | ||||
|     profile.append(profileInput); | ||||
|     imageAttr.append(profile); | ||||
|  | ||||
|     // Generate tooltips | ||||
|     nodesetForm.find('div input[title],select').tooltip({ | ||||
|         position: "center right", | ||||
| @@ -187,16 +139,11 @@ function loadNodesetPage(tgtNodes) { | ||||
|  | ||||
|         if (ready) { | ||||
|             // Get nodes | ||||
|             var tgts = $('#' + tabId + ' input[name=target]').val(); | ||||
|             // Get boot method | ||||
|             var method = $('#' + tabId + ' select[id=bootMethod]').val(); | ||||
|             var tgts = $('#' + tabId + ' input[name=target]').val();             | ||||
|             // Get boot type | ||||
|             var type = $('#' + tabId + ' select[id=bootType]').val(); | ||||
|  | ||||
|             // Get OS, arch, and profile | ||||
|             var os = $('#' + tabId + ' input[name=os]').val(); | ||||
|             var arch = $('#' + tabId + ' input[name=arch]').val(); | ||||
|             var profile = $('#' + tabId + ' input[name=profile]').val(); | ||||
|             // Get operating system image | ||||
|             var os = $('#' + tabId + ' select[name=os]').val(); | ||||
|  | ||||
|             // Disable all inputs, selects, and Ok button | ||||
|             inputs.attr('disabled', 'disabled'); | ||||
| @@ -212,10 +159,7 @@ function loadNodesetPage(tgtNodes) { | ||||
|                 data : { | ||||
|                     cmd : 'nodeadd', | ||||
|                     tgt : '', | ||||
|                     args : tgts + ';noderes.netboot=' + type  | ||||
|                         + ';nodetype.os=' + os  | ||||
|                         + ';nodetype.arch=' + arch  | ||||
|                         + ';nodetype.profile=' + profile, | ||||
|                     args : tgts + ';noderes.netboot=' + type, | ||||
|                     msg : 'cmd=nodeadd;inst=' + inst | ||||
|                 }, | ||||
|  | ||||
| @@ -259,8 +203,8 @@ function updateNodesetStatus(data) { | ||||
|  | ||||
|     // Get nodes | ||||
|     var tgts = $('#' + tabId + ' input[name=target]').val(); | ||||
|     // Get boot method | ||||
|     var method = $('#' + tabId + ' select[id=bootMethod]').val(); | ||||
| 	// Get operating system image | ||||
|     var os = $('#' + tabId + ' select[name=os]').val(); | ||||
|  | ||||
|     /** | ||||
|      * (2) Update /etc/hosts | ||||
|   | ||||
| @@ -79,12 +79,12 @@ function loadProvisionPage() { | ||||
|  | ||||
|     // Create radio buttons for platforms | ||||
|     var hwList = $('<ol>Platforms available:</ol>'); | ||||
|     var esx = $('<li><input type="radio" name="hw" value="esx" checked/>ESX</li>'); | ||||
|     var kvm = $('<li><input type="radio" name="hw" value="kvm"/>KVM</li>'); | ||||
|     var zvm = $('<li><input type="radio" name="hw" value="zvm"/>z\/VM</li>'); | ||||
|     var ipmi = $('<li><input type="radio" name="hw" value="ipmi"/>iDataPlex</li>'); | ||||
|     var blade = $('<li><input type="radio" name="hw" value="blade"/>BladeCenter</li>'); | ||||
|     var hmc = $('<li><input type="radio" name="hw" value="hmc"/>System p</li>'); | ||||
|     var esx = $('<li><input type="radio" name="hw" value="esx" disabled/>ESX</li>'); | ||||
|     var kvm = $('<li><input type="radio" name="hw" value="kvm" disabled/>KVM</li>'); | ||||
|     var zvm = $('<li><input type="radio" name="hw" value="zvm" checked/>z\/VM</li>'); | ||||
|     var ipmi = $('<li><input type="radio" name="hw" value="ipmi" disabled/>iDataPlex</li>'); | ||||
|     var blade = $('<li><input type="radio" name="hw" value="blade" disabled/>BladeCenter</li>'); | ||||
|     var hmc = $('<li><input type="radio" name="hw" value="hmc" disabled/>System p</li>'); | ||||
|      | ||||
|     hwList.append(esx); | ||||
|     hwList.append(kvm); | ||||
| @@ -155,27 +155,27 @@ function loadProvisionPage() { | ||||
|     resrcPg.append(resrcInfoBar); | ||||
|  | ||||
|     // Create radio buttons for platforms | ||||
|     var hwList = $('<ol>Platforms available:</ol>'); | ||||
|     var esx = $('<li><input type="radio" name="hw" value="esx" disabled/>ESX</li>'); | ||||
|     var kvm = $('<li><input type="radio" name="hw" value="kvm" disabled/>KVM</li>'); | ||||
|     var zvm = $('<li><input type="radio" name="hw" value="zvm" checked/>z\/VM</li>'); | ||||
|     var ipmi = $('<li><input type="radio" name="hw" value="ipmi" disabled/>iDataPlex</li>'); | ||||
|     var blade = $('<li><input type="radio" name="hw" value="blade" disabled/>BladeCenter</li>'); | ||||
|     var hmc = $('<li><input type="radio" name="hw" value="hmc" disabled/>System p</li>'); | ||||
|     var rsrcHwList = $('<ol>Platforms available:</ol>'); | ||||
|     esx = $('<li><input type="radio" name="rsrcHw" value="esx" disabled/>ESX</li>'); | ||||
|     kvm = $('<li><input type="radio" name="rsrcHw" value="kvm" disabled/>KVM</li>'); | ||||
|     zvm = $('<li><input type="radio" name="rsrcHw" value="zvm" checked/>z\/VM</li>'); | ||||
|     ipmi = $('<li><input type="radio" name="rsrcHw" value="ipmi" disabled/>iDataPlex</li>'); | ||||
|     blade = $('<li><input type="radio" name="rsrcHw" value="blade" disabled/>BladeCenter</li>'); | ||||
|     hmc = $('<li><input type="radio" name="rsrcHw" value="hmc" disabled/>System p</li>'); | ||||
|      | ||||
|     hwList.append(esx); | ||||
|     hwList.append(kvm); | ||||
|     hwList.append(zvm); | ||||
|     hwList.append(blade); | ||||
|     hwList.append(ipmi); | ||||
|     hwList.append(hmc); | ||||
|     rsrcHwList.append(esx); | ||||
|     rsrcHwList.append(kvm); | ||||
|     rsrcHwList.append(zvm); | ||||
|     rsrcHwList.append(blade); | ||||
|     rsrcHwList.append(ipmi); | ||||
|     rsrcHwList.append(hmc); | ||||
|      | ||||
|     resrcPg.append(hwList); | ||||
|     resrcPg.append(rsrcHwList); | ||||
|  | ||||
|     var okBtn = createButton('Ok'); | ||||
|     okBtn.bind('click', function(event) { | ||||
|         // Get hardware that was selected | ||||
|         var hw = $(this).parent().find('input[name="hw"]:checked').val(); | ||||
|         var hw = $(this).parent().find('input[name="rsrcHw"]:checked').val(); | ||||
|  | ||||
|         // Generate new tab ID | ||||
|         var newTabId = hw + 'ResourceTab'; | ||||
|   | ||||
| @@ -327,7 +327,7 @@ function isRootAcess() { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     if (strcmp($_SESSION["username"], 'root') == 0) { | ||||
|     if (strcmp($_SESSION["username"], 'root') == 0 || strcmp($_SESSION["username"], 'admin') == 0) { | ||||
|         $_SESSION["xcatpassvalid"] = 1; | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user