moved the refresh script to the end of the page so that silly things
authorAndrew Tridgell <tridge@samba.org>
Wed, 18 Mar 1998 07:44:27 +0000 (07:44 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 18 Mar 1998 07:44:27 +0000 (07:44 +0000)
like a refresh of 0 actually work.

source/web/statuspage.c

index 98c0982b99d52ccdef3811ccf6ead06eba0b1b52..5f89eee43a417f6e528bcbdba469582dcb01a1d5 100644 (file)
@@ -142,15 +142,6 @@ 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");
@@ -242,5 +233,17 @@ void status_page(void)
        fclose(f);
 
        printf("</FORM>\n");
+
+       if (autorefresh) {
+               /* 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");
+       }
 }