mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
show network hostname in webui
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
- checkbox for MQTT-TLS enable [#1474](https://github.com/emsesp/EMS-ESP32/issues/1474)
|
||||
- added SK (Slovenian) language. Thanks @misa1515
|
||||
- CPU info [#1497](https://github.com/emsesp/EMS-ESP32/pull/1497)
|
||||
- Show network hostname in Web UI under Network Status
|
||||
|
||||
## Fixed
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import DeviceHubIcon from '@mui/icons-material/DeviceHub';
|
||||
import DnsIcon from '@mui/icons-material/Dns';
|
||||
import GiteIcon from '@mui/icons-material/Gite';
|
||||
import RefreshIcon from '@mui/icons-material/Refresh';
|
||||
import RouterIcon from '@mui/icons-material/Router';
|
||||
import SettingsInputAntennaIcon from '@mui/icons-material/SettingsInputAntenna';
|
||||
@@ -115,6 +116,15 @@ const NetworkStatusForm: FC = () => {
|
||||
<ListItemText primary="Status" secondary={networkStatus(data)} />
|
||||
</ListItem>
|
||||
<Divider variant="inset" component="li" />
|
||||
<ListItem>
|
||||
<ListItemAvatar>
|
||||
<Avatar sx={{ bgcolor: networkStatusHighlight(data, theme) }}>
|
||||
<GiteIcon />
|
||||
</Avatar>
|
||||
</ListItemAvatar>
|
||||
<ListItemText primary="Hostname" secondary={data.hostname} />
|
||||
</ListItem>
|
||||
<Divider variant="inset" component="li" />
|
||||
{isWiFi(data) && (
|
||||
<>
|
||||
<ListItem>
|
||||
|
||||
@@ -20,8 +20,10 @@ void NetworkStatus::networkStatus(AsyncWebServerRequest * request) {
|
||||
// see if Ethernet is connected
|
||||
if (ethernet_connected) {
|
||||
root["status"] = 10; // custom code #10 - ETHERNET_STATUS_CONNECTED
|
||||
root["hostname"] = ETH.getHostname();
|
||||
} else {
|
||||
root["status"] = (uint8_t)wifi_status;
|
||||
root["hostname"] = WiFi.getHostname();
|
||||
}
|
||||
|
||||
// for both connections show ethernet
|
||||
|
||||
@@ -249,7 +249,8 @@ const network_status = {
|
||||
subnet_mask: '255.255.255.0',
|
||||
gateway_ip: '10.10.10.1',
|
||||
dns_ip_1: '10.10.10.1',
|
||||
dns_ip_2: '0.0.0.0'
|
||||
dns_ip_2: '0.0.0.0',
|
||||
hostname: 'ems-esp'
|
||||
};
|
||||
const list_networks = {
|
||||
networks: [
|
||||
@@ -650,9 +651,9 @@ const emsesp_devices = {
|
||||
};
|
||||
|
||||
const emsesp_coredata = {
|
||||
connected: true,
|
||||
// devices: [],
|
||||
devices: [
|
||||
connected: false,
|
||||
devices: [],
|
||||
devices2: [
|
||||
{
|
||||
id: 7,
|
||||
t: 4,
|
||||
|
||||
Reference in New Issue
Block a user