WebguiappTemplate/HTML/reboot.html

41 lines
1.4 KiB
HTML

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset='utf-8' />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>WiFi Controller ~dname~</title>
<style type="text/css">
.txt {font: 14px consolas,monospace;}
</style>
</head>
<body>
<table align='center'><tr align='center'><td class='txt'>Сохранение настроек и перезагрузка устройства...
<h3>Выполнено &nbsp<span id='tmr'>?</span>&nbsp%</h3></td></tr></table>
</body>
<script language="javascript">
function goback(){
var str = document.location.toString();
var ref = str.substring(0,str.lastIndexOf('/reboot.html'))+"/index.html";
window.location=ref;
}
function PostData(data,page,conf,alrt,reld) {
if(conf){if (!confirm(conf)) return;}
var xhr = new XMLHttpRequest();
xhr.open('POST',page, true);
xhr.send(data);
xhr.onreadystatechange = function() {
if (xhr.readyState != 4) return;
if (xhr.status != 200) {alert(xhr.status+': '+xhr.statusText);}
else {if(reld)location.reload();
if(alrt) alert(alrt);
}}}
var cn = 0;
document.getElementById('tmr').innerHTML = cn;
function cntr()
{
if (cn < 100) {cn++;document.getElementById('tmr').innerHTML = cn;}
if (cn == 100) {clearInterval(rpt);goback();}
}
PostData("rbt=prs","reboot.html",false, false, false);
var rpt = setInterval(cntr,130);
</script>
</html>