[SOLVED] Modify (or disable) page auto-refresh

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
cbarry
Posts: 4
Joined: Wed Jan 02, 2008 1:39 pm

[SOLVED] Modify (or disable) page auto-refresh

Post by cbarry »

Hi All,

I'm using Howie's SuperLinks, and that's how I noticed it. When I'm out on another page through SuperLinks, Cacti will auto-refresh every so many minutes. When you've got graphs up, this is actually a Good Thing, but when you're editing a wiki, and it refreshes, it ends up back at the start page of the wiki, and all of your edits are lost.

Is there a switch somewhere to turn this refreshing off?


Thanks,
-C
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

That would be a feature request for the SuperLinks plugin. Even if it sounds simple, it will turn out to be difficult as I'm sure that Howie uses the default function call to creat the HTML header stuff ...
Reinhard
cbarry
Posts: 4
Joined: Wed Jan 02, 2008 1:39 pm

Post by cbarry »

Thanks for the reply.

Are you saying having different refresh rates would be difficult, or changing the refresh rate globally for cacti would be difficult? I'm amenable to completely disabling auto-refresh for the cacti app - it has a button, after all.

Any clues on what to change in the code? I changed a variable in globals.php named page_refresh (was 300, set it 3000000000) but it has not changed behavior (although I have not bounced apache, if that's needed)

Thanks,
-C
User avatar
gilles
Cacti User
Posts: 250
Joined: Tue Jul 12, 2005 8:16 pm

Post by gilles »

there is a hook for that in plugin architecture
it is "UNDER TESTING"
i have tested it with my plugin manage (because when i'm in a cycle, the page is refreshed and my cycle stop) but it didn't work
i think cycle plugin have the same bug
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

gandalf's right, I use the standard Cacti page heads - there are two though, one for console pages (with the menu) and one for graph pages (without).

I've just added a little code to superlinks/setup.php and it seems to work for me:

Code: Select all


// in plugin_init_superlinks():
$plugin_hooks['top_graph_refresh']['superlinks'] = 'superlinks_graph_refresh';



function superlinks_graph_refresh()
{
        return '';
}
I can't think of many situations where the refresh is a Good Thing for superlinks pages, so that will probably be in the next release as default.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
cbarry
Posts: 4
Joined: Wed Jan 02, 2008 1:39 pm

Post by cbarry »

Thanks Howie!

That did it.

Cheers,
-C
killshoot
Cacti User
Posts: 84
Joined: Wed Mar 26, 2008 2:51 am

Post by killshoot »

Hi all,

old post but same problem :wink:

I've found this code in setup.php :

function superlinks_graph_refresh ($current) {
if (preg_match('/superlinks.php\?id=(\d+)/', $_SERVER['REQUEST_URI'], $matches)) return '';
return $current;
}

This function allow to not refresh the page? Because my page always refresh...

Thank you for your help,


Vince

Cact 0.87c, PIA 2.2, superlinks 0.8
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests