From 70b49ee1852823d2b3f735a6a213fc23eac0b1ae Mon Sep 17 00:00:00 2001 From: ling <1042585959@qq.com> Date: Thu, 11 Apr 2024 10:30:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=9F=AD=E4=BF=A1=E5=B7=A5?= =?UTF-8?q?=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luci-app-modem/Makefile | 1 + luci-app-sms-tool/Makefile | 10 +- .../luci-static/resources/icons/delsms.png | Bin 1365 -> 9221 bytes .../luci-static/resources/icons/delsms2.png | Bin 0 -> 1365 bytes .../luasrc/controller/modem/sms.lua | 90 ++++-- .../luasrc/model/cbi/modem/smsconfig.lua | 83 ++++-- .../luasrc/view/modem/atcommands.htm | 31 +- .../luasrc/view/modem/readsms.htm | 109 +++---- .../luasrc/view/modem/sendsms.htm | 60 ++-- luci-app-sms-tool/luasrc/view/modem/ussd.htm | 265 ++++++++++++++++++ luci-app-sms-tool/root/etc/config/atcmds.user | 43 ++- .../root/etc/config/phonebook.user | 2 +- 12 files changed, 518 insertions(+), 176 deletions(-) create mode 100644 luci-app-sms-tool/htdocs/luci-static/resources/icons/delsms2.png create mode 100644 luci-app-sms-tool/luasrc/view/modem/ussd.htm diff --git a/luci-app-modem/Makefile b/luci-app-modem/Makefile index 44ef8a0..da6e3a3 100644 --- a/luci-app-modem/Makefile +++ b/luci-app-modem/Makefile @@ -1,3 +1,4 @@ +# Copyright (C) 2023 Siriling # This is free software, licensed under the GNU General Public License v3. include $(TOPDIR)/rules.mk diff --git a/luci-app-sms-tool/Makefile b/luci-app-sms-tool/Makefile index a62f924..db9d2a2 100644 --- a/luci-app-sms-tool/Makefile +++ b/luci-app-sms-tool/Makefile @@ -1,14 +1,16 @@ -# Copyright 2020-2021 Rafał Wabik - IceG - From eko.one.pl forum -# Licensed to the GNU General Public License v3.0. +# Copyright (C) 2023 Siriling +# This is free software, licensed under the GNU General Public License v3. include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-sms-tool LUCI_TITLE:=LuCI Support for sms_tool LUCI_PKGARCH:=all -LUCI_DEPENDS:=+sms-tool +kmod-usb-serial +kmod-usb-serial-option +luci-compat -PKG_VERSION:=1.9.2-20211018 +PKG_VERSION:=1.0.0 PKG_LICENSE:=GPLv3 +PKG_LINCESE_FILES:=LICENSE +PKF_MAINTAINER:=siriling +LUCI_DEPENDS:=+sms-tool +luci-compat +kmod-usb-serial +kmod-usb-serial-option define Package/luci-app-sms-tool/postinst #!/bin/sh diff --git a/luci-app-sms-tool/htdocs/luci-static/resources/icons/delsms.png b/luci-app-sms-tool/htdocs/luci-static/resources/icons/delsms.png index eeb13c5e674a1a826e0f8f0fdb809834922e1d3c..b036e813f546c56ad0e934e1c7ec9ee359f469b4 100644 GIT binary patch delta 9203 zcmVaB^>EX>4U6ba`-PAZ2)IW&i+q+O3;cc4WD7 zMgK7h4FTQ^2X-yZK*QHQK$69(?v|cRu}LP=;9ejijtQX6{*Qk@=HK{NT(l;pQgh4M z@-Md7eCI*6?_a+^osIYB`{V01_xtna`vuQaf#2c%S@Y-l&42Tr_xsQD^D|E8`SfF; zwm&b7-(TpTfqea3;Pd>~g@St*u7x25F9oGIs{F&6(RPH0* zH?&&!Q<<+~vmps95A@aes+7efmzJG&@HJg?o=_ea-G6f39k=iA=_a=r{q}|5-cLhx z^<*U&&Cj6VMt!;C3jtn)+J{L>1fKQZ_u}ql+r8YR%$Bjs@mB8`Ou6#E{xbjS8_%r? z=WP96EAGoH>$nT+2)};uHX`EAXHnB#;IFSg|0%A42&TKtl?iq`%o}1P_ba)=4Rqj* ziQlh?U4L1h0azj~owyknh=9%1jmz9o@xD06LRJFQxpg0+A4I^VXUy@1BM}*kU|cH*ieE5E5=0rlvv53oB`J8C>z%GVH1aFP@=BIctb;Dx9WF%nxbv(?4u6*Vg zKNIVGHylOJzU4ZTh+8jyezVYAz4K_zMN|@aUK#Jc65gNIq(0Y*;jF?!4Q3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1j$pd}dyCPobkCVRdu9gy<0T(% ztqRI#Ag_WA0*}rZLI@av0|EqKK!Sh%Oh`S9B4{6lAWhmXfAsG1H}A*?+p8BLz6}5h zfdNj?5_CQAgg}9=2W$`m$OyUL50EL5WI(v}=lFa!k8#b&h%kbV;D}%!=N|MFvr%SZ z1$_)*0g)j>MhFDu(Z!>2_9*?2hQ}en1ZNw^3BaQQ$E>b1QN>YqPa|BiON{|9nAqgZlP|hQa5NR+oa_0uLgdAdi8v`!nS9pEt z8Yo26{9}$nrk@BUjE^@iaTHrLY=bPJM1KQ!0>fj10VUvX+u*PJn^mT80-qz0WBpYW z3*%n9MM~8ki3uv1)(hF(@aTVV_AsCe*y1bRyR*s!XamZOTmUN7tPL;_7y^q48ms0G z_D~s6ypX$MI0XwkCRiQ4&0EiY@=yhJ`PU~nUN!mkc$g}VtuA1;LF`L?*G&h z7#1x~!NZPano6TIWNB!lWixgdD@bp#5TUq}&8xyw=XlgBKYi|bR0MyETFu^j$$>;o zDxoCFOnjf8cfq{MR|)Dqn)AFs0;zheUM2tk8cLf-h{ znHM9vo6bJQ4hBpN?zC_aoOo!TsewH6z+;6c8yKW|t~`!1qLkrsCK3=xj8F=}E(3w3 zVeg))baSmjr$oJ@GN69}!XhvNX~L=XCxBuO7xKxF}; z>3fn&7Icr9hAgs(kPzrAs9;?H0000< KMNUMnLSTYs{5O#R diff --git a/luci-app-sms-tool/htdocs/luci-static/resources/icons/delsms2.png b/luci-app-sms-tool/htdocs/luci-static/resources/icons/delsms2.png new file mode 100644 index 0000000000000000000000000000000000000000..eeb13c5e674a1a826e0f8f0fdb809834922e1d3c GIT binary patch literal 1365 zcmV-b1*-aqP)EX>4Tx04R}tkv&MmKpe$iQ>7}k4(*`gkfAzR5EXHhDi*;)X)CnqU~=gfG-*gu zTpR`0f`cE6RRbkxtGNhls^O2g@DIiiS!&O&nHKjq-(z z!wTmu&T6^JTKD8H^yjpd6xV5vAciHxk$?ypRg_SMg$S)0DJGJ%A9e8$H~k56$>b`5 zkz)ZBsF0d|@IUz7t(l*ibdvm0p!>zPKSlxHF3_mi_V=-EH%AO zt%Z+(foN9LZ_VkgwU5&WAWdB@-v9@P zz*vE@*InM-)7jg_CX>@2HM@dakSAh-}0009lNkl3);i_xxh&zU`YW(NM_B_D3B3d(07uYwH%kIooE2pE9_0t8?{g8ocMJ&Yn~AB7-I z+Ae?e?(#S9$Oqf27a_h401ANtPS6r`J@AA;fvyK^5CX^ux!(_vDUoDAxb^4wd^V49 z&B%x_f{x&bU?1lm^c1sEW?}_>3}FG0Awot71m)4iqjB~q{f~ynA;AP^8^;O2qXNgQ zt}{`^QFc&vka!A}5rQKmif3{uPKfou2ROI!sA^kJ;By33^-7QeR3Ql@Hc-wZj1Xxs zGjit!w1gaDej5WWf&nGq zZ`N!m zkc$g}VtuA1;LF`L?*G&h7#1x~!NZPano6TIWNB!lWixgdD@bp#5TUq}&8xyw=XlgB zKYi|bR0NA!&E9*-fkaIzp(M#ne4n3p!Mw^>3FC9L4#RB-uU5}7bCix&OXKt222d@v~Uodcxa!gfjslTV}&Oh7^HfxJdQG= zl;LtF5)ep?Pzu2=1A(Ps@1Ci2bFD(BM7^UjpaH@nFal}FSt1LXAb~U}=O932w^k`9 z!Q(^^`j;e0A6Y8c{jZI{c~S{y%ZFJ zZteQY=9RNdw0vsBiB64t4fN_+N2Z=4sEU3nqE|j&`6JFskRLFn*FkQqzwle|{{sF2 XGLww0Jg8t@00000NkvXXu0mjfu%1_o literal 0 HcmV?d00001 diff --git a/luci-app-sms-tool/luasrc/controller/modem/sms.lua b/luci-app-sms-tool/luasrc/controller/modem/sms.lua index 4d4ba24..f807e9e 100644 --- a/luci-app-sms-tool/luasrc/controller/modem/sms.lua +++ b/luci-app-sms-tool/luasrc/controller/modem/sms.lua @@ -1,7 +1,3 @@ --- Copyright 2020-2021 Rafa Wabik (IceG) - From eko.one.pl forum --- Licensed to the GNU General Public License v3.0. - - local util = require "luci.util" local fs = require "nixio.fs" local sys = require "luci.sys" @@ -14,19 +10,23 @@ module("luci.controller.modem.sms", package.seeall) function index() - entry({"admin", "services", "sms"}, alias("admin", "services", "sms", "readsms"), translate("SMS Messages"), 20).acl_depends={ "luci-app-sms-tool" } - entry({"admin", "services", "sms", "readsms"},template("modem/readsms"),translate("Received Messages"), 10) - entry({"admin", "services", "sms", "sendsms"},template("modem/sendsms"),translate("Send Messages"), 20) - entry({"admin", "services", "sms", "atcommands"},template("modem/atcommands"),translate("AT Commands"), 40) - entry({"admin", "services", "sms", "smsconfig"},cbi("modem/smsconfig"),translate("Configuration"), 50) - entry({"admin", "services", "sms", "delete_one"}, call("delete_sms", smsindex), nil).leaf = true - entry({"admin", "services", "sms", "delete_all"}, call("delete_all_sms"), nil).leaf = true - entry({"admin", "services", "sms", "run_at"}, call("at"), nil).leaf = true - entry({"admin", "services", "sms", "run_sms"}, call("sms"), nil).leaf = true - entry({"admin", "services", "sms", "readsim"}, call("slots"), nil).leaf = true - entry({"admin", "services", "sms", "countsms"}, call("count_sms"), nil).leaf = true - entry({"admin", "services", "sms", "user_atc"}, call("useratc"), nil).leaf = true - entry({"admin", "services", "sms", "user_phonebook"}, call("userphb"), nil).leaf = true + entry({"admin", "modem"}, firstchild(), "Modem", 30).dependent=false + entry({"admin", "modem", "sms"}, alias("admin", "modem", "sms", "readsms"), translate("短信"), 20) + entry({"admin", "modem", "sms", "readsms"},template("modem/readsms"),translate("收到的信息"), 10) + entry({"admin", "modem", "sms", "sendsms"},template("modem/sendsms"),translate("发送消息"), 20) + entry({"admin", "modem", "sms", "ussd"},template("modem/ussd"),translate("USSD 代码"), 30) + entry({"admin", "modem", "sms", "atcommands"},template("modem/atcommands"),translate("AT 命令"), 40) + entry({"admin", "modem", "sms", "smsconfig"},cbi("modem/smsconfig"),translate("配置"), 50) + entry({"admin", "modem", "sms", "delete_one"}, call("delete_sms", smsindex), nil).leaf = true + entry({"admin", "modem", "sms", "delete_all"}, call("delete_all_sms"), nil).leaf = true + entry({"admin", "modem", "sms", "run_ussd"}, call("ussd"), nil).leaf = true + entry({"admin", "modem", "sms", "run_at"}, call("at"), nil).leaf = true + entry({"admin", "modem", "sms", "run_sms"}, call("sms"), nil).leaf = true + entry({"admin", "modem", "sms", "readsim"}, call("slots"), nil).leaf = true + entry({"admin", "modem", "sms", "countsms"}, call("count_sms"), nil).leaf = true + entry({"admin", "modem", "sms", "user_ussd"}, call("userussd"), nil).leaf = true + entry({"admin", "modem", "sms", "user_atc"}, call("useratc"), nil).leaf = true + entry({"admin", "modem", "sms", "user_phonebook"}, call("userphb"), nil).leaf = true end @@ -43,6 +43,15 @@ function delete_all_sms() os.execute("sms_tool -d " .. devv .. " delete all") end +function get_ussd() + local cursor = luci.model.uci.cursor() + if cursor:get("sms_tool", "general", "ussd") == "1" then + return " -R" + else + return "" + end +end + function get_pdu() local cursor = luci.model.uci.cursor() @@ -54,6 +63,24 @@ function get_pdu() end +function ussd() + local devv = tostring(uci:get("sms_tool", "general", "ussdport")) + + local ussd = get_ussd() + local pdu = get_pdu() + + local ussd_code = http.formvalue("code") + if ussd_code then + local odpall = io.popen("sms_tool -d " .. devv .. ussd .. pdu .. " ussd " .. ussd_code .." 2>&1") + local odp = odpall:read("*a") + odpall:close() + http.write(tostring(odp)) + else + http.write_json(http.formvalue()) + end +end + + function at() local devv = tostring(uci:get("sms_tool", "general", "atport")) @@ -99,7 +126,7 @@ function slots() local statusb = luci.util.exec("sms_tool -s" .. smsmem .. " -d ".. devv .. " status") local usex = string.sub (statusb, 23, 27) - local max = string.sub (statusb, -4) + local max = statusb:match('[^: ]+$') sim["use"] = string.match(usex, '%d+') local smscount = string.match(usex, '%d+') if ln == "1" then @@ -133,6 +160,33 @@ function count_sms() end +function uussd(rv) + local c = nixio.fs.access("/etc/config/ussd.user") and + io.popen("cat /etc/config/ussd.user") + + if c then + for l in c:lines() do + local i = l + if i then + rv[#rv + 1] = { + usd = i + } + end + end + c:close() + end +end + + + +function userussd() + local usd = { } + uussd(usd) + luci.http.prepare_content("application/json") + luci.http.write_json(usd) +end + + function uat(rv) local c = nixio.fs.access("/etc/config/atcmds.user") and io.popen("cat /etc/config/atcmds.user") diff --git a/luci-app-sms-tool/luasrc/model/cbi/modem/smsconfig.lua b/luci-app-sms-tool/luasrc/model/cbi/modem/smsconfig.lua index 57a102f..dc756e5 100644 --- a/luci-app-sms-tool/luasrc/model/cbi/modem/smsconfig.lua +++ b/luci-app-sms-tool/luasrc/model/cbi/modem/smsconfig.lua @@ -1,6 +1,3 @@ --- Copyright 2020-2021 Rafa Wabik (IceG) - From eko.one.pl forum --- Licensed to the GNU General Public License v3.0. - local util = require "luci.util" local fs = require "nixio.fs" local sys = require "luci.sys" @@ -10,6 +7,7 @@ local http = require "luci.http" local sys = require "luci.sys" local uci = require "luci.model.uci".cursor() +local USSD_FILE_PATH = "/etc/config/ussd.user" local PHB_FILE_PATH = "/etc/config/phonebook.user" local SMSC_FILE_PATH = "/etc/config/smscommands.user" local AT_FILE_PATH = "/etc/config/atcmds.user" @@ -38,18 +36,19 @@ local smsnum = string.sub (statusb, 23, 27) local smscount = string.match(smsnum, '%d+') -m = Map("sms_tool", translate("Configuration sms-tool"), - translate("Configuration panel for sms_tool and gui application.")) +m = Map("sms_tool", translate("配置短信工具"), + translate("sms_tool和gui应用程序的配置面板。")) -s = m:section(NamedSection, 'general' , "sms_tool" , "

 

