Feature #7016
closedsystem_information_widget.php - Indicate adaptive state timeout status when active
0%
Description
It would be helpful to show the user that pf has enabled adaptive state timeout scaling when it kicks in.
Some sample code to calculate the scaling factor and to flag when it is active:
if (isset($config['system']['adaptivestart']) and $config['system']['adaptivestart'] > 0) { $adaptivestart = "{$config['system']['adaptivestart']}"; } else { $adaptivestart = intval($maxstates * 0.6); } if (isset($config['system']['adaptiveend']) and $config['system']['adaptiveend'] > 0) { $adaptiveend = "{$config['system']['adaptiveend']}"; } else { $adaptiveend = intval($maxstates * 1.2); } $adaptive_text = ""; if ($curentries > $adaptivestart) { $scalingfactor = round(($adaptiveend - $curentries) / ($adaptiveend - $adaptivestart) * 100, 0); $adaptive_text = "Adaptive state handling enabled, state timeouts reduced by {$scalingfactor}%)"; }
Main problem is formatting in the widget, getting it to a place where it's clear what it is without cluttering. Bonus points for changing the color of the progress bar to yellow when this is active.
Updated by Anonymous about 4 years ago
- Assignee set to Jim Pingle
- Private changed from No to Yes
Suggest move this to factory
Updated by Anonymous about 4 years ago
- Assignee changed from Jim Pingle to Anonymous
Updated by Anonymous about 4 years ago
- Status changed from New to Feedback
- Assignee changed from Anonymous to Jim Pingle
Implemented as requested
Updated by Jim Pingle about 4 years ago
- Status changed from Feedback to In Progress
- Assignee changed from Jim Pingle to Anonymous
A few problems as it is implemented:
1. It doesn't work because it's checking $curentries
not $pfstatetext
2. $pfstatetext
isn't populated a the time of the check, it needs to be moved up from where it is set
3. It only takes effect when the page is loaded, not dynamically when the widget is refreshed via JS. If the threshold is exceeded and the page isn't reloaded, the user wouldn't see the change in color. I thought the thermal sensors widget updated dynamically like that but I don't have a simple way to confirm that at the moment.
Updated by Anonymous about 4 years ago
Logic has been updated but only on initial page load. Once this has been tested and confirmed as satisfactory I will add the Ajax magic.
Updated by Jim Pingle about 4 years ago
- Private changed from Yes to No
Seems to also be susceptible to a PHP error, the code can end up dividing by 0: #10993
Updated by Anonymous about 4 years ago
- Assignee changed from Anonymous to Jim Pingle
Functionality has been finalized by adding the required data and providing the needed Ajax logic.
Updated by Jim Pingle about 4 years ago
- Assignee changed from Jim Pingle to Anonymous
I'm still only seeing the label and color change if I reload the page with a high state count. If I change the state count without reloading the page, the value changes as before but the color and labels stay the same.
Updated by Anonymous about 4 years ago
- Assignee changed from Anonymous to Jim Pingle
Updated by Jim Pingle about 4 years ago
- Status changed from In Progress to Resolved
Looks good after a gitsync
Updated by Jim Pingle about 4 years ago
- Assignee changed from Jim Pingle to Anonymous