[go: up one dir, main page]

Menu

[r1]: / js / site.js  Maximize  Restore  History

Download this file

71 lines (67 with data), 2.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
function checkService(x) {
eval("t=xmlhttp"+x);
if (t==null)
{
alert ("Your browser does not support XMLHTTP!");
return;
}
t.onreadystatechange=function() {
eval("t2=xmlhttp"+x);
if(t2.readyState==4) {
tmp=t2.responseText.split(" ",2);
idName=tmp[1]+"-status";
idAction=tmp[1]+"-action";
td=document.getElementById(idName);
td2=document.getElementById(idAction);
if(tmp[0]=="started") {
td.innerHTML="Responding";
td2.innerHTML="<a href='#' >+tmp[1]+",\"stop\")'><img alt='stop' src='stopped.png' width='20' height='20'/></a>";
td2.innerHTML+="<a href='#' >+tmp[1]+",\"restart\")'><img alt='restart' src='restart.png' width='20' height='20'/></a>";
td.style.backgroundColor="lime";
td.style.color="blue";
}
else {
td.innerHTML="Not Responding";
td2.innerHTML="<a href='#' >+tmp[1]+",\"start\")' ><img alt='start' src='start.png' width='20' height='20'/></a>";
td.style.backgroundColor="red";
td.style.color="yellow";
}
}
};
t.open('GET','check_service.php?service='+x,true);
t.send(null);
}
function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
{
return new XMLHttpRequest();
}
if (window.ActiveXObject)
{
return new ActiveXObject("Microsoft.XMLHTTP");
}
return null;
}
function doAction(id,action,sleep) {
var answer = confirm("Are You Sure ?");
if ( ! answer ){
return;
}
eval("t=xmlhttp_a"+id);
if (t==null)
{
alert ("Your browser does not support XMLHTTP!");
return;
}
td=document.getElementById(id+"-status");
td.innerHTML="<img alt='proccessing' src='processing.gif' width='100' height='30'/>";
td.style.backgroundColor="white";
td2=document.getElementById(id+"-action");
td2.innerHTML="";
url='action.php?service='+id+"&action="+action;
url+="&manuall";
t.open('GET',url,false);
t.send(null);
checkService(id);
}