diff --git a/xCAT-UI/js/custom/zvm.js b/xCAT-UI/js/custom/zvm.js index 3972880ad..00063fa30 100644 --- a/xCAT-UI/js/custom/zvm.js +++ b/xCAT-UI/js/custom/zvm.js @@ -783,23 +783,22 @@ zvmPlugin.prototype.loadInventory = function(data) { var networks = $.cookie(temp[0] + 'Networks').split(','); // Create a drop down list - var gLans = ''; + var gLansHipers = ''; for ( var i = 0; i < networks.length; i++) { var network = networks[i].split(' '); - - // Get VSwitches if (network[0] == 'VSWITCH') { - vswitches = vswitches + ''; - } - - // Get Guest LAN - else if (network[0] == 'LAN') { - gLans = gLans + ''; + vswitches = vswitches + ''; + } else if (network[0] == 'LAN:QDIO') { + gLansQdio = gLansQdio + ''; + } else if (network[0] == 'LAN:HIPERS') { + gLansHipers = gLansHipers + ''; } } vswitches = vswitches + ''; - gLans = gLans + ''; + gLansQdio = gLansQdio + ''; + gLansHipers = gLansHipers + ''; var nicTypeForm = '
' + '
' @@ -807,7 +806,7 @@ zvmPlugin.prototype.loadInventory = function(data) { + '
' + '' + '
' + '
' @@ -816,8 +815,10 @@ zvmPlugin.prototype.loadInventory = function(data) { + '' + '' + '
' + '
'; - var configGuestLanForm = '
' + '
' + gLans + '
' + '
'; - var configVSwitchForm = '
' + '
' + vswitches + '
' + '
'; + var configGuestLanQdioForm = '
' + gLansQdio + '
'; + var configGuestLanHipersForm = '
' + gLansHipers + '
'; + var configVSwitchForm = '
' + vswitches + '
'; + var notSupportedForm = '

The requested operation is not supported

'; var states = { // Select NIC type @@ -833,19 +834,41 @@ zvmPlugin.prototype.loadInventory = function(data) { if (!v) { return true; } else { + var nicType = f.nicType; var networkType = f.nicNetworkType; - if (networkType == 'Guest LAN') - $.prompt.goToState('configGuestLan'); - else + if (networkType == 'Guest LAN' && nicType == 'QDIO') + $.prompt.goToState('configGuestLanQdio'); + else if (networkType == 'Guest LAN' && nicType == 'HiperSockets') + $.prompt.goToState('configGuestLanHipers'); + else if (networkType == 'Virtual Switch' && nicType == 'QDIO') $.prompt.goToState('configVSwitch'); + else + $.prompt.goToState('notSupported'); return false; } } }, - // Configure guest LAN - configGuestLan : { - html : configGuestLanForm, + // Configure QDIO guest LAN page + configGuestLanQdio : { + html : configGuestLanQdioForm, + callback : addNic, + buttons : { + Ok : true, + Cancel : false + }, + focus : 1, + prefix : 'cleanblue', + submit : function(v, m, f) { + if (v) { + return true; + } + } + }, + + // Configure HIPERS guest LAN page + configGuestLanHipers : { + html : configGuestLanHipersForm, callback : addNic, buttons : { Ok : true, @@ -860,7 +883,7 @@ zvmPlugin.prototype.loadInventory = function(data) { } }, - // Configure VSwitch + // Configure VSwitch page configVSwitch : { html : configVSwitchForm, callback : addNic, @@ -875,6 +898,21 @@ zvmPlugin.prototype.loadInventory = function(data) { return true; } } + }, + + // Not supported page + notSupported : { + html : notSupportedForm, + buttons : { + Ok : false + }, + focus : 1, + prefix : 'cleanblue', + submit : function(v, m, f) { + if (v) { + return true; + } + } } }; diff --git a/xCAT-UI/js/custom/zvmUtils.js b/xCAT-UI/js/custom/zvmUtils.js index 5f5a6ef19..49e9a6b1b 100644 --- a/xCAT-UI/js/custom/zvmUtils.js +++ b/xCAT-UI/js/custom/zvmUtils.js @@ -1142,15 +1142,21 @@ function addNic(v, m, f) { var nicType = f.nicType; var networkType = f.nicNetworkType; var address = f.nicAddress; - + /** * Add guest LAN */ if (networkType == 'Guest LAN') { - var temp = f.nicLanName.split(' '); - var lanName = temp[1]; + var temp; + if (nicType == 'QDIO') { + temp = f.nicLanQdioName.split(' '); + } else { + temp = f.nicLanHipersName.split(' '); + } + var lanOwner = temp[0]; - + var lanName = temp[1]; + $.ajax( { url : 'lib/cmd.php', dataType : 'json',