mirror of https://github.com/lumapu/ahoy.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
4.0 KiB
102 lines
4.0 KiB
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<title>Save</title>
|
|
<link rel="stylesheet" type="text/css" href="style.css?v=0.8.0001"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta charset="UTF-8">
|
|
<script type="text/javascript" src="api.js?v=0.8.0001"></script>
|
|
<link rel="stylesheet" type="text/css" href="colors.css?v=0.8.0001"/>
|
|
<meta name="robots" content="noindex, nofollow" />
|
|
</head>
|
|
<body>
|
|
<div class="topnav">
|
|
<a href="/?v=0.8.0001" class="title">AhoyDTU</a>
|
|
<a href="javascript:void(0);" class="icon" onclick="topnav()">
|
|
<span></span>
|
|
<span></span>
|
|
<span></span>
|
|
</a>
|
|
<div id="topnav" class="mobile">
|
|
<a id="nav3" class="hide" href="/live?v=0.8.0001">Live</a>
|
|
<a id="nav4" class="hide" href="/serial?v=0.8.0001">Webserial</a>
|
|
<a id="nav5" class="hide" href="/setup?v=0.8.0001">Settings</a>
|
|
<span class="seperator"></span>
|
|
<a id="nav6" class="hide" href="/update?v=0.8.0001">Update</a>
|
|
<a id="nav7" class="hide" href="/system?v=0.8.0001">System</a>
|
|
<span class="seperator"></span>
|
|
<a id="nav8" href="/api" target="_blank">REST API</a>
|
|
<a id="nav9" href="https://ahoydtu.de" target="_blank">Documentation</a>
|
|
<a id="nav10" href="/about?v=0.8.0001">About</a>
|
|
<span class="seperator"></span>
|
|
<a id="nav0" class="hide" href="/login">Login</a>
|
|
<a id="nav1" class="hide" href="/logout">Logout</a>
|
|
</div>
|
|
<div id="wifiicon" class="info"></div>
|
|
</div>
|
|
<div id="wrapper">
|
|
<div id="content">
|
|
<div id="html" class="mt-3 mb-3">Saving settings...</div>
|
|
</div>
|
|
</div>
|
|
<div id="footer">
|
|
<div class="left">
|
|
<a href="https://ahoydtu.de" target="_blank">AhoyDTU © 2023</a>
|
|
<ul>
|
|
<li><a href="https://discord.gg/WzhxEY62mB" target="_blank">Discord</a></li>
|
|
<li><a href="https://github.com/lumapu/ahoy" target="_blank">Github</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="right">
|
|
<ul>
|
|
<li><a target="_blank" href="https://github.com/lumapu/ahoy/commits/bf77275">GIT SHA: bf77275 :: 0.8.0001</a></li>
|
|
<li id="esp_type"></li>
|
|
<li><a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed" target="_blank" >CC BY-NC-SA 4.0</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
var intervalId = null;
|
|
|
|
function parseGeneric(obj) {
|
|
parseNav(obj);
|
|
parseESP(obj);
|
|
parseRssi(obj);
|
|
}
|
|
|
|
function parseHtml(obj) {
|
|
var html = "";
|
|
if(!obj.pending) {
|
|
if(intervalId != null) {
|
|
clearInterval(intervalId);
|
|
}
|
|
if(obj.success) {
|
|
var meta = document.createElement('meta');
|
|
meta.httpEquiv = "refresh"
|
|
if(!obj.reboot) {
|
|
html = "Settings successfully saved. Automatic page reload in 3 seconds.";
|
|
meta.content = 3;
|
|
} else {
|
|
html = "Settings successfully saved. Rebooting. Automatic redirect in 20 seconds.";
|
|
meta.content = 20 + "; URL=/";
|
|
}
|
|
document.getElementsByTagName('head')[0].appendChild(meta);
|
|
} else {
|
|
html = "Failed saving settings.";
|
|
}
|
|
}
|
|
document.getElementById("html").innerHTML = html;
|
|
}
|
|
|
|
function parse(obj) {
|
|
if(null != obj) {
|
|
parseGeneric(obj["generic"]);
|
|
parseHtml(obj);
|
|
}
|
|
}
|
|
|
|
intervalId = window.setInterval("getAjax('/api/html/save', parse)", 2500);
|
|
getAjax("/api/generic", parseGeneric);
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|