diff options
author | jim-p <jimp@pfsense.org> | 2010-08-10 16:17:48 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-08-10 16:21:32 -0400 |
commit | e0c27075f36858e62a5d5445216a3bac3f6ebfde (patch) | |
tree | 26dfc1fa7f88305eb56aca9cc0fb4295796a6c35 /usr/local/www/javascript | |
parent | a9d5bf0cab6016341655999001d3c672a6a4970c (diff) | |
download | pfsense-e0c27075f36858e62a5d5445216a3bac3f6ebfde.zip pfsense-e0c27075f36858e62a5d5445216a3bac3f6ebfde.tar.gz |
Add the ability to select a mode for LB pool members, load balance (default) or manual failover. If manual failover is selected, only allow one server to be chosen as active.
Diffstat (limited to 'usr/local/www/javascript')
-rwxr-xr-x | usr/local/www/javascript/load_balancer_pool_edit/pool.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/usr/local/www/javascript/load_balancer_pool_edit/pool.js b/usr/local/www/javascript/load_balancer_pool_edit/pool.js index ab6303d..fd626e5 100755 --- a/usr/local/www/javascript/load_balancer_pool_edit/pool.js +++ b/usr/local/www/javascript/load_balancer_pool_edit/pool.js @@ -110,6 +110,44 @@ function moveOptions(theSelFrom, theSelTo) } } +function checkPoolControls() { + var active = document.iform.serversSelect; + var inactive = document.iform.serversDisabledSelect; + if ($("mode").value == "failover") { + if ($("serversSelect").length > 0) { + $("moveToEnabled").disabled=1; + } else { + $("moveToEnabled").disabled=0; + } + } else { + $("moveToEnabled").disabled=0; + } +} + +function enforceFailover() { + if ($("mode").value != "failover") { + return; + } + var active = document.iform.serversSelect; + var inactive = document.iform.serversDisabledSelect; + var count = 0; + var moveText = new Array(); + var moveVals = new Array(); + var i; + if (active.length > 1) { + // Move all but one entry to the disabled list + for (i=active.length-1; i>0; i--) { + moveText[count] = active.options[i].text; + moveVals[count] = active.options[i].value; + deleteOption(active, i); + count++; + } + for (i=count-1; i>=0; i--) { + addOption(inactive, moveText[i], moveVals[i]); + } + } +} + // functions up() and down() modified from http://www.babailiica.com/js/sorter/ function up(obj) { |