Skip to content

Commit

Permalink
core: frontend: Add checks prior to disconnecting
Browse files Browse the repository at this point in the history
* Add a check layer prior to disconnecting from the WiFi
  network currently being used to access BlueOS
  • Loading branch information
JoaoMario109 committed Mar 13, 2024
1 parent 76e2741 commit d2c36cf
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions core/frontend/src/components/wifi/DisconnectionDialog.vue
Expand Up @@ -18,6 +18,25 @@
</v-btn>
</v-card-title>

<v-card-title
v-if="holds_ip_being_used"
class="justify-center"
>
<v-icon
color="white"
size="45"
>
mdi-alert-octagon
</v-icon>
</v-card-title>

<v-card-subtitle
v-if="holds_ip_being_used"
class="text-center mt-2 mb-2"
>
This IP address is currently being used to access BlueOS. Are you sure you want to disconnect?
</v-card-subtitle>

<v-expand-transition>
<div v-show="show_more_info">
<v-card-text>
Expand Down Expand Up @@ -58,6 +77,7 @@
import Vue, { PropType } from 'vue'
import Notifier from '@/libs/notifier'
import beacon from '@/store/beacon'
import wifi from '@/store/wifi'
import { wifi_service } from '@/types/frontend_services'
import { Network, WifiStatus } from '@/types/wifi'
Expand Down Expand Up @@ -100,6 +120,12 @@ export default Vue.extend({
}
return { ...this.network, ...this.status }
},
holds_ip_being_used(): boolean {
return this.status?.ip_address === beacon.nginx_ip_address
},
},
mounted() {
beacon.registerBeaconListener(this)
},
methods: {
toggleInfoShow(): void {
Expand Down

0 comments on commit d2c36cf

Please sign in to comment.