" .. translate("")) +s = m:section(NamedSection, 'general' , "sms_tool" , "" .. translate("")) s.anonymous = true -s:tab("sms", translate("SMS Settings")) -s:tab("at", translate("AT Commands Settings")) -s:tab("info", translate("Notification Settings")) +s:tab("sms", translate("SMS 设置")) +s:tab("ussd", translate("USSD 代码设置")) +s:tab("at", translate("AT 命令设置")) +s:tab("info", translate("通知设置")) this_tab = "sms" -dev1 = s:taboption(this_tab, Value, "readport", translate("SMS Reading Port")) +dev1 = s:taboption(this_tab, Value, "readport", translate("短信读取端口")) if try_devices1 then local node for node in try_devices1 do @@ -57,16 +56,16 @@ dev1:value(node, node) end end -mem = s:taboption(this_tab, ListValue, "storage", translate("Message storage area"), translate("Messages are stored in a specific location (for example, on the SIM card or modem memory), but other areas may also be available depending on the type of device.")) +mem = s:taboption(this_tab, ListValue, "storage", translate("信息存储区"), translate("信息存储在一个特定的位置(例如,在SIM卡或调制解调器内存),但根据设备的类型,其他区域也可能是可用的。")) mem.default = "SM" -mem:value("SM", translate("SIM card")) -mem:value("ME", translate("Modem memory")) +mem:value("SM", translate("SIM 卡")) +mem:value("ME", translate("调制解调器内存")) mem.rmempty = true -local msm = s:taboption(this_tab, Flag, "mergesms", translate("Merge split messages"), translate("Checking this option will make it easier to read the messages, but it will cause a discrepancy in the number of messages shown and received.")) +local msm = s:taboption(this_tab, Flag, "mergesms", translate("合并分割的信息"), translate("勾选这个选项会使阅读信息更容易,但会导致显示和接收的信息数量不一致。")) msm.rmempty = false -dev2 = s:taboption(this_tab, Value, "sendport", translate("SMS Sending Port")) +dev2 = s:taboption(this_tab, Value, "sendport", translate("短信发送端口")) if try_devices2 then local node for node in try_devices2 do @@ -74,18 +73,18 @@ dev2:value(node, node) end end -local t = s:taboption(this_tab, Value, "pnumber", translate("Prefix Number"), translate("The phone number should be preceded by the country prefix (for Poland it is 48, without '+'). If the number is 5, 4 or 3 characters, it is treated as 'short' and should not be preceded by a country prefix.")) +local t = s:taboption(this_tab, Value, "pnumber", translate("前缀号码"), translate("电话号码的前面应该有国家的前缀(波兰是48,没有'+')。如果号码是5个、4个或3个字符,它将被视为 '短',不应该在前面加上国家前缀。")) t.rmempty = true t.default = 48 -local f = s:taboption(this_tab, Flag, "prefix", translate("Add Prefix to Phone Number"), translate("Automatically add prefix to the phone number field.")) +local f = s:taboption(this_tab, Flag, "prefix", translate("为电话号码添加前缀"), translate("自动添加电话号码字段的前缀。")) f.rmempty = false -local i = s:taboption(this_tab, Flag, "information", translate("Explanation of number and prefix"), translate("In the tab for sending SMSes, show an explanation of the prefix and the correct phone number.")) +local i = s:taboption(this_tab, Flag, "information", translate("号码和前缀的解释"), translate("在发送短信的标签中,显示前缀的解释和正确的电话号码。")) i.rmempty = false -local ta = s:taboption(this_tab, TextValue, "user_phonebook", translate("User Phonebook"), translate("Each line must have the following format: 'Contact name;Phone number'. Save to file '/etc/config/phonebook.user'.")) +local ta = s:taboption(this_tab, TextValue, "user_phonebook", translate("用户电话簿"), translate("每一行必须有以下格式。'联系人姓名;电话号码'。保存到文件'/etc/config/phonebook.user'。")) ta.rows = 7 ta.rmempty = false @@ -98,10 +97,38 @@ function ta.write(self, section, value) fs.writefile(PHB_FILE_PATH, value) end +this_taba = "ussd" + +dev3 = s:taboption(this_taba, Value, "ussdport", translate("USSD发送端口")) +if try_devices3 then +local node +for node in try_devices3 do +dev3:value(node, node) +end +end + +local u = s:taboption(this_taba, Flag, "ussd", translate("以纯文本发送USSD代码"), translate("以纯文本发送USSD代码。命令没有被编码到PDU中。")) +u.rmempty = false + +local p = s:taboption(this_taba, Flag, "pdu", translate("接收没有PDU解码的信息"), translate("接收并显示消息,而不将其解码为PDU。")) +p.rmempty = false + +local tb = s:taboption(this_taba, TextValue, "user_ussd", translate("用户USSD代码"), translate("每一行必须有以下格式。'代码名称;代码'。保存到文件'/etc/config/ussd.user'。")) +tb.rows = 7 +tb.rmempty = true + +function tb.cfgvalue(self, section) + return fs.readfile(USSD_FILE_PATH) +end + +function tb.write(self, section, value) + value = value:gsub("\r\n", "\n") + fs.writefile(USSD_FILE_PATH, value) +end this_tabc = "at" -dev4 = s:taboption(this_tabc, Value, "atport", translate("AT Commands Sending Port")) +dev4 = s:taboption(this_tabc, Value, "atport", translate("AT命令的发送端口")) if try_devices4 then local node for node in try_devices4 do @@ -109,7 +136,7 @@ dev4:value(node, node) end end -local tat = s:taboption(this_tabc, TextValue, "user_at", translate("User AT Commands"), translate("Each line must have the following format: 'AT Command name;AT Command'. Save to file '/etc/config/atcmds.user'.")) +local tat = s:taboption(this_tabc, TextValue, "user_at", translate("用户AT命令"), translate("每一行必须有以下格式。'AT命令名称;AT命令'。保存到文件'/etc/config/atcmds.user'。")) tat.rows = 20 tat.rmempty = true @@ -124,7 +151,7 @@ end this_tabb = "info" -local uw = s:taboption(this_tabb, Flag, "lednotify", translate("Notify new messages"), translate("The LED informs about a new message. Before activating this function, please config and save the SMS reading port, time to check SMS inbox and select the notification LED.")) +local uw = s:taboption(this_tabb, Flag, "lednotify", translate("通知新消息"), translate("LED通知有新的信息。在激活这个功能之前,请配置并保存短信阅读端口,检查短信收件箱的时间,并选择通知LED。")) uw.rmempty = false function uw.write(self, section, value) @@ -149,7 +176,7 @@ return Flag.write(self, section ,value) end end -local time = s:taboption(this_tabb, Value, "checktime", translate("Check inbox every minute(s)"), translate("Specify how many minutes you want your inbox to be checked.")) +local time = s:taboption(this_tabb, Value, "checktime", translate("每(几)分钟检查一次收件箱"), translate("指定你想在多少分钟内检查你的收件箱。")) time.rmempty = false time.maxlength = 2 time.default = 5 @@ -160,7 +187,7 @@ function time.validate(self, value) end end -sync = s:taboption(this_tabb, ListValue, "prestart", translate("Restart the inbox checking process every"), translate("The process will restart at the selected time interval. This will eliminate the delay in checking your inbox.")) +sync = s:taboption(this_tabb, ListValue, "prestart", translate("每隔一段时间重新启动收件箱检查程序"), translate("该过程将在选定的时间间隔内重新启动。这将消除检查收件箱的延迟。")) sync.default = "6" sync:value("4", translate("4h")) sync:value("6", translate("6h")) @@ -169,7 +196,7 @@ sync:value("12", translate("12h")) sync.rmempty = true -leds = s:taboption(this_tabb, Value, "smsled", translate("Notification LED"), translate("Select the notification LED.")) +leds = s:taboption(this_tabb, Value, "smsled", translate("通知LED"), translate("选择通知LED。")) if try_leds then local node local status @@ -180,18 +207,18 @@ leds:value(all, all) end end -oled = s:taboption(this_tabb, ListValue, "ledtype", translate("The diode is dedicated only to these notifications"), translate("Select 'No' in case the router has only one LED or if the LED is multi-tasking.")) +oled = s:taboption(this_tabb, ListValue, "ledtype", translate("该二极管只专门用于这些通知"), translate("如果路由器只有一个LED,或者LED是多任务的,就选'No'。")) oled.default = "D" oled:value("S", translate("No")) oled:value("D", translate("Yes")) oled.rmempty = true -local timeon = s:taboption(this_tabb, Value, "ledtimeon", translate("Turn on the LED for seconds(s)"), translate("Specify for how long the LED should be on.")) +local timeon = s:taboption(this_tabb, Value, "ledtimeon", translate("每(几)秒打开LED灯"), translate("指定LED应该亮多长时间。")) timeon.rmempty = false timeon.maxlength = 3 timeon.default = 1 -local timeoff = s:taboption(this_tabb, Value, "ledtimeoff", translate("Turn off the LED for seconds(s)"), translate("Specify for how long the LED should be off.")) +local timeoff = s:taboption(this_tabb, Value, "ledtimeoff", translate("每(几)秒关闭LED灯"), translate("指定LED应该关闭多长时间。")) timeoff.rmempty = false timeoff.maxlength = 3 timeoff.default = 5 diff --git a/luci-app-sms-tool/luasrc/view/modem/atcommands.htm b/luci-app-sms-tool/luasrc/view/modem/atcommands.htm index 1e206c1..3510d8b 100644 --- a/luci-app-sms-tool/luasrc/view/modem/atcommands.htm +++ b/luci-app-sms-tool/luasrc/view/modem/atcommands.htm @@ -1,41 +1,41 @@ <%+header%> -

