From d2c36cf58dbbf234b9d2ff2b0cc202891d64cf7e Mon Sep 17 00:00:00 2001 From: Joao Mario Lago Date: Wed, 13 Mar 2024 09:02:30 -0300 Subject: [PATCH] core: frontend: Add checks prior to disconnecting * Add a check layer prior to disconnecting from the WiFi network currently being used to access BlueOS --- .../components/wifi/DisconnectionDialog.vue | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/core/frontend/src/components/wifi/DisconnectionDialog.vue b/core/frontend/src/components/wifi/DisconnectionDialog.vue index 5de9e945d0..677e6c94a8 100644 --- a/core/frontend/src/components/wifi/DisconnectionDialog.vue +++ b/core/frontend/src/components/wifi/DisconnectionDialog.vue @@ -18,6 +18,25 @@ + + + mdi-alert-octagon + + + + + This IP address is currently being used to access BlueOS. Are you sure you want to disconnect? + +
@@ -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' @@ -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 {