From c41740a102da8cfc11320aa68f78d982718438f2 Mon Sep 17 00:00:00 2001 From: phamt Date: Thu, 7 Oct 2010 14:15:56 +0000 Subject: [PATCH] Show "Under construction" message for functions not yet completed. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7772 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/custom/blade.js | 47 +++++++++++++++++++++++++++++++- xCAT-UI/js/custom/customUtils.js | 2 ++ xCAT-UI/js/custom/fsp.js | 47 +++++++++++++++++++++++++++++++- xCAT-UI/js/custom/hmc.js | 27 +++++++++++++++++- xCAT-UI/js/custom/ipmi.js | 47 +++++++++++++++++++++++++++++++- xCAT-UI/js/custom/ivm.js | 47 +++++++++++++++++++++++++++++++- 6 files changed, 212 insertions(+), 5 deletions(-) diff --git a/xCAT-UI/js/custom/blade.js b/xCAT-UI/js/custom/blade.js index cab00096e..bc7c067dc 100644 --- a/xCAT-UI/js/custom/blade.js +++ b/xCAT-UI/js/custom/blade.js @@ -22,7 +22,27 @@ var bladePlugin = function() { * @return Nothing */ bladePlugin.prototype.loadInventory = function(data) { + // Get arguments + var args = data.msg.split(','); + // Get tab ID + var tabId = args[0].replace('out=', ''); + // Get node + var node = args[1].replace('node=', ''); + // Get node inventory + var inv = data.rsp; + // Remove loader + var loaderId = tabId + 'TabLoader'; + $('#' + loaderId).remove(); + + // Create division to hold inventory + var invDivId = tabId + 'Inventory'; + var invDiv = $('
'); + var info = createInfoBar('Under construction'); + invDiv.append(info); + + // Append to inventory form + $('#' + tabId).append(invDiv); }; /** @@ -33,7 +53,30 @@ bladePlugin.prototype.loadInventory = function(data) { * @return Nothing */ bladePlugin.prototype.loadClonePage = function(node) { + // Get nodes tab + var tab = getNodesTab(); + var newTabId = node + 'CloneTab'; + // If there is no existing clone tab + if (!$('#' + newTabId).length) { + // Create status bar and hide it + var statBarId = node + 'CloneStatusBar'; + var statBar = $('
') + .hide(); + + // Create info bar + var infoBar = createInfoBar('Under construction'); + + // Create clone form + var cloneForm = $('
'); + cloneForm.append(statBar); + cloneForm.append(infoBar); + + // Add clone tab + tab.add(newTabId, 'Clone', cloneForm, true); + } + + tab.select(newTabId); }; /** @@ -111,12 +154,14 @@ bladePlugin.prototype.loadProvisionPage = function(tabId) { /** * Create provision new node division */ + // You should copy whatever is in this function here and customize it var provNew = createProvisionNew('blade', inst); provForm.append(provNew); /** * Create provision existing node division */ + // You should copy whatever is in this function here and customize it var provExisting = createProvisionExisting('blade', inst); provForm.append(provExisting); @@ -148,5 +193,5 @@ bladePlugin.prototype.loadResources = function() { * @return Nothing */ bladePlugin.prototype.addNode = function() { - + openDialog('info', 'Under construction'); }; \ No newline at end of file diff --git a/xCAT-UI/js/custom/customUtils.js b/xCAT-UI/js/custom/customUtils.js index d215a644a..bbf9947db 100644 --- a/xCAT-UI/js/custom/customUtils.js +++ b/xCAT-UI/js/custom/customUtils.js @@ -247,6 +247,7 @@ function createProvisionExisting(plugin, inst) { var provisionBtn = createButton('Provision'); provisionBtn.bind('click', function(event) { // TODO Insert provision code here + openDialog('info', 'Under construction'); }); provExisting.append(provisionBtn); @@ -360,6 +361,7 @@ function createProvisionNew(plugin, inst) { var provisionBtn = createButton('Provision'); provisionBtn.bind('click', function(event) { // TODO Insert provision code here + openDialog('info', 'Under construction'); }); provNew.append(provisionBtn); diff --git a/xCAT-UI/js/custom/fsp.js b/xCAT-UI/js/custom/fsp.js index 94e8be06a..88b4d003e 100644 --- a/xCAT-UI/js/custom/fsp.js +++ b/xCAT-UI/js/custom/fsp.js @@ -22,7 +22,27 @@ var fspPlugin = function() { * @return Nothing */ fspPlugin.prototype.loadInventory = function(data) { + // Get arguments + var args = data.msg.split(','); + // Get tab ID + var tabId = args[0].replace('out=', ''); + // Get node + var node = args[1].replace('node=', ''); + // Get node inventory + var inv = data.rsp; + // Remove loader + var loaderId = tabId + 'TabLoader'; + $('#' + loaderId).remove(); + + // Create division to hold inventory + var invDivId = tabId + 'Inventory'; + var invDiv = $('
'); + var info = createInfoBar('Under construction'); + invDiv.append(info); + + // Append to inventory form + $('#' + tabId).append(invDiv); }; /** @@ -33,7 +53,30 @@ fspPlugin.prototype.loadInventory = function(data) { * @return Nothing */ fspPlugin.prototype.loadClonePage = function(node) { + // Get nodes tab + var tab = getNodesTab(); + var newTabId = node + 'CloneTab'; + // If there is no existing clone tab + if (!$('#' + newTabId).length) { + // Create status bar and hide it + var statBarId = node + 'CloneStatusBar'; + var statBar = $('
') + .hide(); + + // Create info bar + var infoBar = createInfoBar('Under construction'); + + // Create clone form + var cloneForm = $('
'); + cloneForm.append(statBar); + cloneForm.append(infoBar); + + // Add clone tab + tab.add(newTabId, 'Clone', cloneForm, true); + } + + tab.select(newTabId); }; /** @@ -111,12 +154,14 @@ fspPlugin.prototype.loadProvisionPage = function(tabId) { /** * Create provision new node division */ + // You should copy whatever is in this function here and customize it var provNew = createProvisionNew('fsp', inst); provForm.append(provNew); /** * Create provision existing node division */ + // You should copy whatever is in this function here and customize it var provExisting = createProvisionExisting('fsp', inst); provForm.append(provExisting); @@ -148,5 +193,5 @@ fspPlugin.prototype.loadResources = function() { * @return Nothing */ fspPlugin.prototype.addNode = function() { - + openDialog('info', 'Under construction'); }; \ No newline at end of file diff --git a/xCAT-UI/js/custom/hmc.js b/xCAT-UI/js/custom/hmc.js index 21bce650d..8d89ea7e3 100644 --- a/xCAT-UI/js/custom/hmc.js +++ b/xCAT-UI/js/custom/hmc.js @@ -86,7 +86,30 @@ hmcPlugin.prototype.loadInventory = function(data) { * @return Nothing */ hmcPlugin.prototype.loadClonePage = function(node) { + // Get nodes tab + var tab = getNodesTab(); + var newTabId = node + 'CloneTab'; + // If there is no existing clone tab + if (!$('#' + newTabId).length) { + // Create status bar and hide it + var statBarId = node + 'CloneStatusBar'; + var statBar = $('
') + .hide(); + + // Create info bar + var infoBar = createInfoBar('Under construction'); + + // Create clone form + var cloneForm = $('
'); + cloneForm.append(statBar); + cloneForm.append(infoBar); + + // Add clone tab + tab.add(newTabId, 'Clone', cloneForm, true); + } + + tab.select(newTabId); }; /** @@ -164,12 +187,14 @@ hmcPlugin.prototype.loadProvisionPage = function(tabId) { /** * Create provision new node division */ + // You should copy whatever is in this function here and customize it var provNew = createProvisionNew('hmc', inst); provForm.append(provNew); /** * Create provision existing node division */ + // You should copy whatever is in this function here and customize it var provExisting = createProvisionExisting('hmc', inst); provForm.append(provExisting); @@ -201,5 +226,5 @@ hmcPlugin.prototype.loadResources = function() { * @return Nothing */ hmcPlugin.prototype.addNode = function() { - + openDialog('info', 'Under construction'); }; \ No newline at end of file diff --git a/xCAT-UI/js/custom/ipmi.js b/xCAT-UI/js/custom/ipmi.js index ae021864b..fe3d7c6d4 100644 --- a/xCAT-UI/js/custom/ipmi.js +++ b/xCAT-UI/js/custom/ipmi.js @@ -22,7 +22,27 @@ var ipmiPlugin = function() { * @return Nothing */ ipmiPlugin.prototype.loadInventory = function(data) { + // Get arguments + var args = data.msg.split(','); + // Get tab ID + var tabId = args[0].replace('out=', ''); + // Get node + var node = args[1].replace('node=', ''); + // Get node inventory + var inv = data.rsp; + // Remove loader + var loaderId = tabId + 'TabLoader'; + $('#' + loaderId).remove(); + + // Create division to hold inventory + var invDivId = tabId + 'Inventory'; + var invDiv = $('
'); + var info = createInfoBar('Under construction'); + invDiv.append(info); + + // Append to inventory form + $('#' + tabId).append(invDiv); }; /** @@ -33,7 +53,30 @@ ipmiPlugin.prototype.loadInventory = function(data) { * @return Nothing */ ipmiPlugin.prototype.loadClonePage = function(node) { + // Get nodes tab + var tab = getNodesTab(); + var newTabId = node + 'CloneTab'; + // If there is no existing clone tab + if (!$('#' + newTabId).length) { + // Create status bar and hide it + var statBarId = node + 'CloneStatusBar'; + var statBar = $('
') + .hide(); + + // Create info bar + var infoBar = createInfoBar('Under construction'); + + // Create clone form + var cloneForm = $('
'); + cloneForm.append(statBar); + cloneForm.append(infoBar); + + // Add clone tab + tab.add(newTabId, 'Clone', cloneForm, true); + } + + tab.select(newTabId); }; /** @@ -111,12 +154,14 @@ ipmiPlugin.prototype.loadProvisionPage = function(tabId) { /** * Create provision new node division */ + // You should copy whatever is in this function here and customize it var provNew = createProvisionNew('ipmi', inst); provForm.append(provNew); /** * Create provision existing node division */ + // You should copy whatever is in this function here and customize it var provExisting = createProvisionExisting('ipmi', inst); provForm.append(provExisting); @@ -148,5 +193,5 @@ ipmiPlugin.prototype.loadResources = function() { * @return Nothing */ ipmiPlugin.prototype.addNode = function() { - + openDialog('info', 'Under construction'); }; \ No newline at end of file diff --git a/xCAT-UI/js/custom/ivm.js b/xCAT-UI/js/custom/ivm.js index 64042a99d..630976aa6 100644 --- a/xCAT-UI/js/custom/ivm.js +++ b/xCAT-UI/js/custom/ivm.js @@ -22,7 +22,27 @@ var ivmPlugin = function() { * @return Nothing */ ivmPlugin.prototype.loadInventory = function(data) { + // Get arguments + var args = data.msg.split(','); + // Get tab ID + var tabId = args[0].replace('out=', ''); + // Get node + var node = args[1].replace('node=', ''); + // Get node inventory + var inv = data.rsp; + // Remove loader + var loaderId = tabId + 'TabLoader'; + $('#' + loaderId).remove(); + + // Create division to hold inventory + var invDivId = tabId + 'Inventory'; + var invDiv = $('
'); + var info = createInfoBar('Under construction'); + invDiv.append(info); + + // Append to inventory form + $('#' + tabId).append(invDiv); }; /** @@ -33,7 +53,30 @@ ivmPlugin.prototype.loadInventory = function(data) { * @return Nothing */ ivmPlugin.prototype.loadClonePage = function(node) { + // Get nodes tab + var tab = getNodesTab(); + var newTabId = node + 'CloneTab'; + // If there is no existing clone tab + if (!$('#' + newTabId).length) { + // Create status bar and hide it + var statBarId = node + 'CloneStatusBar'; + var statBar = $('
') + .hide(); + + // Create info bar + var infoBar = createInfoBar('Under construction'); + + // Create clone form + var cloneForm = $('
'); + cloneForm.append(statBar); + cloneForm.append(infoBar); + + // Add clone tab + tab.add(newTabId, 'Clone', cloneForm, true); + } + + tab.select(newTabId); }; /** @@ -111,12 +154,14 @@ ivmPlugin.prototype.loadProvisionPage = function(tabId) { /** * Create provision new node division */ + // You should copy whatever is in this function here and customize it var provNew = createProvisionNew('ivm', inst); provForm.append(provNew); /** * Create provision existing node division */ + // You should copy whatever is in this function here and customize it var provExisting = createProvisionExisting('ivm', inst); provForm.append(provExisting); @@ -148,5 +193,5 @@ ivmPlugin.prototype.loadResources = function() { * @return Nothing */ ivmPlugin.prototype.addNode = function() { - + openDialog('info', 'Under construction'); }; \ No newline at end of file