hide IP addresses

This commit is contained in:
proddy
2024-01-28 14:09:42 +01:00
parent fab74a9061
commit eec0051997

View File

@@ -1230,23 +1230,23 @@ bool System::command_info(const char * value, const int8_t id, JsonObject output
node["network"] = "Ethernet"; node["network"] = "Ethernet";
node["hostname"] = ETH.getHostname(); node["hostname"] = ETH.getHostname();
// node["MAC"] = ETH.macAddress(); // node["MAC"] = ETH.macAddress();
node["IPv4 address"] = uuid::printable_to_string(ETH.localIP()) + "/" + uuid::printable_to_string(ETH.subnetMask()); // node["IPv4 address"] = uuid::printable_to_string(ETH.localIP()) + "/" + uuid::printable_to_string(ETH.subnetMask());
node["IPv4 gateway"] = uuid::printable_to_string(ETH.gatewayIP()); // node["IPv4 gateway"] = uuid::printable_to_string(ETH.gatewayIP());
node["IPv4 nameserver"] = uuid::printable_to_string(ETH.dnsIP()); // node["IPv4 nameserver"] = uuid::printable_to_string(ETH.dnsIP());
if (ETH.localIPv6().toString() != "0000:0000:0000:0000:0000:0000:0000:0000") { // if (ETH.localIPv6().toString() != "0000:0000:0000:0000:0000:0000:0000:0000") {
node["IPv6 address"] = uuid::printable_to_string(ETH.localIPv6()); // node["IPv6 address"] = uuid::printable_to_string(ETH.localIPv6());
} // }
} else if (WiFi.status() == WL_CONNECTED) { } else if (WiFi.status() == WL_CONNECTED) {
node["network"] = "WiFi"; node["network"] = "WiFi";
node["hostname"] = WiFi.getHostname(); node["hostname"] = WiFi.getHostname();
node["RSSI"] = WiFi.RSSI(); node["RSSI"] = WiFi.RSSI();
// node["MAC"] = WiFi.macAddress(); // node["MAC"] = WiFi.macAddress();
node["IPv4 address"] = uuid::printable_to_string(WiFi.localIP()) + "/" + uuid::printable_to_string(WiFi.subnetMask()); // node["IPv4 address"] = uuid::printable_to_string(WiFi.localIP()) + "/" + uuid::printable_to_string(WiFi.subnetMask());
node["IPv4 gateway"] = uuid::printable_to_string(WiFi.gatewayIP()); // node["IPv4 gateway"] = uuid::printable_to_string(WiFi.gatewayIP());
node["IPv4 nameserver"] = uuid::printable_to_string(WiFi.dnsIP()); // node["IPv4 nameserver"] = uuid::printable_to_string(WiFi.dnsIP());
if (WiFi.localIPv6().toString() != "0000:0000:0000:0000:0000:0000:0000:0000") { // if (WiFi.localIPv6().toString() != "0000:0000:0000:0000:0000:0000:0000:0000") {
node["IPv6 address"] = uuid::printable_to_string(WiFi.localIPv6()); // node["IPv6 address"] = uuid::printable_to_string(WiFi.localIPv6());
} // }
} }
#endif #endif
EMSESP::esp8266React.getNetworkSettingsService()->read([&](NetworkSettings & settings) { EMSESP::esp8266React.getNetworkSettingsService()->read([&](NetworkSettings & settings) {