更新短信工具
This commit is contained in:
parent
6661f89c9b
commit
70b49ee185
@ -1,3 +1,4 @@
|
|||||||
|
# Copyright (C) 2023 Siriling <siriling@qq.com>
|
||||||
# This is free software, licensed under the GNU General Public License v3.
|
# This is free software, licensed under the GNU General Public License v3.
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
# Copyright 2020-2021 Rafał Wabik - IceG - From eko.one.pl forum
|
# Copyright (C) 2023 Siriling <siriling@qq.com>
|
||||||
# Licensed to the GNU General Public License v3.0.
|
# This is free software, licensed under the GNU General Public License v3.
|
||||||
|
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-sms-tool
|
PKG_NAME:=luci-app-sms-tool
|
||||||
LUCI_TITLE:=LuCI Support for sms_tool
|
LUCI_TITLE:=LuCI Support for sms_tool
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
LUCI_DEPENDS:=+sms-tool +kmod-usb-serial +kmod-usb-serial-option +luci-compat
|
PKG_VERSION:=1.0.0
|
||||||
PKG_VERSION:=1.9.2-20211018
|
|
||||||
PKG_LICENSE:=GPLv3
|
PKG_LICENSE:=GPLv3
|
||||||
|
PKG_LINCESE_FILES:=LICENSE
|
||||||
|
PKF_MAINTAINER:=siriling <siriling@qq.com>
|
||||||
|
LUCI_DEPENDS:=+sms-tool +luci-compat +kmod-usb-serial +kmod-usb-serial-option
|
||||||
|
|
||||||
define Package/luci-app-sms-tool/postinst
|
define Package/luci-app-sms-tool/postinst
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 9.0 KiB |
BIN
luci-app-sms-tool/htdocs/luci-static/resources/icons/delsms2.png
Normal file
BIN
luci-app-sms-tool/htdocs/luci-static/resources/icons/delsms2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
@ -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 util = require "luci.util"
|
||||||
local fs = require "nixio.fs"
|
local fs = require "nixio.fs"
|
||||||
local sys = require "luci.sys"
|
local sys = require "luci.sys"
|
||||||
@ -14,19 +10,23 @@
|
|||||||
module("luci.controller.modem.sms", package.seeall)
|
module("luci.controller.modem.sms", package.seeall)
|
||||||
|
|
||||||
function index()
|
function index()
|
||||||
entry({"admin", "services", "sms"}, alias("admin", "services", "sms", "readsms"), translate("SMS Messages"), 20).acl_depends={ "luci-app-sms-tool" }
|
entry({"admin", "modem"}, firstchild(), "Modem", 30).dependent=false
|
||||||
entry({"admin", "services", "sms", "readsms"},template("modem/readsms"),translate("Received Messages"), 10)
|
entry({"admin", "modem", "sms"}, alias("admin", "modem", "sms", "readsms"), translate("短信"), 20)
|
||||||
entry({"admin", "services", "sms", "sendsms"},template("modem/sendsms"),translate("Send Messages"), 20)
|
entry({"admin", "modem", "sms", "readsms"},template("modem/readsms"),translate("收到的信息"), 10)
|
||||||
entry({"admin", "services", "sms", "atcommands"},template("modem/atcommands"),translate("AT Commands"), 40)
|
entry({"admin", "modem", "sms", "sendsms"},template("modem/sendsms"),translate("发送消息"), 20)
|
||||||
entry({"admin", "services", "sms", "smsconfig"},cbi("modem/smsconfig"),translate("Configuration"), 50)
|
entry({"admin", "modem", "sms", "ussd"},template("modem/ussd"),translate("USSD 代码"), 30)
|
||||||
entry({"admin", "services", "sms", "delete_one"}, call("delete_sms", smsindex), nil).leaf = true
|
entry({"admin", "modem", "sms", "atcommands"},template("modem/atcommands"),translate("AT 命令"), 40)
|
||||||
entry({"admin", "services", "sms", "delete_all"}, call("delete_all_sms"), nil).leaf = true
|
entry({"admin", "modem", "sms", "smsconfig"},cbi("modem/smsconfig"),translate("配置"), 50)
|
||||||
entry({"admin", "services", "sms", "run_at"}, call("at"), nil).leaf = true
|
entry({"admin", "modem", "sms", "delete_one"}, call("delete_sms", smsindex), nil).leaf = true
|
||||||
entry({"admin", "services", "sms", "run_sms"}, call("sms"), nil).leaf = true
|
entry({"admin", "modem", "sms", "delete_all"}, call("delete_all_sms"), nil).leaf = true
|
||||||
entry({"admin", "services", "sms", "readsim"}, call("slots"), nil).leaf = true
|
entry({"admin", "modem", "sms", "run_ussd"}, call("ussd"), nil).leaf = true
|
||||||
entry({"admin", "services", "sms", "countsms"}, call("count_sms"), nil).leaf = true
|
entry({"admin", "modem", "sms", "run_at"}, call("at"), nil).leaf = true
|
||||||
entry({"admin", "services", "sms", "user_atc"}, call("useratc"), nil).leaf = true
|
entry({"admin", "modem", "sms", "run_sms"}, call("sms"), nil).leaf = true
|
||||||
entry({"admin", "services", "sms", "user_phonebook"}, call("userphb"), 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
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -43,6 +43,15 @@ function delete_all_sms()
|
|||||||
os.execute("sms_tool -d " .. devv .. " delete all")
|
os.execute("sms_tool -d " .. devv .. " delete all")
|
||||||
end
|
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()
|
function get_pdu()
|
||||||
local cursor = luci.model.uci.cursor()
|
local cursor = luci.model.uci.cursor()
|
||||||
@ -54,6 +63,24 @@ function get_pdu()
|
|||||||
end
|
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()
|
function at()
|
||||||
local devv = tostring(uci:get("sms_tool", "general", "atport"))
|
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 statusb = luci.util.exec("sms_tool -s" .. smsmem .. " -d ".. devv .. " status")
|
||||||
local usex = string.sub (statusb, 23, 27)
|
local usex = string.sub (statusb, 23, 27)
|
||||||
local max = string.sub (statusb, -4)
|
local max = statusb:match('[^: ]+$')
|
||||||
sim["use"] = string.match(usex, '%d+')
|
sim["use"] = string.match(usex, '%d+')
|
||||||
local smscount = string.match(usex, '%d+')
|
local smscount = string.match(usex, '%d+')
|
||||||
if ln == "1" then
|
if ln == "1" then
|
||||||
@ -133,6 +160,33 @@ function count_sms()
|
|||||||
end
|
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)
|
function uat(rv)
|
||||||
local c = nixio.fs.access("/etc/config/atcmds.user") and
|
local c = nixio.fs.access("/etc/config/atcmds.user") and
|
||||||
io.popen("cat /etc/config/atcmds.user")
|
io.popen("cat /etc/config/atcmds.user")
|
||||||
|
@ -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 util = require "luci.util"
|
||||||
local fs = require "nixio.fs"
|
local fs = require "nixio.fs"
|
||||||
local sys = require "luci.sys"
|
local sys = require "luci.sys"
|
||||||
@ -10,6 +7,7 @@ local http = require "luci.http"
|
|||||||
local sys = require "luci.sys"
|
local sys = require "luci.sys"
|
||||||
local uci = require "luci.model.uci".cursor()
|
local uci = require "luci.model.uci".cursor()
|
||||||
|
|
||||||
|
local USSD_FILE_PATH = "/etc/config/ussd.user"
|
||||||
local PHB_FILE_PATH = "/etc/config/phonebook.user"
|
local PHB_FILE_PATH = "/etc/config/phonebook.user"
|
||||||
local SMSC_FILE_PATH = "/etc/config/smscommands.user"
|
local SMSC_FILE_PATH = "/etc/config/smscommands.user"
|
||||||
local AT_FILE_PATH = "/etc/config/atcmds.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+')
|
local smscount = string.match(smsnum, '%d+')
|
||||||
|
|
||||||
m = Map("sms_tool", translate("Configuration sms-tool"),
|
m = Map("sms_tool", translate("配置短信工具"),
|
||||||
translate("Configuration panel for sms_tool and gui application."))
|
translate("sms_tool和gui应用程序的配置面板。"))
|
||||||
|
|
||||||
s = m:section(NamedSection, 'general' , "sms_tool" , "<p> </p>" .. translate(""))
|
s = m:section(NamedSection, 'general' , "sms_tool" , "" .. translate(""))
|
||||||
s.anonymous = true
|
s.anonymous = true
|
||||||
s:tab("sms", translate("SMS Settings"))
|
s:tab("sms", translate("SMS 设置"))
|
||||||
s:tab("at", translate("AT Commands Settings"))
|
s:tab("ussd", translate("USSD 代码设置"))
|
||||||
s:tab("info", translate("Notification Settings"))
|
s:tab("at", translate("AT 命令设置"))
|
||||||
|
s:tab("info", translate("通知设置"))
|
||||||
|
|
||||||
this_tab = "sms"
|
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
|
if try_devices1 then
|
||||||
local node
|
local node
|
||||||
for node in try_devices1 do
|
for node in try_devices1 do
|
||||||
@ -57,16 +56,16 @@ dev1:value(node, node)
|
|||||||
end
|
end
|
||||||
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.default = "SM"
|
||||||
mem:value("SM", translate("SIM card"))
|
mem:value("SM", translate("SIM 卡"))
|
||||||
mem:value("ME", translate("Modem memory"))
|
mem:value("ME", translate("调制解调器内存"))
|
||||||
mem.rmempty = true
|
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
|
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
|
if try_devices2 then
|
||||||
local node
|
local node
|
||||||
for node in try_devices2 do
|
for node in try_devices2 do
|
||||||
@ -74,18 +73,18 @@ dev2:value(node, node)
|
|||||||
end
|
end
|
||||||
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.rmempty = true
|
||||||
t.default = 48
|
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
|
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
|
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.rows = 7
|
||||||
ta.rmempty = false
|
ta.rmempty = false
|
||||||
|
|
||||||
@ -98,10 +97,38 @@ function ta.write(self, section, value)
|
|||||||
fs.writefile(PHB_FILE_PATH, value)
|
fs.writefile(PHB_FILE_PATH, value)
|
||||||
end
|
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"
|
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
|
if try_devices4 then
|
||||||
local node
|
local node
|
||||||
for node in try_devices4 do
|
for node in try_devices4 do
|
||||||
@ -109,7 +136,7 @@ dev4:value(node, node)
|
|||||||
end
|
end
|
||||||
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.rows = 20
|
||||||
tat.rmempty = true
|
tat.rmempty = true
|
||||||
|
|
||||||
@ -124,7 +151,7 @@ end
|
|||||||
|
|
||||||
this_tabb = "info"
|
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
|
uw.rmempty = false
|
||||||
|
|
||||||
function uw.write(self, section, value)
|
function uw.write(self, section, value)
|
||||||
@ -149,7 +176,7 @@ return Flag.write(self, section ,value)
|
|||||||
end
|
end
|
||||||
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.rmempty = false
|
||||||
time.maxlength = 2
|
time.maxlength = 2
|
||||||
time.default = 5
|
time.default = 5
|
||||||
@ -160,7 +187,7 @@ function time.validate(self, value)
|
|||||||
end
|
end
|
||||||
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.default = "6"
|
||||||
sync:value("4", translate("4h"))
|
sync:value("4", translate("4h"))
|
||||||
sync:value("6", translate("6h"))
|
sync:value("6", translate("6h"))
|
||||||
@ -169,7 +196,7 @@ sync:value("12", translate("12h"))
|
|||||||
sync.rmempty = true
|
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
|
if try_leds then
|
||||||
local node
|
local node
|
||||||
local status
|
local status
|
||||||
@ -180,18 +207,18 @@ leds:value(all, all)
|
|||||||
end
|
end
|
||||||
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.default = "D"
|
||||||
oled:value("S", translate("No"))
|
oled:value("S", translate("No"))
|
||||||
oled:value("D", translate("Yes"))
|
oled:value("D", translate("Yes"))
|
||||||
oled.rmempty = true
|
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.rmempty = false
|
||||||
timeon.maxlength = 3
|
timeon.maxlength = 3
|
||||||
timeon.default = 1
|
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.rmempty = false
|
||||||
timeoff.maxlength = 3
|
timeoff.maxlength = 3
|
||||||
timeoff.default = 5
|
timeoff.default = 5
|
||||||
|
@ -1,41 +1,41 @@
|
|||||||
<%+header%>
|
<%+header%>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
-- Copyright 2020-2021 Rafał Wabik (IceG) - From eko.one.pl forum
|
-- Copyright 2020-2022 Rafał Wabik (IceG) - From eko.one.pl forum
|
||||||
-- Licensed to the GNU General Public License v3.0.
|
-- Licensed to the GNU General Public License v3.0.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<h2 name="content"><%:AT Commands%></h2>
|
<h2><%:AT 命令%></h2>
|
||||||
<div class="cbi-map-descr"><%:Web UI for handling AT commands via sms_tool.%></div>
|
<div class="cbi-map-descr"><%:通过sms_tool处理AT命令的Web用户界面。关于sms-tool的更多信息,请见%> <a href="https://eko.one.pl/?p=openwrt-sms_tool" target="_blank"><%:eko.one.pl 论坛%></a>.</div>
|
||||||
<p></p>
|
<p></p>
|
||||||
<h4><br/></h4>
|
<h4><%:向调制解调器发送命令%></h4>
|
||||||
<div class="table" width="100%">
|
<div class="table" width="100%">
|
||||||
|
|
||||||
<div class="tr">
|
<div class="tr">
|
||||||
<div class="td left" width="25%"><%:User AT Commands%>:</div>
|
<div class="td left"><%:用户AT命令%>:</div>
|
||||||
|
|
||||||
<div class="td left" style="width:50%;">
|
<div class="td left";">
|
||||||
<select name="ussd" id="pl" onclick="copyFunction()">
|
<select name="ussd" id="pl" onclick="copyFunction()">
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="td left" style="width:50%;"></div>
|
<div class="td left""></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tr">
|
<div class="tr">
|
||||||
<div class="td left" style="width:25%;"><%:Command to send%>:</div>
|
<div class="td left" ><%:要发送的命令%>:</div>
|
||||||
<div class="td left" ><input type="text" id="code" required size="20" ></div>
|
<div class="td left" ><input type="text" id="code"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="table" width="100%">
|
<div class="table" width="100%">
|
||||||
<div class="td left" style="width:25%;"><%:Reply%>:
|
<div class="td left";"><%:回复%>:
|
||||||
<p>
|
<p>
|
||||||
<pre id="odp" style="visibility: hidden; width:75%;"></pre></div>
|
<pre id="odp" style="visibility: hidden;"></pre></div>
|
||||||
|
|
||||||
<div class="tr cbi-rowstyle-2">
|
<div class="tr cbi-rowstyle-2">
|
||||||
<div class="td right"><input type="button" style="margin-right: 26%"; id="sendcmd" class="btn cbi-button cbi-button-neutral" value="<%:Send Command%>" /></div>
|
<div class="td right"><input type="button" style="margin-right: 5%"; id="sendcmd" class="btn cbi-button cbi-button-neutral" value="<%:发送命令%>" /></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -45,7 +45,7 @@
|
|||||||
window.onload = function readUSER() {
|
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)
|
function(x, json)
|
||||||
{
|
{
|
||||||
select = document.getElementById('pl');
|
select = document.getElementById('pl');
|
||||||
@ -55,8 +55,7 @@ window.onload = function readUSER() {
|
|||||||
|
|
||||||
for(var d=0;d<=count;d++)
|
for(var d=0;d<=count;d++)
|
||||||
{
|
{
|
||||||
var opt = document.createElement('option');
|
var opt = document.createElement('option');
|
||||||
|
|
||||||
var s = json[d].atu;
|
var s = json[d].atu;
|
||||||
var fields = s.split(/;/);
|
var fields = s.split(/;/);
|
||||||
var name = fields[0];
|
var name = fields[0];
|
||||||
@ -86,7 +85,7 @@ function copyFunction() {
|
|||||||
|
|
||||||
|
|
||||||
function postcmd(cmd) {
|
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.response)
|
||||||
console.log(x)
|
console.log(x)
|
||||||
|
|
||||||
|
@ -7,31 +7,27 @@
|
|||||||
local uci = require "luci.model.uci".cursor()
|
local uci = require "luci.model.uci".cursor()
|
||||||
|
|
||||||
local devv = tostring(uci:get("sms_tool", "general", "readport"))
|
local devv = tostring(uci:get("sms_tool", "general", "readport"))
|
||||||
|
|
||||||
local smsmem = tostring(uci:get("sms_tool", "general", "storage"))
|
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' -j recv 2>/dev/null"))
|
||||||
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 smsmer = tostring(uci:get("sms_tool", "general", "mergesms"))
|
local smsmer = tostring(uci:get("sms_tool", "general", "mergesms"))
|
||||||
local smscuta = string.sub (sms, 8)
|
local smscuta = string.sub (sms, 8)
|
||||||
local smscut = smscuta:sub(1, #smscuta - 2)
|
local smscut = smscuta:sub(1, #smscuta - 2)
|
||||||
local statusb = luci.util.exec("sms_tool -s" .. smsmem .. " -d ".. devv .. " status")
|
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 location = ""
|
||||||
local l = string.sub (statusb, 15, 16)
|
local l = string.sub (statusb, 15, 16)
|
||||||
if l == "SM" then
|
if l == "SM" then
|
||||||
location = translate("SIM card")
|
location = translate("SIM card")
|
||||||
end
|
end
|
||||||
|
|
||||||
if l == "ME" then
|
if l == "ME" then
|
||||||
location = translate("Modem memory")
|
location = translate("Modem memory")
|
||||||
end
|
end
|
||||||
|
|
||||||
-%>
|
-%>
|
||||||
|
|
||||||
<%+header%>
|
<%+header%>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
-- Copyright 2020-2021 Rafał Wabik (IceG) - From eko.one.pl forum
|
-- Copyright 2020-2022 Rafał Wabik (IceG) - From eko.one.pl forum
|
||||||
-- Licensed to the GNU General Public License v3.0.
|
-- Licensed to the GNU General Public License v3.0.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -40,26 +36,24 @@
|
|||||||
table {
|
table {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
th, td {
|
th, td {
|
||||||
border-bottom: 1px solid #ddd;
|
border-bottom: 1px solid var(--border-color-medium);
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
display: table-cell;
|
display: table-cell;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
td input[type="checkbox"] {
|
td input[type="checkbox"] {
|
||||||
float: left;
|
float: left;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
width: 50%;
|
width: 40%;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr:nth-child(odd) {background-color: #f5f5f5;}
|
tr:nth-child(odd) {background-color: var(--background-color-medium)}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@ -67,29 +61,23 @@ tr:nth-child(odd) {background-color: #f5f5f5;}
|
|||||||
|
|
||||||
window.onload = function readSMS() {
|
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)
|
function(x, sim)
|
||||||
{
|
{
|
||||||
var vn = parseInt(sim.use) || 0;
|
var vn = parseInt(sim.use) || 0;
|
||||||
var mn = parseInt(sim.all) || 100;
|
var mn = parseInt(sim.all) || 100;
|
||||||
var pc = Math.floor((100 / mn) * vn);
|
var pc = Math.floor((100 / mn) * vn);
|
||||||
document.getElementById('usse').innerHTML=sim.use + " / " + sim.all + " " + '('+ pc + '%)';
|
document.getElementById('usse').innerHTML=sim.use + " / " + sim.all + " " + '('+ pc + '%)';
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
var msgm = <%=smsmer%>;
|
var msgm = <%=smsmer%>;
|
||||||
if ( msgm == "0" ) {
|
if ( msgm == "0" ) {
|
||||||
|
|
||||||
var array = <%=smscut%>;
|
var array = <%=smscut%>;
|
||||||
|
|
||||||
var sortedData = array .sort((function (a, b) { return new Date(b.timestamp) - new Date(a.timestamp) }));
|
var sortedData = array .sort((function (a, b) { return new Date(b.timestamp) - new Date(a.timestamp) }));
|
||||||
|
|
||||||
var table = document.getElementById("smsTable");
|
var table = document.getElementById("smsTable");
|
||||||
|
|
||||||
var data = JSON.stringify(sortedData);
|
var data = JSON.stringify(sortedData);
|
||||||
|
|
||||||
var json = JSON.parse(data);
|
var json = JSON.parse(data);
|
||||||
|
|
||||||
var x = <%=all%>;
|
var x = <%=all%>;
|
||||||
@ -100,13 +88,10 @@ tr:nth-child(odd) {background-color: #f5f5f5;}
|
|||||||
var cell2 = row.insertCell(0);
|
var cell2 = row.insertCell(0);
|
||||||
var cell3 = row.insertCell(0);
|
var cell3 = row.insertCell(0);
|
||||||
var cell4 = row.insertCell(0);
|
var cell4 = row.insertCell(0);
|
||||||
|
|
||||||
cell4.innerHTML = "<input type='checkbox' name='smsn' id="+"btn"+json[d].index+" /><img src='<%=resource%>/icons/delsms.png'>"
|
cell4.innerHTML = "<input type='checkbox' name='smsn' id="+"btn"+json[d].index+" /><img src='<%=resource%>/icons/delsms.png'>"
|
||||||
cell3.innerHTML = json[d].sender;
|
cell3.innerHTML = json[d].sender;
|
||||||
cell2.innerHTML = json[d].timestamp;
|
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 = [];
|
result = [];
|
||||||
|
|
||||||
MergeMySMS.forEach(function (o) {
|
MergeMySMS.forEach(function (o) {
|
||||||
if (!this[o.timestamp] && !this[o.sender]) {
|
if (!this[o.sender]) {
|
||||||
this[o.timestamp] = { index: o.index, sender: o.sender, timestamp: o.timestamp, content: o.content };
|
if(o.part > 0){
|
||||||
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, 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;
|
return;
|
||||||
}
|
}
|
||||||
if (this[o.timestamp].sender == o.sender) {
|
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.timestamp].content += o.content;
|
this[o.sender].index += '-' + o.index;
|
||||||
this[o.timestamp].index += '-' + o.index;}
|
this[o.sender].contentparts[o.part] = o.content;}
|
||||||
else {
|
else {
|
||||||
this[o.timestamp] = { index: o.index, sender: o.sender, timestamp: o.timestamp, content: o.content };
|
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.timestamp]);
|
result.push(this[o.sender]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}, Object.create(null));
|
}, Object.create(null));
|
||||||
|
result.forEach(function(o) {
|
||||||
|
if(o.contentparts){
|
||||||
|
o.contentparts.shift();
|
||||||
|
o.content = o.contentparts.join('');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var data = JSON.stringify(result);
|
var data = JSON.stringify(result);
|
||||||
var json = JSON.parse(data);
|
var json = JSON.parse(data);
|
||||||
@ -146,24 +142,17 @@ tr:nth-child(odd) {background-color: #f5f5f5;}
|
|||||||
var cell2 = row.insertCell(0);
|
var cell2 = row.insertCell(0);
|
||||||
var cell3 = row.insertCell(0);
|
var cell3 = row.insertCell(0);
|
||||||
var cell4 = row.insertCell(0);
|
var cell4 = row.insertCell(0);
|
||||||
|
|
||||||
cell4.innerHTML = "<input type='checkbox' name='smsn' id="+"btn"+json[d].index+" /><img src='<%=resource%>/icons/delsms.png'>"
|
cell4.innerHTML = "<input type='checkbox' name='smsn' id="+"btn"+json[d].index+" /><img src='<%=resource%>/icons/delsms.png'>"
|
||||||
cell3.innerHTML = json[d].sender;
|
cell3.innerHTML = json[d].sender;
|
||||||
cell2.innerHTML = json[d].timestamp;
|
cell2.innerHTML = json[d].timestamp;
|
||||||
cell1.innerHTML = json[d].content;
|
cell1.innerHTML = json[d].content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function refreshSMS() {
|
function refreshSMS() {
|
||||||
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggle(source) {
|
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 (document.querySelectorAll('input[name="smsn"]:checked').length === document.querySelectorAll('input[name="smsn"]').length) {
|
||||||
|
|
||||||
if (confirm("<%:Delete all the messages?%>")) {
|
if (confirm("<%:Delete all the messages?%>")) {
|
||||||
|
|
||||||
|
|
||||||
var rowCount = smsTable.rows.length;
|
var rowCount = smsTable.rows.length;
|
||||||
document.getElementById('usse').innerHTML = "0" + " / " + <%=all%>;
|
document.getElementById('usse').innerHTML = "0" + " / " + <%=all%>;
|
||||||
for (var i = rowCount - 1; i > 0; i--) {
|
for (var i = rowCount - 1; i > 0; i--) {
|
||||||
smsTable.deleteRow(i);}
|
smsTable.deleteRow(i);}
|
||||||
|
|
||||||
|
XHR.get('<%=luci.dispatcher.build_url("admin", "modem", "sms", "delete_all")%>/' , null,
|
||||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "sms", "delete_all")%>/' , null,
|
|
||||||
|
|
||||||
function()
|
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()
|
function()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,11 +207,11 @@ if (document.querySelectorAll('input[name="smsn"]:checked').length === document.
|
|||||||
|
|
||||||
if (confirm("<%:Delete selected message(s)?%>")) {
|
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()
|
function()
|
||||||
{
|
{
|
||||||
var table = document.getElementById("smsTable");
|
var table = document.getElementById("smsTable");
|
||||||
var index = 1;
|
var index = 1;
|
||||||
while (index < table.rows.length) {
|
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)
|
function(x, sim)
|
||||||
{
|
{
|
||||||
var vn = parseInt(sim.use) || 0;
|
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()
|
function()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//]]></script>
|
//]]></script>
|
||||||
|
|
||||||
|
<h2><%:短信%></h2>
|
||||||
<h2 name="content"><%:SMS Messages%></h2>
|
<div class="cbi-map-descr"><%:通过sms_tool接收信息的Web用户界面。关于短信工具的更多信息,请见%> <a href="https://eko.one.pl/?p=openwrt-sms_tool" target="_blank"><%:eko.one.pl 论坛%></a>。</div>
|
||||||
<div class="cbi-map-descr"><%:Web UI for receiveling messages via sms_tool.%></div>
|
|
||||||
<p></p>
|
<p></p>
|
||||||
<h4><br/></h4>
|
<h4><%:接收的信息%></h4>
|
||||||
<div class="table" width="100%">
|
<div class="table" width="100%">
|
||||||
<div class="tr"><div class="td left" width="33%"><%:Messages store in%>:</div><div class="td left"><%=location%></div></div>
|
<div class="tr"><div class="td left" width="33%"><%:信息存储在%>:</div><div class="td left"><%=location%></div></div>
|
||||||
<div class="tr"><div class="td left" width="33%"><%:Messages (Inbox / Maximum)%>:</div><div class="td left" id="usse"></div></div>
|
<div class="tr"><div class="td left" width="33%"><%:信息 (收件箱 / 最大值)%>:</div><div class="td left" id="usse"></div></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table id="smsTable" width="100%" class="table">
|
<table id="smsTable" width="100%" class="table">
|
||||||
<tr class="tr cbi-rowstyle-2">
|
<tr class="tr cbi-rowstyle-2">
|
||||||
|
|
||||||
<td class="td left" width="7%"><input type='checkbox' id='allcheck' onclick='toggle(this);'/></td>
|
<td class="td left" width="7%"><input type='checkbox' id='allcheck' onclick='toggle(this);'/></td>
|
||||||
<td class="td left" width="10%"><strong><%:From%></strong></td>
|
<td class="td left" width="11%"><strong><%:来自%></strong></td>
|
||||||
<td class="td left" width="13%"><strong><%:Received%></strong></td>
|
<td class="td left" width="15%"><strong><%:收到%></strong></td>
|
||||||
<td class="td left" width="60%" ><strong><%:Message%></strong></td>
|
<td class="td center" width="66%" ><strong><%:信息%></strong></td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -294,13 +275,11 @@ if (document.querySelectorAll('input[name="smsn"]:checked').length === document.
|
|||||||
<div class="table" width="100%" >
|
<div class="table" width="100%" >
|
||||||
<div class="tr cbi-rowstyle-2">
|
<div class="tr cbi-rowstyle-2">
|
||||||
|
|
||||||
|
|
||||||
<div class="td right" style="width:100%;">
|
<div class="td right" style="width:100%;">
|
||||||
<input type="button" id="delbtn" class="btn cbi-button cbi-button-neutral" value="<%:Refresh SMS%>" onclick="refreshSMS()" /> <input type="button" id="delabtn" class="btn cbi-button cbi-button-neutral" value="<%:Delete message(s)%>" onclick="delete_new()" />
|
<div style="float: left;"></div>
|
||||||
|
<input type="button" id="delbtn" class="btn cbi-button cbi-button-neutral" value="<%:刷新消息%>" onclick="refreshSMS()" /> <input type="button" id="delabtn" class="btn cbi-button cbi-button-neutral" value="<%:删除消息(s)%>" onclick="delete_new()" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<%+footer%>
|
<%+footer%>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<%+header%>
|
<%+header%>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
-- Copyright 2020-2021 Rafał Wabik (IceG) - From eko.one.pl forum
|
-- Copyright 2020-2022 Rafał Wabik (IceG) - From eko.one.pl forum
|
||||||
-- Licensed to the GNU General Public License v3.0.
|
-- Licensed to the GNU General Public License v3.0.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -47,12 +47,12 @@ window.onload = function prefiksSMS() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( msg == "1" ) {
|
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)
|
function(x, json)
|
||||||
{
|
{
|
||||||
select = document.getElementById('pb');
|
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++)
|
for(var d=0;d<=countpb;d++)
|
||||||
{
|
{
|
||||||
|
|
||||||
var opt = document.createElement('option');
|
var opt = document.createElement('option');
|
||||||
var s = json[d].phb;
|
var s = json[d].phb;
|
||||||
var fields = s.split(/;/);
|
var fields = s.split(/;/);
|
||||||
@ -75,13 +74,16 @@ XHR.get('<%=luci.dispatcher.build_url("admin", "services", "sms", "user_phoneboo
|
|||||||
var number = fields[1];
|
var number = fields[1];
|
||||||
opt.text = name;
|
opt.text = name;
|
||||||
opt.value = number.trim();
|
opt.value = number.trim();
|
||||||
opt.innerHTML = name;
|
opt.innerHTML = name;
|
||||||
select.appendChild(opt);
|
select.appendChild(opt);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -91,6 +93,7 @@ function copyFunction2() {
|
|||||||
document.getElementById("numer").value = x;
|
document.getElementById("numer").value = x;
|
||||||
document.getElementById("odp").innerHTML = "";
|
document.getElementById("odp").innerHTML = "";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -98,7 +101,7 @@ function count_replace(obj) {
|
|||||||
|
|
||||||
document.getElementById('counter').innerHTML = (160 - document.getElementById('smstxt').value.length);
|
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, 'c').replace(/Ć/g, 'C')
|
||||||
obj.value = obj.value.replace(/ę/g, 'e').replace(/Ę/g, 'E')
|
obj.value = obj.value.replace(/ę/g, 'e').replace(/Ę/g, 'E')
|
||||||
obj.value = obj.value.replace(/ł/g, 'l').replace(/Ł/g, 'L')
|
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, 's').replace(/Ś/g, 'S')
|
||||||
obj.value = obj.value.replace(/ż/g, 'z').replace(/Ż/g, 'Z')
|
obj.value = obj.value.replace(/ż/g, 'z').replace(/Ż/g, 'Z')
|
||||||
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) {
|
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.response)
|
||||||
console.log(x)
|
console.log(x)
|
||||||
var cut = x.response;
|
var cut = x.response;
|
||||||
@ -185,47 +188,46 @@ document.addEventListener('DOMContentLoaded', function (ev) {var button = docume
|
|||||||
//]]></script>
|
//]]></script>
|
||||||
|
|
||||||
|
|
||||||
<h2 name="content"><%:SMS Messages%></h2>
|
<h2><%:短信%></h2>
|
||||||
<div class="cbi-map-descr"><%:Web UI for sending messages via sms_tool.%></div>
|
<div class="cbi-map-descr"><%:通过sms_tool发送信息的Web用户界面。关于短信工具的更多信息,请见%> <a href="https://eko.one.pl/?p=openwrt-sms_tool" target="_blank"><%:eko.one.pl 论坛%></a>.</div>
|
||||||
<div class="cbi-map-descr"><%: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.%></div>
|
|
||||||
<p></p>
|
<p></p>
|
||||||
<h4><br/></h4>
|
|
||||||
|
|
||||||
|
<h4><%:发送短信%></h4>
|
||||||
|
|
||||||
<div class="table" width="100%">
|
<div class="table">
|
||||||
|
|
||||||
<div class="tr">
|
<div class="tr">
|
||||||
<div class="td left" style="width:25%;"><%:User Phonebook%>:</div>
|
<div class="td left" ><%:用户电话簿%>:</div>
|
||||||
<div class="td left" style="width:50%;">
|
<div class="td left" >
|
||||||
|
|
||||||
<select name="ussd" id="pb" onchange="copyFunction2()">
|
<select name="ussd" id="pb" onchange="copyFunction2()">
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="td left" style="width:0%;"></div>
|
<div class="td left" ></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tr">
|
<div class="tr">
|
||||||
<div class="td left" style="width:25%;"><%:Send to%>:</div>
|
<div class="td left" ><%:发送至%>:</div>
|
||||||
<div class="td left" style="width:50%;"><input type="text" id="numer" onKeyUp="codsp()" placeholder="<%:PHONE_NUMBER%>" required minlength="3" maxlength="24" size="11"></div>
|
<div class="td left" ><input type="text" id="numer" onKeyUp="codsp()" placeholder="<%:PHONE_NUMBER%>" required minlength="3" maxlength="24" size="11"></div>
|
||||||
<div class="td left" style="width:0%;"></div>
|
<div class="td left" ></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tr">
|
<div class="tr">
|
||||||
<div class="td left" style="width:25%;"><%:Message text%>:</div>
|
<div class="td left" ><%:消息正文%>:</div>
|
||||||
<div class="td left" style="width:50%;"><textarea id="smstxt" onKeyUp="count_replace(this)" required></textarea><div id="counter">160</div></div>
|
<div class="td left" ><textarea id="smstxt" onKeyUp="count_replace(this)" required></textarea><div id="counter">160</div></div>
|
||||||
<div class="td left" style="width:0%;"></div>
|
<div class="td left" ></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tr">
|
<div class="tr">
|
||||||
<div class="td left" width="25%"><%:Status%>:</div><div class="td left" id="odp"></div>
|
<div class="td left" ><%:状态%>:</div><div class="td left" id="odp"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="table" width="100%">
|
<div class="table">
|
||||||
|
|
||||||
<div class="tr cbi-rowstyle-2">
|
<div class="tr cbi-rowstyle-2">
|
||||||
<div class="td center"><input type="button" style="margin-left: 35%"; id="sendsms" class="btn cbi-button cbi-button-neutral" value="<%:Send Message%>" /></div>
|
<div class="td right"><input type="button" style="margin-right: 5%"; id="sendsms" class="btn cbi-button cbi-button-neutral" value="<%:发送短信%>" /></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
265
luci-app-sms-tool/luasrc/view/modem/ussd.htm
Normal file
265
luci-app-sms-tool/luasrc/view/modem/ussd.htm
Normal file
@ -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%>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
-- Copyright 2020-2022 Rafał Wabik (IceG) - From eko.one.pl forum
|
||||||
|
-- Licensed to the GNU General Public License v3.0.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<h2><%:USSD 代码%></h2>
|
||||||
|
<div class="cbi-map-descr"><%:通过sms_tool处理USSD代码的Web用户界面。关于短信工具的更多信息,请见%> <a href="https://eko.one.pl/?p=openwrt-sms_tool" target="_blank"><%:eko.one.pl forum%></a>.</div>
|
||||||
|
<p></p>
|
||||||
|
<h4><%:发送 USSD 代码%></h4>
|
||||||
|
<div class="table" width="100%">
|
||||||
|
|
||||||
|
<div class="tr">
|
||||||
|
<div class="td left" width="25%"><%:用户 USSD 代码%>:</div>
|
||||||
|
|
||||||
|
<div class="td left" >
|
||||||
|
<select name="ussd" id="pl" onclick="copyFunction()">
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="td left" ></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tr">
|
||||||
|
<div class="td left" ><%:要发送的代码%>:</div>
|
||||||
|
<div class="td left" ><input type="text" id="code" required size="20"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="tr">
|
||||||
|
<div class="td left" ><%:回复%>:</div><div class="td left" ><pre id="odp" style="visibility: hidden;"></pre></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="table" width="100%">
|
||||||
|
<div class="tr cbi-rowstyle-2">
|
||||||
|
<div class="td right"><input type="button" style="margin-right: 5%"; id="sendussd" class="btn cbi-button cbi-button-neutral" value="<%:发送代码%>" /></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">//<![CDATA[
|
||||||
|
|
||||||
|
|
||||||
|
window.onload = function readUSER() {
|
||||||
|
|
||||||
|
|
||||||
|
XHR.get('<%=luci.dispatcher.build_url("admin", "modem", "sms", "user_ussd")%>', null,
|
||||||
|
function(x, json)
|
||||||
|
{
|
||||||
|
select = document.getElementById('pl');
|
||||||
|
|
||||||
|
var count = Object.keys(json).length;
|
||||||
|
|
||||||
|
|
||||||
|
for(var d=0;d<=count;d++)
|
||||||
|
{
|
||||||
|
var opt = document.createElement('option');
|
||||||
|
var s = json[d].usd;
|
||||||
|
var fields = s.split(/;/);
|
||||||
|
var name = fields[0];
|
||||||
|
var code = fields[1];
|
||||||
|
opt.text = name;
|
||||||
|
opt.value = code.trim();
|
||||||
|
opt.innerHTML = name;
|
||||||
|
select.appendChild(opt);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function copyFunction() {
|
||||||
|
var node = document.getElementById('odp');
|
||||||
|
node.style.visibility = 'hidden';
|
||||||
|
|
||||||
|
var x = document.getElementById("pl").value;
|
||||||
|
document.getElementById("code").value = x;
|
||||||
|
document.getElementById("odp").innerHTML = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function postcmd(cmd) {
|
||||||
|
(new XHR()).post("<%=luci.dispatcher.build_url("admin", "modem", "sms", "run_ussd")%>", {"code":cmd}, function(x) {
|
||||||
|
console.log(x.response)
|
||||||
|
console.log(x)
|
||||||
|
var cut = x.response;
|
||||||
|
if ( true == cut.includes("error: 0") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Phone/Modem failure.%>"};
|
||||||
|
if ( true == cut.includes("error: 1") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:No connection to phone.%>"};
|
||||||
|
if ( true == cut.includes("error: 2") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Phone/Modem adapter link reserved.%>"};
|
||||||
|
if ( true == cut.includes("error: 3") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Operation not allowed.%>"};
|
||||||
|
if ( true == cut.includes("error: 4") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Operation not supported.%>"};
|
||||||
|
if ( true == cut.includes("error: 5") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:PH_SIM PIN required.%>"};
|
||||||
|
if ( true == cut.includes("error: 6") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:PH_FSIM PIN required.%>"};
|
||||||
|
if ( true == cut.includes("error: 7") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:PH_FSIM PUK required.%>"};
|
||||||
|
if ( true == cut.includes("error: 10") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:SIM not inserted.%>"};
|
||||||
|
if ( true == cut.includes("error: 11") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:SIM PIN required.%>"};
|
||||||
|
if ( true == cut.includes("error: 12") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:SIM PUK required.%>"};
|
||||||
|
if ( true == cut.includes("error: 13") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:SIM failure.%>"};
|
||||||
|
if ( true == cut.includes("error: 14") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:SIM busy.%>"};
|
||||||
|
if ( true == cut.includes("error: 15") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:SIM wrong.%>"};
|
||||||
|
if ( true == cut.includes("error: 16") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Incorrect password.%>"};
|
||||||
|
if ( true == cut.includes("error: 17") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:SIM PIN2 required.%>"};
|
||||||
|
if ( true == cut.includes("error: 18") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:SIM PUK2 required.%>"};
|
||||||
|
if ( true == cut.includes("error: 20") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Memory full.%>"};
|
||||||
|
if ( true == cut.includes("error: 21") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Invalid index.%>"};
|
||||||
|
if ( true == cut.includes("error: 22") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Not found.%>"};
|
||||||
|
if ( true == cut.includes("error: 23") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Memory failure.%>"};
|
||||||
|
if ( true == cut.includes("error: 24") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Text string too long.%>"};
|
||||||
|
if ( true == cut.includes("error: 25") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Invalid characters in text string.%>"};
|
||||||
|
if ( true == cut.includes("error: 26") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Dial string too long.%>"};
|
||||||
|
if ( true == cut.includes("error: 27") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Invalid characters in dial string.%>"};
|
||||||
|
if ( true == cut.includes("error: 30") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:No network service.%>"};
|
||||||
|
if ( true == cut.includes("error: 31") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Network timeout.%>"};
|
||||||
|
if ( true == cut.includes("error: 32") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Network not allowed, emergency calls only.%>"};
|
||||||
|
if ( true == cut.includes("error: 40") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Network personalization PIN required.%>"};
|
||||||
|
if ( true == cut.includes("error: 41") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Network personalization PUK required.%>"};
|
||||||
|
if ( true == cut.includes("error: 42") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Network subset personalization PIN required.%>"};
|
||||||
|
if ( true == cut.includes("error: 43") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Network subset personalization PUK required.%>"};
|
||||||
|
if ( true == cut.includes("error: 44") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Service provider personalization PIN required.%>"};
|
||||||
|
if ( true == cut.includes("error: 45") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Service provider personalization PUK required.%>"};
|
||||||
|
if ( true == cut.includes("error: 46") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Corporate personalization PIN required.%>"};
|
||||||
|
if ( true == cut.includes("error: 47") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Corporate personalization PUK required.%>"};
|
||||||
|
if ( true == cut.includes("error: 48") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:PH-SIM PUK required.%>"};
|
||||||
|
if ( true == cut.includes("error: 100") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Unknown error.%>"};
|
||||||
|
if ( true == cut.includes("error: 103") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Illegal MS.%>"};
|
||||||
|
if ( true == cut.includes("error: 106") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Illegal ME.%>"};
|
||||||
|
if ( true == cut.includes("error: 107") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:GPRS services not allowed.%>"};
|
||||||
|
if ( true == cut.includes("error: 111") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:PLMN not allowed.%>"};
|
||||||
|
if ( true == cut.includes("error: 112") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Location area not allowed.%>"};
|
||||||
|
if ( true == cut.includes("error: 113") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Roaming not allowed in this location area.%>"};
|
||||||
|
if ( true == cut.includes("error: 126") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Operation temporary not allowed.%>"};
|
||||||
|
if ( true == cut.includes("error: 132") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Service operation not supported.%>"};
|
||||||
|
if ( true == cut.includes("error: 133") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Requested service option not subscribed.%>"};
|
||||||
|
if ( true == cut.includes("error: 134") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Service option temporary out of order.%>"};
|
||||||
|
if ( true == cut.includes("error: 148") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Unspecified GPRS error.%>"};
|
||||||
|
if ( true == cut.includes("error: 149") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:PDP authentication failure.%>"};
|
||||||
|
if ( true == cut.includes("error: 150") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Invalid mobile class.%>"};
|
||||||
|
if ( true == cut.includes("error: 256") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Operation temporarily not allowed.%>"};
|
||||||
|
if ( true == cut.includes("error: 257") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Call barred.%>"};
|
||||||
|
if ( true == cut.includes("error: 258") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Phone/Modem is busy.%>"};
|
||||||
|
if ( true == cut.includes("error: 259") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:User abort.%>"};
|
||||||
|
if ( true == cut.includes("error: 260") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Invalid dial string.%>"};
|
||||||
|
if ( true == cut.includes("error: 261") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:SS not executed.%>"};
|
||||||
|
if ( true == cut.includes("error: 262") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:SIM Blocked.%>"};
|
||||||
|
if ( true == cut.includes("error: 263") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Invalid block.%>"};
|
||||||
|
if ( true == cut.includes("error: 527") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Please wait, and retry your selection later (Specific Modem Sierra).%>"};
|
||||||
|
if ( true == cut.includes("error: 528") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Location update failure – emergency calls only (Specific Modem Sierra).%>"};
|
||||||
|
if ( true == cut.includes("error: 529") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:Selection failure – emergency calls only (Specific Modem Sierra).%>"};
|
||||||
|
if ( true == cut.includes("error: 772") ) {
|
||||||
|
document.getElementById("odp").innerHTML = "<%:SIM powered down.%>"};
|
||||||
|
if ( true != cut.includes("error: ") ) {
|
||||||
|
document.getElementById("odp").innerHTML = x.response};
|
||||||
|
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function (ev) {var button = document.getElementById("sendussd");
|
||||||
|
button.addEventListener("click", function () {
|
||||||
|
|
||||||
|
|
||||||
|
var s = document.getElementById("code").value;
|
||||||
|
if ( s.length == 0 )
|
||||||
|
{
|
||||||
|
document.getElementById("odp").innerHTML = "";
|
||||||
|
alert("<%:Please enter a USSD code%>");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var cmd = document.getElementById("code");
|
||||||
|
postcmd(cmd.value);
|
||||||
|
cmd.value = "";
|
||||||
|
|
||||||
|
var node = document.getElementById('odp');
|
||||||
|
if (node.style.visibility=='visible') {
|
||||||
|
node.style.visibility = 'hidden';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
node.style.visibility = 'visible'
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}, true);
|
||||||
|
|
||||||
|
|
||||||
|
//]]></script>
|
||||||
|
|
||||||
|
<%+footer%>
|
@ -1,15 +1,28 @@
|
|||||||
Check signal strength > AT+CSQ;AT+CSQ
|
------查询------;AT
|
||||||
Get the temperature of MT > AT+QTEMP;AT+QTEMP
|
查看IMEI;AT+CGSN
|
||||||
Current band in use > AT+QNWINFO;AT+QNWINFO
|
固件版本信息;AT+GMR
|
||||||
Carrier Agregation Info > AT+QCAINFO;AT+QCAINFO
|
信号强度;AT+CSQ
|
||||||
SIM Preferred Message Storage > AT+CPMS="SM","SM","SM";AT+CPMS="SM","SM","SM"
|
正在使用的网络信息;AT+QNWINFO
|
||||||
Save SMS Settings > AT+CSAS;AT+CSAS
|
查询限速;AT+C5GQOSRDP=1
|
||||||
Reboot the modem > AT+CFUN=1,1;AT+CFUN=1,1
|
模块温度;AT+QTEMP
|
||||||
Reset the modem > AT+CFUN=1;AT+CFUN=1
|
查询运营商名称;AT+QSPN
|
||||||
QMI/PPP/Default > AT+QCFG="usbnet",0;AT+QCFG="usbnet",0
|
查询小区信息;AT+QENG="servingcell"
|
||||||
ECM > AT+QCFG="usbnet",1;AT+QCFG="usbnet",1
|
-----3/4/5G网络配置-----;AT
|
||||||
MBIM > AT+QCFG="usbnet",2;AT+QCFG="usbnet",2
|
查询当前网络搜索模式;AT+QNWPREFCFG="mode_pref"
|
||||||
4G-LTE only > AT+QCFG="nwscanmode",3,1;AT+QCFG="nwscanmode",3,1
|
!切换仅3G;AT+QNWPREFCFG="mode_pref",WCDMA
|
||||||
WCDMA only > AT+QCFG="nwscanmode",2,1;AT+QCFG="nwscanmode",2,1
|
切换仅4G;AT+QNWPREFCFG="mode_pref",LTE
|
||||||
GSM only > AT+QCFG="nwscanmode",1,1;AT+QCFG="nwscanmode",1,1
|
切换仅5G;AT+QNWPREFCFG="mode_pref",NR5G
|
||||||
Scan all modes > AT+QCFG="nwscanmode",0,1;AT+QCFG="nwscanmode",0,11
|
切换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"
|
@ -1 +1 @@
|
|||||||
user;8613800138000
|
other user;8613188888888
|
||||||
|
Loading…
x
Reference in New Issue
Block a user