diff --git a/www/fetchlogfile.html b/www/fetchlogfile.html index 7fea1bf29f1344d5dea6384927ed90df4c24c75b..9f0ca29930f728357104ac7b18e4892abd745969 100644 --- a/www/fetchlogfile.html +++ b/www/fetchlogfile.html @@ -1,10 +1,3 @@ - @@ -18,8 +11,8 @@ // the current path. var url = window.location.protocol + '//' + window.location.host + - '/spewlogfile.php3' + - window.location.search; + '/spewlogfile.php3' + + window.location.search + '&isajax=1'; // Fetch spewlogfile via AJAX call var xhr = new XMLHttpRequest(); @@ -45,6 +38,18 @@ window.scroll(window.scrollX, document.body.scrollHeight); } } + // + // Request is done, we got everything. + // + if (xhr.readyState == 4) { + # + # This will clear th busy indicators in the outer page, + # if there are any. + # + if (typeof(parent.loadFinished) == "function") { + parent.loadFinished(); + } + } }; // Invoke the AJAX xhr.open('get', url, true); diff --git a/www/showlogfile_sup.php3 b/www/showlogfile_sup.php3 index 7875ff62b36166aa6835224a729e0a709cd2cb7d..48543f63e45aa8f7d5b3566f51596d9e1fe4b911 100644 --- a/www/showlogfile_sup.php3 +++ b/www/showlogfile_sup.php3 @@ -1,6 +1,6 @@ GetLogfile(); } - $url = CreateURL("fetchlogfile", $object); + $url = CreateURL("spewlogfile", $object); - echo "
\n"; - echo " + # + # If the logfile is open, put up the spinner. + # + if ($object->isopen()) { + echo "
\n"; + echo " Working ..."; - echo "
\n"; - echo "
\n"; - - echo "
\n"; - - echo "". - "\n"; + echo "
\n"; + echo "
\n"; + + echo "\n"; + } echo "\n"; echo ""; } diff --git a/www/spewlogfile.php3 b/www/spewlogfile.php3 index b6ae82fe8993016ebf3b095a32d90183c4b73c10..916bcf1f3233cb6594b75f9f273aeb1eb6965ac2 100644 --- a/www/spewlogfile.php3 +++ b/www/spewlogfile.php3 @@ -1,6 +1,6 @@ logid(); +# +# Spew is broken in Chrome, so we have switched to a pure ajax +# approach (thanks Jon!). If the logfile is currently open, we +# return an HTML fragment that requests this page again, but as +# an ajax request, so that the client gets periodic updates. +# +if (!isset($asajax) && $logfile->isopen()) { + header("Content-type: text/html; charset=utf-8"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Cache-Control: no-cache, must-revalidate"); + header("Pragma: no-cache"); + readfile("fetchlogfile.php3"); + return; +} + # # A cleanup function to keep the child from becoming a zombie, since # the script is terminated, but the children are left to roam.