From 0ec0d4bf6802d1da78cff3f595864651e525783d Mon Sep 17 00:00:00 2001 From: Magnus Date: Tue, 20 Feb 2024 22:07:54 +0100 Subject: [PATCH 1/8] Fix migration function --- html/index.htm | 17 +++++++---------- html/index.min.htm | 2 +- platformio.ini | 2 +- src/webserver.cpp | 17 ++++++++++------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/html/index.htm b/html/index.htm index 9b1db48f..3eec7968 100644 --- a/html/index.htm +++ b/html/index.htm @@ -101,7 +101,7 @@ iSpindel configuration file has been detected, do you want to copy formula and gyro calibration ?
-
@@ -124,17 +124,14 @@ // var url = "/test/migrate.json"; $.getJSON(url, function (cfg) { console.log( cfg ); - - gyro = {} - gyro["ax"] = cfg["Offset"][0]; - gyro["ay"] = cfg["Offset"][1]; - gyro["az"] = cfg["Offset"][2]; - gyro["gx"] = cfg["Offset"][3]; - gyro["gy"] = cfg["Offset"][4]; - gyro["gz"] = cfg["Offset"][5]; data = {} - data["gyro-calibration-data"] = gyro; + data["ax"] = cfg["Offset"][0]; + data["ay"] = cfg["Offset"][1]; + data["az"] = cfg["Offset"][2]; + data["gx"] = cfg["Offset"][3]; + data["gy"] = cfg["Offset"][4]; + data["gz"] = cfg["Offset"][5]; data["gravity-formula"] = cfg["POLY"]; $.ajax( "/api/migrate", { diff --git a/html/index.min.htm b/html/index.min.htm index 551a46ce..2f8af537 100644 --- a/html/index.min.htm +++ b/html/index.min.htm @@ -1,4 +1,4 @@ -Beer Gravity Monitor
iSpindel configuration file has been detected, do you want to copy formula and gyro calibration ?

Gravity:
Loading...
Temperature:
Loading...
Angle/Tilt:
Loading...
Battery:
Loading...
Average runtime:
Loading...

Current version:
Loading...
Host name:
Loading...
Device ID:
Loading...
Platform:
Loading...
SSID:
Loading...
Loading log data, please wait...
Collecting support data, please wait...
iSpindel configuration file has been detected, do you want to copy formula and gyro calibration ?

Gravity:
Loading...
Temperature:
Loading...
Angle/Tilt:
Loading...
Battery:
Loading...
Average runtime:
Loading...

Current version:
Loading...
Host name:
Loading...
Device ID:
Loading...
Platform:
Loading...
SSID:
Loading...
Loading log data, please wait...
Collecting support data, please wait...
iSpindel configuration file has been detected, do you want to copy formula and gyro calibration ?

Gravity:
Loading...
Temperature:
Loading...
Angle/Tilt:
Loading...
Battery:
Loading...
Average runtime:
Loading...

Current version:
Loading...
Host name:
Loading...
Device ID:
Loading...
Platform:
Loading...
SSID:
Loading...
Loading log data, please wait...
Collecting support data, please wait...
iSpindel configuration file has been detected, do you want to copy formula and gyro calibration ?

Gravity:
Loading...
Temperature:
Loading...
Angle/Tilt:
Loading...
Battery:
Loading...
Average runtime:
Loading...

Current version:
Loading...
Host name:
Loading...
Device ID:
Loading...
Platform:
Loading...
SSID:
Loading...
Loading log data, please wait...
Collecting support data, please wait...
- - - @@ -358,23 +358,17 @@

//var url = "/test/adv.json"; $.getJSON(url, function (cfg) { debug["advanced"] = cfg; - - var url = "/api/upload"; - //var url = "/test/upload.json"; - $.getJSON(url, function (cfg) { - debug["files"] = cfg; - var url = "/log"; - //var url = "/test/log"; - $.ajax({url: url, method: 'get', success: function (data) { - debug["log"] = data.split("\n"); - var s = JSON.stringify(debug, null, 2); - $("#supportContent").text( s ); - $('#spinner').hide(); - //navigator.clipboard.writeText(s); - //alert("Support information copied to clipboard"); - } - }); + var url = "/log"; + //var url = "/test/log"; + $.ajax({url: url, method: 'get', success: function (data) { + debug["log"] = data.split("\n"); + var s = JSON.stringify(debug, null, 2); + $("#supportContent").text( s ); + $('#spinner').hide(); + //navigator.clipboard.writeText(s); + //alert("Support information copied to clipboard"); + } }); }); }); diff --git a/html/index.min.htm b/html/index.min.htm index 6d7c0b58..8e93b481 100644 --- a/html/index.min.htm +++ b/html/index.min.htm @@ -1,4 +1,4 @@ -Beer Gravity Monitor
iSpindel configuration file has been detected, do you want to copy formula and gyro calibration ?

Gravity:
Loading...
Temperature:
Loading...
Angle/Tilt:
Loading...
Battery:
Loading...
Average runtime:
Loading...

Current version:
Loading...
Host name:
Loading...
Device ID:
Loading...
Platform:
Loading...
SSID:
Loading...
Loading log data, please wait...
Collecting support data, please wait...
iSpindel configuration file has been detected, do you want to copy formula and gyro calibration ?

Gravity:
Loading...
Temperature:
Loading...
Angle/Tilt:
Loading...
Battery:
Loading...
Average runtime:
Loading...

Current version:
Loading...
Host name:
Loading...
Device ID:
Loading...
Platform:
Loading...
SSID:
Loading...
Loading log data, please wait...
Collecting support data, please wait...