mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
Prevents page refreshes while browsing historical flows
This commit is contained in:
parent
bed1ce31f2
commit
b5863ec320
1 changed files with 8 additions and 4 deletions
|
|
@ -84,8 +84,7 @@ function navigatedir(url, label, base, path, go_deep, print_html, ifid, host, st
|
|||
|
||||
-- io.write(debug.traceback().."\n")
|
||||
|
||||
rrds = ntop.readdir(path)
|
||||
table.sort(rrds)
|
||||
local rrds = ntop.readdir(path)
|
||||
|
||||
for k,v in pairsByKeys(rrds, asc) do
|
||||
if(v ~= nil) then
|
||||
|
|
@ -392,14 +391,19 @@ function drawRRD(ifid, host, rrdFile, zoomLevel, baseurl, show_timeseries,
|
|||
print[[
|
||||
<script>
|
||||
setInterval(function() {
|
||||
var talkers_loaded, protocols_loaded;
|
||||
var talkers_loaded, protocols_loaded, flows_loaded;
|
||||
if($('a[href="#historical-top-talkers"]').length){
|
||||
talkers_loaded = $('a[href="#historical-top-talkers"]').attr("loaded");
|
||||
}
|
||||
if($('a[href="#historical-top-apps"]').length){
|
||||
protocols_loaded = $('a[href="#historical-top-apps"]').attr("loaded");
|
||||
}
|
||||
if(typeof talkers_loaded == 'undefined' && typeof protocols_loaded == 'undefined'){
|
||||
if($('a[href="#historical-flows"]').length){
|
||||
flows_loaded = $('a[href="#historical-flows"]').attr("loaded");
|
||||
}
|
||||
if(typeof talkers_loaded == 'undefined'
|
||||
&& typeof protocols_loaded == 'undefined'
|
||||
&& typeof flows_loaded == 'undefined'){
|
||||
window.location.reload(); /* do not reload, it'a annoying */
|
||||
}
|
||||
}, 60*1000);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue