Skip to content

Commit

Permalink
Fixing #4045 - URL does not update when searching
Browse files Browse the repository at this point in the history
When searching tree or list views, the URL does not update after changes
  • Loading branch information
TheWitness committed Jun 4, 2023
1 parent f66ed84 commit 978c61e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Cacti CHANGELOG
1.2.25
-SECURITY#5318: Multiple minor stored XSS vulnerabilities in Cacti 1.2.24
-issue#2959: Multi-threaded cli/rebuild_poller_cache.php, deprecated push_out_hosts.php
-issue#4045: When searching tree or list views, the URL does not update after changes
-issue#5254: Created a data source template to specify the snmp port, but it doesn't seem to work properly
-issue#5255: Data query xml path with space problem
-issue#5258: Warnings occur when installing thold plugin and as such thold will not upgrade correctly
Expand Down
24 changes: 17 additions & 7 deletions include/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3425,13 +3425,23 @@ function saveGraphFilter(section) {
}

function applyGraphFilter() {
var href = appendHeaderSuppression(graphPage+'?action='+pageAction+
'&rfilter=' + base64_encode($('#rfilter').val())+
(typeof $('#host_id').val() != 'undefined' ? '&host_id='+$('#host_id').val():'')+
'&columns='+$('#columns').val()+
'&graphs='+$('#graphs').val()+
'&graph_template_id='+$('#graph_template_id').val()+
'&thumbnails='+$('#thumbnails').is(':checked'));
statePushed = false;

var href = appendHeaderSuppression(graphPage+'?action='+pageAction +
'&rfilter=' + base64_encode($('#rfilter').val()) +
(typeof $('#host_id').val() != 'undefined' ? '&host_id=' + $('#host_id').val():'') +
'&columns=' + $('#columns').val() +
'&graphs=' + $('#graphs').val() +
'&graph_template_id=' + $('#graph_template_id').val() +
'&thumbnails=' + $('#thumbnails').is(':checked'));

/* replace myHref parameter for address bar update */
const urlParams = new URLSearchParams(myHref);
urlParams.set('rfilter', base64_encode($('#rfilter').val()));
if (typeof $('#host_id').val() != 'undefined') {
urlParams.set('host_id', $('#host_id').val());
}
myHref = urlParams.toString();

closeDateFilters();

Expand Down

0 comments on commit 978c61e

Please sign in to comment.