summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-01-27 11:24:13 -0200
committerRenato Botelho <renato@netgate.com>2017-01-27 11:24:13 -0200
commit99a49467f6957bbbf2de1e8baef967498f57115d (patch)
tree2133efeaf39b0dd0773182836debb6a1085aec60 /src/usr
parente8256d16e57d2d39c94ae5f2ecd9ab3780b334d0 (diff)
parentc18d0d12b3e683f07b4bac933240332cd4d95829 (diff)
downloadpfsense-99a49467f6957bbbf2de1e8baef967498f57115d.zip
pfsense-99a49467f6957bbbf2de1e8baef967498f57115d.tar.gz
Merge pull request #3446 from jskyboo/master
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/local/www/js/pfSenseHelpers.js9
-rw-r--r--src/usr/local/www/services_ntpd.php2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/usr/local/www/js/pfSenseHelpers.js b/src/usr/local/www/js/pfSenseHelpers.js
index 1dff7fa..49c9415 100644
--- a/src/usr/local/www/js/pfSenseHelpers.js
+++ b/src/usr/local/www/js/pfSenseHelpers.js
@@ -292,6 +292,15 @@ function add_row() {
// Find the last repeatable group
var lastRepeatableGroup = $('.repeatable:last');
+ // If the number of repeats exceeds the maximum, do not add another clone
+ if ($('.repeatable').length >= lastRepeatableGroup.attr('max_repeats')) {
+ // Alert user if alert message is specified
+ if (typeof lastRepeatableGroup.attr('max_repeats_alert') !== 'undefined') {
+ alert(lastRepeatableGroup.attr('max_repeats_alert'));
+ }
+ return;
+ }
+
// Clone it
var newGroup = lastRepeatableGroup.clone();
diff --git a/src/usr/local/www/services_ntpd.php b/src/usr/local/www/services_ntpd.php
index ad25b1a..9c40909 100644
--- a/src/usr/local/www/services_ntpd.php
+++ b/src/usr/local/www/services_ntpd.php
@@ -228,6 +228,8 @@ $auto_pool_suffix = "pool.ntp.org";
for ($counter=0; $counter < $maxrows; $counter++) {
$group = new Form_Group($counter == 0 ? 'Time Servers':'');
$group->addClass('repeatable');
+ $group->setAttribute('max_repeats', NUMTIMESERVERS);
+ $group->setAttribute('max_repeats_alert', sprintf(gettext('%d is the maximum number of configured servers.'), NUMTIMESERVERS));
$group->add(new Form_Input(
'server' . $counter,
OpenPOWER on IntegriCloud