Finish up inventory page for HMC. Cleaned up some code.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6862 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
980fcfb821
commit
cb8187086c
@ -19,8 +19,8 @@ var hmcPlugin = function() {
|
||||
* @return Nothing
|
||||
*/
|
||||
hmcPlugin.prototype.loadInventory = function(data) {
|
||||
// Get arguments
|
||||
var args = data.msg.split(',');
|
||||
|
||||
// Get tab ID
|
||||
var tabId = args[0].replace('out=', '');
|
||||
// Get node
|
||||
@ -33,26 +33,45 @@ hmcPlugin.prototype.loadInventory = function(data) {
|
||||
$('#' + loaderId).remove();
|
||||
|
||||
// Create division to hold inventory
|
||||
var invDivId = node + 'Inventory';
|
||||
var invDivId = tabId + 'Inventory';
|
||||
var invDiv = $('<div class="inventory" id="' + invDivId + '"></div>');
|
||||
|
||||
var fieldSet = $('<fieldset></fieldset>');
|
||||
var legend = $('<legend>Inventory</legend>');
|
||||
fieldSet.append(legend);
|
||||
var oList = $('<ol></ol>');
|
||||
var item, label, input, args;
|
||||
|
||||
// Loop through each property
|
||||
var fieldSet, legend, oList, item;
|
||||
|
||||
// Loop through each line
|
||||
for ( var k = 0; k < inv.length; k++) {
|
||||
// Create a list item for each property
|
||||
item = $('<li></li>');
|
||||
item.append(inv[k].replace(node + ': ', ''));
|
||||
oList.append(item);
|
||||
// Remove the node name in front
|
||||
var str = inv[k].replace(node + ': ', '');
|
||||
|
||||
// If the string is a header
|
||||
if (str.indexOf('I/O Bus Information') > -1 || str.indexOf('Machine Configuration Info') > -1) {
|
||||
// Create a fieldset
|
||||
fieldSet = $('<fieldset></fieldset>');
|
||||
legend = $('<legend>' + str + '</legend>');
|
||||
fieldSet.append(legend);
|
||||
oList = $('<ol></ol>');
|
||||
fieldSet.append(oList);
|
||||
invDiv.append(fieldSet);
|
||||
} else {
|
||||
// If no fieldset is defined
|
||||
if (!fieldSet) {
|
||||
// Define fieldset
|
||||
fieldSet = $('<fieldset></fieldset>');
|
||||
legend = $('<legend>General</legend>');
|
||||
fieldSet.append(legend);
|
||||
oList = $('<ol></ol>');
|
||||
fieldSet.append(oList);
|
||||
invDiv.append(fieldSet);
|
||||
}
|
||||
|
||||
// Append the string to a list
|
||||
item = $('<li></li>');
|
||||
item.append(str);
|
||||
oList.append(item);
|
||||
}
|
||||
}
|
||||
|
||||
// Append to inventory form
|
||||
fieldSet.append(oList);
|
||||
invDiv.append(fieldSet);
|
||||
$('#' + tabId).append(invDiv);
|
||||
};
|
||||
|
||||
|
@ -69,7 +69,7 @@ function loadMonitorPage() {
|
||||
var resrcForm = $('<div class="monitor"></div>');
|
||||
|
||||
// Create info bar
|
||||
var resrcInfoBar = createInfoBar('Select a hardware to view its resources');
|
||||
var resrcInfoBar = createInfoBar('Select a platform to view its resources');
|
||||
resrcForm.append(resrcInfoBar);
|
||||
|
||||
// Create drop-down menu
|
||||
|
@ -616,11 +616,11 @@ function loadNode(e) {
|
||||
// the node name may contain special char(such as '.','#'), so we can not use the node name as a id.
|
||||
var myTab = getNodesTab();
|
||||
var inst = 0;
|
||||
var newTabId = 'NodeTab' + inst;
|
||||
var newTabId = 'nodeTab' + inst;
|
||||
while ($('#' + newTabId).length) {
|
||||
// If one already exists, generate another one
|
||||
inst = inst + 1;
|
||||
newTabId = 'NodeTab' + inst;
|
||||
newTabId = 'nodeTab' + inst;
|
||||
}
|
||||
// Reset node process
|
||||
$.cookie(node + 'Processes', 0);
|
||||
@ -2216,6 +2216,7 @@ function getRowNum(nodeName){
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
function selectAllCheckbox(event, obj){
|
||||
var status = obj.attr('checked');
|
||||
$('#nodesDataTable :checkbox').attr('checked', status);
|
||||
|
@ -61,7 +61,7 @@ function loadProvisionPage() {
|
||||
var div = $('<div></div>');
|
||||
provForm.append(div);
|
||||
|
||||
var label = $('<span>Select the hardware to provision:</span>');
|
||||
var label = $('<span>Select a platform to provision:</span>');
|
||||
var hw = $('<select></select>');
|
||||
var ipmi = $('<option value="ipmi">ipmi</option>');
|
||||
var blade = $('<option value="blade">blade</option>');
|
||||
|
Loading…
Reference in New Issue
Block a user