<%:AT Commands%>

-
<%:Web UI for handling AT commands via sms_tool.%>
+

<%:AT 命令%>

+
<%:通过sms_tool处理AT命令的Web用户界面。关于sms-tool的更多信息,请见%> <%:eko.one.pl 论坛%>.

-


+

<%:向调制解调器发送命令%>

-
<%:User AT Commands%>:
+
<%:用户AT命令%>:
-
+
-
+
-
<%:Command to send%>:
-
+
<%:要发送的命令%>:
+
-
<%:Reply%>: +
<%:回复%>:

-

+
-
+
@@ -45,7 +45,7 @@ window.onload = function readUSER() { - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "sms", "user_atc")%>', null, + XHR.get('<%=luci.dispatcher.build_url("admin", "modem", "sms", "user_atc")%>', null, function(x, json) { select = document.getElementById('pl'); @@ -55,8 +55,7 @@ window.onload = function readUSER() { for(var d=0;d<=count;d++) { - var opt = document.createElement('option'); - + var opt = document.createElement('option'); var s = json[d].atu; var fields = s.split(/;/); var name = fields[0]; @@ -86,7 +85,7 @@ function copyFunction() { function postcmd(cmd) { - (new XHR()).post("<%=luci.dispatcher.build_url("admin", "services", "sms", "run_at")%>", {"code":cmd}, function(x) { + (new XHR()).post("<%=luci.dispatcher.build_url("admin", "modem", "sms", "run_at")%>", {"code":cmd}, function(x) { console.log(x.response) console.log(x) diff --git a/luci-app-sms-tool/luasrc/view/modem/readsms.htm b/luci-app-sms-tool/luasrc/view/modem/readsms.htm index a066003..dc8245e 100644 --- a/luci-app-sms-tool/luasrc/view/modem/readsms.htm +++ b/luci-app-sms-tool/luasrc/view/modem/readsms.htm @@ -7,31 +7,27 @@ local uci = require "luci.model.uci".cursor() local devv = tostring(uci:get("sms_tool", "general", "readport")) - local smsmem = tostring(uci:get("sms_tool", "general", "storage")) - - local sms = tostring(luci.sys.exec("sms_tool -s" .. smsmem .. " -d " .. devv .. " -f '%Y-%m-%d %H:%M:%S' -j recv 2>/dev/null")) + local sms = tostring(luci.sys.exec("sms_tool -s" .. smsmem .. " -d " .. devv .. " -f '%Y-%m-%d %H:%M' -j recv 2>/dev/null")) local smsmer = tostring(uci:get("sms_tool", "general", "mergesms")) local smscuta = string.sub (sms, 8) local smscut = smscuta:sub(1, #smscuta - 2) local statusb = luci.util.exec("sms_tool -s" .. smsmem .. " -d ".. devv .. " status") - local all = string.sub (statusb, -4) + local all = statusb:match('[^: ]+$') local location = "" local l = string.sub (statusb, 15, 16) if l == "SM" then location = translate("SIM card") end - if l == "ME" then location = translate("Modem memory") end - -%> - + <%+header%> @@ -40,26 +36,24 @@ table { border-collapse: collapse; width: 100%; - } th, td { - border-bottom: 1px solid #ddd; + border-bottom: 1px solid var(--border-color-medium); font-size: 12px; padding: 10px; text-align: justify; display: table-cell; vertical-align: top; - } td input[type="checkbox"] { float: left; margin: 0 auto; - width: 50%; + width: 40%; } -tr:nth-child(odd) {background-color: #f5f5f5;} +tr:nth-child(odd) {background-color: var(--background-color-medium)} @@ -67,29 +61,23 @@ tr:nth-child(odd) {background-color: #f5f5f5;} window.onload = function readSMS() { - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "sms", "readsim")%>', null, + XHR.get('<%=luci.dispatcher.build_url("admin", "modem", "sms", "readsim")%>', null, function(x, sim) { var vn = parseInt(sim.use) || 0; var mn = parseInt(sim.all) || 100; var pc = Math.floor((100 / mn) * vn); document.getElementById('usse').innerHTML=sim.use + " / " + sim.all + " " + '('+ pc + '%)'; - } ); - var msgm = <%=smsmer%>; if ( msgm == "0" ) { var array = <%=smscut%>; - var sortedData = array .sort((function (a, b) { return new Date(b.timestamp) - new Date(a.timestamp) })); - var table = document.getElementById("smsTable"); - var data = JSON.stringify(sortedData); - var json = JSON.parse(data); var x = <%=all%>; @@ -100,13 +88,10 @@ tr:nth-child(odd) {background-color: #f5f5f5;} var cell2 = row.insertCell(0); var cell3 = row.insertCell(0); var cell4 = row.insertCell(0); - cell4.innerHTML = "" cell3.innerHTML = json[d].sender; cell2.innerHTML = json[d].timestamp; - cell1.innerHTML = json[d].content; - - + cell1.innerHTML = json[d].content; } } @@ -120,20 +105,31 @@ tr:nth-child(odd) {background-color: #f5f5f5;} result = []; MergeMySMS.forEach(function (o) { - if (!this[o.timestamp] && !this[o.sender]) { - this[o.timestamp] = { index: o.index, sender: o.sender, timestamp: o.timestamp, content: o.content }; - result.push(this[o.timestamp]); + if (!this[o.sender]) { + if(o.part > 0){ + this[o.sender] = { index: o.index, sender: o.sender, timestamp: o.timestamp, part: o.part, total: o.total, content: o.content, contentparts: [] }; + this[o.sender].contentparts[o.part] = o.content; + }else{ + this[o.sender] = { index: o.index, sender: o.sender, timestamp: o.timestamp, part: o.part, total: o.total, content: o.content}; + } + result.push(this[o.sender]); return; } - if (this[o.timestamp].sender == o.sender) { - this[o.timestamp].content += o.content; - this[o.timestamp].index += '-' + o.index;} + if (this[o.sender].total == o.total && this[o.sender].timestamp == o.timestamp && this[o.sender].sender == o.sender && this[o.sender].part > 0) { + this[o.sender].index += '-' + o.index; + this[o.sender].contentparts[o.part] = o.content;} else { - this[o.timestamp] = { index: o.index, sender: o.sender, timestamp: o.timestamp, content: o.content }; - result.push(this[o.timestamp]); + this[o.sender] = { index: o.index, sender: o.sender, timestamp: o.timestamp, part: o.part, total: o.total, content: o.content }; + result.push(this[o.sender]); return; } }, Object.create(null)); + result.forEach(function(o) { + if(o.contentparts){ + o.contentparts.shift(); + o.content = o.contentparts.join(''); + } + }); var data = JSON.stringify(result); var json = JSON.parse(data); @@ -146,24 +142,17 @@ tr:nth-child(odd) {background-color: #f5f5f5;} var cell2 = row.insertCell(0); var cell3 = row.insertCell(0); var cell4 = row.insertCell(0); - cell4.innerHTML = "" cell3.innerHTML = json[d].sender; cell2.innerHTML = json[d].timestamp; cell1.innerHTML = json[d].content; } - - } - - } function refreshSMS() { - window.location.reload(); - } function toggle(source) { @@ -180,15 +169,12 @@ function delete_new() if (document.querySelectorAll('input[name="smsn"]:checked').length === document.querySelectorAll('input[name="smsn"]').length) { if (confirm("<%:Delete all the messages?%>")) { - - var rowCount = smsTable.rows.length; document.getElementById('usse').innerHTML = "0" + " / " + <%=all%>; for (var i = rowCount - 1; i > 0; i--) { smsTable.deleteRow(i);} - - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "sms", "delete_all")%>/' , null, + XHR.get('<%=luci.dispatcher.build_url("admin", "modem", "sms", "delete_all")%>/' , null, function() { @@ -196,14 +182,12 @@ if (document.querySelectorAll('input[name="smsn"]:checked').length === document. } ); - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "sms", "countsms")%>/' , null, + XHR.get('<%=luci.dispatcher.build_url("admin", "modem", "sms", "countsms")%>/' , null, function() { - } ); - return false; } @@ -223,11 +207,11 @@ if (document.querySelectorAll('input[name="smsn"]:checked').length === document. if (confirm("<%:Delete selected message(s)?%>")) { - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "sms", "delete_one")%>/' + smsindex, null, + XHR.get('<%=luci.dispatcher.build_url("admin", "modem", "sms", "delete_one")%>/' + smsindex, null, function() { - var table = document.getElementById("smsTable"); + var table = document.getElementById("smsTable"); var index = 1; while (index < table.rows.length) { @@ -240,7 +224,7 @@ if (document.querySelectorAll('input[name="smsn"]:checked').length === document. } } - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "sms", "readsim")%>', null, + XHR.get('<%=luci.dispatcher.build_url("admin", "modem", "sms", "readsim")%>', null, function(x, sim) { var vn = parseInt(sim.use) || 0; @@ -254,39 +238,36 @@ if (document.querySelectorAll('input[name="smsn"]:checked').length === document. ); - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "sms", "countsms")%>/' , null, + XHR.get('<%=luci.dispatcher.build_url("admin", "modem", "sms", "countsms")%>/' , null, function() { - } ); return false; } - } } } //]]> - -

<%:SMS Messages%>

-
<%:Web UI for receiveling messages via sms_tool.%>
+

<%:短信%>

+
<%:通过sms_tool接收信息的Web用户界面。关于短信工具的更多信息,请见%> <%:eko.one.pl 论坛%>

-


+

<%:接收的信息%>

-
<%:Messages store in%>:
<%=location%>
-
<%:Messages (Inbox / Maximum)%>:
+
<%:信息存储在%>:
<%=location%>
+
<%:信息 (收件箱 / 最大值)%>:
- - - + + +
<%:From%><%:Received%><%:Message%><%:来自%><%:收到%><%:信息%>
@@ -294,13 +275,11 @@ if (document.querySelectorAll('input[name="smsn"]:checked').length === document.
-
-     +
+    
-
- <%+footer%> diff --git a/luci-app-sms-tool/luasrc/view/modem/sendsms.htm b/luci-app-sms-tool/luasrc/view/modem/sendsms.htm index 287e338..f9747c6 100644 --- a/luci-app-sms-tool/luasrc/view/modem/sendsms.htm +++ b/luci-app-sms-tool/luasrc/view/modem/sendsms.htm @@ -12,7 +12,7 @@ <%+header%> @@ -47,12 +47,12 @@ window.onload = function prefiksSMS() { } if ( msg == "1" ) { - alert("<%:The phone number should be preceded by the country prefix (for Poland it is 48, without +). If the number is 5, 4 or 3 characters, it is treated as.. short and should not be preceded by a country prefix.%>"); + alert("<%:电话号码的前面应该有国家的前缀(波兰是48,没有+)。如果号码是5个、4个或3个字符,它将被视为短号码,而不应在前面加上国家前缀。(The phone number should be preceded by the country prefix (for Poland it is 48, without +). If the number is 5, 4 or 3 characters, it is treated as.. short and should not be preceded by a country prefix.)%>"); } -XHR.get('<%=luci.dispatcher.build_url("admin", "services", "sms", "user_phonebook")%>', null, +XHR.get('<%=luci.dispatcher.build_url("admin", "modem", "sms", "user_phonebook")%>', null, function(x, json) { select = document.getElementById('pb'); @@ -67,7 +67,6 @@ XHR.get('<%=luci.dispatcher.build_url("admin", "services", "sms", "user_phoneboo for(var d=0;d<=countpb;d++) { - var opt = document.createElement('option'); var s = json[d].phb; var fields = s.split(/;/); @@ -75,13 +74,16 @@ XHR.get('<%=luci.dispatcher.build_url("admin", "services", "sms", "user_phoneboo var number = fields[1]; opt.text = name; opt.value = number.trim(); - opt.innerHTML = name; - select.appendChild(opt); + opt.innerHTML = name; + select.appendChild(opt); } } ); - + + + + } @@ -91,6 +93,7 @@ function copyFunction2() { document.getElementById("numer").value = x; document.getElementById("odp").innerHTML = ""; + } @@ -98,7 +101,7 @@ function count_replace(obj) { document.getElementById('counter').innerHTML = (160 - document.getElementById('smstxt').value.length); - obj.value = obj.value.replace(/ą/g, 'a').replace(/Ą/g, 'A'); + obj.value = obj.value.replace(/ą/g, 'a').replace(/Ą/g, 'A'); obj.value = obj.value.replace(/ć/g, 'c').replace(/Ć/g, 'C') obj.value = obj.value.replace(/ę/g, 'e').replace(/Ę/g, 'E') obj.value = obj.value.replace(/ł/g, 'l').replace(/Ł/g, 'L') @@ -107,7 +110,7 @@ function count_replace(obj) { obj.value = obj.value.replace(/ś/g, 's').replace(/Ś/g, 'S') obj.value = obj.value.replace(/ż/g, 'z').replace(/Ż/g, 'Z') obj.value = obj.value.replace(/ź/g, 'z').replace(/Ź/g, 'Z'); - document.getElementById("odp").innerHTML = ""; + document.getElementById("odp").innerHTML = ""; } @@ -120,7 +123,7 @@ function codsp() { function postcmd(cmd) { - (new XHR()).post("<%=luci.dispatcher.build_url("admin", "services", "sms", "run_sms")%>", {"scode":cmd}, function(x) { + (new XHR()).post("<%=luci.dispatcher.build_url("admin", "modem", "sms", "run_sms")%>", {"scode":cmd}, function(x) { console.log(x.response) console.log(x) var cut = x.response; @@ -185,47 +188,46 @@ document.addEventListener('DOMContentLoaded', function (ev) {var button = docume //]]> -

<%:SMS Messages%>

-
<%:Web UI for sending messages via sms_tool.%>
-
<%:The phone number should be preceded by the country prefix (for Poland it is 48, without '+'). If the number is 5, 4 or 3 characters, it is treated as 'short' and should not be preceded by a country prefix.%>
-

-


+

<%:短信%>

+
<%:通过sms_tool发送信息的Web用户界面。关于短信工具的更多信息,请见%> <%:eko.one.pl 论坛%>.
+

+ +

<%:发送短信%>

- -
+
-
<%:User Phonebook%>:
-
+
<%:用户电话簿%>:
+
-
+
-
<%:Send to%>:
-
-
+
<%:发送至%>:
+
+
-
<%:Message text%>:
-
160
-
+
<%:消息正文%>:
+
160
+
-
<%:Status%>:
+
<%:状态%>:
-
+
-
+
diff --git a/luci-app-sms-tool/luasrc/view/modem/ussd.htm b/luci-app-sms-tool/luasrc/view/modem/ussd.htm new file mode 100644 index 0000000..38be1c3 --- /dev/null +++ b/luci-app-sms-tool/luasrc/view/modem/ussd.htm @@ -0,0 +1,265 @@ +<% + local util = require "luci.util" + local fs = require "nixio.fs" + local sys = require "luci.sys" + local http = require "luci.http" + local dispatcher = require "luci.dispatcher" + local uci = require "luci.model.uci".cursor() + +-%> + + +<%+header%> + + + +

<%:USSD 代码%>

+
<%:通过sms_tool处理USSD代码的Web用户界面。关于短信工具的更多信息,请见%> <%:eko.one.pl forum%>.
+

+

<%:发送 USSD 代码%>

+
+ +
+
<%:用户 USSD 代码%>:
+ +
+ +
+
+
+ +
+
<%:要发送的代码%>:
+
+ +
+
+
<%:回复%>:
+ +
+
+ +
+
+
+
+ +
+ + + +<%+footer%> diff --git a/luci-app-sms-tool/root/etc/config/atcmds.user b/luci-app-sms-tool/root/etc/config/atcmds.user index c4bb488..44bafb9 100644 --- a/luci-app-sms-tool/root/etc/config/atcmds.user +++ b/luci-app-sms-tool/root/etc/config/atcmds.user @@ -1,15 +1,28 @@ -Check signal strength > AT+CSQ;AT+CSQ -Get the temperature of MT > AT+QTEMP;AT+QTEMP -Current band in use > AT+QNWINFO;AT+QNWINFO -Carrier Agregation Info > AT+QCAINFO;AT+QCAINFO -SIM Preferred Message Storage > AT+CPMS="SM","SM","SM";AT+CPMS="SM","SM","SM" -Save SMS Settings > AT+CSAS;AT+CSAS -Reboot the modem > AT+CFUN=1,1;AT+CFUN=1,1 -Reset the modem > AT+CFUN=1;AT+CFUN=1 -QMI/PPP/Default > AT+QCFG="usbnet",0;AT+QCFG="usbnet",0 -ECM > AT+QCFG="usbnet",1;AT+QCFG="usbnet",1 -MBIM > AT+QCFG="usbnet",2;AT+QCFG="usbnet",2 -4G-LTE only > AT+QCFG="nwscanmode",3,1;AT+QCFG="nwscanmode",3,1 -WCDMA only > AT+QCFG="nwscanmode",2,1;AT+QCFG="nwscanmode",2,1 -GSM only > AT+QCFG="nwscanmode",1,1;AT+QCFG="nwscanmode",1,1 -Scan all modes > AT+QCFG="nwscanmode",0,1;AT+QCFG="nwscanmode",0,11 +------查询------;AT +查看IMEI;AT+CGSN +固件版本信息;AT+GMR +信号强度;AT+CSQ +正在使用的网络信息;AT+QNWINFO +查询限速;AT+C5GQOSRDP=1 +模块温度;AT+QTEMP +查询运营商名称;AT+QSPN +查询小区信息;AT+QENG="servingcell" +-----3/4/5G网络配置-----;AT +查询当前网络搜索模式;AT+QNWPREFCFG="mode_pref" +!切换仅3G;AT+QNWPREFCFG="mode_pref",WCDMA +切换仅4G;AT+QNWPREFCFG="mode_pref",LTE +切换仅5G;AT+QNWPREFCFG="mode_pref",NR5G +切换5,4G;AT+QNWPREFCFG="mode_pref",NR5G:LTE +切换AUTO;AT+QNWPREFCFG="mode_pref",AUTO +-----锁频段-----;AT +查询支持的所有频段;AT+QNWPREFCFG=? +查询当前配置的5G频段;AT+QNWPREFCFG="nr5g_band" +查询当前配置的4G频段;AT+QNWPREFCFG="lte_band" +!5G锁频段(78);AT+QNWPREFCFG="nr5g_band",78 +5G默认频段;AT+QNWPREFCFG="nr5g_band",1:28:41:77:78:79 +!4G锁频段(1);AT+QNWPREFCFG="lte_band",1 +4G默认频段;AT+QNWPREFCFG="lte_band",1:2:3:5:7:8:20:28:34:38:39:40:41 +-----MORE-----;AT +查看产品型号;ATI +挂断现有语音;ATH +!更改IMEI,需重启;AT+EGMR=1,7,"868227050701486" \ No newline at end of file diff --git a/luci-app-sms-tool/root/etc/config/phonebook.user b/luci-app-sms-tool/root/etc/config/phonebook.user index 6392a6d..74c98ab 100644 --- a/luci-app-sms-tool/root/etc/config/phonebook.user +++ b/luci-app-sms-tool/root/etc/config/phonebook.user @@ -1 +1 @@ -user;8613800138000 +other user;8613188888888