From cfc523a963ed945144dd9dd7df7df97e43654bf9 Mon Sep 17 00:00:00 2001 From: phamt Date: Thu, 7 Oct 2010 15:38:03 +0000 Subject: [PATCH] Change node range and user ID range to accept expressions such as gpok1-10 or gpok[1-10]. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7773 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/custom/zvm.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/xCAT-UI/js/custom/zvm.js b/xCAT-UI/js/custom/zvm.js index 86f46d284..04346ba80 100644 --- a/xCAT-UI/js/custom/zvm.js +++ b/xCAT-UI/js/custom/zvm.js @@ -141,7 +141,7 @@ zvmPlugin.prototype.loadClonePage = function(node) { // Get starting index var nodeStart = parseInt(tmp[0].match(/\d+/)); // Get ending index - var nodeEnd = parseInt(tmp[1]); + var nodeEnd = parseInt(tmp[1].match(/\d+/)); tmp = userIdRange.split('-'); @@ -150,7 +150,7 @@ zvmPlugin.prototype.loadClonePage = function(node) { // Get starting index var userIdStart = parseInt(tmp[0].match(/\d+/)); // Get ending index - var userIdEnd = parseInt(tmp[1]); + var userIdEnd = parseInt(tmp[1].match(/\d+/)); // If starting and ending index do not match if (!(nodeStart == userIdStart) || !(nodeEnd == userIdEnd)) { @@ -183,7 +183,7 @@ zvmPlugin.prototype.loadClonePage = function(node) { // Get starting index var nodeStart = parseInt(tmp[0].match(/\d+/)); // Get ending index - var nodeEnd = parseInt(tmp[1]); + var nodeEnd = parseInt(tmp[1].match(/\d+/)); tmp = userIdRange.split('-'); @@ -192,7 +192,7 @@ zvmPlugin.prototype.loadClonePage = function(node) { // Get starting index var userIdStart = parseInt(tmp[0].match(/\d+/)); // Get ending index - var userIdEnd = parseInt(tmp[1]); + var userIdEnd = parseInt(tmp[1].match(/\d+/)); // Loop through each node in the node range for ( var i = nodeStart; i <= nodeEnd; i++) { @@ -942,6 +942,7 @@ zvmPlugin.prototype.addNode = function() { warn.prependTo($(this)); } else { // Check node range and user ID range + // Range can be given as gpok10-gpok20, gpok[10-20], or gpok10+10 var errMsg = ''; var ready = true; if (nodeRange.indexOf('-') > -1 || userIdRange.indexOf('-') > -1) { @@ -956,7 +957,7 @@ zvmPlugin.prototype.addNode = function() { // Get starting index var nodeStart = parseInt(tmp[0].match(/\d+/)); // Get ending index - var nodeEnd = parseInt(tmp[1]); + var nodeEnd = parseInt(tmp[1].match(/\d+/)); tmp = userIdRange.split('-'); @@ -965,7 +966,7 @@ zvmPlugin.prototype.addNode = function() { // Get starting index var userIdStart = parseInt(tmp[0].match(/\d+/)); // Get ending index - var userIdEnd = parseInt(tmp[1]); + var userIdEnd = parseInt(tmp[1].match(/\d+/)); // If starting and ending index do not match if (!(nodeStart == userIdStart) || !(nodeEnd == userIdEnd)) { @@ -987,7 +988,7 @@ zvmPlugin.prototype.addNode = function() { // Get starting index var nodeStart = parseInt(tmp[0].match(/\d+/)); // Get ending index - var nodeEnd = parseInt(tmp[1]); + var nodeEnd = parseInt(tmp[1].match(/\d+/)); tmp = userIdRange.split('-'); @@ -996,7 +997,7 @@ zvmPlugin.prototype.addNode = function() { // Get starting index var userIdStart = parseInt(tmp[0].match(/\d+/)); // Get ending index - var userIdEnd = parseInt(tmp[1]); + var userIdEnd = parseInt(tmp[1].match(/\d+/)); // Loop through each node in the node range for ( var i = nodeStart; i <= nodeEnd; i++) {