mirror of
https://github.com/eddyem/bta-meteo-logger.git
synced 2026-03-21 17:21:00 +03:00
init github
This commit is contained in:
222
C/daemon/temp.html
Normal file
222
C/daemon/temp.html
Normal file
@@ -0,0 +1,222 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
|
||||
<title>íÏÎÉÔÏÒÉÎÇ</title>
|
||||
<link rel="stylesheet" href="temp2.css" type="text/css">
|
||||
<link rel="stylesheet" href="datetime.css" type="text/css">
|
||||
<script src="datetime.js" type="text/javascript" charset="koi8-r" language="javascript"></script>
|
||||
<script language="JavaScript"><!--
|
||||
var request;
|
||||
var timeout_id, monit_tid;
|
||||
var CGI_PATH = '/cgi-bin/eddy/tempmon';
|
||||
var ShowOnGraph = 0;
|
||||
var isRunning = 0, t_start = 0, t_end = 0;
|
||||
function $(Id){
|
||||
return document.getElementById(Id);
|
||||
}
|
||||
|
||||
var utf2koi={
|
||||
1025:179,
|
||||
1072:193,
|
||||
1073:194,
|
||||
1074:215,
|
||||
1075:199,
|
||||
1076:196,
|
||||
1077:197,
|
||||
1078:214,
|
||||
1079:218,
|
||||
1080:201,
|
||||
1081:202,
|
||||
1082:203,
|
||||
1083:204,
|
||||
1084:205,
|
||||
1085:206,
|
||||
1086:207,
|
||||
1087:208,
|
||||
1088:210,
|
||||
1089:211,
|
||||
1090:212,
|
||||
1091:213,
|
||||
1092:198,
|
||||
1093:200,
|
||||
1094:195,
|
||||
1095:222,
|
||||
1096:219,
|
||||
1097:221,
|
||||
1098:223,
|
||||
1099:217,
|
||||
1100:216,
|
||||
1101:220,
|
||||
1102:192,
|
||||
1103:209,
|
||||
1105:163
|
||||
};
|
||||
|
||||
function hexdump(str){
|
||||
var ret = "";
|
||||
var l = str.length;
|
||||
var i, ch, code;
|
||||
for(i=0; i<l; i++){
|
||||
ch = str.charCodeAt(i);
|
||||
if(utf2koi[ch] != null)
|
||||
code = utf2koi[ch];
|
||||
else if(utf2koi[ch+32] != null)
|
||||
code = utf2koi[ch+32]+32;
|
||||
else code = ch;
|
||||
ch = code.toString(16);
|
||||
ret += "%" + ch;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
function TimeOut(){
|
||||
request.abort();
|
||||
handleError("Time over");
|
||||
}
|
||||
|
||||
function handleError(message) {
|
||||
ch_status("<h1>ïÛÉÂËÁ xmlhttprequest:<br>" + message + "</h1>")
|
||||
}
|
||||
|
||||
function sendrequest(req_STR){
|
||||
request = new XMLHttpRequest();
|
||||
request.open("POST", CGI_PATH, true);
|
||||
/*
|
||||
var params = 'name=' + encodeURIComponent(name) + '&surname=' + encodeURIComponent(surname)
|
||||
xmlhttp.open("POST", '/script.html', true)
|
||||
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
|
||||
request.setRequestHeader("Accept-Language", "ru, en");
|
||||
*/
|
||||
request.setRequestHeader("Accept-Charset", "koi8-r");
|
||||
request.overrideMimeType("multipart/form-data; charset=koi8-r");
|
||||
request.onreadystatechange=function(){
|
||||
if (request.readyState == 4){
|
||||
if (request.status == 200){
|
||||
clearTimeout(timeout_id);
|
||||
ch_status(request.responseText);
|
||||
var scripts = $('body').getElementsByTagName("script");
|
||||
for(var i=0,len=scripts.length; i<len; i++)
|
||||
eval.call(window, scripts[i].innerHTML);
|
||||
}
|
||||
else handleError(request.statusText);
|
||||
}
|
||||
}
|
||||
request.send(req_STR);
|
||||
timeout_id = setTimeout(TimeOut, 10000);
|
||||
}
|
||||
|
||||
function ch_status(stat){
|
||||
$('body').innerHTML = stat;
|
||||
}
|
||||
|
||||
function submit_form(){
|
||||
var rs = "", i;
|
||||
var F = $('datetime').elements;
|
||||
for(i = 0; i < F.length; i++)
|
||||
if(F[i].name && F[i].value)
|
||||
rs += F[i].name + '=' + F[i].value + ' ';
|
||||
sendrequest(rs);
|
||||
}
|
||||
|
||||
function refresh_all(){
|
||||
clearTimeout(monit_tid);
|
||||
sendrequest("Show=1");
|
||||
chkvals();
|
||||
// $('widecen').style.display = 'block';
|
||||
}
|
||||
|
||||
function chkvals(){
|
||||
var Boxes = document.getElementsByName('show');
|
||||
ShowOnGraph = 0;
|
||||
for(i = 0; i < Boxes.length; i++)
|
||||
if(Boxes[i].checked) ShowOnGraph += parseInt(Boxes[i].value);
|
||||
if(isRunning)
|
||||
mkImage();
|
||||
}
|
||||
var CHK = 1;
|
||||
function checkAll(ii){
|
||||
var Boxes = document.getElementsByName('show');
|
||||
var i;
|
||||
if(!ii) ii = Boxes.length;
|
||||
for(i = 0; i < ii; i++)
|
||||
Boxes[i].checked = CHK;
|
||||
CHK = !CHK;
|
||||
chkvals();
|
||||
}
|
||||
|
||||
function get_seconds(blkid){
|
||||
var td_value = $(blkid).value;
|
||||
var seconds = Math.round(Date.parse(td_value) / 1000);
|
||||
return seconds;
|
||||
}
|
||||
|
||||
function mkImage(){
|
||||
if(ShowOnGraph == 0) return;
|
||||
var str = CGI_PATH + '?Graph=' + ShowOnGraph;
|
||||
if(t_start) str += '&Tstart=' + t_start;
|
||||
else return;
|
||||
if(t_end) str += '&Tend=' + t_end;
|
||||
$('IMG').src = str + '?' + Math.random();
|
||||
}
|
||||
|
||||
function make_request(){
|
||||
if(!$('t_beg').value){
|
||||
alert("÷×ÅÄÉÔÅ ÎÁÞÁÌØÎÏÅ ×ÒÅÍÑ");
|
||||
return;
|
||||
}
|
||||
var td = new Date();
|
||||
var t_now = Math.round(td / 1000);
|
||||
t_start = get_seconds('t_beg');
|
||||
if(t_start >= t_now){
|
||||
alert("îÁÞÁÌØÎÏÅ ×ÒÅÍÑ × ÂÕÄÕÝÅÍ :)");
|
||||
return;
|
||||
}
|
||||
var str = 'Tstart=' + t_start;
|
||||
if($('t_end').value){
|
||||
t_end = get_seconds('t_end');
|
||||
str += ' Tend=' + t_end}
|
||||
sendrequest(str);
|
||||
chkvals();
|
||||
if(ShowOnGraph > 0)
|
||||
mkImage();
|
||||
isRunning = 1;
|
||||
}
|
||||
|
||||
//--></script>
|
||||
</head>
|
||||
<body>
|
||||
<noscript><h1 align=center>÷ËÌÀÞÉÔÅ ÐÏÄÄÅÒÖËÕ JavaScript<br>Turn on Javascript</noscript>
|
||||
<h2>úÁÇÏÌÏ×ÏË</h2>
|
||||
<div id='body'></div>
|
||||
<div id='widecen'>
|
||||
<div id='fsttwo'>
|
||||
<div id='lefcol'>
|
||||
<div style='text-align: center;'>
|
||||
äÁÔÁ É ×ÒÅÍÑ<p>
|
||||
(MM/DD/YY HH:MM)<p>
|
||||
</div>
|
||||
<form id='datetime' OnSubmit='submit_form()' style='text-align: right;'>
|
||||
Ó: <input name='t_beg' class='datetime' id='t_beg'>
|
||||
<img OnClick='displayDatePicker("t_beg", false, "mdy", "/");' class='dpBtn' src='cal.jpg'><br>
|
||||
ÐÏ: <input name='t_end' class='datetime' id='t_end'>
|
||||
<img OnClick='displayDatePicker("t_end", false, "mdy", "/");' class='dpBtn' src='cal.jpg'>
|
||||
</form>
|
||||
<input type='button' OnClick='make_request();' value="OK">
|
||||
</div>
|
||||
<div id='cencol'>
|
||||
<!--<embed id='IMG' src='scene.svg' type='image/svg-xml'></embed>-->
|
||||
<img src='' type='image/gif' id='IMG'>
|
||||
</div>
|
||||
</div>
|
||||
<div id='rigcol'>
|
||||
<b OnClick='checkAll();'>ïÔÏÂÒÁÚÉÔØ (×ÓÅ)</b><p>
|
||||
<form id='temper'>
|
||||
<b OnClick='checkAll(3);'>ÔÅÍÐÅÒÁÔÕÒÕ:</b>
|
||||
<div><input type='checkbox' name='show' value='1' OnChange='chkvals();'>×ÎÅÛÎÀÀ</div>
|
||||
<div><input type='checkbox' name='show' value='2' OnChange='chkvals();'>×ÎÕÔÒÅÎÎÀÀ</div>
|
||||
<div><input type='checkbox' name='show' value='4' OnChange='chkvals();'>ÚÅÒËÁÌÁ</div></form><p>
|
||||
<div><input type='checkbox' name='show' value='8' OnChange='chkvals();'>óËÏÒÏÓÔØ ×ÅÔÒÁ</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user