mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-10 13:36:54 +03:00
Cleanup REST API 2 (#1273)
This commit is contained in:
@@ -811,11 +811,17 @@ void register_server_tflite_uri(httpd_handle_t server)
|
|||||||
camuri.user_ctx = (void*) "Light On";
|
camuri.user_ctx = (void*) "Light On";
|
||||||
httpd_register_uri_handler(server, &camuri);
|
httpd_register_uri_handler(server, &camuri);
|
||||||
|
|
||||||
|
// Legacy API => New: "/setPreValue"
|
||||||
camuri.uri = "/setPreValue.html";
|
camuri.uri = "/setPreValue.html";
|
||||||
camuri.handler = handler_prevalue;
|
camuri.handler = handler_prevalue;
|
||||||
camuri.user_ctx = (void*) "Prevalue";
|
camuri.user_ctx = (void*) "Prevalue";
|
||||||
httpd_register_uri_handler(server, &camuri);
|
httpd_register_uri_handler(server, &camuri);
|
||||||
|
|
||||||
|
camuri.uri = "/setPreValue";
|
||||||
|
camuri.handler = handler_prevalue;
|
||||||
|
camuri.user_ctx = (void*) "Prevalue";
|
||||||
|
httpd_register_uri_handler(server, &camuri);
|
||||||
|
|
||||||
camuri.uri = "/doflow";
|
camuri.uri = "/doflow";
|
||||||
camuri.handler = handler_doflow;
|
camuri.handler = handler_doflow;
|
||||||
camuri.user_ctx = (void*) "Light Off";
|
camuri.user_ctx = (void*) "Light Off";
|
||||||
@@ -826,26 +832,50 @@ void register_server_tflite_uri(httpd_handle_t server)
|
|||||||
camuri.user_ctx = (void*) "Light Off";
|
camuri.user_ctx = (void*) "Light Off";
|
||||||
httpd_register_uri_handler(server, &camuri);
|
httpd_register_uri_handler(server, &camuri);
|
||||||
|
|
||||||
|
camuri.uri = "/statusflow";
|
||||||
|
camuri.handler = handler_statusflow;
|
||||||
|
camuri.user_ctx = (void*) "Light Off";
|
||||||
|
httpd_register_uri_handler(server, &camuri);
|
||||||
|
|
||||||
|
// Legacy API => New: "/cpu_temperature"
|
||||||
camuri.uri = "/cputemp.html";
|
camuri.uri = "/cputemp.html";
|
||||||
camuri.handler = handler_cputemp;
|
camuri.handler = handler_cputemp;
|
||||||
camuri.user_ctx = (void*) "Light Off";
|
camuri.user_ctx = (void*) "Light Off";
|
||||||
httpd_register_uri_handler(server, &camuri);
|
httpd_register_uri_handler(server, &camuri);
|
||||||
|
|
||||||
|
camuri.uri = "/cpu_temperature";
|
||||||
|
camuri.handler = handler_cputemp;
|
||||||
|
camuri.user_ctx = (void*) "Light Off";
|
||||||
|
httpd_register_uri_handler(server, &camuri);
|
||||||
|
|
||||||
|
// Legacy API => New: "/rssi"
|
||||||
camuri.uri = "/rssi.html";
|
camuri.uri = "/rssi.html";
|
||||||
camuri.handler = handler_rssi;
|
camuri.handler = handler_rssi;
|
||||||
camuri.user_ctx = (void*) "Light Off";
|
camuri.user_ctx = (void*) "Light Off";
|
||||||
httpd_register_uri_handler(server, &camuri);
|
httpd_register_uri_handler(server, &camuri);
|
||||||
|
|
||||||
|
camuri.uri = "/rssi";
|
||||||
|
camuri.handler = handler_rssi;
|
||||||
|
camuri.user_ctx = (void*) "Light Off";
|
||||||
|
httpd_register_uri_handler(server, &camuri);
|
||||||
|
|
||||||
camuri.uri = "/editflow.html";
|
camuri.uri = "/editflow.html";
|
||||||
camuri.handler = handler_editflow;
|
camuri.handler = handler_editflow;
|
||||||
camuri.user_ctx = (void*) "EditFlow";
|
camuri.user_ctx = (void*) "EditFlow";
|
||||||
httpd_register_uri_handler(server, &camuri);
|
httpd_register_uri_handler(server, &camuri);
|
||||||
|
|
||||||
|
// Legacy API => New: "/value"
|
||||||
camuri.uri = "/value.html";
|
camuri.uri = "/value.html";
|
||||||
camuri.handler = handler_wasserzaehler;
|
camuri.handler = handler_wasserzaehler;
|
||||||
camuri.user_ctx = (void*) "Value";
|
camuri.user_ctx = (void*) "Value";
|
||||||
httpd_register_uri_handler(server, &camuri);
|
httpd_register_uri_handler(server, &camuri);
|
||||||
|
|
||||||
|
camuri.uri = "/value";
|
||||||
|
camuri.handler = handler_wasserzaehler;
|
||||||
|
camuri.user_ctx = (void*) "Value";
|
||||||
|
httpd_register_uri_handler(server, &camuri);
|
||||||
|
|
||||||
|
// Legacy API => New: "/value"
|
||||||
camuri.uri = "/wasserzaehler.html";
|
camuri.uri = "/wasserzaehler.html";
|
||||||
camuri.handler = handler_wasserzaehler;
|
camuri.handler = handler_wasserzaehler;
|
||||||
camuri.user_ctx = (void*) "Wasserzaehler";
|
camuri.user_ctx = (void*) "Wasserzaehler";
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ function setprevalue() {
|
|||||||
inputVal = inputVal.replace(",", ".");
|
inputVal = inputVal.replace(",", ".");
|
||||||
var xhttp = new XMLHttpRequest();
|
var xhttp = new XMLHttpRequest();
|
||||||
try {
|
try {
|
||||||
url = basepath + "/setPreValue.html?value=" + inputVal + "&numbers=" + _number;
|
url = basepath + "/setPreValue?value=" + inputVal + "&numbers=" + _number;
|
||||||
xhttp.open("GET", url, false);
|
xhttp.open("GET", url, false);
|
||||||
xhttp.send();
|
xhttp.send();
|
||||||
response = xhttp.responseText;
|
response = xhttp.responseText;
|
||||||
@@ -102,7 +102,7 @@ function loadPrevalue(_basepath) {
|
|||||||
|
|
||||||
var xhttp = new XMLHttpRequest();
|
var xhttp = new XMLHttpRequest();
|
||||||
try {
|
try {
|
||||||
url = _basepath + '/setPreValue.html?numbers=' + _number;
|
url = _basepath + '/setPreValue?numbers=' + _number;
|
||||||
xhttp.open("GET", url, false);
|
xhttp.open("GET", url, false);
|
||||||
xhttp.send();
|
xhttp.send();
|
||||||
response = xhttp.responseText;
|
response = xhttp.responseText;
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ function refresh() {
|
|||||||
var basepath = "http://192.168.178.22";
|
var basepath = "http://192.168.178.22";
|
||||||
|
|
||||||
function loadStatus() {
|
function loadStatus() {
|
||||||
url = basepath + '/statusflow.html';
|
url = basepath + '/statusflow';
|
||||||
var xhttp = new XMLHttpRequest();
|
var xhttp = new XMLHttpRequest();
|
||||||
xhttp.onreadystatechange = function() {
|
xhttp.onreadystatechange = function() {
|
||||||
if (this.readyState == 4 && this.status == 200) {
|
if (this.readyState == 4 && this.status == 200) {
|
||||||
@@ -125,7 +125,7 @@ function refresh() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadCPUTemp() {
|
function loadCPUTemp() {
|
||||||
url = basepath + '/cputemp.html';
|
url = basepath + '/cpu_temperature';
|
||||||
var xhttp = new XMLHttpRequest();
|
var xhttp = new XMLHttpRequest();
|
||||||
xhttp.onreadystatechange = function() {
|
xhttp.onreadystatechange = function() {
|
||||||
if (this.readyState == 4 && this.status == 200) {
|
if (this.readyState == 4 && this.status == 200) {
|
||||||
@@ -138,7 +138,7 @@ function refresh() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadRSSI() {
|
function loadRSSI() {
|
||||||
url = basepath + '/rssi.html';
|
url = basepath + '/rssi';
|
||||||
var xhttp = new XMLHttpRequest();
|
var xhttp = new XMLHttpRequest();
|
||||||
xhttp.onreadystatechange = function() {
|
xhttp.onreadystatechange = function() {
|
||||||
if (this.readyState == 4 && this.status == 200) {
|
if (this.readyState == 4 && this.status == 200) {
|
||||||
|
|||||||
Reference in New Issue
Block a user