diff --git a/html/style.css b/html/style.css index 29d15a3..e67d064 100644 --- a/html/style.css +++ b/html/style.css @@ -206,6 +206,16 @@ pre.console a { color: #fff; } +#menu .hostname { + width: 100%; + font-size: 12px; + height: 20px; + padding-left: 10px; + text-align: center; + color: #fff; + background: #9d1414; +} + #menu .pure-menu-heading { font-size: 110%; color: #fff; diff --git a/html/ui.js b/html/ui.js index 5de2f4c..5d703c8 100644 --- a/html/ui.js +++ b/html/ui.js @@ -226,6 +226,7 @@ onLoad(function() {
\ \  esp-link\ +
\ \
\ \ @@ -258,6 +259,9 @@ onLoad(function() { v = $("#version"); if (v != null) { v.innerHTML = data.version; } + + $("#hostname").innerHTML = data.hostname; + }, function() { setTimeout(getMenu, 1000); }); }; getMenu(); diff --git a/user/cgi.c b/user/cgi.c index 8f87d38..afef507 100644 --- a/user/cgi.c +++ b/user/cgi.c @@ -66,7 +66,7 @@ int ICACHE_FLASH_ATTR cgiMenu(HttpdConnData *connData) { os_sprintf(buff, "{\"menu\": [\"Home\", \"/home.html\", \"Wifi\", \"/wifi/wifi.html\"," "\"\xC2\xB5" "C Console\", \"/console.html\", \"Debug log\", \"/log.html\" ],\n" - " \"version\": \"%s\" }", esp_link_version); + " \"version\": \"%s\", \"hostname\": \"%s\"}", esp_link_version, wifi_station_get_hostname()); httpdSend(connData, buff, -1); return HTTPD_CGI_DONE; }