From 1fd200193984d0e5b1f525296c74d90f55044740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Wabik?= <4rafal@gmail.com> Date: Wed, 12 Jan 2022 11:03:56 -0800 Subject: [PATCH] Update scripts --- luci-app-3ginfo-lite/Makefile | 4 +- .../resources/view/modem/3gdetail.js | 10 +-- .../share/3ginfo-lite/3ginfo-addon/119968a2 | 10 +-- .../share/3ginfo-lite/3ginfo-addon/11999071 | 12 +--- .../share/3ginfo-lite/3ginfo-addon/16907588 | 4 +- .../share/3ginfo-lite/3ginfo-addon/19d20167 | 2 +- .../share/3ginfo-lite/3ginfo-addon/19d21432 | 68 +++++++++++++++++++ .../share/3ginfo-lite/3ginfo-addon/20202033 | 2 +- .../share/3ginfo-lite/3ginfo-addon/2c7c0306 | 5 +- .../share/3ginfo-lite/3ginfo-addon/2cd20004 | 4 +- .../root/usr/share/3ginfo-lite/3ginfo.sh | 4 +- 11 files changed, 93 insertions(+), 32 deletions(-) create mode 100644 luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/19d21432 diff --git a/luci-app-3ginfo-lite/Makefile b/luci-app-3ginfo-lite/Makefile index 0e81276c..fb4360eb 100644 --- a/luci-app-3ginfo-lite/Makefile +++ b/luci-app-3ginfo-lite/Makefile @@ -1,4 +1,4 @@ -# Copyright 2021 Rafał Wabik - IceG - From eko.one.pl forum +# Copyright 2021-2022 Rafał Wabik - IceG - From eko.one.pl forum # MIT License include $(TOPDIR)/rules.mk @@ -7,7 +7,7 @@ PKG_NAME:=luci-app-3ginfo-lite LUCI_TITLE:=LuCI panel for 3ginfo-lite LUCI_PKGARCH:=all LUCI_DEPENDS:=+sms-tool -PKG_VERSION:=1.0.9-20211218 +PKG_VERSION:=1.0.9-20220112 PKG_RELEASE:=1 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-app-3ginfo-lite/htdocs/luci-static/resources/view/modem/3gdetail.js b/luci-app-3ginfo-lite/htdocs/luci-static/resources/view/modem/3gdetail.js index f8e069ec..17ba55a0 100644 --- a/luci-app-3ginfo-lite/htdocs/luci-static/resources/view/modem/3gdetail.js +++ b/luci-app-3ginfo-lite/htdocs/luci-static/resources/view/modem/3gdetail.js @@ -38,7 +38,7 @@ var pc = Math.floor((100 / mn) * vn); var tip = _('Very weak'); }; pg.firstElementChild.style.width = pc + '%'; -pg.style.width = '50%'; +pg.style.width = '33%'; pg.setAttribute('title', '%s'.format(v) + ' | ' + tip + ' '); } @@ -70,7 +70,7 @@ var pc = Math.floor(100*(1-(-50 - vn)/(-50 - mn))); var tip = _('Very weak'); }; pg.firstElementChild.style.width = pc + '%'; -pg.style.width = '50%'; +pg.style.width = '33%'; pg.firstElementChild.style.animationDirection = "reverse"; pg.setAttribute('title', '%s'.format(v) + ' | ' + tip + ' '); } @@ -103,7 +103,7 @@ var pc = Math.floor(120*(1-(-50 - vn)/(-50 - mn))); var tip = _('Very weak'); }; pg.firstElementChild.style.width = pc + '%'; -pg.style.width = '50%'; +pg.style.width = '33%'; pg.firstElementChild.style.animationDirection = "reverse"; pg.setAttribute('title', '%s'.format(v) + ' | ' + tip + ' '); } @@ -134,7 +134,7 @@ var pc = Math.floor(100-(100*(1-((mn - vn)/(mn - 25))))); var tip = _('Cell edge'); }; pg.firstElementChild.style.width = pc + '%'; -pg.style.width = '50%'; +pg.style.width = '33%'; pg.firstElementChild.style.animationDirection = "reverse"; pg.setAttribute('title', '%s'.format(v) + ' | ' + tip + ' '); } @@ -166,7 +166,7 @@ if (vn > 0) { vn = 0; }; var tip = _('Cell edge'); }; pg.firstElementChild.style.width = pc + '%'; -pg.style.width = '50%'; +pg.style.width = '33%'; pg.firstElementChild.style.animationDirection = "reverse"; pg.setAttribute('title', '%s'.format(v) + ' | ' + tip + ' '); } diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/119968a2 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/119968a2 index b318c935..9373b7e3 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/119968a2 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/119968a2 @@ -10,31 +10,31 @@ if [ -n "$T" ]; then *"B7") MODE=$(band 7 "LTE ");; *"B8") MODE=$(band 8 "LTE ");; *"B20") MODE=$(band 20 "LTE ");; - *) MODE="$T";; + *) MODE="LTE B${T}";; esac fi T=$(echo "$O" | awk '/^RSSI/ {print $3}' | xargs) if [ -n "$T" ]; then - RSSI='$T' + RSSI="'$T' dBm" [ -n "$ADDON" ] && ADDON="$ADDON," ADDON="$ADDON"'{"RSSI":"'$T' dBm"}' fi T=$(echo "$O" | awk '/^RSRP/ {print $3}' | xargs) if [ -n "$T" ]; then - RSRP='$T' + RSRP="'$T' dBm" [ -n "$ADDON" ] && ADDON="$ADDON," ADDON="$ADDON"'{"RSRP":"'$T' dBm"}' fi T=$(echo "$O" | awk '/^RSRQ/ {print $3}' | xargs) if [ -n "$T" ]; then - RSRQ='$T' + RSRQ="'$T' dB" [ -n "$ADDON" ] && ADDON="$ADDON," ADDON="$ADDON"'{"RSRQ":"'$T' dB"}' fi T=$(echo "$O" | awk '/^SINR/ {print $3}' | xargs) if [ -n "$T" ]; then - SINR='$T' + SINR="'$T' dB" [ -n "$ADDON" ] && ADDON="$ADDON," ADDON="$ADDON"'{"SINR":"'$T' dB"}' fi diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/11999071 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/11999071 index 70574740..5b680636 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/11999071 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/11999071 @@ -21,7 +21,7 @@ if [ -n "$T" ]; then *"B29") MODE=$(band 29 "LTE ");; *"B30") MODE=$(band 30 "LTE ");; *"B41") MODE=$(band 41 "LTE ");; - *) MODE="$T";; + *) MODE="LTE B${T}";; esac T=$(echo "$O" | awk -F: '/^LTE CA state:.*ACTIVE/ {print $3}' | xargs) @@ -42,17 +42,9 @@ if [ -n "$T" ]; then *"B29") MODE="{MODE/LTE/LTE_A} / "$(band 29 "");; *"B30") MODE="{MODE/LTE/LTE_A} / "$(band 30 "");; *"B41") MODE="{MODE/LTE/LTE_A} / "$(band 41 "");; - *) MODE="${MODE/LTE/LTE_A} / $T";; + *) MODE="${MODE/LTE/LTE_A} / B${T}";; esac - SPACEOFF=$(echo $MODE | tr -d '"') - MAIN=$(echo $SPACEOFF | cut -d "/" -f 1) - PLUS=$(echo $SPACEOFF | cut -d "/" -f 2) - MAINCUT=$(echo $MAIN | sed 's/LTE //g') - PLUSCUT=$(echo $PLUS | sed 's/LTE //g') - PLUSVIEW=$(echo $PLUSCUT | sed 's/[0-9] /&\/ /g') - MODE="LTE-A | $MAINCUT + "$PLUSVIEW - fi fi diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/16907588 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/16907588 index ef7d2f23..4ba68582 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/16907588 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/16907588 @@ -69,7 +69,7 @@ if [ -n "$T" ]; then *"Band:7") MODE=$(band 7 "LTE ");; *"Band:8") MODE=$(band 8 "LTE ");; *"Band:20") MODE=$(band 20 "LTE ");; - *) MODE="$T";; + *) MODE="LTE B${T}";; esac fi @@ -81,7 +81,7 @@ if [ -n "$T" ]; then *"(S)Band:7") MODE="${MODE/LTE/LTE_A} / "$(band 7 "");; *"(S)Band:8") MODE="${MODE/LTE/LTE_A} / "$(band 8 "");; *"(S)Band:20") MODE="${MODE/LTE/LTE_A} / "$(band 20 "");; - *) MODE="${MODE/LTE/LTE_A} / $T";; + *) MODE="${MODE/LTE/LTE_A} / B${T}";; esac fi diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/19d20167 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/19d20167 index d67de5a6..e350e4af 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/19d20167 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/19d20167 @@ -10,7 +10,7 @@ case "$MODE1" in *"B7") MODE=$(band 7 "LTE ");; *"B8") MODE=$(band 8 "LTE ");; *"B20") MODE=$(band 20 "LTE ");; - *) MODE="$MODE $BAND";; + *) MODE="$MODE B${BAND}";; esac ;; *) diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/19d21432 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/19d21432 new file mode 100644 index 00000000..af9032ea --- /dev/null +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/19d21432 @@ -0,0 +1,68 @@ +# ZTE MF286 + +O=$(sms_tool -d $DEVICE at "at+zrssi;+zcellinfo?;+zcainfo?;+zdon?") + +case "$MODE1" in + 2*| \ + 3*) + T=$(echo "$O" | awk -F[,:] '/^\+ZRSSI/ {print $2}' | xargs) + [ -n "$ADDON" ] && ADDON="$ADDON," + RSSI="'$T' dBm" + ADDON="$ADDON"'{"RSSI":"'$T' dBm"}' + ;; + 4*| \ + 5*| \ + 6*) + T=$(echo "$O" | awk -F[,:] '/^\+ZRSSI/ {print $2}' | xargs) + [ -n "$ADDON" ] && ADDON="$ADDON," + ADDON="$ADDON"'{"RSCP":"'$T' dBm"}' + T=$(echo "$O" | awk -F[,:] '/^\+ZRSSI/ {print $3}' | xargs) + [ -n "$ADDON" ] && ADDON="$ADDON," + ADDON="$ADDON"'{"ECIO":"'$T' dB"}' + T=$(echo "$O" | awk -F[,:] '/^\+ZCELLINFO/ {print $4}' | xargs) + [ -n "$T" ] && MODE="$T" + ;; + 7*) + T=$(echo "$O" | awk -F[,:] '/^\+ZRSSI/ {print $2}' | xargs) + [ -n "$ADDON" ] && ADDON="$ADDON," + RSRP="'$T' dBm" + ADDON="$ADDON"'{"RSRP":"'$T' dBm"}' + T=$(echo "$O" | awk -F[,:] '/^\+ZRSSI/ {print $3}' | xargs) + [ -n "$ADDON" ] && ADDON="$ADDON," + RSRQ="'$T' dB" + ADDON="$ADDON"'{"RSRQ":"'$T' dB"}' + T=$(echo "$O" | awk -F[,:] '/^\+ZRSSI/ {print $4}' | xargs) + [ -n "$ADDON" ] && ADDON="$ADDON," + RSSI="'$T' dBm" + ADDON="$ADDON"'{"RSSI":"'$T' dBm"}' + T=$(echo "$O" | awk -F[,:] '/^\+ZRSSI/ {print $5}' | xargs) + [ -n "$ADDON" ] && ADDON="$ADDON," + ADDON="$ADDON"'{"SINR":"'$T' dB"}' + SINR="'$T' dB" + T=$(echo "$O" | awk -F[,:] '/^\+ZCELLINFO/ {print $4}' | xargs) + case "$T" in + *"LTE B1") MODE=$(band 1 "LTE ");; + *"LTE B3") MODE=$(band 3 "LTE ");; + *"LTE B7") MODE=$(band 7 "LTE ");; + *"LTE B8") MODE=$(band 8 "LTE ");; + *"LTE B20") MODE=$(band 20 "LTE ");; + *) MODE="LTE B${T}";; + esac + T=$(echo "$O" | awk -F[,:] '/^\+ZCAINFO/ {print $8}' | xargs) + if [ -n "$T" ]; then + case $T in + *"1") MODE="${MODE/LTE/LTE_A} / "$(band 1 "");; + *"3") MODE="${MODE/LTE/LTE_A} / "$(band 3 "");; + *"7") MODE="${MODE/LTE/LTE_A} / "$(band 7 "");; + *"8") MODE="${MODE/LTE/LTE_A} / "$(band 8 "");; + *"20") MODE="{MODE/LTE/LTE_A} / "$(band 20 "");; + *) MODE="${MODE/LTE/LTE_A} / B${T}";; + esac + fi + ;; +esac + +T=$(echo "$O" | awk -F[,:] '/^\+ZDON/ {print $2}' | xargs) +if [ -n "$T" ]; then + COPS="$T" +fi diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/20202033 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/20202033 index 0ad7b457..c65ff1f2 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/20202033 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/20202033 @@ -33,7 +33,7 @@ if [ "x$MODE" = "xLTE" ]; then *"7") MODE=$(band 7 "LTE ");; *"8") MODE=$(band 8 "LTE ");; *"20") MODE=$(band 20 "LTE ");; - *) MODE="$T";; + *) MODE="LTE B${T}";; esac fi fi diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2c7c0306 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2c7c0306 index 6c819598..91dc3391 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2c7c0306 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2c7c0306 @@ -18,8 +18,7 @@ if [ -n "$T" ]; then *"LTE BAND 38") MODE=$(band 38 "LTE ");; *"LTE BAND 40") MODE=$(band 40 "LTE ");; *"LTE BAND 41") MODE=$(band 41 "LTE ");; - *) MODE=${T:-$MODE};; - *) MODE="$T";; + *) MODE="LTE B${T}";; esac T=$(echo "$O" | awk -F[,] '/^\+QCAINFO: "sss"/{print $4}') @@ -37,7 +36,7 @@ if [ -n "$T" ]; then *"LTE BAND 38") MODE="${MODE/LTE/LTE_A} / "$(band 38 "");; *"LTE BAND 40") MODE="${MODE/LTE/LTE_A} / "$(band 40 "");; *"LTE BAND 41") MODE="${MODE/LTE/LTE_A} / "$(band 41 "");; - *) MODE="${MODE/LTE/LTE_A} / $T";; + *) MODE="${MODE/LTE/LTE_A} / B${T}";; esac fi fi diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2cd20004 b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2cd20004 index 47eba63e..cbbe95f7 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2cd20004 +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo-addon/2cd20004 @@ -18,6 +18,7 @@ fi T=$(echo "$O" | awk -F[,:] '/^\+CESQ/ {print $6}' | xargs) if [ -n "$T" ]; then if [ "$T" != "255" ]; then + RSRQ="-'$T' dB" [ -n "$ADDON" ] && ADDON="$ADDON," ADDON="$ADDON"'{"RSRQ":"-'$T' dB"}' fi @@ -25,6 +26,7 @@ fi T=$(echo "$O" | awk -F[,:] '/^\+CESQ/ {print $7}' | xargs) if [ -n "$T" ]; then if [ "$T" != "255" ]; then + RSRP="-'$T' dBm" [ -n "$ADDON" ] && ADDON="$ADDON," ADDON="$ADDON"'{"RSRP":"-'$T' dBm"}' fi @@ -57,7 +59,7 @@ case "$MODE1" in *"7") MODE="$MODE / "$(band 7 "");; *"8") MODE="$MODE / "$(band 8 "");; *"20") MODE="$MODE / "$(band 20 "");; - *) MODE="$MODE / $T";; + *) MODE="$MODE / B${T}";; esac fi fi diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh index 507df302..6fd9b6ee 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/3ginfo.sh @@ -1,8 +1,8 @@ #!/bin/sh # -# (c) 2010-2021 Cezary Jackiewicz -# (c) 2021 modified by Rafał Wabik - IceG - From eko.one.pl forum +# (c) 2010-2022 Cezary Jackiewicz +# (c) 2021-2022 modified by Rafał Wabik - IceG - From eko.one.pl forum # band() {