fix to network

This commit is contained in:
Honney
2026-06-19 15:00:34 +02:00
parent 3c41176933
commit 858ac26fdc
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -55,7 +55,7 @@ QtObject {
" echo \"TX_BYTES=$(cat /sys/class/net/$ACTIVE/statistics/tx_bytes 2>/dev/null || echo 0)\"; " +
"fi; " +
"echo '===WIFI==='; " +
"nmcli -t -f IN-USE,SSID,SIGNAL,CHAN,FREQ,RATE device wifi 2>/dev/null | grep '^\\\\*' | head -1 | sed 's/^\\*://'; " +
"nmcli -t -f active,ssid,signal,chan,freq,rate dev wifi | awk -F: '$1==\"yes\" { $1=\"\"; sub(/^:/,\"\"); print }'; " +
"echo '===PING==='; " +
"ping -c 1 -W 2 1.1.1.1 2>/dev/null | awk -F/ '/rtt/{print $5}' || echo ''; " +
"echo '===INTERNET==='; " +
@@ -171,12 +171,12 @@ QtObject {
// Parse WIFI section
if (wifiSection) {
var wifiParts = wifiSection.split(":")
var wifiParts = wifiSection.split(" ")
if (wifiParts.length >= 2) {
root.signalStrength = wifiParts[1] || ""
if (wifiParts.length >= 3) root.wifiChannel = wifiParts[2] || ""
if (wifiParts.length >= 4) root.wifiFrequency = wifiParts[3] || ""
if (wifiParts.length >= 5) root.linkSpeed = wifiParts[4] || ""
if (wifiParts.length >= 4) root.wifiFrequency = wifiParts[3] + " " + wifiParts[4] || ""
if (wifiParts.length >= 5) root.linkSpeed = wifiParts[5] + " " + wifiParts[6] || ""
}
}