Bug #10406
closed
Interfaces.php PPPoE selection display inappropriate "Toggle All" button when periodic reset set to "pre-set"
Added by Grischa Zengel over 4 years ago.
Updated about 4 years ago.
Description
"cron based reset" for PPPoE connections at interfaces.php uses radio buttons and shows Toggle All Button.
$group = new Form_MultiCheckboxGroup('cron based reset');
$group->addClass('pppoepreset');
$group->add(new Form_MultiCheckbox(
'pppoe_pr_preset_val',
null,
'Reset at each month ("0 0 1 * *")',
$pconfig['pppoe_monthly'],
'monthly'
))->displayAsRadio();
- Status changed from New to Rejected
I don't see a "Toggle All" button on the page in the source or rendered in the browser. I tried in Firefox and Chrome.
Ensure you do not have any ad blocking or script blocking browser add-ons active while viewing the GUI. If you still have problems, post on the forum to discuss the problem and try to find out what might be happening in your environment.
Are you sure?
I get it with Linux Firefox, Windows 10 Edge.
From different customers intranet.
Even with Netgate SG-3100 on 2.4.4 P2.
It should always show the button, even for you.
If I have this:
<div class="form-group pppoepreset">
<label class="col-sm-2 control-label">
cron based reset
</label>
<div class="checkbox multi col-sm-10">
<label class="chkboxlbl"><input name="pppoe_pr_preset_val" id="pppoe_pr_preset_val_monthly:d5ea" type="radio" value="monthly"> Reset at each month ("0 0 1 * *")</label><label class="chkboxlbl"><input name="pppoe_pr_preset_val" id="pppoe_pr_preset_val_weekly:d5fd" type="radio" value="weekly"> Reset at each week ("0 0 * * 0")</label><label class="chkboxlbl"><input name="pppoe_pr_preset_val" id="pppoe_pr_preset_val_daily:d60b" type="radio" value="daily"> Reset at each day ("0 0 * * *")</label><label class="chkboxlbl"><input name="pppoe_pr_preset_val" id="pppoe_pr_preset_val_hourly:d61a" type="radio" value="hourly"> Reset at each hour ("0 * * * *")</label>
</div>
</div>
This should always add the Toggle All button:
$('.control-label + .checkbox.multi').each(function() {
var a = $('<a name="btntoggleall" class="btn btn-xs btn-info"><i class="fa fa-check-square-o icon-embed-btn"></i>Toggle All</a>');
a.on('click', function() {
var wrap = $(this).parents('.form-group').find('.checkbox.multi'),
all = wrap.find('input[type=checkbox]'),
checked = wrap.find('input[type=checkbox]:checked');
all.prop('checked', (all.length != checked.length));
});
if ( ! $(this).parent().hasClass("notoggleall")) {
a.appendTo($(this));
}
});
Did you choose Pre-Set at "Periodic reset" ?
- Status changed from Rejected to Confirmed
- Target version set to 2.5.0
I did, but apparently I was looking on the actual PPP interface settings page not interfaces.php. I see it there.
It's fine on interfaces_ppps_edit.php
- Assignee set to Anonymous
- Subject changed from "Toggle All" button for radio buttons to Interfaces.php PPPoE selection display inappropriate "Toggle All" button when periodic reset set to "pre-set"
- Status changed from Confirmed to Feedback
- Assignee changed from Anonymous to Grischa Zengel
if ( ! $(this).parent().hasClass("notoggleall"))
was a bit of a giveaway
- % Done changed from 0 to 100
Tested this in
2.5.0-DEVELOPMENT (amd64)
built on Tue Oct 20 07:02:36 EDT 2020
FreeBSD 12.2-STABLE
Currently the patch needs to be applied to change the behavior. Once applied, the Toggle All button won't appear under Interfaces / <PPPPoE Interface> / Periodic Reset.
Tested in Chrome, Firefox, IE, Edge.
- Status changed from Feedback to Resolved
- Assignee changed from Grischa Zengel to Anonymous
Also available in: Atom
PDF