Cleaned up code

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7602 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
phamt 2010-09-24 02:27:04 +00:00
parent 81aeefc5a1
commit 73b5795475
18 changed files with 259 additions and 198 deletions

View File

@ -4,7 +4,7 @@
font: 12px verdana, arial, helvetica, sans-serif;
}
.ui-dialog label, input, p, button {
.ui-dialog label, .ui-dialog input, .ui-dialog p, .ui-dialog button {
font: 12px verdana, arial, helvetica, sans-serif;
}
@ -131,7 +131,7 @@ body {
display: inline-table;
}
/****************** Info bar ******************/
/****************** Info/warning bar ******************/
span.ui-icon-info {
float: left;
margin-right: 0.3em;
@ -158,7 +158,7 @@ span.ui-icon-info {
background: url(../images/header-gloss-wave.png) 50% 50% repeat-x;
}
/****************** Tabs section ******************/
/****************** Tabs ******************/
.tab {
font: 12px verdana, arial, helvetica, sans-serif;
border-style: none;
@ -263,7 +263,7 @@ span.ui-icon-info {
height: 300px;
}
/****************** Action bar (on nodes tab) ******************/
/****************** Action bar ******************/
.actionBar {
display: inline-table;
}
@ -314,7 +314,7 @@ span.ui-icon-info {
word-wrap: break-word;
}
/****************** Data table ******************/
/****************** Datatable ******************/
.dataTables_wrapper {
overflow: auto;
width: 700px;
@ -521,7 +521,7 @@ span.ui-icon-info {
display: inline-table;
}
.form input, textarea, select {
.form input, .form textarea, .form select {
font: 12px verdana, arial, helvetica, sans-serif;
border: solid 1px #BDBDBD;
padding: 5px;
@ -564,7 +564,7 @@ span.ui-icon-info {
width: 60px;
}
/****************** Provision and clone new nodes table ******************/
/****************** Provision and clone table ******************/
.special table {
border-width: 1px;
border-spacing: 0px;

View File

@ -67,7 +67,7 @@ function showRepository(data) {
StableRepository = "http://xcat.sourceforge.net/yum/xcat-core/";
}
//dispaly the Devel Repository, remember user's last selection
//display the Devel Repository, remember user's last selection
Show = Show + "<input type='radio' ";
if(1 == $.cookie('xcatrepository'))
{
@ -79,7 +79,7 @@ function showRepository(data) {
$('#repository fieldset').append(Show);
//dispaly the Stable Repository, remember user's last selection
//display the Stable Repository, remember user's last selection
Show = "<input type='radio' ";
if(2 == $.cookie('xcatrepository'))
{
@ -91,7 +91,7 @@ function showRepository(data) {
$('#repository fieldset').append(Show);
//dispaly the Input Repository, remember user's last selection
//display the Input Repository, remember user's last selection
if (($.cookie('xcatrepository'))
&& (1 != $.cookie('xcatrepository'))
&& (2 != $.cookie('xcatrepository')))

View File

@ -143,7 +143,7 @@ bladePlugin.prototype.loadResources = function() {
};
/**
* Add node
* Add node range
*
* @return Nothing
*/

View File

@ -174,11 +174,12 @@ function createProvisionExisting(plugin, inst) {
var method = $('<div></div>');
var methodLabel = $('<label for="method">Boot method:</label>');
var methodSelect = $('<select id="bootMethod" name="bootMethod"></select>');
methodSelect.append('<option value="boot">boot</option>');
methodSelect.append('<option value="install">install</option>');
methodSelect.append('<option value="iscsiboot">iscsiboot</option>');
methodSelect.append('<option value="netboot">netboot</option>');
methodSelect.append('<option value="statelite">statelite</option>');
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);
provExisting.append(method);
@ -187,9 +188,10 @@ function createProvisionExisting(plugin, inst) {
var type = $('<div></div>');
var typeLabel = $('<label for="type">Boot type:</label>');
var typeSelect = $('<select id="bootType" name="bootType"></select>');
typeSelect.append('<option value="pxe">pxe</option>');
typeSelect.append('<option value="iscsiboot">yaboot</option>');
typeSelect.append('<option value="zvm">zvm</option>');
typeSelect.append('<option value="pxe">pxe</option>'
+ '<option value="iscsiboot">yaboot</option>'
+ '<option value="zvm">zvm</option>'
);
type.append(typeLabel);
type.append(typeSelect);
provExisting.append(type);
@ -285,11 +287,12 @@ function createProvisionNew(plugin, inst) {
var method = $('<div></div>');
var methodLabel = $('<label for="method">Boot method:</label>');
var methodSelect = $('<select id="bootMethod" name="bootMethod"></select>');
methodSelect.append('<option value="boot">boot</option>');
methodSelect.append('<option value="install">install</option>');
methodSelect.append('<option value="iscsiboot">iscsiboot</option>');
methodSelect.append('<option value="netboot">netboot</option>');
methodSelect.append('<option value="statelite">statelite</option>');
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);
provNew.append(method);
@ -298,9 +301,10 @@ function createProvisionNew(plugin, inst) {
var type = $('<div></div>');
var typeLabel = $('<label for="type">Boot type:</label>');
var typeSelect = $('<select id="bootType" name="bootType"></select>');
typeSelect.append('<option value="install">pxe</option>');
typeSelect.append('<option value="iscsiboot">yaboot</option>');
typeSelect.append('<option value="zvm">zvm</option>');
typeSelect.append('<option value="install">pxe</option>'
+ '<option value="iscsiboot">yaboot</option>'
+ '<option value="zvm">zvm</option>'
);
type.append(typeLabel);
type.append(typeSelect);
provNew.append(type);

View File

@ -143,7 +143,7 @@ fspPlugin.prototype.loadResources = function() {
};
/**
* Add node
* Add node range
*
* @return Nothing
*/

View File

@ -196,7 +196,7 @@ hmcPlugin.prototype.loadResources = function() {
};
/**
* Add node
* Add node range
*
* @return Nothing
*/

View File

@ -143,7 +143,7 @@ ipmiPlugin.prototype.loadResources = function() {
};
/**
* Add node
* Add node range
*
* @return Nothing
*/

View File

@ -143,7 +143,7 @@ ivmPlugin.prototype.loadResources = function() {
};
/**
* Add node
* Add node range
*
* @return Nothing
*/

View File

@ -60,13 +60,8 @@ zvmPlugin.prototype.loadClonePage = function(node) {
var cloneForm = $('<div class="form"></div>');
cloneForm.append(statBar);
cloneForm.append(infoBar);
// Create target node range input
cloneForm.append('<div><label>Target node range:</label><input type="text" id="tgtNode" name="tgtNode"/></div>');
// Create target user ID range input
cloneForm.append('<div><label>Target user ID range:</label><input type="text" id="tgtUserId" name="tgtUserId"/></div>');
// Create clone source and hardware control point inputs
cloneForm.append('<div><label>Clone source:</label><input type="text" id="srcNode" name="srcNode" readonly="readonly" value="' + node + '"/></div>');
cloneForm.append('<div><label>Hardware control point:</label><input type="text" id="newHcp" name="newHcp" readonly="readonly" value="' + hcp + '"/></div>');
@ -97,7 +92,6 @@ zvmPlugin.prototype.loadClonePage = function(node) {
poolDiv.append(poolInput);
cloneForm.append(poolDiv);
// Create disk password input
cloneForm.append('<div><label>Disk password:</label><input type="password" id="diskPw" name="diskPw"/></div>');
/**
@ -105,6 +99,9 @@ zvmPlugin.prototype.loadClonePage = function(node) {
*/
var cloneBtn = createButton('Clone');
cloneBtn.bind('click', function(event) {
// Remove any warning messages
$(this).parent().parent().find('.ui-state-error').remove();
var ready = true;
var errMsg = '';
@ -123,7 +120,7 @@ zvmPlugin.prototype.loadClonePage = function(node) {
// Write error message
if (!ready) {
errMsg = errMsg + 'You are missing some inputs. ';
errMsg = errMsg + 'You are missing some inputs.<br>';
}
// Get target node
@ -134,7 +131,7 @@ zvmPlugin.prototype.loadClonePage = function(node) {
// Check node range and user ID range
if (nodeRange.indexOf('-') > -1 || userIdRange.indexOf('-') > -1) {
if (nodeRange.indexOf('-') < 0 || userIdRange.indexOf('-') < 0) {
errMsg = errMsg + 'A user ID range and node range needs to be given. ';
errMsg = errMsg + 'A user ID range and node range needs to be given.<br>';
ready = false;
} else {
var tmp = nodeRange.split('-');
@ -158,7 +155,7 @@ zvmPlugin.prototype.loadClonePage = function(node) {
// If starting and ending index do not match
if (!(nodeStart == userIdStart) || !(nodeEnd == userIdEnd)) {
// Not ready to provision
errMsg = errMsg + 'The node range and user ID range does not match. ';
errMsg = errMsg + 'The node range and user ID range does not match.<br>';
ready = false;
}
}
@ -254,7 +251,9 @@ zvmPlugin.prototype.loadClonePage = function(node) {
// Disable clone button
$(this).attr('disabled', 'true');
} else {
alert('(Error) ' + errMsg);
// Show warning message
var warn = createWarnBar(errMsg);
warn.prependTo($(this).parent().parent());
}
});
cloneForm.append(cloneBtn);
@ -329,7 +328,7 @@ zvmPlugin.prototype.loadInventory = function(data) {
* Show user entry
*/
var toggleLinkId = node + 'ToggleLink';
var toggleLink = $('<a id="' + toggleLinkId + '" href="#">Show user entry</a>');
var toggleLink = $('<a id="' + toggleLinkId + '" href="#">Show directory entry</a>');
toggleLink.one('click', function(event) {
// Toggle inventory division
$('#' + invDivId).toggle();
@ -556,7 +555,7 @@ zvmPlugin.prototype.loadInventory = function(data) {
*/
var addProcLink = $('<a href="#">Add processor</a>');
addProcLink.bind('click', function(event) {
createAddProcDialog(node);
openAddProcDialog(node);
});
procFooter.append(addProcLink);
@ -635,7 +634,7 @@ zvmPlugin.prototype.loadInventory = function(data) {
var addDasdLink = $('<a href="#">Add disk</a>');
addDasdLink.bind('click', function(event) {
var hcp = attrs['hcp'][0].split('.');
createAddDiskDialog(node, hcp[0]);
openAddDiskDialog(node, hcp[0]);
});
dasdFooter.append(addDasdLink);
dasdTable.append(dasdFooter);
@ -716,7 +715,7 @@ zvmPlugin.prototype.loadInventory = function(data) {
var addNicLink = $('<a href="#">Add NIC</a>');
addNicLink.bind('click', function(event) {
var hcp = attrs['hcp'][0].split('.');
createAddNicDialog(node, hcp[0]);
openAddNicDialog(node, hcp[0]);
});
nicFooter.append(addNicLink);
nicTable.append(nicFooter);
@ -863,27 +862,27 @@ zvmPlugin.prototype.loadResources = function() {
};
/**
* Add node
* Add node range
*
* @return Nothing
*/
zvmPlugin.prototype.addNode = function() {
var info = createInfoBar('Add a new node');
// Create form to add node range
var addNodeForm = $('<div class="form"></div>');
addNodeForm.append(info);
var info = createInfoBar('Add a node range');
addNodeForm.append(info);
addNodeForm.append('<div><label for="node">Node range:</label><input type="text" id="node" name="node"/></div>');
addNodeForm.append('<div><label for="userId">User ID range:</label><input type="text" id="userId" name="userId"/></div>');
addNodeForm.append('<div><label for="hcp">Hardware control point:</label><input type="text" id="hcp" name="hcp"/></div>');
addNodeForm.append('<div><label for="group">Group:</label><input type="text" id="group" name="group"/></div>');
// Create add node dialog
// Open form as a dialog
addNodeForm.dialog({
position: 'top',
modal: true,
width: 400,
buttons: {
"Cancel": function(){
// Close dialog
$(this).dialog( "close" );
},
"Ok": function(){
@ -895,7 +894,8 @@ zvmPlugin.prototype.addNode = function() {
var userIdRange = $(this).find('input[name=userId]').val();
var group = $(this).find('input[name=group]').val();
var hcp = $(this).find('input[name=hcp]').val();
// Show warning message if inputs are not complete
if (!nodeRange || !userIdRange || !group || !hcp) {
var warn = createWarnBar('Missing values');
warn.prependTo($(this));
@ -1053,9 +1053,9 @@ zvmPlugin.prototype.addNode = function() {
// Show warning message
var warn = createWarnBar(errMsg);
warn.prependTo($(this));
}
}
}
}
} // End of else
} // End of function()
}
});
};

View File

@ -60,7 +60,7 @@ function loadUserEntry(data) {
var ueDivId = args[0].replace('out=', '');
// Get node
var node = args[1].replace('node=', '');
// Get user entry
// Get user directory entry
var userEntry = data.rsp[0].split(node + ':');
// Remove loader
@ -78,16 +78,16 @@ function loadUserEntry(data) {
$('#' + node + 'Inventory').toggle();
// Change text
if (lnkText == 'Show user entry') {
if (lnkText == 'Show directory entry') {
$(this).text('Show inventory');
} else {
$(this).text('Show user entry');
$(this).text('Show directory entry');
}
});
// Put user entry into a list
var fieldSet = $('<fieldset></fieldset>');
var legend = $('<legend>User Entry</legend>');
var legend = $('<legend>Directory Entry</legend>');
fieldSet.append(legend);
var txtArea = $('<textarea></textarea>');
@ -176,7 +176,7 @@ function loadUserEntry(data) {
});
// Create info bar
var infoBar = createInfoBar('Double click on the user entry to edit');
var infoBar = createInfoBar('Double click on the directory entry to edit');
// Append user entry into division
$('#' + ueDivId).append(infoBar);
@ -235,8 +235,7 @@ function updateZProvisionNewStatus(data) {
* (2) Update /etc/hosts
*/
if (cmd == 'nodeadd') {
// If there was an error
// Do not continue
// If there was an error, do not continue
if (rsp.length) {
$('#' + loaderId).hide();
$('#' + statBarId).append('<p>(Error) Failed to create node definition</p>');
@ -261,8 +260,7 @@ function updateZProvisionNewStatus(data) {
* (3) Update DNS
*/
else if (cmd == 'makehosts') {
// If there was an error
// Do not continue
// If there was an error, do not continue
if (rsp.length) {
$('#' + loaderId).hide();
$('#' + statBarId).append('<p>(Error) Failed to update /etc/hosts</p>');
@ -321,13 +319,12 @@ function updateZProvisionNewStatus(data) {
var prg = writeRsp(rsp, '');
$('#' + statBarId).append(prg);
// If there was an error
// Do not continue
// If there was an error, do not continue
if (prg.html().indexOf('Error') > -1) {
// Try again
var tries = parseInt($.cookie('tries4' + tabId));
if (tries < 2) {
$('#' + statBarId).append('<p>Trying again</p>');
$('#' + statBarId).append('<p>Trying again...</p>');
tries = tries + 1;
// One more try
@ -411,15 +408,14 @@ function updateZProvisionNewStatus(data) {
var prg = writeRsp(rsp, '');
$('#' + statBarId).append(prg);
// If there was an error
// Do not continue
// If there was an error, do not continue
if (prg.html().indexOf('Error') > -1) {
$('#' + loaderId).hide();
// Try again
var tries = parseInt($.cookie('tries4' + tabId));
if (tries < 2) {
$('#' + statBarId).append('<p>Trying again</p>');
$('#' + statBarId).append('<p>Trying again...</p>');
tries = tries + 1;
// One more try
@ -1007,12 +1003,11 @@ function getAttrs(keys, propNames, data) {
* Node to add processor to
* @return Nothing
*/
function createAddProcDialog(node) {
function openAddProcDialog(node) {
// Create form to add processor
var addProcForm = $('<div class="form"></div>');
// Create info bar
var info = createInfoBar('Add a processor');
// Create add processor form
var addProcForm = $('<div class="form"></div>');
addProcForm.append(info);
addProcForm.append('<div><label for="procNode">Processor for:</label><input type="text" readonly="readonly" id="procNode" name="procNode" value="' + node + '"/></div>');
addProcForm.append('<div><label for="procAddress">Processor address:</label><input type="text" id="procAddress" name="procAddress"/></div>');
@ -1021,34 +1016,35 @@ function createAddProcDialog(node) {
var procType = $('<div></div>');
procType.append('<label for="procType">Processor type:</label>');
var typeSelect = $('<select id="procType" name="procType"></select>');
typeSelect.append('<option>CP</option>');
typeSelect.append('<option>IFL</option>');
typeSelect.append('<option>ZAAP</option>');
typeSelect.append('<option>ZIIP</option>');
typeSelect.append('<option>CP</option>'
+ '<option>IFL</option>'
+ '<option>ZAAP</option>'
+ '<option>ZIIP</option>'
);
procType.append(typeSelect);
addProcForm.append(procType);
// Create add processor dialog
// Open dialog to add processor
addProcForm.dialog({
position: 'top',
modal: true,
width: 400,
buttons: {
"Cancel": function() {
// Close dialog
$(this).dialog( "close" );
},
"Ok": function(){
// Remove any warning messages
$(this).find('.ui-state-error').remove();
// Get processor properties
// Get inputs
var node = $(this).find('input[name=procNode]').val();
var address = $(this).find('input[name=procAddress]').val();
var type = $(this).find('select[name=procType]').val();
// If inputs are not complete, show warning message
if (!node || !address || !type) {
var warn = createWarnBar('Missing values');
var warn = createWarnBar('You are missing inputs.');
warn.prependTo($(this));
} else {
// Add processor
@ -1091,16 +1087,15 @@ function createAddProcDialog(node) {
* Hardware control point of node
* @return Nothing
*/
function createAddDiskDialog(node, hcp) {
function openAddDiskDialog(node, hcp) {
// Get list of disk pools
var cookie = $.cookie(hcp + 'DiskPools');
var pools = cookie.split(',');
// Create form to add disk
var addDiskForm = $('<div class="form"></div>');
// Create info bar
var info = createInfoBar('Add a disk');
// Create add disk form
var addDiskForm = $('<div class="form"></div>');
addDiskForm.append(info);
addDiskForm.append('<div><label for="diskNode">Disk for:</label><input type="text" readonly="readonly" id="diskNode" name="diskNode" value="' + node + '"/></div>');
addDiskForm.append('<div><label for="diskType">Disk type:</label><select id="diskType" name="diskType"><option value="3390">3390</option><option value="9336">9336</option></select></div>');
@ -1121,33 +1116,33 @@ function createAddDiskDialog(node, hcp) {
var diskMode = $('<div></div>');
diskMode.append('<label for="diskMode">Disk mode:</label>');
var modeSelect = $('<select id="diskMode" name="diskMode"></select>');
modeSelect.append('<option>R</option>');
modeSelect.append('<option>RR</option>');
modeSelect.append('<option>W</option>');
modeSelect.append('<option>WR</option>');
modeSelect.append('<option>M</option>');
modeSelect.append('<option>MR</option>');
modeSelect.append('<option>MW</option>');
modeSelect.append('<option>R</option>'
+ '<option>RR</option>'
+ '<option>W</option>'
+ '<option>WR</option>'
+ '<option>M</option>'
+ '<option>MR</option>'
+ '<option>MW</option>'
);
diskMode.append(modeSelect);
addDiskForm.append(diskMode);
addDiskForm.append('<div><label for="diskPassword">Disk password:</label><input type="password" id="diskPassword" name="diskPassword"/></div>');
// Create add disk dialog
// Open dialog to add disk
addDiskForm.dialog({
position: 'top',
modal: true,
width: 400,
buttons: {
"Cancel": function() {
// Close dialog
$(this).dialog( "close" );
},
"Ok": function(){
// Remove any warning messages
$(this).find('.ui-state-error').remove();
// Get disk properties
// Get inputs
var node = $(this).find('input[name=diskNode]').val();
var type = $(this).find('select[name=diskType]').val();
var address = $(this).find('input[name=diskAddress]').val();
@ -1156,8 +1151,9 @@ function createAddDiskDialog(node, hcp) {
var mode = $(this).find('select[name=diskMode]').val();
var password = $(this).find('input[name=diskPassword]').val();
// If inputs are not complete, show warning message
if (!node || !type || !address || !size || !pool || !mode) {
var warn = createWarnBar('Missing values');
var warn = createWarnBar('You are missing inputs.');
warn.prependTo($(this));
} else {
// Add disk
@ -1215,7 +1211,7 @@ function createAddDiskDialog(node, hcp) {
// Close dialog
$(this).dialog( "close" );
} // End of else
}
} // End of function()
}
});
}
@ -1229,15 +1225,14 @@ function createAddDiskDialog(node, hcp) {
* Hardware control point of node
* @return Nothing
*/
function createAddNicDialog(node, hcp) {
function openAddNicDialog(node, hcp) {
// Get network names
var networks = $.cookie(hcp + 'Networks').split(',');
// Create form to add NIC
var addNicForm = $('<div class="form"></div>');
// Create info bar
var info = createInfoBar('Add a NIC');
// Create add NIC form
var addNicForm = $('<div class="form"></div>');
addNicForm.append(info);
addNicForm.append('<div><label for="nicNode">NIC for:</label><input type="text" readonly="readonly" id="nicNode" name="nicNode" value="' + node + '"/></div>');
addNicForm.append('<div><label for="nicAddress">NIC address:</label><input type="text" id="nicAddress" name="nicAddress"/></div>');
@ -1246,9 +1241,10 @@ function createAddNicDialog(node, hcp) {
var nicType = $('<div></div>');
nicType.append('<label for="nicType">NIC type:</label>');
var nicTypeSelect = $('<select id="nicType" name="nicType"></select>');
nicTypeSelect.append('<option></option>');
nicTypeSelect.append('<option>QDIO</option>');
nicTypeSelect.append('<option>HiperSockets</option>');
nicTypeSelect.append('<option></option>'
+ '<option>QDIO</option>'
+ '<option>HiperSockets</option>'
);
nicType.append(nicTypeSelect);
addNicForm.append(nicType);
@ -1256,9 +1252,10 @@ function createAddNicDialog(node, hcp) {
var networkType = $('<div></div>');
networkType.append('<label for="nicNetworkType">Network type:</label>');
var networkTypeSelect = $('<select id="nicNetworkType" name="nicNetworkType"></select>');
networkTypeSelect.append('<option></option>');
networkTypeSelect.append('<option>Guest LAN</option>');
networkTypeSelect.append('<option>Virtual Switch</option>');
networkTypeSelect.append('<option></option>'
+ '<option>Guest LAN</option>'
+ '<option>Virtual Switch</option>'
);
networkType.append(networkTypeSelect);
addNicForm.append(networkType);
@ -1278,16 +1275,20 @@ function createAddNicDialog(node, hcp) {
}
}
// Hide network name drop downs until the NIC type and network type is selected
// QDIO Guest LAN drop down
var guestLanQdio = $('<div></div>').hide();
guestLanQdio.append('<label for="nicLanQdioName">Guest LAN name:</label>');
guestLanQdio.append(gLansQdioSelect);
addNicForm.append(guestLanQdio);
// HIPERS Guest LAN drop down
var guestLanHipers = $('<div></div>').hide();
guestLanHipers.append('<label for="nicLanHipersName">Guest LAN name:</label>');
guestLanHipers.append(gLansHipersSelect);
addNicForm.append(guestLanHipers);
// VSWITCH drop down
var vswitch = $('<div></div>').hide();
vswitch.append('<label for="nicVSwitchName">VSWITCH name:</label>');
vswitch.append(vswitchSelect);
@ -1298,74 +1299,102 @@ function createAddNicDialog(node, hcp) {
// Remove any warning messages
$(this).parent().parent().find('.ui-state-error').remove();
// Get NIC type and network type
var nicType = nicTypeSelect.val();
var networkType = $(this).val();
// Hide network name drop downs
guestLanQdio.hide();
guestLanHipers.hide();
vswitch.hide();
if (networkType == 'Guest LAN' && nicType == 'QDIO')
// Show correct network name
if (networkType == 'Guest LAN' && nicType == 'QDIO') {
guestLanQdio.show();
else if (networkType == 'Guest LAN' && nicType == 'HiperSockets')
} else if (networkType == 'Guest LAN' && nicType == 'HiperSockets') {
guestLanHipers.show();
else if (networkType == 'Virtual Switch' && nicType == 'QDIO')
vswitch.show();
else if (networkType == 'Virtual Switch' && nicType != 'QDIO') {
var warn = createWarnBar('The selected choices are not valid');
warn.prependTo($(this).parent().parent());
} else if (networkType == 'Virtual Switch') {
if (nicType == 'QDIO') {
vswitch.show();
} else {
// No such thing as HIPERS VSWITCH
var warn = createWarnBar('The selected choices are not valid.');
warn.prependTo($(this).parent().parent());
}
}
});
// Show network names on change
nicTypeSelect.change(function(){
// Remove any warning messages
$(this).parent().parent().find('.ui-state-error').remove();
// Get NIC type and network type
var nicType = $(this).val();
var networkType = networkTypeSelect.val();
// Hide network name drop downs
guestLanQdio.hide();
guestLanHipers.hide();
vswitch.hide();
if (networkType == 'Guest LAN' && nicType == 'QDIO')
// Show correct network name
if (networkType == 'Guest LAN' && nicType == 'QDIO') {
guestLanQdio.show();
else if (networkType == 'Guest LAN' && nicType == 'HiperSockets')
} else if (networkType == 'Guest LAN' && nicType == 'HiperSockets') {
guestLanHipers.show();
else if (networkType == 'Virtual Switch' && nicType == 'QDIO')
vswitch.show();
else if (networkType == 'Virtual Switch' && nicType != 'QDIO') {
var warn = createWarnBar('The selected choices are not valid');
warn.prependTo($(this).parent().parent());
} else if (networkType == 'Virtual Switch') {
if (nicType == 'QDIO') {
vswitch.show();
} else {
// No such thing as HIPERS VSWITCH
var warn = createWarnBar('The selected choices are not valid.');
warn.prependTo($(this).parent().parent());
}
}
});
// Create add NIC dialog
// Open dialog to add NIC
addNicForm.dialog({
position: 'top',
modal: true,
width: 400,
buttons: {
"Cancel": function(){
// Close dialog
$(this).dialog( "close" );
},
"Ok": function(){
// Remove any warning messages
$(this).find('.ui-state-error').remove();
var ready = true;
var errMsg = '';
// Get inputs
var node = $(this).find('input[name=nicNode]').val();
var nicType = $(this).find('select[name=nicType]').val();
var networkType = $(this).find('select[name=nicNetworkType]').val();
var address = $(this).find('input[name=nicAddress]').val();
// If inputs are not complete, show warning message
if (!node || !nicType || !networkType || !address) {
var warn = createWarnBar('Missing values');
warn.prependTo($(this));
errMsg = 'You are missing inputs.<br>';
ready = false;
}
// If a HIPERS VSWITCH is selected, show warning message
if (nicType == 'HiperSockets' && networkType == 'Virtual Switch') {
errMsg += 'The selected choices are not valid.';
ready = false;
}
// If there are errors
if (!ready) {
// Show warning message
var warn = createWarnBar(errMsg);
warn.prependTo($(this));
} else {
/**
* Add guest LAN
*/
// Add guest LAN
if (networkType == 'Guest LAN') {
var temp;
if (nicType == 'QDIO') {
@ -1391,9 +1420,7 @@ function createAddNicDialog(node, hcp) {
});
}
/**
* Add virtual switch
*/
// Add virtual switch
else if (networkType == 'Virtual Switch' && nicType == 'QDIO') {
var temp = $(this).find('select[name=nicVSwitchName]').val().split(' ');
var vswitchName = temp[1];
@ -1425,7 +1452,7 @@ function createAddNicDialog(node, hcp) {
// Close dialog
$(this).dialog( "close" );
} // End of else
}
} // End of function()
}
});
}
@ -1606,9 +1633,8 @@ function getDiskPool(data) {
success : loadDiskPoolTable
});
}
}
} // End of if
} // End of for
}
}
@ -1643,8 +1669,8 @@ function getNetwork(data) {
success : loadNetworkTable
});
}
}
} // End of for
} // End of if
}
/**
@ -1909,11 +1935,12 @@ function createZProvisionExisting(inst) {
var bootMethod = $('<div></div>');
var methoddLabel = $('<label>Boot method:</label>');
var methodSelect = $('<select name="bootMethod"></select>');
methodSelect.append('<option value="boot">boot</option>');
methodSelect.append('<option value="install">install</option>');
methodSelect.append('<option value="iscsiboot">iscsiboot</option>');
methodSelect.append('<option value="netboot">netboot</option>');
methodSelect.append('<option value="statelite">statelite</option>');
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>'
);
bootMethod.append(methoddLabel);
bootMethod.append(methodSelect);
provExisting.append(bootMethod);
@ -1923,6 +1950,9 @@ function createZProvisionExisting(inst) {
*/
var provisionBtn = createButton('Provision');
provisionBtn.bind('click', function(event) {
// Remove any warning messages
$(this).parent().parent().find('.ui-state-error').remove();
var ready = true;
var errMsg = '';
@ -1935,13 +1965,14 @@ function createZProvisionExisting(inst) {
var dTableId = 'zNodesDatatable' + inst;
var tgts = getNodesChecked(dTableId);
if (!tgts) {
errMsg = 'You need to select a node.';
errMsg += 'You need to select a node.<br>';
ready = false;
}
// Check operating system image
var os = $('#' + thisTabId + ' input[name=os]:visible');
if (!os.val()) {
errMsg += 'You need to select a operating system image.';
os.css('border', 'solid #FF0000 1px');
ready = false;
} else {
@ -1988,7 +2019,9 @@ function createZProvisionExisting(inst) {
success : updateZProvisionExistingStatus
});
} else {
alert('(Error) ' + errMsg);
// Show warning message
var warn = createWarnBar(errMsg);
warn.prependTo($(this).parent().parent());
}
});
provExisting.append(provisionBtn);
@ -2116,10 +2149,9 @@ function createZProvisionNew(inst) {
// Create disk type drop down
var diskType = $('<td></td>');
var diskTypeSelect = $('<select></select>');
var diskType3390 = $('<option value="3390">3390</option>');
var diskType9336 = $('<option value="9336">9336</option>');
diskTypeSelect.append(diskType3390);
diskTypeSelect.append(diskType9336);
diskTypeSelect.append('<option value="3390">3390</option>'
+ '<option value="9336">9336</option>'
);
diskType.append(diskTypeSelect);
diskRow.append(diskType);
@ -2134,13 +2166,14 @@ function createZProvisionNew(inst) {
// Create disk mode input
var diskMode = $('<td></td>');
var diskModeSelect = $('<select></select>');
diskModeSelect.append('<option value="R">R</option>');
diskModeSelect.append('<option value="RR">RR</option>');
diskModeSelect.append('<option value="W">W</option>');
diskModeSelect.append('<option value="WR">WR</option>');
diskModeSelect.append('<option value="M">M</option>');
diskModeSelect.append('<option value="MR">MR</option>');
diskModeSelect.append('<option value="MW">MW</option>');
diskModeSelect.append('<option value="R">R</option>'
+ '<option value="RR">RR</option>'
+ '<option value="W">W</option>'
+ '<option value="WR">WR</option>'
+ '<option value="M">M</option>'
+ '<option value="MR">MR</option>'
+ '<option value="MW">MW</option>'
);
diskMode.append(diskModeSelect);
diskRow.append(diskMode);
@ -2182,6 +2215,9 @@ function createZProvisionNew(inst) {
*/
var provisionBtn = createButton('Provision');
provisionBtn.bind('click', function(event) {
// Remove any warning messages
$(this).parent().parent().find('.ui-state-error').remove();
var ready = true;
var errMsg = '';
@ -2218,7 +2254,7 @@ 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 user entry does not contain the correct user ID. ';
errMsg = errMsg + 'The user entry does not contain the correct user ID.<br>';
ready = false;
}
@ -2229,7 +2265,7 @@ function createZProvisionNew(inst) {
var diskRows = $('#' + thisTabId + ' table tr');
// If an OS is given, disks are needed
if (os.val() && (diskRows.length < 1)) {
errMsg = errMsg + 'You need to add at some disks. ';
errMsg = errMsg + 'You need to add at some disks.<br>';
ready = false;
}
@ -2387,7 +2423,9 @@ function createZProvisionNew(inst) {
});
}
} else {
alert('(Error) ' + errMsg);
// Show warning message
var warn = createWarnBar(errMsg);
warn.prependTo($(this).parent().parent());
}
});
provNew.append(provisionBtn);

View File

@ -73,6 +73,7 @@ function addGangLink(){
window.open('../ganglia/');
});
}
function gangRpmCheck(data){
var rpmStatus = data.rsp.split(/\n/);
var stopFlag = false;

View File

@ -57,9 +57,6 @@ function loadMonitorPage() {
var monitorInfoBar = createInfoBar('Select the Monitor Tool');
monitorForm.append(monitorInfoBar);
// Create drop-down menu
// Hardware available to provision - ipmi, blade, hmc, ivm, fsp, and zvm
var monitorList = $('<ol></ol>');
var items = "<li><a href='#' name='xcatmon'>xCAT Monitor</a> : xcatmon provides node status " +
"monitoring using fping on AIX and nmap on Linux. It also provides application " +

View File

@ -191,6 +191,7 @@ function rmcWorkingCheck(){
}
});
}
function loadRmcMonShow(){
$('#rmcMonStatus').empty().append("Getting monitoring Data.");
$('#rmcMonStatus').append(createLoader());

View File

@ -168,18 +168,17 @@ function loadGroups(data) {
+ '</select>'
+ '</div>' );
// Create add processor dialog
// Open dialog to add node
addNodeForm.dialog({
position: 'top',
modal: true,
width: 400,
buttons: {
"Cancel": function(){
// Close dialog
$(this).dialog( "close" );
},
"Ok": function(){
// Get processor properties
// Get hardware management
var mgt = $(this).find('select[name=mgt]').val();
var plugin;
@ -205,8 +204,6 @@ function loadGroups(data) {
}
plugin.addNode();
// Close dialog
$(this).dialog( "close" );
}
}
@ -462,10 +459,9 @@ function loadNodes(data) {
// Advanced actions
var advancedActions;
if ('compute' == group){
if ('compute' == group) {
advancedActions = [ boot2NetworkLnk, scriptLnk, setBootStateLnk, updateLnk, rcons ];
}
else{
} else {
advancedActions = [ boot2NetworkLnk, scriptLnk, setBootStateLnk, updateLnk ];
}
@ -605,7 +601,7 @@ function loadPowerStatus(data) {
var rowNum, node, status, args;
for ( var i in power) {
// node name and power status, where power[0] = nodeName and power[1] = state
// power[0] = nodeName and power[1] = state
args = power[i].split(':');
node = jQuery.trim(args[0]);
status = jQuery.trim(args[1]);
@ -613,7 +609,7 @@ function loadPowerStatus(data) {
// Get the row containing the node
rowNum = getRowNum(node);
//update the data in the
// Update the power status column
dTable.fnUpdate(status, rowNum, 3);
}
@ -665,14 +661,14 @@ function loadPingStatus(data) {
// Get all nodes within the datatable
var rows = dTable.fnGetNodes();
for ( var i in ping) {
// where ping[0] = nodeName ping[1] = state
// ping[0] = nodeName and ping[1] = state
node = jQuery.trim(ping[i][0]);
status = jQuery.trim(ping[i][1]);
// Get the row containing the node
rowPos = getRowNum(node);
// Update the power status column
// Update the ping status column
dTable.fnUpdate(status, rowPos, 2);
}
@ -748,7 +744,7 @@ function loadNode(e) {
}
// Get tab area where a new tab will be inserted
// the node name may contain special char(such as '.','#'), so we can not use the node name as a id.
// 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;
@ -781,7 +777,7 @@ function loadNode(e) {
});
// Select new tab
// tabid may contains special char, so we had to use the index
// Tab ID may contains special char, so we had to use the index
myTab.select(newTabId);
}
@ -828,6 +824,9 @@ function loadUnlockPage(tgtNodes) {
*/
var okBtn = createButton('Ok');
okBtn.bind('click', function(event) {
// Remove any warning messages
$(this).parent().parent().find('.ui-state-error').remove();
// If form is complete
var ready = formComplete(newTabId);
if (ready) {
@ -852,6 +851,10 @@ function loadUnlockPage(tgtNodes) {
// Disable Ok button
$(this).attr('disabled', 'true');
} else {
// Show warning message
var warn = createWarnBar('You are missing some values');
warn.prependTo($(this).parent().parent());
}
});
@ -928,6 +931,9 @@ function loadScriptPage(tgtNodes) {
*/
var runBtn = createButton('Run');
runBtn.bind('click', function(event) {
// Remove any warning messages
$(this).parent().parent().find('.ui-state-error').remove();
var ready = true;
// Check script
@ -946,7 +952,9 @@ function loadScriptPage(tgtNodes) {
// Run script
runScript(inst);
} else {
alert('You are missing some values');
// Show warning message
var warn = createWarnBar('You are missing some values');
warn.prependTo($(this).parent().parent());
}
});
scriptForm.append(runBtn);
@ -1130,8 +1138,7 @@ function updateStatusBar(data) {
var prg = writeRsp(rsp, '');
$('#' + statBarId).append(prg);
// If there was an error
// Do not continue
// If there was an error, do not continue
if (prg.html().indexOf('Error') > -1) {
failed = true;
}
@ -1310,7 +1317,6 @@ function getNodeAttr(node, attrName) {
}
}
// If the column containing the attribute is found
if (attrCol) {
// Get the attribute column index

View File

@ -58,11 +58,12 @@ function loadNodesetPage(tgtNodes) {
var method = $('<div></div>');
var methodLabel = $('<label for="method">Boot method:</label>');
var methodSelect = $('<select id="bootMethod" name="bootMethod"></select>');
methodSelect.append('<option value="boot">boot</option>');
methodSelect.append('<option value="install">install</option>');
methodSelect.append('<option value="iscsiboot">iscsiboot</option>');
methodSelect.append('<option value="netboot">netboot</option>');
methodSelect.append('<option value="statelite">statelite</option>');
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);
nodesetForm.append(method);
@ -71,9 +72,10 @@ function loadNodesetPage(tgtNodes) {
var type = $('<div></div>');
var typeLabel = $('<label for="type">Boot type:</label>');
var typeSelect = $('<select id="bootType" name="bootType"></select>');
typeSelect.append('<option value="zvm">zvm</option>');
typeSelect.append('<option value="install">pxe</option>');
typeSelect.append('<option value="iscsiboot">yaboot</option>');
typeSelect.append('<option value="zvm">zvm</option>'
+ '<option value="install">pxe</option>'
+ '<option value="iscsiboot">yaboot</option>'
);
type.append(typeLabel);
type.append(typeSelect);
nodesetForm.append(type);
@ -128,6 +130,9 @@ function loadNodesetPage(tgtNodes) {
*/
var okBtn = createButton('Ok');
okBtn.bind('click', function(event) {
// Remove any warning messages
$(this).parent().parent().find('.ui-state-error').remove();
// Check state, OS, arch, and profile
var ready = true;
var inputs = $('#' + tabId + ' input');
@ -178,7 +183,9 @@ function loadNodesetPage(tgtNodes) {
// Show status bar
statBar.show();
} else {
alert('You are missing some values');
// Show warning message
var warn = createWarnBar('You are missing some values');
warn.prependTo($(this).parent().parent());
}
});
nodesetForm.append(okBtn);

View File

@ -104,6 +104,9 @@ function loadNetbootPage(tgtNodes) {
*/
var okBtn = createButton('Ok');
okBtn.bind('click', function(event) {
// Remove any warning messages
$(this).parent().parent().find('.ui-state-error').remove();
// Check inputs
var ready = true;
var inputs = $("#" + newTabId + " input[type='text']:visible");
@ -169,7 +172,9 @@ function loadNetbootPage(tgtNodes) {
// Show status bar
statusBar.show();
} else {
alert('You are missing some values');
// Show warning message
var warn = createWarnBar('You are missing some values');
warn.prependTo($(this).parent().parent());
}
});
netbootForm.append(okBtn);

View File

@ -155,6 +155,7 @@ function loadUpdatenodePage(tgtNodes) {
var postscripts = $('<li><label for="postscripts">Postscripts:</label><input type="text" name="postscripts"/></li>');
postscripts.hide();
optsList.append(postscripts);
// Show alternate source directory when checked
postChkBox.bind('click', function(event) {
if ($(this).is(':checked')) {
@ -203,6 +204,8 @@ function loadUpdatenodePage(tgtNodes) {
*/
var okBtn = createButton('Ok');
okBtn.bind('click', function(event) {
// Remove any warning messages
$(this).parent().parent().find('.ui-state-error').remove();
var ready = true;
// Generate arguments
@ -218,9 +221,9 @@ function loadUpdatenodePage(tgtNodes) {
var srcDir = $('#' + newTabId + ' input[name=allSwSrcDirectory]').val();
if (srcDir) {
optStr += ';-d ' + srcDir;
}
}
}
// If update software is checked
if (opt == 'S') {
// Get source directory
@ -299,7 +302,9 @@ function loadUpdatenodePage(tgtNodes) {
// Show status bar
statusBar.show();
} else {
alert('You are missing some values');
// Show warning message
var warn = createWarnBar('You are missing some values');
warn.prependTo($(this).parent().parent());
}
});
updatenodeForm.append(okBtn);

View File

@ -416,7 +416,6 @@ function initPage() {
includeJs("js/jquery/jquery.autocomplete.js");
includeJs("js/jquery/jquery.contextmenu.js");
includeJs("js/jquery/jquery.cookie.js");
includeJs("js/jquery/jquery-impromptu.3.0.min.js");
includeJs("js/jquery/superfish.js");
includeJs("js/jquery/hoverIntent.js");
includeJs("js/jquery/jquery.tree.js");
@ -529,17 +528,15 @@ function writeRsp(rsp, pattern) {
* @return Nothing
*/
function openDialog(msg) {
// If there was an error, do not continue
var div = $('<div><p>' + msg + '</p></div>');
// Create dialog
// Open dialog
div.dialog({
position: 'top',
modal: true,
width: 400,
buttons: {
"Ok": function(){
// Close dialog
$(this).dialog("close");
}
}