Revision 19c25a53
Added by Jack Booth over 8 years ago
src/usr/local/www/js/pfSenseHelpers.js | ||
---|---|---|
314 | 314 |
|
315 | 315 |
function add_row() { |
316 | 316 |
// Find the last repeatable group |
317 |
var lastRepeatableGroup = $('.repeatable:last');
|
|
318 |
|
|
319 |
// If the number of repeats exceeds the maximum, do not add another clone
|
|
320 |
if ($('.repeatable').length >= lastRepeatableGroup.attr('max_repeats')) {
|
|
321 |
// Alert user if alert message is specified
|
|
322 |
if (typeof lastRepeatableGroup.attr('max_repeats_alert') !== 'undefined') {
|
|
323 |
alert(lastRepeatableGroup.attr('max_repeats_alert'));
|
|
324 |
}
|
|
325 |
return;
|
|
326 |
}
|
|
317 |
var lastRepeatableGroup = $('.repeatable:last');
|
|
318 |
|
|
319 |
// If the number of repeats exceeds the maximum, do not add another clone
|
|
320 |
if ($('.repeatable').length >= lastRepeatableGroup.attr('max_repeats')) {
|
|
321 |
// Alert user if alert message is specified
|
|
322 |
if (typeof lastRepeatableGroup.attr('max_repeats_alert') !== 'undefined') {
|
|
323 |
alert(lastRepeatableGroup.attr('max_repeats_alert'));
|
|
324 |
}
|
|
325 |
return;
|
|
326 |
}
|
|
327 | 327 |
|
328 | 328 |
// Clone it |
329 | 329 |
var newGroup = lastRepeatableGroup.clone(); |
src/usr/local/www/services_ntpd.php | ||
---|---|---|
252 | 252 |
$maxrows = max(count($timeservers), 1); |
253 | 253 |
for ($counter=0; $counter < $maxrows; $counter++) { |
254 | 254 |
$group = new Form_Group($counter == 0 ? 'Time Servers':''); |
255 |
$group->addClass('repeatable');
|
|
256 |
$group->setAttribute('max_repeats', NUMTIMESERVERS);
|
|
257 |
$group->setAttribute('max_repeats_alert', sprintf(gettext('%d is the maximum number of configured servers.'), NUMTIMESERVERS));
|
|
255 |
$group->addClass('repeatable');
|
|
256 |
$group->setAttribute('max_repeats', NUMTIMESERVERS);
|
|
257 |
$group->setAttribute('max_repeats_alert', sprintf(gettext('%d is the maximum number of configured servers.'), NUMTIMESERVERS));
|
|
258 | 258 |
|
259 | 259 |
$group->add(new Form_Input( |
260 | 260 |
'server' . $counter, |
Also available in: Unified diff
Fix indentation
(cherry picked from commit c18d0d12b3e683f07b4bac933240332cd4d95829)