From 40530b8a08c553dbb2f2aa84349b9283b0df25e2 Mon Sep 17 00:00:00 2001 From: phamt Date: Tue, 20 Jul 2010 18:49:31 +0000 Subject: [PATCH] Added provision pages for other platforms git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6806 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/custom/blade.js | 209 +++++++++++++++++++++++++++++++++++++ xCAT-UI/js/custom/fsp.js | 209 +++++++++++++++++++++++++++++++++++++ xCAT-UI/js/custom/hmc.js | 164 +++++++++++++++++++++++++++++ xCAT-UI/js/custom/ipmi.js | 209 +++++++++++++++++++++++++++++++++++++ xCAT-UI/js/custom/ivm.js | 209 +++++++++++++++++++++++++++++++++++++ xCAT-UI/js/custom/zvm.js | 2 - 6 files changed, 1000 insertions(+), 2 deletions(-) create mode 100644 xCAT-UI/js/custom/blade.js create mode 100644 xCAT-UI/js/custom/fsp.js create mode 100644 xCAT-UI/js/custom/ipmi.js create mode 100644 xCAT-UI/js/custom/ivm.js diff --git a/xCAT-UI/js/custom/blade.js b/xCAT-UI/js/custom/blade.js new file mode 100644 index 000000000..d3fcec564 --- /dev/null +++ b/xCAT-UI/js/custom/blade.js @@ -0,0 +1,209 @@ +$(document).ready(function(){ + // Include utility scripts +}); + +/** + * Load node inventory + * + * @param data + * Data from HTTP request + * @return Nothing + */ +function loadInventory(data) { + +} + +/** + * Load clone page + * + * @param node + * Source node to clone + * @return Nothing + */ +function loadClonePage(node) { + +} + +/** + * Load provision page + * + * @param tabId + * The provision tab ID + * @return Nothing + */ +function loadProvisionPage(tabId) { + var errMsg; + + // Get the OS image names + $.ajax( { + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'tabdump', + tgt : '', + args : 'osimage', + msg : '' + }, + + success : setOSImageCookies + }); + + // Get groups + $.ajax( { + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'extnoderange', + tgt : '/.*', + args : 'subgroups', + msg : '' + }, + + success : setGroupsCookies + }); + + // Generate new tab ID + var inst = tabId.replace('bladeProvisionTab', ''); + + // Open new tab + // Create provision form + var provForm = $('
'); + + // Create status bar + var barId = 'bladeProvisionStatBar' + inst; + var statBar = createStatusBar(barId); + statBar.hide(); + provForm.append(statBar); + + // Create loader + var loader = createLoader('bladeProvisionLoader' + inst); + loader.hide(); + statBar.append(loader); + + // Create info bar + var infoBar = createInfoBar('Provision a blade node'); + provForm.append(infoBar); + + // Append to provision tab + $('#' + tabId).append(provForm); + + // Node name + var nodeName = $('
'); + provForm.append(nodeName); + + // Group + var group = $('
'); + var groupLabel = $(''); + var groupInput = $(''); + + // Get the groups on-focus + groupInput.focus(function() { + var groupNames = $.cookie('Groups'); + + // If there are groups, turn on auto-complete + if (groupNames) { + $(this).autocomplete(groupNames.split(',')); + } + }); + + group.append(groupLabel); + group.append(groupInput); + provForm.append(group); + + // Boot method (boot, install, stat, iscsiboot, netboot, statelite) + var method = $('
'); + var methodLabel = $(''); + var methodSelect = $(''); + methodSelect.append(''); + methodSelect.append(''); + methodSelect.append(''); + methodSelect.append(''); + methodSelect.append(''); + method.append(methodLabel); + method.append(methodSelect); + provForm.append(method); + + // Boot type (zvm, pxe, yaboot) + var type = $('
'); + var typeLabel = $(''); + var typeSelect = $(''); + typeSelect.append(''); + typeSelect.append(''); + typeSelect.append(''); + type.append(typeLabel); + type.append(typeSelect); + provForm.append(type); + + // Operating system + var os = $('
'); + var osLabel = $(''); + var osInput = $(''); + + // Get the OS versions on-focus + var tmp; + osInput.focus(function() { + tmp = $.cookie('OSVers'); + + // If there are any, turn on auto-complete + if (tmp) { + $(this).autocomplete(tmp.split(',')); + } + }); + os.append(osLabel); + os.append(osInput); + provForm.append(os); + + // Architecture + var arch = $('
'); + var archLabel = $(''); + var archInput = $(''); + + // Get the OS architectures on-focus + archInput.focus(function() { + tmp = $.cookie('OSArchs'); + + // If there are any, turn on auto-complete + if (tmp) { + $(this).autocomplete(tmp.split(',')); + } + }); + arch.append(archLabel); + arch.append(archInput); + provForm.append(arch); + + // Profiles + var profile = $('
'); + var profileLabel = $(''); + var profileInput = $(''); + + // Get the profiles on-focus + profileInput.focus(function() { + tmp = $.cookie('Profiles'); + + // If there are any, turn on auto-complete + if (tmp) { + $(this).autocomplete(tmp.split(',')); + } + }); + profile.append(profileLabel); + profile.append(profileInput); + provForm.append(profile); + + /** + * Provision + */ + var provisionBtn = createButton('Provision'); + provisionBtn.bind('click', function(event) { + // Insert provision code here + }); + provForm.append(provisionBtn); +} + +/** + * Load resources + * + * @return Nothing + */ +function loadResources() { + +} \ No newline at end of file diff --git a/xCAT-UI/js/custom/fsp.js b/xCAT-UI/js/custom/fsp.js new file mode 100644 index 000000000..a69587737 --- /dev/null +++ b/xCAT-UI/js/custom/fsp.js @@ -0,0 +1,209 @@ +$(document).ready(function(){ + // Include utility scripts +}); + +/** + * Load node inventory + * + * @param data + * Data from HTTP request + * @return Nothing + */ +function loadInventory(data) { + +} + +/** + * Load clone page + * + * @param node + * Source node to clone + * @return Nothing + */ +function loadClonePage(node) { + +} + +/** + * Load provision page + * + * @param tabId + * The provision tab ID + * @return Nothing + */ +function loadProvisionPage(tabId) { + var errMsg; + + // Get the OS image names + $.ajax( { + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'tabdump', + tgt : '', + args : 'osimage', + msg : '' + }, + + success : setOSImageCookies + }); + + // Get groups + $.ajax( { + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'extnoderange', + tgt : '/.*', + args : 'subgroups', + msg : '' + }, + + success : setGroupsCookies + }); + + // Generate new tab ID + var inst = tabId.replace('fspProvisionTab', ''); + + // Open new tab + // Create provision form + var provForm = $('
'); + + // Create status bar + var barId = 'fspProvisionStatBar' + inst; + var statBar = createStatusBar(barId); + statBar.hide(); + provForm.append(statBar); + + // Create loader + var loader = createLoader('fspProvisionLoader' + inst); + loader.hide(); + statBar.append(loader); + + // Create info bar + var infoBar = createInfoBar('Provision a FSP node'); + provForm.append(infoBar); + + // Append to provision tab + $('#' + tabId).append(provForm); + + // Node name + var nodeName = $('
'); + provForm.append(nodeName); + + // Group + var group = $('
'); + var groupLabel = $(''); + var groupInput = $(''); + + // Get the groups on-focus + groupInput.focus(function() { + var groupNames = $.cookie('Groups'); + + // If there are groups, turn on auto-complete + if (groupNames) { + $(this).autocomplete(groupNames.split(',')); + } + }); + + group.append(groupLabel); + group.append(groupInput); + provForm.append(group); + + // Boot method (boot, install, stat, iscsiboot, netboot, statelite) + var method = $('
'); + var methodLabel = $(''); + var methodSelect = $(''); + methodSelect.append(''); + methodSelect.append(''); + methodSelect.append(''); + methodSelect.append(''); + methodSelect.append(''); + method.append(methodLabel); + method.append(methodSelect); + provForm.append(method); + + // Boot type (zvm, pxe, yaboot) + var type = $('
'); + var typeLabel = $(''); + var typeSelect = $(''); + typeSelect.append(''); + typeSelect.append(''); + typeSelect.append(''); + type.append(typeLabel); + type.append(typeSelect); + provForm.append(type); + + // Operating system + var os = $('
'); + var osLabel = $(''); + var osInput = $(''); + + // Get the OS versions on-focus + var tmp; + osInput.focus(function() { + tmp = $.cookie('OSVers'); + + // If there are any, turn on auto-complete + if (tmp) { + $(this).autocomplete(tmp.split(',')); + } + }); + os.append(osLabel); + os.append(osInput); + provForm.append(os); + + // Architecture + var arch = $('
'); + var archLabel = $(''); + var archInput = $(''); + + // Get the OS architectures on-focus + archInput.focus(function() { + tmp = $.cookie('OSArchs'); + + // If there are any, turn on auto-complete + if (tmp) { + $(this).autocomplete(tmp.split(',')); + } + }); + arch.append(archLabel); + arch.append(archInput); + provForm.append(arch); + + // Profiles + var profile = $('
'); + var profileLabel = $(''); + var profileInput = $(''); + + // Get the profiles on-focus + profileInput.focus(function() { + tmp = $.cookie('Profiles'); + + // If there are any, turn on auto-complete + if (tmp) { + $(this).autocomplete(tmp.split(',')); + } + }); + profile.append(profileLabel); + profile.append(profileInput); + provForm.append(profile); + + /** + * Provision + */ + var provisionBtn = createButton('Provision'); + provisionBtn.bind('click', function(event) { + // Insert provision code here + }); + provForm.append(provisionBtn); +} + +/** + * Load resources + * + * @return Nothing + */ +function loadResources() { + +} \ No newline at end of file diff --git a/xCAT-UI/js/custom/hmc.js b/xCAT-UI/js/custom/hmc.js index 52ba6486d..367a69f30 100644 --- a/xCAT-UI/js/custom/hmc.js +++ b/xCAT-UI/js/custom/hmc.js @@ -32,7 +32,171 @@ function loadClonePage(node) { * @return Nothing */ function loadProvisionPage(tabId) { + var errMsg; + + // Get the OS image names + $.ajax( { + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'tabdump', + tgt : '', + args : 'osimage', + msg : '' + }, + + success : setOSImageCookies + }); + + // Get groups + $.ajax( { + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'extnoderange', + tgt : '/.*', + args : 'subgroups', + msg : '' + }, + + success : setGroupsCookies + }); + + // Generate new tab ID + var inst = tabId.replace('hmcProvisionTab', ''); + + // Open new tab + // Create provision form + var provForm = $('
'); + + // Create status bar + var barId = 'hmcProvisionStatBar' + inst; + var statBar = createStatusBar(barId); + statBar.hide(); + provForm.append(statBar); + + // Create loader + var loader = createLoader('hmcProvisionLoader' + inst); + loader.hide(); + statBar.append(loader); + + // Create info bar + var infoBar = createInfoBar('Provision a HMC node'); + provForm.append(infoBar); + + // Append to provision tab + $('#' + tabId).append(provForm); + + // Node name + var nodeName = $('
'); + provForm.append(nodeName); + // Group + var group = $('
'); + var groupLabel = $(''); + var groupInput = $(''); + + // Get the groups on-focus + groupInput.focus(function() { + var groupNames = $.cookie('Groups'); + + // If there are groups, turn on auto-complete + if (groupNames) { + $(this).autocomplete(groupNames.split(',')); + } + }); + + group.append(groupLabel); + group.append(groupInput); + provForm.append(group); + + // Boot method (boot, install, stat, iscsiboot, netboot, statelite) + var method = $('
'); + var methodLabel = $(''); + var methodSelect = $(''); + methodSelect.append(''); + methodSelect.append(''); + methodSelect.append(''); + methodSelect.append(''); + methodSelect.append(''); + method.append(methodLabel); + method.append(methodSelect); + provForm.append(method); + + // Boot type (zvm, pxe, yaboot) + var type = $('
'); + var typeLabel = $(''); + var typeSelect = $(''); + typeSelect.append(''); + typeSelect.append(''); + typeSelect.append(''); + type.append(typeLabel); + type.append(typeSelect); + provForm.append(type); + + // Operating system + var os = $('
'); + var osLabel = $(''); + var osInput = $(''); + + // Get the OS versions on-focus + var tmp; + osInput.focus(function() { + tmp = $.cookie('OSVers'); + + // If there are any, turn on auto-complete + if (tmp) { + $(this).autocomplete(tmp.split(',')); + } + }); + os.append(osLabel); + os.append(osInput); + provForm.append(os); + + // Architecture + var arch = $('
'); + var archLabel = $(''); + var archInput = $(''); + + // Get the OS architectures on-focus + archInput.focus(function() { + tmp = $.cookie('OSArchs'); + + // If there are any, turn on auto-complete + if (tmp) { + $(this).autocomplete(tmp.split(',')); + } + }); + arch.append(archLabel); + arch.append(archInput); + provForm.append(arch); + + // Profiles + var profile = $('
'); + var profileLabel = $(''); + var profileInput = $(''); + + // Get the profiles on-focus + profileInput.focus(function() { + tmp = $.cookie('Profiles'); + + // If there are any, turn on auto-complete + if (tmp) { + $(this).autocomplete(tmp.split(',')); + } + }); + profile.append(profileLabel); + profile.append(profileInput); + provForm.append(profile); + + /** + * Provision + */ + var provisionBtn = createButton('Provision'); + provisionBtn.bind('click', function(event) { + // Insert provision code here + }); + provForm.append(provisionBtn); } /** diff --git a/xCAT-UI/js/custom/ipmi.js b/xCAT-UI/js/custom/ipmi.js new file mode 100644 index 000000000..c5432e7a1 --- /dev/null +++ b/xCAT-UI/js/custom/ipmi.js @@ -0,0 +1,209 @@ +$(document).ready(function(){ + // Include utility scripts +}); + +/** + * Load node inventory + * + * @param data + * Data from HTTP request + * @return Nothing + */ +function loadInventory(data) { + +} + +/** + * Load clone page + * + * @param node + * Source node to clone + * @return Nothing + */ +function loadClonePage(node) { + +} + +/** + * Load provision page + * + * @param tabId + * The provision tab ID + * @return Nothing + */ +function loadProvisionPage(tabId) { + var errMsg; + + // Get the OS image names + $.ajax( { + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'tabdump', + tgt : '', + args : 'osimage', + msg : '' + }, + + success : setOSImageCookies + }); + + // Get groups + $.ajax( { + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'extnoderange', + tgt : '/.*', + args : 'subgroups', + msg : '' + }, + + success : setGroupsCookies + }); + + // Generate new tab ID + var inst = tabId.replace('ipmiProvisionTab', ''); + + // Open new tab + // Create provision form + var provForm = $('
'); + + // Create status bar + var barId = 'ipmiProvisionStatBar' + inst; + var statBar = createStatusBar(barId); + statBar.hide(); + provForm.append(statBar); + + // Create loader + var loader = createLoader('ipmiProvisionLoader' + inst); + loader.hide(); + statBar.append(loader); + + // Create info bar + var infoBar = createInfoBar('Provision a IPMI node'); + provForm.append(infoBar); + + // Append to provision tab + $('#' + tabId).append(provForm); + + // Node name + var nodeName = $('
'); + provForm.append(nodeName); + + // Group + var group = $('
'); + var groupLabel = $(''); + var groupInput = $(''); + + // Get the groups on-focus + groupInput.focus(function() { + var groupNames = $.cookie('Groups'); + + // If there are groups, turn on auto-complete + if (groupNames) { + $(this).autocomplete(groupNames.split(',')); + } + }); + + group.append(groupLabel); + group.append(groupInput); + provForm.append(group); + + // Boot method (boot, install, stat, iscsiboot, netboot, statelite) + var method = $('
'); + var methodLabel = $(''); + var methodSelect = $(''); + methodSelect.append(''); + methodSelect.append(''); + methodSelect.append(''); + methodSelect.append(''); + methodSelect.append(''); + method.append(methodLabel); + method.append(methodSelect); + provForm.append(method); + + // Boot type (zvm, pxe, yaboot) + var type = $('
'); + var typeLabel = $(''); + var typeSelect = $(''); + typeSelect.append(''); + typeSelect.append(''); + typeSelect.append(''); + type.append(typeLabel); + type.append(typeSelect); + provForm.append(type); + + // Operating system + var os = $('
'); + var osLabel = $(''); + var osInput = $(''); + + // Get the OS versions on-focus + var tmp; + osInput.focus(function() { + tmp = $.cookie('OSVers'); + + // If there are any, turn on auto-complete + if (tmp) { + $(this).autocomplete(tmp.split(',')); + } + }); + os.append(osLabel); + os.append(osInput); + provForm.append(os); + + // Architecture + var arch = $('
'); + var archLabel = $(''); + var archInput = $(''); + + // Get the OS architectures on-focus + archInput.focus(function() { + tmp = $.cookie('OSArchs'); + + // If there are any, turn on auto-complete + if (tmp) { + $(this).autocomplete(tmp.split(',')); + } + }); + arch.append(archLabel); + arch.append(archInput); + provForm.append(arch); + + // Profiles + var profile = $('
'); + var profileLabel = $(''); + var profileInput = $(''); + + // Get the profiles on-focus + profileInput.focus(function() { + tmp = $.cookie('Profiles'); + + // If there are any, turn on auto-complete + if (tmp) { + $(this).autocomplete(tmp.split(',')); + } + }); + profile.append(profileLabel); + profile.append(profileInput); + provForm.append(profile); + + /** + * Provision + */ + var provisionBtn = createButton('Provision'); + provisionBtn.bind('click', function(event) { + // Insert provision code here + }); + provForm.append(provisionBtn); +} + +/** + * Load resources + * + * @return Nothing + */ +function loadResources() { + +} \ No newline at end of file diff --git a/xCAT-UI/js/custom/ivm.js b/xCAT-UI/js/custom/ivm.js new file mode 100644 index 000000000..c43dddc77 --- /dev/null +++ b/xCAT-UI/js/custom/ivm.js @@ -0,0 +1,209 @@ +$(document).ready(function(){ + // Include utility scripts +}); + +/** + * Load node inventory + * + * @param data + * Data from HTTP request + * @return Nothing + */ +function loadInventory(data) { + +} + +/** + * Load clone page + * + * @param node + * Source node to clone + * @return Nothing + */ +function loadClonePage(node) { + +} + +/** + * Load provision page + * + * @param tabId + * The provision tab ID + * @return Nothing + */ +function loadProvisionPage(tabId) { + var errMsg; + + // Get the OS image names + $.ajax( { + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'tabdump', + tgt : '', + args : 'osimage', + msg : '' + }, + + success : setOSImageCookies + }); + + // Get groups + $.ajax( { + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'extnoderange', + tgt : '/.*', + args : 'subgroups', + msg : '' + }, + + success : setGroupsCookies + }); + + // Generate new tab ID + var inst = tabId.replace('ivmProvisionTab', ''); + + // Open new tab + // Create provision form + var provForm = $('
'); + + // Create status bar + var barId = 'ivmProvisionStatBar' + inst; + var statBar = createStatusBar(barId); + statBar.hide(); + provForm.append(statBar); + + // Create loader + var loader = createLoader('ivmProvisionLoader' + inst); + loader.hide(); + statBar.append(loader); + + // Create info bar + var infoBar = createInfoBar('Provision a IVM node'); + provForm.append(infoBar); + + // Append to provision tab + $('#' + tabId).append(provForm); + + // Node name + var nodeName = $('
'); + provForm.append(nodeName); + + // Group + var group = $('
'); + var groupLabel = $(''); + var groupInput = $(''); + + // Get the groups on-focus + groupInput.focus(function() { + var groupNames = $.cookie('Groups'); + + // If there are groups, turn on auto-complete + if (groupNames) { + $(this).autocomplete(groupNames.split(',')); + } + }); + + group.append(groupLabel); + group.append(groupInput); + provForm.append(group); + + // Boot method (boot, install, stat, iscsiboot, netboot, statelite) + var method = $('
'); + var methodLabel = $(''); + var methodSelect = $(''); + methodSelect.append(''); + methodSelect.append(''); + methodSelect.append(''); + methodSelect.append(''); + methodSelect.append(''); + method.append(methodLabel); + method.append(methodSelect); + provForm.append(method); + + // Boot type (zvm, pxe, yaboot) + var type = $('
'); + var typeLabel = $(''); + var typeSelect = $(''); + typeSelect.append(''); + typeSelect.append(''); + typeSelect.append(''); + type.append(typeLabel); + type.append(typeSelect); + provForm.append(type); + + // Operating system + var os = $('
'); + var osLabel = $(''); + var osInput = $(''); + + // Get the OS versions on-focus + var tmp; + osInput.focus(function() { + tmp = $.cookie('OSVers'); + + // If there are any, turn on auto-complete + if (tmp) { + $(this).autocomplete(tmp.split(',')); + } + }); + os.append(osLabel); + os.append(osInput); + provForm.append(os); + + // Architecture + var arch = $('
'); + var archLabel = $(''); + var archInput = $(''); + + // Get the OS architectures on-focus + archInput.focus(function() { + tmp = $.cookie('OSArchs'); + + // If there are any, turn on auto-complete + if (tmp) { + $(this).autocomplete(tmp.split(',')); + } + }); + arch.append(archLabel); + arch.append(archInput); + provForm.append(arch); + + // Profiles + var profile = $('
'); + var profileLabel = $(''); + var profileInput = $(''); + + // Get the profiles on-focus + profileInput.focus(function() { + tmp = $.cookie('Profiles'); + + // If there are any, turn on auto-complete + if (tmp) { + $(this).autocomplete(tmp.split(',')); + } + }); + profile.append(profileLabel); + profile.append(profileInput); + provForm.append(profile); + + /** + * Provision + */ + var provisionBtn = createButton('Provision'); + provisionBtn.bind('click', function(event) { + // Insert provision code here + }); + provForm.append(provisionBtn); +} + +/** + * Load resources + * + * @return Nothing + */ +function loadResources() { + +} \ No newline at end of file diff --git a/xCAT-UI/js/custom/zvm.js b/xCAT-UI/js/custom/zvm.js index 57cc418c0..1457349ca 100644 --- a/xCAT-UI/js/custom/zvm.js +++ b/xCAT-UI/js/custom/zvm.js @@ -899,8 +899,6 @@ function loadInventory(data) { * @return Nothing */ function loadProvisionPage(tabId) { - // Get tab area where new tab will go - var myTab = getProvisionTab(); var errMsg; // Get the OS image names