diff options
| author | low012 <low012@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2010-03-28 22:17:36 +0000 |
|---|---|---|
| committer | low012 <low012@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2010-03-28 22:17:36 +0000 |
| commit | 000dad034b18367f2c13f401aa0ed0158442dbcd (patch) | |
| tree | bea88c9556ef6709490073c7c2533588672b0f38 /htroot/Steering.html | |
| parent | a85c5bb8a70103aaed048d3b89254f6b2a6d70f4 (diff) | |
*) better usage of JS timers (intervals)
*) added messages when status is checked
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6781 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot/Steering.html')
| -rw-r--r-- | htroot/Steering.html | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/htroot/Steering.html b/htroot/Steering.html index de098ff26..1abcba1a8 100644 --- a/htroot/Steering.html +++ b/htroot/Steering.html @@ -10,23 +10,33 @@ <script type="text/javascript">
<!--
var ro;
- function online() {
+
+ function pingPeer() {
ro = createRequestObject();
var url = "yacy/hello.html" + '?' + Math.random();
ro.open("Get",url,true);
ro.onreadystatechange = callback;
ro.send(null);
+ document.getElementById("status").innerHTML = 'Checking peer status...';
}
function callback() {
if (ro.readyState == 4) {
if(ro.status == 200) {
+ document.getElementById("status").innerHTML = 'Peer is online again, forwarding to status page...';
window.location.replace('Status.html');
+ } else {
+ isDown = true;
+ document.getElementById("status").innerHTML = 'Peer is not online yet, will check again in a few seconds...';
}
- } else {
- setTimeout('online()', 10000);
}
}
+
+ function setPingInterval() {
+ window.setInterval('pingPeer()', 5000);
+ pingPeer();
+ }
+
//-->
</script>
@@ -50,12 +60,14 @@ Application will terminate after working off all scheduled tasks.<br />
Then YaCy will restart.<br />
If you can't reach YaCy's interface after 5 minutes restart failed.
- <script type="text/javascript">setTimeout('online()', 60000);</script>
+ <script type="text/javascript">window.setTimeout('setPingInterval()', 60000);</script>
+ <div id="status"></div>
::
<h2>Just a moment, please!</h2>
<b>Installing release #[release]#</b><br />
- <p>YaCy will be restarted after installation</p>
- <script type="text/javascript">setTimeout('online()', 60000);</script>
+ YaCy will be restarted after installation.
+ <script type="text/javascript">window.setTimeout('setPingInterval()', 60000);</script>
+ <div id="status"></div>
#(/info)#
</p>
</body>
|
