diff --git a/luci-app-3ginfo-lite/Makefile b/luci-app-3ginfo-lite/Makefile index a82f1a2e..2eff6bac 100644 --- a/luci-app-3ginfo-lite/Makefile +++ b/luci-app-3ginfo-lite/Makefile @@ -12,7 +12,7 @@ MAINTAINER:=RafaƂ Wabik <4Rafal@gmail.com> LUCI_DESCRIPTION:=LuCI JS interface for the 3ginfo-lite. The package allows you to view the parameters of the mobile internet connection. LUCI_DEPENDS:=+sms-tool +comgt +kmod-usb-serial-option LUCI_PKGARCH:=all -PKG_VERSION:=1.0.68-20240422 +PKG_VERSION:=1.0.69-20240427 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 215810ff..4d252b4b 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 @@ -932,7 +932,7 @@ simDialog: baseclass.extend({ 'class': 'ifacebadge', 'title': null, 'id': 'simv', - 'style': 'visibility: hidden; max-width:3em; display: inline-block;', + 'style': 'visibility: hidden; margin:0 auto; padding: 4px;', 'click': ui.createHandlerFn(this, function() { return upSIMDialog.show(); }), @@ -942,7 +942,7 @@ simDialog: baseclass.extend({ E('div', { 'class': 'cbi-tooltip-container' }, [ E('img', { 'src': L.resource('icons/sim1m.png'), - 'style': 'width:24px; height:auto; padding: 0px', + 'style': 'width:24px; height:auto; padding: 1%; margin:0 auto;', 'title': _(''), 'class': 'middle', }), diff --git a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/hilink/huawei_hilink.sh b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/hilink/huawei_hilink.sh index 9019c2ae..9797ecc2 100644 --- a/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/hilink/huawei_hilink.sh +++ b/luci-app-3ginfo-lite/root/usr/share/3ginfo-lite/modem/hilink/huawei_hilink.sh @@ -49,16 +49,16 @@ PV=$(cat /sys/kernel/debug/usb/devices) PVCUT=$(echo $PV | awk -F 'Vendor=12d1 ProdID=' '{print $2}' | cut -c-1108) if echo "$PVCUT" | grep -q "Driver=qmi_wwan" then - PROTO="QMI" + PROTO="qmi" elif echo "$PVCUT" | grep -q "Driver=cdc_mbim" then - PROTO="MBIM" + PROTO="mbim" elif echo "$PVCUT" | grep -q "Driver=cdc_ether" then - PROTO="ECM" + PROTO="ecm" elif echo "$PVCUT" | grep -q "Driver=huawei_cdc_ncm" then - PROTO="NCM" + PROTO="ncm" fi RSSI=$(getvalue device-signal rssi) @@ -159,6 +159,16 @@ if [ -n "$FW" ]; then FW="$rev / $FW" fi +if [ -z "$FW" ] +then + FW='-' +fi + +if [ -z "$TEMP" ] +then + TEMP='-' +fi + COPSA=$(getvaluen net-current-plmn Numeric) COPSB=$(echo "${COPSA}" | cut -c1-3) COPSC=$(echo -n $COPSA | tail -c 2) @@ -167,9 +177,12 @@ COPS_MNC="$COPSC" COPS=$(getvalue net-current-plmn ShortName) -if [[ -n "$COPS" ]]; then - COPS=$(awk -F[\;] '/^'$COPS';/ {print $3}' $RES/mccmnc.dat) - LOC=$(awk -F[\;] '/^'$COPS';/ {print $2}' $RES/mccmnc.dat) +if [[ $COPSA =~ ^[0-9]+$ ]]; then + if [ -z "$COPS" ] + then + COPS=$(awk -F[\;] '/^'$COPSA';/ {print $3}' $RES/mccmnc.dat | xargs) + fi + LOC=$(awk -F[\;] '/^'$COPSA';/ {print $2}' $RES/mccmnc.dat) fi # operator location from temporary config @@ -179,15 +192,27 @@ if [ -e "$LOCATIONFILE" ]; then LOC=$(cat $LOCATIONFILE) if [ -n "$LOC" ]; then LOC=$(cat $LOCATIONFILE) - else - echo "-" > /tmp/location + if [[ $LOC == "-" ]]; then + rm $LOCATIONFILE + LOC=$(awk -F[\;] '/^'$COPSA';/ {print $2}' $RES/mccmnc.dat) + if [ -n "$LOC" ]; then + echo "$LOC" > /tmp/location + fi + else + LOC=$(awk -F[\;] '/^'$COPSA';/ {print $2}' $RES/mccmnc.dat) + if [ -n "$LOC" ]; then + echo "$LOC" > /tmp/location + fi + fi fi else - LOC=$(awk -F[\;] '/^'$COPS_NUM';/ {print $2}' $RES/mccmnc.dat) - if [ -n "$LOC" ]; then - echo "$LOC" > /tmp/location - else - echo "-" > /tmp/location + if [[ "$COPS_MCC$COPS_MNC" =~ ^[0-9]+$ ]]; then + if [ -n "$LOC" ]; then + LOC=$(awk -F[\;] '/^'$COPS_MCC$COPS_MNC';/ {print $2}' $RES/mccmnc.dat) + echo "$LOC" > /tmp/location + else + echo "-" > /tmp/location + fi fi fi @@ -213,6 +238,11 @@ then CID_HEX='-' fi +if [ -z "$CID_DEC" ] +then + [ -n "$CID_HEX" ] && CID_DEC=$(echo $((0x$CID_HEX))) +fi + rm $cookie break