Fix for converted/non-converted rssi values

This commit is contained in:
Charles
2021-10-12 11:12:47 -04:00
parent 8360644864
commit 45f206d947
9 changed files with 21 additions and 7 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "ucentral-client",
"version": "2.2.4",
"version": "2.2.5",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ucentral-client",
"version": "2.2.4",
"version": "2.2.5",
"dependencies": {
"@coreui/coreui": "^3.4.0",
"@coreui/icons": "^2.0.1",

View File

@@ -1,6 +1,6 @@
{
"name": "ucentral-client",
"version": "2.2.4",
"version": "2.2.5",
"dependencies": {
"@coreui/coreui": "^3.4.0",
"@coreui/icons": "^2.0.1",

View File

@@ -5,7 +5,7 @@
<link rel="icon" href="favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<title>uCentralGW</title>
<title>Gateway</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>

View File

@@ -508,6 +508,7 @@
"waiting_for_device": "Warten, bis das Gerät wieder verbunden ist"
},
"user": {
"add_phone_number": "Telefonnummer hinzufügen",
"avatar": "Dein Avatar",
"avatar_file": "Dein Avatar (max. 2 MB)",
"create": "Benutzer erstellen",
@@ -535,6 +536,7 @@
"not_validated": "Nicht validiert",
"note": "Hinweis",
"password": "Passwort",
"phone_number": "Telefonnummer",
"provide_email": "Bitte geben Sie eine gültige E-Mail Adresse an",
"provide_password": "Bitte geben Sie ein gültiges Passwort ein",
"save_avatar": "Avatar speichern",

View File

@@ -508,6 +508,7 @@
"waiting_for_device": "Waiting for device to reconnect"
},
"user": {
"add_phone_number": "Add Phone Number",
"avatar": "Your Avatar",
"avatar_file": "Your Avatar (max. of 2 MB)",
"create": "Create User",
@@ -535,6 +536,7 @@
"not_validated": "Not Validated",
"note": "Note",
"password": "Password",
"phone_number": "Phone Number",
"provide_email": "Please provide a valid email address",
"provide_password": "Please provide a valid password",
"save_avatar": "Save Avatar",

View File

@@ -508,6 +508,7 @@
"waiting_for_device": "Esperando que el dispositivo se vuelva a conectar"
},
"user": {
"add_phone_number": "Agregar el número de teléfono",
"avatar": "Tu avatar",
"avatar_file": "Tu avatar (máx. De 2 MB)",
"create": "Crear usuario",
@@ -535,6 +536,7 @@
"not_validated": "No validado",
"note": "Nota",
"password": "Contraseña",
"phone_number": "Número de teléfono",
"provide_email": "Por favor ingrese su dirección de correo electrónico válida",
"provide_password": "Proporcione una contraseña válida",
"save_avatar": "Guardar avatar",

View File

@@ -508,6 +508,7 @@
"waiting_for_device": "En attente de la reconnexion de l'appareil"
},
"user": {
"add_phone_number": "Ajouter un numéro de téléphone",
"avatar": "Votre avatar",
"avatar_file": "Votre Avatar (max. de 2 Mo)",
"create": "Créer un utilisateur",
@@ -535,6 +536,7 @@
"not_validated": "Pas valide",
"note": "Remarque",
"password": "Mot de passe",
"phone_number": "Numéro de téléphone",
"provide_email": "Veuillez fournir une adresse email valide",
"provide_password": "Veuillez fournir un mot de passe valide",
"save_avatar": "Enregistrer l'avatar",

View File

@@ -508,6 +508,7 @@
"waiting_for_device": "Esperando que o dispositivo se reconecte"
},
"user": {
"add_phone_number": "ADICIONAR NÚMERO DE TELEFONE",
"avatar": "Seu avatar",
"avatar_file": "Seu avatar (máx. De 2 MB)",
"create": "Criar usuário",
@@ -535,6 +536,7 @@
"not_validated": "Não validado",
"note": "Nota",
"password": "Senha",
"phone_number": "Número de telefone",
"provide_email": "Por favor, forneça um endereço de e-mail válido",
"provide_password": "Forneça uma senha válida",
"save_avatar": "Salvar Avatar",

View File

@@ -21,6 +21,11 @@ import {
import CIcon from '@coreui/icons-react';
import { cilX } from '@coreui/icons';
const parseDbm = (value) => {
if (value > -150 && value < 100) return value;
return (4294967295 - value) * -1;
};
const WifiAnalysisPage = () => {
const { t } = useTranslation();
const { deviceId } = useParams();
@@ -60,7 +65,6 @@ const WifiAnalysisPage = () => {
};
const parseAssociationStats = (json) => {
const dbmNumber = 4294967295;
const newParsedAssociationStats = [];
const newParsedRadioStats = [];
@@ -77,7 +81,7 @@ const WifiAnalysisPage = () => {
radio: i,
channel: radio.channel,
channelWidth: radio.channel_width,
noise: radio.noise ? (dbmNumber - radio.noise) * -1 : '-',
noise: radio.noise ? parseDbm(radio.noise) : '-',
txPower: radio.tx_power,
activeMs: secondsToLabel(radio?.active_ms ? Math.floor(radio.active_ms / 1000) : 0),
busyMs: secondsToLabel(radio?.busy_ms ? Math.floor(radio.busy_ms / 1000) : 0),
@@ -121,7 +125,7 @@ const WifiAnalysisPage = () => {
...extractIp(stat.data, association.bssid),
bssid: association.bssid,
ssid: ssid.ssid,
rssi: association.rssi ? (dbmNumber - association.rssi) * -1 : '-',
rssi: association.rssi ? parseDbm(association.rssi) : '-',
mode: ssid.mode,
rxBytes: cleanBytesString(association.rx_bytes, 0),
rxRate: association.rx_rate.bitrate,