mirror of
				https://github.com/DigitalDevices/octonet.git
				synced 2023-10-10 11:36:52 +00:00 
			
		
		
		
	Replaces DOM based dynamic jscript elements with XMLHttpRequests and JSON replies. Not yet on all pages.
		
			
				
	
	
		
			127 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			127 lines
		
	
	
		
			3.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 | 
						|
<html>
 | 
						|
<head>
 | 
						|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 | 
						|
<title>OctopusNet</title>
 | 
						|
<link rel="stylesheet" type="text/css" href="/style.css">
 | 
						|
<script type="text/javascript" src="/menu.js"></script>
 | 
						|
<!--  Add included scripts here -->
 | 
						|
 | 
						|
<!-- Add page scripts here -->
 | 
						|
<script type="text/javascript">
 | 
						|
 | 
						|
var xmlhttp = new XMLHttpRequest();
 | 
						|
 | 
						|
xmlhttp.onreadystatechange=function()
 | 
						|
{
 | 
						|
}
 | 
						|
 | 
						|
function Request(url) 
 | 
						|
{
 | 
						|
   xmlhttp.open("GET", url, true);
 | 
						|
   xmlhttp.send();
 | 
						|
}
 | 
						|
 | 
						|
function DisableButtons()
 | 
						|
{
 | 
						|
  document.getElementById("RebootButton").disabled  = true;    
 | 
						|
  document.getElementById("RestartOctoButton").disabled  = true;    
 | 
						|
  document.getElementById("RestartDMSButton").disabled  = true;    
 | 
						|
}
 | 
						|
 | 
						|
function Reboot()
 | 
						|
{
 | 
						|
  DisableButtons();
 | 
						|
  Request("/reboot.lua?sjiwjsiowjs");
 | 
						|
  WaitCounter = 20;
 | 
						|
  document.getElementById("updatestatus").firstChild.nodeValue  = WaitCounter;
 | 
						|
  window.setTimeout(Wait,1000);  
 | 
						|
}
 | 
						|
 | 
						|
function RestartOcto()
 | 
						|
{
 | 
						|
  DisableButtons();
 | 
						|
  Request("/reboot.lua?restart_octo");
 | 
						|
  WaitCounter = 4;
 | 
						|
  document.getElementById("updatestatus").firstChild.nodeValue  = WaitCounter;
 | 
						|
  window.setTimeout(Wait,1000);  
 | 
						|
}
 | 
						|
 | 
						|
function RestartDMS()
 | 
						|
{
 | 
						|
  DisableButtons();
 | 
						|
  Request("/reboot.lua?restart_dms");
 | 
						|
  WaitCounter = 4;
 | 
						|
  document.getElementById("updatestatus").firstChild.nodeValue  = WaitCounter;
 | 
						|
  window.setTimeout(Wait,1000);  
 | 
						|
}
 | 
						|
 | 
						|
function Wait()
 | 
						|
{
 | 
						|
  document.getElementById("updatestatus").firstChild.nodeValue  = WaitCounter;
 | 
						|
  if( WaitCounter == 0 )
 | 
						|
  {
 | 
						|
    location.replace('/index.html');
 | 
						|
  }
 | 
						|
  else
 | 
						|
  {
 | 
						|
    WaitCounter = WaitCounter - 1;
 | 
						|
    window.setTimeout(Wait,1000);  
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
</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"> </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="updatestatus">  </td>
 | 
						|
          </tr>
 | 
						|
          <tr>
 | 
						|
            <td>
 | 
						|
              <form action="">
 | 
						|
                 <input id="RebootButton" type="Button" value="Reboot" onclick="Reboot()" />
 | 
						|
              </form>
 | 
						|
            </td>
 | 
						|
          <tr>                  
 | 
						|
          <tr>
 | 
						|
            <td>
 | 
						|
              <form action="">
 | 
						|
                 <input id="RestartOctoButton" type="Button" value="Restart Server" onclick="RestartOcto()" />
 | 
						|
              </form>
 | 
						|
            </td>
 | 
						|
          <tr>                  
 | 
						|
          <tr>
 | 
						|
            <td>
 | 
						|
              <form action="">
 | 
						|
                 <input id="RestartDMSButton" type="Button" value="Restart DMS" onclick="RestartDMS()" />
 | 
						|
              </form>
 | 
						|
            </td>
 | 
						|
          <tr>                  
 | 
						|
        </table>
 | 
						|
        <!-- End Content -->
 | 
						|
      </div>
 | 
						|
    </td>
 | 
						|
  </tr>
 | 
						|
  <tr><td colspan="2"> </td></tr>
 | 
						|
</table>
 | 
						|
 | 
						|
</body>
 | 
						|
</html>
 |