From 345efc453f525a2b1796b95852884538e0ae661b Mon Sep 17 00:00:00 2001 From: ling <1042585959@qq.com> Date: Wed, 10 Jan 2024 15:12:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=95=8C=E9=9D=A2=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luci-app-modem/luasrc/controller/modem.lua | 2 + .../luasrc/model/cbi/modem/index.lua | 2 +- luci-app-modem/luasrc/view/modem/at.htm | 150 ++++++++++++++++++ .../luasrc/view/modem/modem_info.htm | 72 +++++---- 4 files changed, 198 insertions(+), 28 deletions(-) create mode 100644 luci-app-modem/luasrc/view/modem/at.htm diff --git a/luci-app-modem/luasrc/controller/modem.lua b/luci-app-modem/luasrc/controller/modem.lua index aa9ef30..7a5bf85 100644 --- a/luci-app-modem/luasrc/controller/modem.lua +++ b/luci-app-modem/luasrc/controller/modem.lua @@ -29,6 +29,8 @@ function index() entry({"admin", "network", "modem", "send_at_command"}, call("sendATCommand"), nil).leaf = true entry({"admin", "network", "modem", "user_at_command"}, call("userATCommand"), nil).leaf = true entry({"admin", "network", "modem", "get_at_port"}, call("getATPort"), nil).leaf = true + + entry({"admin", "network", "modem", "at"},template("modem/at"),translate("AT"),40).leaf = true end -- 判断字符串是否含有字母 diff --git a/luci-app-modem/luasrc/model/cbi/modem/index.lua b/luci-app-modem/luasrc/model/cbi/modem/index.lua index 19facb3..d08fe88 100644 --- a/luci-app-modem/luasrc/model/cbi/modem/index.lua +++ b/luci-app-modem/luasrc/model/cbi/modem/index.lua @@ -61,7 +61,7 @@ end o = s:option(DummyValue, "dial_tool", translate("Dial Tool")) o.cfgvalue = function(t, n) - local dial_tool = (Value.cfgvalue(t, n) or ""):upper() + local dial_tool = (Value.cfgvalue(t, n) or "") if dial_tool == "" then dial_tool=translate("Auto Choose") end diff --git a/luci-app-modem/luasrc/view/modem/at.htm b/luci-app-modem/luasrc/view/modem/at.htm new file mode 100644 index 0000000..4ca2c2f --- /dev/null +++ b/luci-app-modem/luasrc/view/modem/at.htm @@ -0,0 +1,150 @@ +<%+header%> +<% +local sys = require "luci.sys" +local utl = require "luci.util" +local fs = require "nixio.fs" +local uci = require "luci.model.uci".cursor() +local s = uci:get("custom", "bandlock", "enabled") +local a = uci:get("custom", "atcmd", "enabled") + +local multilock = uci:get("custom", "multiuser", "multi") or "0" +local rootlock = uci:get("custom", "multiuser", "root") or "0" +nomulti=1 +if (multilock == "0") or (multilock == "1" and rootlock == "1") then + nosms = 1 + if a == "1" then + nosms = 0 + end +else + nosms = 1 + nomulti = 0 +end +block = 1 +if s == "1" then + block = 0 +end + +function showicon(lck) +end + +-%> + + + + +