Skip to content

Commit

Permalink
*) better usage of JS timers (intervals)
Browse files Browse the repository at this point in the history
*) added messages when status is checked

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6781 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
low012 committed Mar 28, 2010
1 parent a85c5bb commit 000dad0
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions htroot/Steering.html
Expand Up @@ -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>

Expand All @@ -50,12 +60,14 @@ <h2>Just a moment, please!</h2>
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>
Expand Down

0 comments on commit 000dad0

Please sign in to comment.