@@ -97,8 +97,10 @@ import { OneMoreTime } from '@/one-more-time'
9797import helper from ' @/store/helper'
9898import mavlink from ' @/store/mavlink'
9999import video from ' @/store/video'
100+ import wifi from ' @/store/wifi'
100101import { InternetConnectionState } from ' @/types/helper'
101102import { StreamStatus } from ' @/types/video'
103+ import { WifiInterface } from ' @/types/wifi'
102104import mavlink_store_get from ' @/utils/mavlink'
103105import CPUUsage from ' @/widgets/CpuPie.vue'
104106import Networking from ' @/widgets/Networking.vue'
@@ -133,9 +135,45 @@ export default Vue.extend({
133135 apps(): AppItem [] {
134136 return [
135137 ... this .baseApps ,
138+ ... this .wifiWidgets ,
136139 ... this .videoStreamWidgets ,
137140 ]
138141 },
142+ wifi_interfaces(): WifiInterface [] {
143+ return wifi .wifi_interfaces
144+ },
145+ wifiWidgets(): AppItem [] {
146+ // If we have detected interfaces from v2 API, show them dynamically
147+ if (this .wifi_interfaces .length > 0 ) {
148+ return this .wifi_interfaces .map ((iface ) => ({
149+ icon: ' mdi-wifi' ,
150+ title: ` WiFi - ${iface .name } ` ,
151+ component: Networking ,
152+ size: {
153+ w: 0.1 ,
154+ h: 0.4 ,
155+ },
156+ props: {
157+ interface: iface .name ,
158+ },
159+ }))
160+ }
161+ // Fallback to wlan0 if no interfaces detected yet
162+ return [
163+ {
164+ icon: ' mdi-wifi' ,
165+ title: ' WiFi Status' ,
166+ component: Networking ,
167+ size: {
168+ w: 0.1 ,
169+ h: 0.4 ,
170+ },
171+ props: {
172+ interface: ' wlan0' ,
173+ },
174+ },
175+ ]
176+ },
139177 baseApps(): AppItem [] {
140178 return [
141179 {
@@ -180,18 +218,6 @@ export default Vue.extend({
180218 interface: ' eth0' ,
181219 },
182220 },
183- {
184- icon: ' mdi-wifi' ,
185- title: ' WiFi Status' ,
186- component: Networking ,
187- size: {
188- w: 0.1 ,
189- h: 0.4 ,
190- },
191- props: {
192- interface: ' wlan0' ,
193- },
194- },
195221 ]
196222 },
197223 videoStreamWidgets(): AppItem [] {
0 commit comments