-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathTimersLogs.js
executable file
·77 lines (60 loc) · 1.75 KB
/
TimersLogs.js
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
69
70
71
72
73
74
75
76
77
/**
* @author touzeau
* // made by: Nicolas - http://www.javascript-page.com
*/
var timerID = 0;
var tStart = null;
function UpdateTimer() {
if(timerID) {
clearTimeout(timerID);
clockID = 0;
}
if(!tStart){tStart = new Date();}
var tDate = new Date();
var tDiff = tDate.getTime() - tStart.getTime();
tDate.setTime(tDiff);
var seconds=tDate.getSeconds();
var TimerEnd=document.getElementById("ExecSecs").value;
if(seconds>TimerEnd){
RefreshDatas();
Reset();
return true;
}
if(document.getElementById("timertext")){document.getElementById("timertext").value = "" + tDate.getMinutes() + ":" + tDate.getSeconds();}
timerID = setTimeout("UpdateTimer()", 1000);
}
function Start() {
tStart = new Date();
document.getElementById("timertext").value = "00:00";
timerID = setTimeout("UpdateTimer()", 1000);
}
function Stop() {
if(timerID) {
clearTimeout(timerID);
timerID = 0;
}
tStart = null;
}
function Reset() {
tStart = null;
if(document.getElementById("timertext")){
document.getElementById("timertext").value = "00:00";
}
}
function executeLogMonitor(){s_PopUpScroll('listener.logs.php',800,500,'Logs Monitor');}
function RefreshDatas(){
setTimeout("SendRequests()", 500);
Start();
}
function StartLogMonitor(){
executeLogMonitor();
}
function SendRequests(){
var XHR = new XHRConnection();
document.getElementById("logs_windows").innerHTML='';
XHR.setRefreshArea('logs_windows');
if(document.getElementById("ExecSecs")){XHR.appendData('Refresh',document.getElementById("ExecSecs").value);}
XHR.appendData('maillog','yes');
XHR.appendData('maillog_filter',document.getElementById("maillog_filter").value);
XHR.sendAndLoad('listener.logs.php', 'GET');
}