diff --git a/luci/luci-app-qmodem/po/zh-cn/qmodem.po b/luci/luci-app-qmodem/po/zh-cn/qmodem.po index be25ea4..665460f 100644 --- a/luci/luci-app-qmodem/po/zh-cn/qmodem.po +++ b/luci/luci-app-qmodem/po/zh-cn/qmodem.po @@ -355,10 +355,10 @@ msgid "Access Maximum Bit Rate for Downlink" msgstr "下行链路最大比特率" msgid "Transmit Rate" -msgstr "传输速率" +msgstr "发送速率" msgid "Receive Rate" -msgstr "发送速率" +msgstr "接收速率" msgid "Network Mode" diff --git a/luci/luci-app-qmodem/po/zh_Hans/qmodem.po b/luci/luci-app-qmodem/po/zh_Hans/qmodem.po index be25ea4..665460f 100644 --- a/luci/luci-app-qmodem/po/zh_Hans/qmodem.po +++ b/luci/luci-app-qmodem/po/zh_Hans/qmodem.po @@ -355,10 +355,10 @@ msgid "Access Maximum Bit Rate for Downlink" msgstr "下行链路最大比特率" msgid "Transmit Rate" -msgstr "传输速率" +msgstr "发送速率" msgid "Receive Rate" -msgstr "发送速率" +msgstr "接收速率" msgid "Network Mode" diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/fibocom.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/fibocom.sh index 363b2a5..5428788 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/fibocom.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/fibocom.sh @@ -565,8 +565,10 @@ network_info() add_plain_info_entry "CQI DL" "$cqi_dl" "Channel Quality Indicator for Downlink" add_plain_info_entry "AMBR UL" "$ambr_ul" "Access Maximum Bit Rate for Uplink" add_plain_info_entry "AMBR DL" "$ambr_dl" "Access Maximum Bit Rate for Downlink" - add_plain_info_entry "Tx Rate" "$tx_rate B/s" "Transmit Rate" - add_plain_info_entry "Rx Rate" "$rx_rate B/s" "Receive Rate" + rx_rate=$(rate_convert $rx_rate) + tx_rate=$(rate_convert $tx_rate) + add_plain_info_entry "Tx Rate" "$tx_rate" "Transmit Rate" + add_plain_info_entry "Rx Rate" "$rx_rate" "Receive Rate" } get_lockband(){ diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/generic.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/generic.sh index 9b34a15..d93f513 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/generic.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/generic.sh @@ -347,3 +347,16 @@ get_reboot_caps() json_close_object json_dump } + +rate_convert() +{ + local rate=$1 + rate_units="bps Kbps Mbps Gbps" + for i in $(seq 0 3); do + if [ $rate -lt 1024 ]; then + break + fi + rate=$(($rate / 1024)) + done + echo "$rate `echo $rate_units | cut -d ' ' -f $(($i+1))`" +} diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/quectel.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/quectel.sh index c33b673..718f9c2 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/quectel.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/quectel.sh @@ -486,6 +486,8 @@ network_info() add_plain_info_entry "CQI DL" "$cqi_dl" "Channel Quality Indicator for Downlink" add_plain_info_entry "AMBR UL" "$ambr_ul" "Access Maximum Bit Rate for Uplink" add_plain_info_entry "AMBR DL" "$ambr_dl" "Access Maximum Bit Rate for Downlink" + rx_rate=$(rate_convert $rx_rate) + tx_rate=$(rate_convert $tx_rate) add_plain_info_entry "Tx Rate" "$tx_rate" "Transmit Rate" add_plain_info_entry "Rx Rate" "$rx_rate" "Receive Rate" }