diff --git a/xCAT-UI/js/custom/zvmUtils.js b/xCAT-UI/js/custom/zvmUtils.js
index 013f654b5..5bf4c13be 100644
--- a/xCAT-UI/js/custom/zvmUtils.js
+++ b/xCAT-UI/js/custom/zvmUtils.js
@@ -1994,7 +1994,7 @@ function openAddScsi2SystemDialog(hcp) {
systemSelect.append($(''));
}
- var devNum = $('
');
+ var devNo = $('');
var devPathLabel = $('');
var devPathCount = 1;
var pathDiv = $('');
@@ -2003,10 +2003,10 @@ function openAddScsi2SystemDialog(hcp) {
var devPathTable = $('
');
var devPathHeader = $('
FCP Device
WWPN
LUN
');
// Adjust header width
- devPathHeader.find('th').css( {
+ devPathHeader.find('th').css({
'width' : '120px'
});
- devPathHeader.find('th').eq(0).css( {
+ devPathHeader.find('th').eq(0).css({
'width' : '20px'
});
var devPathBody = $('');
@@ -2121,7 +2121,7 @@ function openAddScsi2SystemDialog(hcp) {
'' +
'' +
'');
- addS2SForm.append(system, devNum, devPathDiv, option, persist);
+ addS2SForm.append(system, devNo, devPathDiv, option, persist);
// Generate tooltips
addS2SForm.find('div input[title],select[title]').tooltip({
@@ -2171,42 +2171,53 @@ function openAddScsi2SystemDialog(hcp) {
// Remove any warning messages
$(this).find('.ui-state-error').remove();
- var system = $(this).find('input[name=system]').val();
- var num = $(this).find('input[name=devNum]').val();
+ var system = $(this).find('select[name=system]').val();
+ var devNo = $(this).find('input[name=devNo]').val();
var pathArray = "";
$('.devPath').each(function(index) {
- pathArray += $(this).find('input[name=fcpDevNum]').val() + ' ';
- pathArray += $(this).find('input[name=fcpWwpn]').val() + ' ';
- pathArray += $(this).find('input[name=fcpLun]').val() + '; ';
+ pathArray += $(this).find('input[name=fcpDevNum]').val() + ',';
+ pathArray += $(this).find('input[name=fcpWwpn]').val() + ',';
+ pathArray += $(this).find('input[name=fcpLun]').val() + ';';
});
- path_Array = pathArray + "'";
var option = $(this).find('select[name=option]').val();
var persist = $(this).find('select[name=persist]').val();
// If inputs are not complete, show warning message
- if (!system || !num || !pathArray || !option || !persist) {
- var warn = createWarnBar('Please provide a value for each missing field.');
- warn.prependTo($(this));
- } else {
- // Change dialog buttons
- $(this).dialog('option', 'buttons', {
- 'Close': function() {$(this).dialog("close");}
- });
-
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'chhypervisor',
- tgt : system,
- args : "--addscsi||" + num + "||" + pathArray + "||" + option + "||" + persist,
- msg : dialogId
- },
-
- success : updateResourceDialog
- });
-
+ var ready = true;
+ var args = new Array('select[name=system]', 'input[name=devNum]', 'select[name=option]', 'select[name=persist]');
+ for (var i in args) {
+ if (!$(this).find(args[i]).val()) {
+ $(this).find(args[i]).css('border', 'solid #FF0000 1px');
+ ready = false;
+ } else {
+ $(this).find(args[i]).css('border', 'solid #BDBDBD 1px');
+ }
}
+
+ // Show warning message
+ if (!ready || !pathArray) {
+ var warn = createWarnBar('Please provide a value for each required field.');
+ warn.prependTo($(this));
+ return;
+ }
+
+ // Change dialog buttons
+ $(this).dialog('option', 'buttons', {
+ 'Close': function() {$(this).dialog("close");}
+ });
+
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'chhypervisor',
+ tgt : system,
+ args : "--addscsi||" + devNo + "||'" + pathArray + "'||" + option + "||" + persist,
+ msg : dialogId
+ },
+
+ success : updateResourceDialog
+ });
},
"Cancel": function() {
$(this).dialog( "close" );
@@ -2283,34 +2294,46 @@ function openRemoveScsiDialog(hcp) {
$(this).find('.ui-state-error').remove();
// Get inputs
- var system = $(this).find('input[name=system]').val();
+ var system = $(this).find('select[name=system]').val();
var devnum = $(this).find('input[name=devNum]').val();
var persist = $(this).find('select[name=persist]').val();
// If inputs are not complete, show warning message
- if (!system || !devnum) {
- var warn = createWarnBar('Please provide a value for each missing field.');
+ var ready = true;
+ var args = new Array('select[name=system]', 'input[name=devNum]');
+ for (var i in args) {
+ if (!$(this).find(args[i]).val()) {
+ $(this).find(args[i]).css('border', 'solid #FF0000 1px');
+ ready = false;
+ } else {
+ $(this).find(args[i]).css('border', 'solid #BDBDBD 1px');
+ }
+ }
+
+ if (!ready) {
+ // Show warning message
+ var warn = createWarnBar('Please provide a value for each required field.');
warn.prependTo($(this));
- } else {
- // Change dialog buttons
- $(this).dialog('option', 'buttons', {
- 'Close': function() {$(this).dialog("close");}
- });
-
- $.ajax( {
- url : 'lib/cmd.php',
- dataType : 'json',
- data : {
- cmd : 'chhypervisor',
- tgt : system,
- args : "--removescsi;" + devnum + ";" + persist,
- msg : dialogId
- },
+ return;
+ }
- success : updateResourceDialog
- });
+ // Change dialog buttons
+ $(this).dialog('option', 'buttons', {
+ 'Close': function() {$(this).dialog("close");}
+ });
+
+ $.ajax( {
+ url : 'lib/cmd.php',
+ dataType : 'json',
+ data : {
+ cmd : 'chhypervisor',
+ tgt : system,
+ args : "--removescsi;" + devnum + ";" + persist,
+ msg : dialogId
+ },
- } // End of else
+ success : updateResourceDialog
+ });
},
"Cancel": function() {
$(this).dialog( "close" );
@@ -2578,7 +2601,7 @@ function openAddNicDialog(node, hcp) {
$(this).dialog( "close" );
} // End of else
},
- "Cancel": function(){
+ "Cancel": function() {
$(this).dialog( "close" );
}
}
@@ -2606,8 +2629,8 @@ function openAddVswitchVlanDialog(hcp) {
var typeFS = $('').hide();
var typeLegend = $('');
typeFS.append(typeLegend);
-
addVswitchForm.append(info, netFS, typeFS);
+
var netAttr = $('');
netFS.append($(''));
netFS.append(netAttr);
@@ -2622,120 +2645,94 @@ function openAddVswitchVlanDialog(hcp) {
netAttr.append(networkTypeDiv);
var system = $('');
- var systemSelect = $('');
+ var systemSelect = $('');
system.append(systemSelect);
netAttr.append(system);
+
+ // Obtain mapping for zHCP to zVM system
+ var hcp2zvm = new Object();
+ hcp2zvm = getHcpZvmHash();
+ systemSelect.append($(''));
+ for (var hcp in hcp2zvm) {
+ systemSelect.append($(''));
+ }
var typeAttr = $('');
typeFS.append($(''));
typeFS.append(typeAttr);
// Create vSwitch parameters
- var vswitchOptions = $('').hide();
+ var vswitchOptions = $('').hide();
vswitchOptions.append($(''));
vswitchOptions.append($(''));
- vswitchOptions.append($(''));
vswitchOptions.append($(''));
- vswitchOptions.append($('