diff --git a/src/WebApi_network.cpp b/src/WebApi_network.cpp index e5925f7d..3254c4b4 100644 --- a/src/WebApi_network.cpp +++ b/src/WebApi_network.cpp @@ -31,13 +31,14 @@ void WebApiNetworkClass::onNetworkStatus(AsyncWebServerRequest* request) root[F("sta_status")] = ((WiFi.getMode() & WIFI_STA) != 0); root[F("sta_ssid")] = WiFi.SSID(); - root[F("sta_ip")] = NetworkSettings.localIP().toString(); - root[F("sta_netmask")] = NetworkSettings.subnetMask().toString(); - root[F("sta_gateway")] = NetworkSettings.gatewayIP().toString(); - root[F("sta_dns1")] = NetworkSettings.dnsIP(0).toString(); - root[F("sta_dns2")] = NetworkSettings.dnsIP(1).toString(); - root[F("sta_mac")] = NetworkSettings.macAddress(); root[F("sta_rssi")] = WiFi.RSSI(); + root[F("network_ip")] = NetworkSettings.localIP().toString(); + root[F("network_netmask")] = NetworkSettings.subnetMask().toString(); + root[F("network_gateway")] = NetworkSettings.gatewayIP().toString(); + root[F("network_dns1")] = NetworkSettings.dnsIP(0).toString(); + root[F("network_dns2")] = NetworkSettings.dnsIP(1).toString(); + root[F("network_mac")] = NetworkSettings.macAddress(); + root[F("network_mode")] = NetworkSettings.NetworkMode() == network_mode::WiFi ? F("Station") : F("Ethernet"); root[F("ap_status")] = ((WiFi.getMode() & WIFI_AP) != 0); root[F("ap_ssid")] = NetworkSettings.getApName(); root[F("ap_ip")] = WiFi.softAPIP().toString(); diff --git a/webapp/src/components/NetworkInfoView.vue b/webapp/src/components/NetworkInfoView.vue index 819648d0..3f424628 100644 --- a/webapp/src/components/NetworkInfoView.vue +++ b/webapp/src/components/NetworkInfoView.vue @@ -14,7 +14,7 @@
- +
@@ -26,14 +26,14 @@ import { defineComponent } from 'vue'; import WifiStationInfo from "./partials/WifiStationInfo.vue"; import WifiApInfo from "./partials/WifiApInfo.vue"; -import InterfaceStationInfo from "./partials/InterfaceStationInfo.vue"; +import InterfaceNetworkInfo from "./partials/InterfaceNetworkInfo.vue"; import InterfaceApInfo from "./partials/InterfaceApInfo.vue"; export default defineComponent({ components: { WifiStationInfo, WifiApInfo, - InterfaceStationInfo, + InterfaceNetworkInfo, InterfaceApInfo, }, data() { @@ -48,13 +48,14 @@ export default defineComponent({ ap_status: false, ap_ssid: "", ap_stationnum: 0, - // InterfaceStationInfo - sta_ip: "", - sta_netmask: "", - sta_gateway: "", - sta_dns1: "", - sta_dns2: "", - sta_mac: "", + // InterfaceNetworkInfo + network_ip: "", + network_netmask: "", + network_gateway: "", + network_dns1: "", + network_dns2: "", + network_mac: "", + network_mode: "", // InterfaceApInfo ap_ip: "", ap_mac: "", diff --git a/webapp/src/components/partials/InterfaceStationInfo.vue b/webapp/src/components/partials/InterfaceNetworkInfo.vue similarity index 65% rename from webapp/src/components/partials/InterfaceStationInfo.vue rename to webapp/src/components/partials/InterfaceNetworkInfo.vue index c70389ec..dfb6aa70 100644 --- a/webapp/src/components/partials/InterfaceStationInfo.vue +++ b/webapp/src/components/partials/InterfaceNetworkInfo.vue @@ -1,7 +1,7 @@