mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Use redirects for a gracefully navigation
This commit is contained in:
parent
375458b378
commit
d82a4cee6c
2 changed files with 21 additions and 6 deletions
|
|
@ -2318,6 +2318,21 @@ print [[
|
|||
|
||||
end
|
||||
|
||||
function jsRedirect(subpage, withoutTag)
|
||||
local url = '"'..ntop.getHttpPrefix()..'/lua/'..subpage..'"'
|
||||
|
||||
if not withoutTag then print("<script>") end
|
||||
print[[
|
||||
if(history.replaceState) {
|
||||
// use history facility if available
|
||||
history.replaceState(null, null, ]] print(url) print[[);
|
||||
} else {
|
||||
// fallback
|
||||
window.location.href = ]] print(url) print[[;
|
||||
}]]
|
||||
if not withoutTag then print("</script>") end
|
||||
end
|
||||
|
||||
-- ####################################################
|
||||
|
||||
-- Compute the difference in seconds between local time and UTC.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue