diff --git a/src/frontend/components/interfaces/AddInterfacePage.vue b/src/frontend/components/interfaces/AddInterfacePage.vue index 51afc03..ef1ec91 100644 --- a/src/frontend/components/interfaces/AddInterfacePage.vue +++ b/src/frontend/components/interfaces/AddInterfacePage.vue @@ -118,7 +118,12 @@ +
+ Discovering Bluetooth RNodes... + Discover Bluetooth RNodes +
@@ -184,6 +189,9 @@ export default { config: null, comports: [], + rnodes: [], + + isLoadingRnodes: false, newInterfaceName: null, newInterfaceType: null, @@ -243,6 +251,7 @@ export default { this.getConfig(); this.loadComports(); + this.loadRnodes(); // check if we are editing an interface const interfaceName = this.$route.query.interface_name; @@ -276,9 +285,30 @@ export default { const response = await window.axios.get(`/api/v1/comports`); this.comports = response.data.comports; } catch(e) { - // do nothing if failed to load interfaces + // do nothing if failed to load comports } }, + async loadRnodes() { + + // do nothing if already loading + if(this.isLoadingRnodes){ + return; + } + + // show loading + this.isLoadingRnodes = true; + + try { + const response = await window.axios.get(`/api/v1/rnodes/ble-scan`); + this.rnodes = response.data.rnodes; + } catch(e) { + // do nothing if failed to load rnodes + } finally { + // no longer loading + this.isLoadingRnodes = false; + } + + }, async loadInterfaceToEdit(interfaceName) { try {