优化界面显示
This commit is contained in:
parent
3b1398fc98
commit
345efc453f
@ -29,6 +29,8 @@ function index()
|
|||||||
entry({"admin", "network", "modem", "send_at_command"}, call("sendATCommand"), nil).leaf = true
|
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", "user_at_command"}, call("userATCommand"), nil).leaf = true
|
||||||
entry({"admin", "network", "modem", "get_at_port"}, call("getATPort"), 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
|
end
|
||||||
|
|
||||||
-- 判断字符串是否含有字母
|
-- 判断字符串是否含有字母
|
||||||
|
@ -61,7 +61,7 @@ end
|
|||||||
|
|
||||||
o = s:option(DummyValue, "dial_tool", translate("Dial Tool"))
|
o = s:option(DummyValue, "dial_tool", translate("Dial Tool"))
|
||||||
o.cfgvalue = function(t, n)
|
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
|
if dial_tool == "" then
|
||||||
dial_tool=translate("Auto Choose")
|
dial_tool=translate("Auto Choose")
|
||||||
end
|
end
|
||||||
|
150
luci-app-modem/luasrc/view/modem/at.htm
Normal file
150
luci-app-modem/luasrc/view/modem/at.htm
Normal file
@ -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
|
||||||
|
|
||||||
|
-%>
|
||||||
|
<script type="text/javascript" src="<%=resource%>/xhr.js"></script>
|
||||||
|
<script type="text/javascript">//<![CDATA[
|
||||||
|
|
||||||
|
|
||||||
|
function sendcmd(event)
|
||||||
|
{
|
||||||
|
|
||||||
|
var v = document.getElementById("drop1").value;
|
||||||
|
var s = document.getElementById("atcmd").value;
|
||||||
|
var r =document.getElementById("attxt").value;
|
||||||
|
if ( s.length == 0 )
|
||||||
|
{
|
||||||
|
|
||||||
|
document.getElementById("attxt").value= '<%:请输入AT命令!%>\r' + r;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
XHR.get('<%=luci.dispatcher.build_url("admin", "modem", "send_atcmd")%>',
|
||||||
|
{ set: s , p: v},
|
||||||
|
function(x, rv)
|
||||||
|
{
|
||||||
|
var pd = rv.result;
|
||||||
|
document.getElementById("attxt").value=pd + r;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
function sendclean(event)
|
||||||
|
{
|
||||||
|
document.getElementById("attxt").value='';
|
||||||
|
}
|
||||||
|
//]]></script>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="cbi-map" id="cbi-at-commands">
|
||||||
|
<h2 id="content" name="content"><%:AT Commands%></h2>
|
||||||
|
<div class="cbi-map-descr"><%:Debugging Your Module with AT Command%></div>
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
input {
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
#popup {
|
||||||
|
width:560px;
|
||||||
|
height:190px;
|
||||||
|
padding:20px;
|
||||||
|
background-color:gainsboro;
|
||||||
|
border-style : solid;
|
||||||
|
position:fixed;
|
||||||
|
top : 40%;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
text-align: center;
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
textarea{
|
||||||
|
background:#373737;
|
||||||
|
border:none;
|
||||||
|
color:#FFF;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<fieldset class="cbi-section" id="cbi-term">
|
||||||
|
<!-- <legend><%:AT Command Console%></legend> -->
|
||||||
|
<h3><%:AT Command Console%></h3>
|
||||||
|
<!-- <div id="popup">
|
||||||
|
<table width="500" border="0">
|
||||||
|
<tr>
|
||||||
|
<td width="50px"><div><%:Enter Password to Unlock Full Terminal%></div></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="200px"><input id="pass" type="password"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><input type="image" src="<%=showicon(0)%>" style="width:48px;height:48px;" onclick="return done()" /></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div> -->
|
||||||
|
|
||||||
|
<table width="700" border="0" id="droptxt">
|
||||||
|
<tr>
|
||||||
|
<td width="10%"><div align="right"><%:Quick Option%>:</div></td>
|
||||||
|
<td width="15%">
|
||||||
|
<div align="left">
|
||||||
|
<input type="radio" name="quick_option" value="auto" checked="checked">自动
|
||||||
|
<input type="radio" name="quick_option" value="custom">自定义
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td width="10%"><div align="right"><%:Quick Commands%>:</div></td>
|
||||||
|
<td width="15%"><select name="command_choose" id="command_choose" onclick="copyToSend()"></select></td>
|
||||||
|
<td width="10%"></td>
|
||||||
|
<td width="15%"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="10%"><div align="right"><%:Modem Select%>:</div></td>
|
||||||
|
<td width="15%"><select style="width:200px" name="modem_select" id="modem_select"></select></td>
|
||||||
|
<td width="10%"><div align="right"><%:AT Commands%>:</div></td>
|
||||||
|
<td width="15%"><input style="visibility:visible;width: 200px;maxlength="200" type="text" name="atcmdlck" id="atcmd" class="cbi-input-text"></input></td>
|
||||||
|
<td width="10%">
|
||||||
|
<input style="visibility:visible" type="submit" id="sendat" class="cbi-button cbi-button-apply" value="<%:发送%>" onclick="return sendcmd()" />
|
||||||
|
<input style="visibility:visible" type="submit" id="sendclean" class="cbi-button cbi-button-reset" value="<%:清除%>" onclick="return sendclean()" />
|
||||||
|
</td>
|
||||||
|
<td width="15%"></td>
|
||||||
|
<!-- <td width="47%"> </td> -->
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<textarea readonly="readonly" name="attxt" id="attxt" rows="50" style="width: 100%;" maxlength="160"></textarea>
|
||||||
|
<div class="table" width="100%">
|
||||||
|
<h2 name="content"><%=translate("TTYD Terminal")%></h2>
|
||||||
|
<iframe id="terminal" style="width: 100%; min-height: 500px; border: none; border-radius: 3px;" src="http://192.168.10.1:7681"></iframe>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%+footer%>
|
@ -12,7 +12,22 @@ if fs.stat("/etc/havegps") then
|
|||||||
havegps = 1
|
havegps = 1
|
||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
<style>g {color:grey; font-size:75%; vertical-align: super;}</style>
|
<style>
|
||||||
|
g {color:grey; font-size:75%; vertical-align: super;}
|
||||||
|
|
||||||
|
/*移动端显示优化*/
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
tr td:first-child {
|
||||||
|
width: 30%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
width: 100%;
|
||||||
|
border-spacing: 10px;
|
||||||
|
border: 0px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script type="text/javascript" src="<%=resource%>/xhr.js?v=git-23.159.15540-7154b89"></script>
|
<script type="text/javascript" src="<%=resource%>/xhr.js?v=git-23.159.15540-7154b89"></script>
|
||||||
<script type="text/javascript">//<![CDATA[
|
<script type="text/javascript">//<![CDATA[
|
||||||
|
|
||||||
@ -54,7 +69,7 @@ end
|
|||||||
value=translation[value];
|
value=translation[value];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sim_info_view+='<tr><td width="20%" title="'+full_name+'">'+translation[key]+' :</td><td id="'+key+'">'+value+'</td><td></td></tr>';
|
sim_info_view+='<tr><td width="20%" title="'+full_name+'">'+translation[key]+'</td><td id="'+key+'">'+value+'</td><td></td></tr>';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -117,7 +132,7 @@ end
|
|||||||
else if (key=="SCS") {
|
else if (key=="SCS") {
|
||||||
value=value+" KHz"
|
value=value+" KHz"
|
||||||
}
|
}
|
||||||
cell_info_view+='<tr><td width="20%" title="'+full_name+'">'+translation[key]+' :</td><td id="'+key+'">'+value+'</td><td></td></tr>';
|
cell_info_view+='<tr><td width="20%" title="'+full_name+'">'+translation[key]+'</td><td id="'+key+'">'+value+'</td><td></td></tr>';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -396,7 +411,7 @@ end
|
|||||||
|
|
||||||
<fieldset class="cbi-section" id="cbi-info" style="display: block;">
|
<fieldset class="cbi-section" id="cbi-info" style="display: block;">
|
||||||
<h3><%:Message%></h3>
|
<h3><%:Message%></h3>
|
||||||
<table width="550" border="0">
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="10%"></td>
|
<td width="10%"></td>
|
||||||
<td width="60%">
|
<td width="60%">
|
||||||
@ -412,18 +427,21 @@ end
|
|||||||
|
|
||||||
<fieldset class="cbi-section" id="cbi-baseinfo" style="display: none;">
|
<fieldset class="cbi-section" id="cbi-baseinfo" style="display: none;">
|
||||||
<h3><%:Base Information%></h3>
|
<h3><%:Base Information%></h3>
|
||||||
<table width="100%" cellspacing="10">
|
<table id="base_info">
|
||||||
<tr><td width="20%"><%:Modem%> :</td><td id="modem_name">
|
<tr>
|
||||||
<select name="modem_select" id="modem_select"></select>
|
<td width="20%"><%:Modem%></td><td id="modem_name">
|
||||||
</td><td></td></tr>
|
<select name="modem_select" id="modem_select"></select>
|
||||||
<tr><td width="20%"><%:Manufacturer%> :</td><td id="manufacturer"></td><td></td></tr>
|
</td>
|
||||||
<tr><td width="20%"><%:Revision%>:</td><td id="revision"></td><td></td></tr>
|
<td></td>
|
||||||
<tr><td width="20%"><%:Data Interface%> :</td><td id="data_interface"></td><td></td></tr>
|
</tr>
|
||||||
<tr><td width="20%"><%:Mode%> :</td><td id="mode"></td><td></td></tr>
|
<tr><td width="20%"><%:Manufacturer%></td><td id="manufacturer"></td><td></td></tr>
|
||||||
<tr><td width="20%"><%:AT Port%> :</td><td id="at_port"></td><td></td></tr>
|
<tr><td width="20%"><%:Revision%></td><td id="revision"></td><td></td></tr>
|
||||||
<tr><td width="20%"><%:Mobile Network%> :</td><td id="network"></td><td></td></tr>
|
<tr><td width="20%"><%:Data Interface%></td><td id="data_interface"></td><td></td></tr>
|
||||||
<tr><td width="20%"><%:Temperature%> :</td><td id="temperature"></td><td></td></tr>
|
<tr><td width="20%"><%:Mode%></td><td id="mode"></td><td></td></tr>
|
||||||
<tr><td width="20%"><%:Update Time%> :</td><td id="update_time"></td><td></td></tr>
|
<tr><td width="20%"><%:AT Port%></td><td id="at_port"></td><td></td></tr>
|
||||||
|
<tr><td width="20%"><%:Mobile Network%></td><td id="network"></td><td></td></tr>
|
||||||
|
<tr><td width="20%"><%:Temperature%></td><td id="temperature"></td><td></td></tr>
|
||||||
|
<tr><td width="20%"><%:Update Time%></td><td id="update_time"></td><td></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
@ -432,7 +450,7 @@ end
|
|||||||
|
|
||||||
<fieldset class="cbi-section" id="cbi-siminfo" style="display: none;">
|
<fieldset class="cbi-section" id="cbi-siminfo" style="display: none;">
|
||||||
<h3><%:SIM Information%></h3>
|
<h3><%:SIM Information%></h3>
|
||||||
<table width="100%" cellspacing="10" id="sim_info">
|
<table id="sim_info">
|
||||||
<!-- <tr><td width="20%"><%:SIM Status%> :</td><td id="sim_status"></td><td></td></tr>
|
<!-- <tr><td width="20%"><%:SIM Status%> :</td><td id="sim_status"></td><td></td></tr>
|
||||||
<tr><td width="20%"><%:ISP%> :</td><td id="isp"></td><td></td></tr>
|
<tr><td width="20%"><%:ISP%> :</td><td id="isp"></td><td></td></tr>
|
||||||
<tr><td width="20%"><%:SIM Slot%> :</td><td id="sim_slot"></td><td></td></tr>
|
<tr><td width="20%"><%:SIM Slot%> :</td><td id="sim_slot"></td><td></td></tr>
|
||||||
@ -445,14 +463,14 @@ end
|
|||||||
|
|
||||||
<fieldset class="cbi-section" id="cbi-networkinfo" style="display: none;">
|
<fieldset class="cbi-section" id="cbi-networkinfo" style="display: none;">
|
||||||
<h3><%:Network Information%></h3>
|
<h3><%:Network Information%></h3>
|
||||||
<table width="100%" cellspacing="10">
|
<table>
|
||||||
<tr><td width="20%"><%:Network Type%> :</td><td id="network_type"></td><td></td></tr>
|
<tr><td width="20%"><%:Network Type%></td><td id="network_type"></td><td></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset class="cbi-section" id="cbi-cellinfo" style="display: none;">
|
<fieldset class="cbi-section" id="cbi-cellinfo" style="display: none;">
|
||||||
<h3><%:Cell Information%></h3>
|
<h3><%:Cell Information%></h3>
|
||||||
<table width="100%" cellspacing="10" id="cell_info">
|
<table id="cell_info">
|
||||||
<!-- <tr><td width="20%"><%:MCC/MNC 国家码/网络码 %> :</td><td id="nr_mcc"></td><td id="nr_mnc"></td></tr>
|
<!-- <tr><td width="20%"><%:MCC/MNC 国家码/网络码 %> :</td><td id="nr_mcc"></td><td id="nr_mnc"></td></tr>
|
||||||
<tr><td width="20%"><%:Duplex Mode 双工模式 %> :</td><td id="nr_duplex_mode"></td><td></td></tr>
|
<tr><td width="20%"><%:Duplex Mode 双工模式 %> :</td><td id="nr_duplex_mode"></td><td></td></tr>
|
||||||
<tr><td width="20%"><%:Cell ID 小区ID %> :</td><td><ul><span id="nr_cell_id" class="r"></span><span id="cidn" class="r"></span></ul></td><td></td></tr>
|
<tr><td width="20%"><%:Cell ID 小区ID %> :</td><td><ul><span id="nr_cell_id" class="r"></span><span id="cidn" class="r"></span></ul></td><td></td></tr>
|
||||||
@ -504,16 +522,16 @@ end
|
|||||||
<% if havegps == 1 then %>
|
<% if havegps == 1 then %>
|
||||||
<fieldset class="cbi-section" id="cbi-gpsinfo">
|
<fieldset class="cbi-section" id="cbi-gpsinfo">
|
||||||
<h3><%:GPS 定位%></h3>
|
<h3><%:GPS 定位%></h3>
|
||||||
<table width="550" border="0">
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="30%"><div align="right"><%:纬度 %> :</div></td>
|
<td width="30%"><div align="right"><%:纬度 %> :</div></td>
|
||||||
<td><ul id="lat"></ul></td>
|
<td><ul id="lat"></ul></td>
|
||||||
<td width="1%"> </td>
|
<td width="1%"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><div align="right"><%:经度 %> :</div></td>
|
<td><div align="right"><%:经度 %> :</div></td>
|
||||||
<td><ul id="long"></ul></td>
|
<td><ul id="long"></ul></td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user