1
0
mirror of https://github.com/DigitalDevices/octonet.git synced 2023-10-10 13:36:52 +02:00
octonet/octoserve/var/www/update.html

133 lines
3.5 KiB
HTML
Raw Normal View History

2016-06-28 20:34:36 +02:00
<!DOCTYPE HTML>
2015-08-05 22:22:06 +02:00
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
2015-08-05 22:22:06 +02:00
<title>OctopusNet</title>
<link rel="stylesheet" type="text/css" href="/style.css">
<script type="text/javascript" src="/menu.js"></script>
<!-- Add included scripts here -->
<script type="text/javascript" src="/systeminfo.lua"></script>
<!-- Add page scripts here -->
<script type="text/javascript">
isChecking = false;
UpdateAvailable = false;
function FWVersion(fwdate)
{
if( fwdate.length > 0 )
{
// Jahr, Monat, Tag, Stunden, Minuten
// date = new Date("20"+fwdate.substr(0,2),fwdate.substr(2,2)-1,fwdate.substr(4,2),fwdate.substr(6,2),fwdate.substr(8,2),"0");
var date = new Date(1);
date.setUTCDate(fwdate.substr(4,2));
date.setUTCFullYear("20"+fwdate.substr(0,2));
date.setUTCMonth(fwdate.substr(2,2)-1);
date.setUTCHours(fwdate.substr(6,2));
date.setUTCMinutes(fwdate.substr(8,2));
var ds = date.toGMTString();
return (ds.substring(5,ds.length-7));
}
return ("?");
}
var xmlhttp = new XMLHttpRequest();
2015-08-05 22:22:06 +02:00
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState == 4 )
{
if ( xmlhttp.status == 200)
{
myFunction(xmlhttp.responseText);
}
isChecking = false;
}
}
function Request(url)
2015-08-05 22:22:06 +02:00
{
xmlhttp.open("GET", url, true);
xmlhttp.send();
}
function myFunction(response) {
var UpdateStatus = JSON.parse(response);
if( UpdateStatus.Info != "" )
2015-08-05 22:22:06 +02:00
{
document.getElementById("UpdateButton").value = "Update";
document.getElementById("updatemsg").firstChild.nodeValue = "New firmware/system package available";
document.getElementById("updatestatus").firstChild.nodeValue = "Version: " + FWVersion(UpdateStatus.Info);
2015-08-05 22:22:06 +02:00
UpdateAvailable = true;
}
else
document.getElementById("updatestatus").firstChild.nodeValue = "No update available";
document.getElementById("UpdateButton").disabled = false;
}
function CheckUpdate()
{
if( !isChecking )
{
document.getElementById("UpdateButton").disabled = true;
isChecking = true;
if( UpdateAvailable )
{
location.replace('/doupdate.html');
}
else
{
Request("/update.lua?check");
2015-08-05 22:22:06 +02:00
}
}
}
</script>
</head>
<body>
<table class="maintable" align="center">
<colgroup>
<col width="182px"/>
<col width="728px"/>
</colgroup>
<tr><td class="maintd" colspan="2">
<a href="http://www.digitaldevices.de"><img src="/BannerDD.jpg" alt="DD" width="910" height="130" /></a>
</td></tr>
<tr><td class="maintd" colspan="2">&nbsp;</td></tr>
<tr>
<td class="maintd"><script type="text/javascript">CreateMenu();</script></td>
<td class="content">
<div>
<!-- Begin Content -->
<table class="table" align="center">
<tr>
<td id="updatemsg">Check for firmware/system update:</td>
<td>
<form action="">
<input id="UpdateButton" type="Button" value="Check" onclick="CheckUpdate()" />
</form>
</td>
<tr>
<tr>
<td id="updatestatus">&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<!-- End Content -->
</div>
</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
</table>
</body>
</html>