mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-27 13:17:11 +02:00
0.6.7
* merge PR #883, improved store of settings and javascript, thx @tastendruecker123 * support `.` and `,` as floating point seperator in setup #881
This commit is contained in:
parent
c3728a8303
commit
12a3d503c8
6 changed files with 46 additions and 42 deletions
|
@ -1,5 +1,9 @@
|
||||||
# Development Changes
|
# Development Changes
|
||||||
|
|
||||||
|
## 0.6.7 - 2023-04-13
|
||||||
|
* merge PR #883, improved store of settings and javascript, thx @tastendruecker123
|
||||||
|
* support `.` and `,` as floating point seperator in setup #881
|
||||||
|
|
||||||
## 0.6.6 - 2023-04-12
|
## 0.6.6 - 2023-04-12
|
||||||
* increased distance for `import` button in mobile view #879
|
* increased distance for `import` button in mobile view #879
|
||||||
* changed `led_high_active` to `bool` #879
|
* changed `led_high_active` to `bool` #879
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 6
|
#define VERSION_MINOR 6
|
||||||
#define VERSION_PATCH 6
|
#define VERSION_PATCH 7
|
||||||
|
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -103,12 +103,10 @@ function parseVersion(obj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseESP(obj) {
|
function parseESP(obj) {
|
||||||
if(document.getElementById("esp_type").childNodes.length < 1) {
|
document.getElementById("esp_type").replaceChildren(
|
||||||
document.getElementById("esp_type").append(
|
|
||||||
document.createTextNode("Board: " + obj["esp_type"])
|
document.createTextNode("Board: " + obj["esp_type"])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function parseRssi(obj) {
|
function parseRssi(obj) {
|
||||||
var icon = iconWifi3;
|
var icon = iconWifi3;
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
</div>
|
</div>
|
||||||
{#HTML_FOOTER}
|
{#HTML_FOOTER}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var intervalId = null;
|
var intervalId = null;
|
||||||
|
|
||||||
function parseGeneric(obj) {
|
function parseGeneric(obj) {
|
||||||
|
@ -24,9 +23,7 @@
|
||||||
|
|
||||||
function parseHtml(obj) {
|
function parseHtml(obj) {
|
||||||
var html = "";
|
var html = "";
|
||||||
if(obj.pending)
|
if(!obj.pending) {
|
||||||
html = "Saving settings ...";
|
|
||||||
else {
|
|
||||||
if(intervalId != null) {
|
if(intervalId != null) {
|
||||||
clearInterval(intervalId);
|
clearInterval(intervalId);
|
||||||
}
|
}
|
||||||
|
@ -36,14 +33,12 @@
|
||||||
if(!obj.reboot) {
|
if(!obj.reboot) {
|
||||||
html = "Settings successfully saved. Automatic page reload in 3 seconds.";
|
html = "Settings successfully saved. Automatic page reload in 3 seconds.";
|
||||||
meta.content = 3;
|
meta.content = 3;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
html = "Settings successfully saved. Rebooting. Automatic redirect in 20 seconds.";
|
html = "Settings successfully saved. Rebooting. Automatic redirect in 20 seconds.";
|
||||||
meta.content = 20 + "; URL=/";
|
meta.content = 20 + "; URL=/";
|
||||||
}
|
}
|
||||||
document.getElementsByTagName('head')[0].appendChild(meta);
|
document.getElementsByTagName('head')[0].appendChild(meta);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
html = "Failed saving settings.";
|
html = "Failed saving settings.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>Serial Console</title>
|
<title>Serial Console</title>
|
||||||
{#HTML_HEADER}
|
{#HTML_HEADER}
|
||||||
|
|
|
@ -1,25 +1,14 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>Setup</title>
|
<title>Setup</title>
|
||||||
{#HTML_HEADER}
|
{#HTML_HEADER}
|
||||||
<script type="text/javascript">
|
|
||||||
function load() {
|
|
||||||
for(it of document.getElementsByClassName("s_collapsible")) {
|
|
||||||
it.addEventListener("click", function() {
|
|
||||||
this.classList.toggle("active");
|
|
||||||
var content = this.nextElementSibling;
|
|
||||||
content.style.display = (content.style.display === "block") ? "none" : "block";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body onload="load()">
|
<body>
|
||||||
{#HTML_NAV}
|
{#HTML_NAV}
|
||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<form method="post" action="/save">
|
<form method="post" action="/save" id="settings">
|
||||||
<button type="button" class="s_collapsible mt-4">System Config</button>
|
<button type="button" class="s_collapsible mt-4">System Config</button>
|
||||||
<div class="s_content">
|
<div class="s_content">
|
||||||
<fieldset class="mb-2">
|
<fieldset class="mb-2">
|
||||||
|
@ -147,11 +136,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12 col-sm-3 my-2">Interval [s]</div>
|
<div class="col-12 col-sm-3 my-2">Interval [s]</div>
|
||||||
<div class="col-12 col-sm-9"><input type="text" name="invInterval" pattern="[0-9]+" title="Invalid input"/></div>
|
<div class="col-12 col-sm-9"><input type="number" name="invInterval" title="Invalid input"/></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12 col-sm-3 my-2">Max retries per Payload</div>
|
<div class="col-12 col-sm-3 my-2">Max retries per Payload</div>
|
||||||
<div class="col-12 col-sm-9"><input type="text" name="invRetry"/></div>
|
<div class="col-12 col-sm-9"><input type="number" name="invRetry"/></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-8 col-sm-3 mb-2">Reset values and YieldDay at midnight</div>
|
<div class="col-8 col-sm-3 mb-2">Reset values and YieldDay at midnight</div>
|
||||||
|
@ -178,7 +167,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12 col-sm-3 my-2">NTP Port</div>
|
<div class="col-12 col-sm-3 my-2">NTP Port</div>
|
||||||
<div class="col-12 col-sm-9"><input type="text" name="ntpPort"/></div>
|
<div class="col-12 col-sm-9"><input type="number" name="ntpPort"/></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12 col-sm-3 my-2">set system time</div>
|
<div class="col-12 col-sm-3 my-2">set system time</div>
|
||||||
|
@ -195,15 +184,13 @@
|
||||||
<div class="s_content">
|
<div class="s_content">
|
||||||
<fieldset class="mb-4">
|
<fieldset class="mb-4">
|
||||||
<legend class="des">Sunrise & Sunset</legend>
|
<legend class="des">Sunrise & Sunset</legend>
|
||||||
<p>Use a decimal separator: '.' (dot) for Latitude and Longitude</p>
|
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12 col-sm-3 my-2">Latitude (decimal)</div>
|
<div class="col-12 col-sm-3 my-2">Latitude (decimal)</div>
|
||||||
<div class="col-12 col-sm-9"><input type="text" name="sunLat"/></div>
|
<div class="col-12 col-sm-9"><input type="number" name="sunLat" step="any"/></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12 col-sm-3 my-2">Longitude (decimal)</div>
|
<div class="col-12 col-sm-3 my-2">Longitude (decimal)</div>
|
||||||
<div class="col-12 col-sm-9"><input type="text" name="sunLon"/></div>
|
<div class="col-12 col-sm-9"><input type="number" name="sunLon" step="any"/></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12 col-sm-3 my-2">Offset (pre sunrise, post sunset)</div>
|
<div class="col-12 col-sm-3 my-2">Offset (pre sunrise, post sunset)</div>
|
||||||
|
@ -226,7 +213,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12 col-sm-3 my-2">Port</div>
|
<div class="col-12 col-sm-3 my-2">Port</div>
|
||||||
<div class="col-12 col-sm-9"><input type="text" name="mqttPort"/></div>
|
<div class="col-12 col-sm-9"><input type="number" name="mqttPort"/></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12 col-sm-3 my-2">Username (optional)</div>
|
<div class="col-12 col-sm-3 my-2">Username (optional)</div>
|
||||||
|
@ -243,7 +230,7 @@
|
||||||
<p class="des">Send Inverter data in a fixed interval, even if there is no change. A value of '0' disables the fixed interval. The data is published once it was successfully received from inverter. (default: 0)</p>
|
<p class="des">Send Inverter data in a fixed interval, even if there is no change. A value of '0' disables the fixed interval. The data is published once it was successfully received from inverter. (default: 0)</p>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12 col-sm-3 my-2">Interval [s]</div>
|
<div class="col-12 col-sm-3 my-2">Interval [s]</div>
|
||||||
<div class="col-12 col-sm-9"><input type="text" name="mqttInterval" pattern="[0-9]+" title="Invalid input" /></div>
|
<div class="col-12 col-sm-9"><input type="number" name="mqttInterval" title="Invalid input" /></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-12 col-sm-3 my-2">Discovery Config (homeassistant)</div>
|
<div class="col-12 col-sm-3 my-2">Discovery Config (homeassistant)</div>
|
||||||
|
@ -292,11 +279,13 @@
|
||||||
<fieldset class="mb-4">
|
<fieldset class="mb-4">
|
||||||
<legend class="des">Import / Export JSON Settings</legend>
|
<legend class="des">Import / Export JSON Settings</legend>
|
||||||
<div class="row mb-4 mt-4">
|
<div class="row mb-4 mt-4">
|
||||||
<div class="col-12 col-sm-3 my-2">Import</div>
|
<div class="col-12 col-sm-3">Import</div>
|
||||||
<div class="col-12 col-sm-9 my-2">
|
<div class="col-12 col-sm-9">
|
||||||
<form id="form" method="POST" action="/upload" enctype="multipart/form-data" accept-charset="utf-8">
|
<form id="form" method="POST" action="/upload" enctype="multipart/form-data" accept-charset="utf-8">
|
||||||
<input type="file" name="upload">
|
<div class="row">
|
||||||
<input type="button" class="btn" value="Import" onclick="hide()">
|
<div class="col-12 col-sm-8 my-2"><input type="file" name="upload"></div>
|
||||||
|
<div class="col-12 col-sm-4 my-2"><input type="button" class="btn" value="Import" onclick="hide()"></div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -419,6 +408,24 @@
|
||||||
|
|
||||||
const re = /11[2,4,6]1.*/;
|
const re = /11[2,4,6]1.*/;
|
||||||
|
|
||||||
|
window.onload = function() {
|
||||||
|
for(it of document.getElementsByClassName("s_collapsible")) {
|
||||||
|
it.addEventListener("click", function() {
|
||||||
|
this.classList.toggle("active");
|
||||||
|
var content = this.nextElementSibling;
|
||||||
|
content.style.display = (content.style.display === "block") ? "none" : "block";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById("settings").addEventListener("submit", function() {
|
||||||
|
var inputs = document.querySelectorAll("input[type='number']");
|
||||||
|
for (var i = 0; i < inputs.length; i++) {
|
||||||
|
if (inputs[i].value.indexOf(",") != -1)
|
||||||
|
inputs[i].value = inputs[i].value.replace(",", ".");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById("btnAdd").addEventListener("click", function() {
|
document.getElementById("btnAdd").addEventListener("click", function() {
|
||||||
if(highestId <= (maxInv-1)) {
|
if(highestId <= (maxInv-1)) {
|
||||||
ivHtml(JSON.parse('{"enabled":true,"name":"","serial":"","channels":4,"ch_max_pwr":[0,0,0,0],"ch_name":["","","",""],"ch_yield_cor":[0,0,0,0]}'), highestId);
|
ivHtml(JSON.parse('{"enabled":true,"name":"","serial":"","channels":4,"ch_max_pwr":[0,0,0,0],"ch_name":["","","",""],"ch_yield_cor":[0,0,0,0]}'), highestId);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue