From 45b59d2f73bd4b50675ea05965d89bf68747078f Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Thu, 19 Sep 2024 00:03:46 +0200 Subject: [PATCH] Reserve statusbar for something else --- locales/en/messages.json | 3 --- .../status-bar/ConnectionStatus.vue | 25 ------------------- src/components/status-bar/StatusBar.vue | 10 -------- src/index.html | 2 -- src/js/data_storage.js | 1 - src/js/main.js | 9 ------- src/js/utils/connection.js | 14 +---------- 7 files changed, 1 insertion(+), 63 deletions(-) delete mode 100644 src/components/status-bar/ConnectionStatus.vue diff --git a/locales/en/messages.json b/locales/en/messages.json index 24e3985e35e..1feca4ca285 100755 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -667,9 +667,6 @@ "versionLabelFirmware": { "message": "Firmware" }, - "versionLabelConnection": { - "message": "ISP" - }, "versionLabelConfigurator": { "message": "Configurator" }, diff --git a/src/components/status-bar/ConnectionStatus.vue b/src/components/status-bar/ConnectionStatus.vue deleted file mode 100644 index b3d5baa2c98..00000000000 --- a/src/components/status-bar/ConnectionStatus.vue +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/src/components/status-bar/StatusBar.vue b/src/components/status-bar/StatusBar.vue index f2eed3cb539..7b58dea24dc 100644 --- a/src/components/status-bar/StatusBar.vue +++ b/src/components/status-bar/StatusBar.vue @@ -21,9 +21,6 @@ :value="cpuLoad" unit="%" /> - import StatusBarVersion from "./StatusBarVersion.vue"; import ReadingStat from "./ReadingStat.vue"; -import ConnectionStatus from "./ConnectionStatus.vue"; import PortUtilization from "./PortUtilization.vue"; export default { components: { PortUtilization, ReadingStat, - ConnectionStatus, StatusBarVersion, }, props: { @@ -72,11 +67,6 @@ export default { default: 0, }, - networkStatus: { - type: String, - default: "", - }, - configuratorVersion: { type: String, default: "", diff --git a/src/index.html b/src/index.html index c42c1bf3630..c08d3b4fa9f 100644 --- a/src/index.html +++ b/src/index.html @@ -177,8 +177,6 @@ :cycle-time="FC.CONFIG.cycleTime" :cpu-load="FC.CONFIG.cpuload" - :network-status="CONFIGURATOR.networkStatus" - :configurator-version="CONFIGURATOR.getDisplayVersion()" :firmware-version="FC.CONFIG.flightControllerVersion" :firmware-id="FC.CONFIG.flightControllerIdentifier" diff --git a/src/js/data_storage.js b/src/js/data_storage.js index 4278fe302d6..efb37b3498e 100644 --- a/src/js/data_storage.js +++ b/src/js/data_storage.js @@ -11,7 +11,6 @@ const CONFIGURATOR = { connectionValid: false, connectionValidCliOnly: false, - networkStatus: 'UNKNOWN', virtualMode: false, virtualApiVersion: '0.0.1', cliActive: false, diff --git a/src/js/main.js b/src/js/main.js index 2202cf38c19..132e951118e 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -99,15 +99,6 @@ function startProcess() { gui_log(i18n.getMessage('infoVersionOs', { operatingSystem: GUI.operating_system })); gui_log(i18n.getMessage('infoVersionConfigurator', { configuratorVersion: CONFIGURATOR.getDisplayVersion() })); - if (navigator.connection) { - console.log(`[ISP] Network connection type: ${navigator.connection.type}`); - console.log(`[ISP] Effective network type: ${navigator.connection.effectiveType}`); - console.log(`[ISP] Downlink Speed: ${navigator.connection.downlink}Mb/s`); - console.log(`[ISP] Round Trip Time: ${navigator.connection.rtt}ms`); - } else { - console.log(`[ISP] Navigator Connection API not supported`); - } - $('.connect_b a.connect').removeClass('disabled'); // with Vue reactive system we don't need to call these, // our view is reactive to model changes diff --git a/src/js/utils/connection.js b/src/js/utils/connection.js index e33ec200be7..a1e501a6628 100644 --- a/src/js/utils/connection.js +++ b/src/js/utils/connection.js @@ -1,29 +1,17 @@ import { get as getConfig } from "../ConfigStorage"; -import CONFIGURATOR from "../data_storage"; export function ispConnected() { const connected = navigator.onLine; const isMetered = getConfig('meteredConnection').meteredConnection; - // navigator.connection is not available if (!navigator.connection) { return connected && !isMetered; } - // navigator.connection is available - const type = navigator.connection.effectiveType; - const downlink = navigator.connection.downlink; - const rtt = navigator.connection.rtt; - - if (isMetered || type === 'none' || !connected) { - CONFIGURATOR.networkStatus = 'Offline'; + if (isMetered || navigator.connection.effectiveType === 'none' || !connected) { return false; - } else if (type === 'slow-2g' || type === '2g' || downlink < 0.115 || rtt > 1000) { - CONFIGURATOR.networkStatus = 'Slow'; - return true; } - CONFIGURATOR.networkStatus = 'Online'; return true; }