Add hostname display. Shown on left, between logo and menu

pull/56/head
Ivan Susanin 9 years ago
parent 2c29e2940a
commit 6f0cce3de5
  1. 10
      html/style.css
  2. 4
      html/ui.js
  3. 2
      user/cgi.c

@ -206,6 +206,16 @@ pre.console a {
color: #fff; 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 { #menu .pure-menu-heading {
font-size: 110%; font-size: 110%;
color: #fff; color: #fff;

@ -226,6 +226,7 @@ onLoad(function() {
<div class="pure-menu">\ <div class="pure-menu">\
<a class="pure-menu-heading" href="https://github.com/jeelabs/esp-link">\ <a class="pure-menu-heading" href="https://github.com/jeelabs/esp-link">\
<img src="/favicon.ico" height="32">&nbsp;esp-link</a>\ <img src="/favicon.ico" height="32">&nbsp;esp-link</a>\
<div id="hostname" class="hostname"></div>\
<ul id="menu-list" class="pure-menu-list"></ul>\ <ul id="menu-list" class="pure-menu-list"></ul>\
</div>\ </div>\
</div>\ </div>\
@ -258,6 +259,9 @@ onLoad(function() {
v = $("#version"); v = $("#version");
if (v != null) { v.innerHTML = data.version; } if (v != null) { v.innerHTML = data.version; }
$("#hostname").innerHTML = data.hostname;
}, function() { setTimeout(getMenu, 1000); }); }, function() { setTimeout(getMenu, 1000); });
}; };
getMenu(); getMenu();

@ -66,7 +66,7 @@ int ICACHE_FLASH_ATTR cgiMenu(HttpdConnData *connData) {
os_sprintf(buff, os_sprintf(buff,
"{\"menu\": [\"Home\", \"/home.html\", \"Wifi\", \"/wifi/wifi.html\"," "{\"menu\": [\"Home\", \"/home.html\", \"Wifi\", \"/wifi/wifi.html\","
"\"\xC2\xB5" "C Console\", \"/console.html\", \"Debug log\", \"/log.html\" ],\n" "\"\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); httpdSend(connData, buff, -1);
return HTTPD_CGI_DONE; return HTTPD_CGI_DONE;
} }

Loading…
Cancel
Save