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", "name": "ucentral-client",
"version": "2.2.4", "version": "2.2.5",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "ucentral-client", "name": "ucentral-client",
"version": "2.2.4", "version": "2.2.5",
"dependencies": { "dependencies": {
"@coreui/coreui": "^3.4.0", "@coreui/coreui": "^3.4.0",
"@coreui/icons": "^2.0.1", "@coreui/icons": "^2.0.1",

View File

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

View File

@@ -5,7 +5,7 @@
<link rel="icon" href="favicon.ico" /> <link rel="icon" href="favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<title>uCentralGW</title> <title>Gateway</title>
</head> </head>
<body> <body>
<noscript>You need to enable JavaScript to run this app.</noscript> <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" "waiting_for_device": "Warten, bis das Gerät wieder verbunden ist"
}, },
"user": { "user": {
"add_phone_number": "Telefonnummer hinzufügen",
"avatar": "Dein Avatar", "avatar": "Dein Avatar",
"avatar_file": "Dein Avatar (max. 2 MB)", "avatar_file": "Dein Avatar (max. 2 MB)",
"create": "Benutzer erstellen", "create": "Benutzer erstellen",
@@ -535,6 +536,7 @@
"not_validated": "Nicht validiert", "not_validated": "Nicht validiert",
"note": "Hinweis", "note": "Hinweis",
"password": "Passwort", "password": "Passwort",
"phone_number": "Telefonnummer",
"provide_email": "Bitte geben Sie eine gültige E-Mail Adresse an", "provide_email": "Bitte geben Sie eine gültige E-Mail Adresse an",
"provide_password": "Bitte geben Sie ein gültiges Passwort ein", "provide_password": "Bitte geben Sie ein gültiges Passwort ein",
"save_avatar": "Avatar speichern", "save_avatar": "Avatar speichern",

View File

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

View File

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

View File

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

View File

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

View File

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