Skip to content

Commit 4ba650d

Browse files
joaomariolagopatrickelectric
authored andcommitted
EthernetUpdater/store:ethernet: Fix ethernet endpoint
* Make sure EthernetUpdate is using `/ethernet` interfaces that filters wifi ones
1 parent c1be155 commit 4ba650d

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

core/frontend/src/components/ethernet/EthernetUpdater.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export default Vue.extend({
1616
}
1717
},
1818
mounted() {
19-
this.fetch_available_interfaces_task.setAction(this.fetchAvailableInterfaces)
19+
this.fetch_available_interfaces_task.setAction(this.fetchAvailableEthernetInterfaces)
2020
},
2121
methods: {
22-
async fetchAvailableInterfaces(): Promise<void> {
23-
await ethernet.getAvailableInterfaces()
22+
async fetchAvailableEthernetInterfaces(): Promise<void> {
23+
await ethernet.getAvailableEthernetInterfaces()
2424
.then((response) => {
2525
ethernet.setInterfaces(response.data)
2626
})

core/frontend/src/store/ethernet.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,21 @@ class EthernetStore extends VuexModule {
166166
url: `${this.API_URL}/interfaces`,
167167
// Necessary since the system can hang with dhclient timeouts
168168
timeout: 10000,
169+
})
170+
.catch((error) => {
171+
this.context.commit('setInterfaces', [])
172+
notifier.pushBackError('AVAILABLE_INTERFACES_FETCH_FAIL', error)
173+
throw error
174+
})
175+
}
176+
177+
@Action
178+
async getAvailableEthernetInterfaces() {
179+
return await back_axios({
180+
method: 'get',
181+
url: `${this.API_URL}/ethernet`,
182+
// Necessary since the system can hang with dhclient timeouts
183+
timeout: 10000,
169184
})
170185
.catch((error) => {
171186
this.context.commit('setInterfaces', [])

0 commit comments

Comments
 (0)