Skip to content

Commit

Permalink
Fix: #6065 - Preview Page not longer refreshes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWitness committed Jan 17, 2025
1 parent 9c34682 commit 096a403
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Cacti CHANGELOG
-issue#5963: Cacti caching for db_table_exists() and db_column_exists() is not connection aware and replication does not replicate empty table structures
-issue#5986: PHP ERRORS with php8.4 while including global_arrays.php
-issue#5987: Please add a new line to upgrade_database script
-issue#6065: Preview page no longer refreshes
-feature#5921: Add HPE Nimble/Alletra template
-feature#5933: Only attempt to change the table type and character encoding for built-in Cacti tables

Expand Down
23 changes: 15 additions & 8 deletions graph_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,19 +329,26 @@ function get_matching_nodes() {

?>
<script type='text/javascript'>
var refreshIsLogout = false;
var refreshPage = '<?php print str_replace('tree_content', 'tree', sanitize_uri($_SERVER['REQUEST_URI']));?>';
var refreshMSeconds = <?php print read_user_setting('page_refresh')*1000;?>;

var graph_start = <?php print get_current_graph_start();?>;
var graph_end = <?php print get_current_graph_end();?>;
var timeOffset = <?php print date('Z');?>

// Adjust the height of the tree
/**
* Adjust the height of the tree and set the page refresh
*/
$(function() {
pageAction = 'tree';
navHeight = $('.cactiTreeNavigationArea').height();
windowHeight = $(window).height();
navOffset = $('.cactiTreeNavigationArea').offset();
/* these are all global variables */
refreshIsLogout = false;
refreshPage = '<?php print str_replace('tree_content', 'tree', sanitize_uri($_SERVER['REQUEST_URI']));?>';
refreshMSeconds = <?php print read_user_setting('page_refresh')*1000;?>;
pageAction = 'tree';
navHeight = $('.cactiTreeNavigationArea').height();
windowHeight = $(window).height();
navOffset = $('.cactiTreeNavigationArea').offset();

setupPageTimeout();

if (navHeight + navOffset.top < windowHeight) {
$('.cactiTreeNavigationArea').height(windowHeight - navOffset.top);
}
Expand Down
8 changes: 6 additions & 2 deletions lib/html_graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,6 @@ function html_graph_preview_filter($page, $action, $devices_where = '', $templat
</form>
<script type='text/javascript'>

var refreshIsLogout = false;
var refreshMSeconds = <?php print read_user_setting('page_refresh')*1000;?>;
var graph_start = <?php print get_current_graph_start();?>;
var graph_end = <?php print get_current_graph_end();?>;
var timeOffset = <?php print date('Z');?>;
Expand Down Expand Up @@ -405,6 +403,12 @@ function initPage() {
}

$(function() {
refreshIsLogout = false;
refreshIsLogout = false;
refreshMSeconds = <?php print read_user_setting('page_refresh')*1000;?>;

setupPageTimeout();

$('#go').off('click').on('click', function(event) {
event.preventDefault();
applyGraphFilter();
Expand Down

0 comments on commit 096a403

Please sign in to comment.