From 9a0fb31dce223017c4883bd806a23a06b607ca4e Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Sun, 14 Jul 2024 14:13:23 +0200 Subject: [PATCH] Hide firmware version dropdown for virtual mode (#4097) * Hide firmware version dropdown for virtual mode * Another try * Cleanup --- src/components/port-picker/PortPicker.vue | 8 +++- src/js/serial_backend.js | 28 +++++-------- src/main.html | 49 +---------------------- 3 files changed, 17 insertions(+), 68 deletions(-) diff --git a/src/components/port-picker/PortPicker.vue b/src/components/port-picker/PortPicker.vue index add7a2e23f..5a57c36377 100644 --- a/src/components/port-picker/PortPicker.vue +++ b/src/components/port-picker/PortPicker.vue @@ -6,7 +6,7 @@ @input="updateValue('portOverride', $event)" /> @@ -27,6 +27,7 @@ import PortOverrideOption from "./PortOverrideOption.vue"; import FirmwareVirtualOption from "./FirmwareVirtualOption.vue"; import PortsInput from "./PortsInput.vue"; +import CONFIGURATOR from "../../js/data_storage"; export default { components: { @@ -70,6 +71,11 @@ export default { default: false, }, }, + computed: { + isConnected() { + return CONFIGURATOR.connectionValid; + }, + }, methods: { updateValue(key, value) { if (key != null) { diff --git a/src/js/serial_backend.js b/src/js/serial_backend.js index e3165379f0..694a3a0ebb 100644 --- a/src/js/serial_backend.js +++ b/src/js/serial_backend.js @@ -642,14 +642,10 @@ function onConnect() { } } - const sensorState = $('#sensor-status'); - sensorState.show(); - - const portPicker = $('#portsinput'); - portPicker.hide(); - - const dataflash = $('#dataflash_wrapper_global'); - dataflash.show(); + // header bar + $('#sensor-status').show(); + $('#portsinput').hide(); + $('#dataflash_wrapper_global').show(); } function onClosed(result) { @@ -659,17 +655,11 @@ function onClosed(result) { $('#tabs ul.mode-connected-cli').hide(); $('#tabs ul.mode-disconnected').show(); - const sensorState = $('#sensor-status'); - sensorState.hide(); - - const portPicker = $('#portsinput'); - portPicker.show(); - - const dataflash = $('#dataflash_wrapper_global'); - dataflash.hide(); - - const battery = $('#quad-status_wrapper'); - battery.hide(); + // header bar + $('#sensor-status').hide(); + $('#portsinput').show(); + $('#dataflash_wrapper_global').hide(); + $('#quad-status_wrapper').hide(); clearLiveDataRefreshTimer(); diff --git a/src/main.html b/src/main.html index a7745098d5..b398fca823 100644 --- a/src/main.html +++ b/src/main.html @@ -76,54 +76,7 @@ :firmware-id="FC.CONFIG.flightControllerIdentifier" :hardware-id="FC.CONFIG.hardwareName" > -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
+