Ajax/Html changes

Changes made so we can use a single namespace "/telnet" vs two.
Somewhat dirty fix inserted into existing ajax function.
pull/205/head
Alex 8 years ago
parent fe95b4bc50
commit ffd13c6e0a
  1. 3
      esp-link/main.c
  2. 4
      html/ui.js

@ -97,8 +97,7 @@ HttpdBuiltInUrl builtInUrls[] = {
{ "/services/info", cgiServicesInfo, NULL },
{ "/services/update", cgiServicesSet, NULL },
{ "/pins", cgiPins, NULL },
{ "/telnet/info", cgiTelnet, NULL},
{ "/telnet/update", cgiTelnet, NULL},
{ "/telnet", cgiTelnet, NULL},
#ifdef MQTT
{ "/mqtt", cgiMqtt, NULL },
#endif

@ -314,7 +314,7 @@ function showTelnetInfo(data) {
}
function getTelnetInfo() {
ajaxJson('GET', "/telnet/info", showTelnetInfo,
ajaxJson('GET', "/telnet", showTelnetInfo,
function(s, st) { window.setTimeout(getTelnetInfo, 1000); });
}
@ -339,6 +339,8 @@ function makeAjaxInput(klass, field) {
var eon = $(".edit-on", div);
var eoff = $(".edit-off", div)[0];
var url = "/"+klass+"/update?"+field;
//Dirty fix to avoid to seperate name spaces to GET or PUT telnet ports
if (klass == "telnet") { var url = "/"+klass+"?"+field; }
if (eoff === undefined || eon == undefined) return;

Loading…
Cancel
Save