summaryrefslogtreecommitdiff
path: root/source3/web/statuspage.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-03-18 07:33:11 +0000
committerAndrew Tridgell <tridge@samba.org>1998-03-18 07:33:11 +0000
commitc8c61ac6a643d1c51c1546a6e346c566bb34f3b2 (patch)
tree4adfb1de29cd2402554f16b4b540d4aa6295e269 /source3/web/statuspage.c
parente12cb8b6107272b625c8f34f3346b8314404f567 (diff)
downloadsamba-c8c61ac6a643d1c51c1546a6e346c566bb34f3b2.tar.gz
samba-c8c61ac6a643d1c51c1546a6e346c566bb34f3b2.tar.bz2
samba-c8c61ac6a643d1c51c1546a6e346c566bb34f3b2.zip
changed the method used for auto-reload on the status page to use
JavaScript. This avoids the nasty inetd problem. (This used to be commit 9d9b13880963a0e3cf5213ce2a24c52f4a11a472)
Diffstat (limited to 'source3/web/statuspage.c')
-rw-r--r--source3/web/statuspage.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source3/web/statuspage.c b/source3/web/statuspage.c
index 41681c2228..98c0982b99 100644
--- a/source3/web/statuspage.c
+++ b/source3/web/statuspage.c
@@ -107,11 +107,6 @@ void status_page(void)
refresh_interval = atoi(v);
}
- if (autorefresh) {
- printf("<META HTTP-EQUIV=refresh CONTENT=\"%d;URL=%s/status?refresh=1&refresh_interval=%d\">\n",
- refresh_interval, cgi_baseurl(), refresh_interval);
- }
-
pstrcpy(fname,lp_lockdir());
standard_sub_basic(fname);
trim_string(fname,"","/");
@@ -147,6 +142,15 @@ void status_page(void)
printf("<input type=submit value=\"Stop Refreshing\" name=norefresh>\n");
printf("<br>Refresh Interval: %d\n", refresh_interval);
printf("<input type=hidden name=refresh value=1>\n");
+ /* this little JavaScript allows for automatic refresh
+ of the page. There are other methods but this seems
+ to be the best alternative */
+ printf("<script language=\"JavaScript\">\n");
+ printf("<!--\nsetTimeout('window.location.replace(\"%s/status?refresh_interval=%d&refresh=1\")', %d)\n",
+ cgi_baseurl(),
+ refresh_interval,
+ refresh_interval*1000);
+ printf("//-->\n</script>\n");
}
printf("<p>\n");