989 lines
33 KiB
HTML
989 lines
33 KiB
HTML
<%+header%>
|
||
<script type="text/javascript" src="<%=resource%>/xhr.js"></script>
|
||
<script type="text/javascript">//<![CDATA[
|
||
|
||
window.onload=function()
|
||
{
|
||
//获取模组选择框元素
|
||
var modem_select = document.getElementById('modem_select');
|
||
//更换模组(AT串口)时触发
|
||
modem_select.addEventListener('change', function() {
|
||
//获取快捷命令
|
||
get_quick_commands();
|
||
//获取模组调试信息
|
||
get_modem_debug_info();
|
||
});
|
||
|
||
//获取快捷选项父元素
|
||
var quick_option_element = document.getElementById('quick_option_td');
|
||
//更换快捷选项时触发
|
||
quick_option_element.addEventListener('change', function(event) {
|
||
var target = event.target;
|
||
if (target.matches('input[type="radio"]')) {
|
||
//获取快捷命令
|
||
get_quick_commands();
|
||
}
|
||
});
|
||
|
||
//获取快捷AT命令选择框元素
|
||
var command_select = document.getElementById('command_select');
|
||
//更换快捷AT命令时触发
|
||
command_select.addEventListener("change", function() {
|
||
//自动填写到命令输入框
|
||
copy_to_input();
|
||
});
|
||
|
||
//获取快捷AT命令选择框元素
|
||
command_select = document.getElementById('command_select');
|
||
//点击快捷AT命令时触发(解决情况再选的问题)
|
||
command_select.addEventListener("click", function() {
|
||
//自动填写到命令输入框
|
||
copy_to_input();
|
||
});
|
||
|
||
//获取网络偏好选项元素
|
||
var prefer_option_auto = document.getElementById('prefer_option_auto');
|
||
var prefer_option_custom = document.getElementById('prefer_option_custom');
|
||
//网络偏好选项为自动时触发
|
||
prefer_option_auto.addEventListener('change', function() {
|
||
if (prefer_option_auto.checked)
|
||
{
|
||
//禁用偏好复选框
|
||
disabled_prefer_custom_config(true);
|
||
//全选偏好复选框
|
||
all_choose_prefer_custom_config(true);
|
||
}
|
||
});
|
||
//网络偏好选项为自定义时触发
|
||
prefer_option_custom.addEventListener('change', function() {
|
||
if (prefer_option_custom.checked)
|
||
{
|
||
//禁用偏好复选框
|
||
disabled_prefer_custom_config(false);
|
||
}
|
||
});
|
||
}
|
||
|
||
// 自动填写到快捷AT命令到输入框
|
||
function copy_to_input()
|
||
{
|
||
var command_select = document.getElementById("command_select").value;
|
||
document.getElementById("at_command").value = command_select;
|
||
}
|
||
|
||
// 发送AT命令
|
||
function send(at_port,at_command)
|
||
{
|
||
XHR.get('<%=luci.dispatcher.build_url("admin", "network", "modem", "send_at_command")%>', {"port":at_port,"command":at_command},
|
||
function(x, data)
|
||
{
|
||
responseElement=document.getElementById("response");
|
||
if ("response" in data) {
|
||
//显示当前时间
|
||
responseElement.value+=data["time"]+" ";
|
||
//显示返回值
|
||
responseElement.value+=data["response"];
|
||
//滚动到底部
|
||
responseElement.scrollTop = responseElement.scrollHeight;
|
||
}
|
||
}
|
||
);
|
||
}
|
||
|
||
// 发送AT命令前处理
|
||
function send_at_command(event)
|
||
{
|
||
//获取选中的模组(选中的AT串口)
|
||
var at_port = document.getElementById("modem_select").value;
|
||
if ( at_port.length == 0 )
|
||
{
|
||
alert("<%:Please choose a Modem%>");
|
||
return false;
|
||
}
|
||
|
||
//获取AT命令
|
||
var at_command = document.getElementById("at_command").value;
|
||
if ( at_command.length == 0 )
|
||
{
|
||
alert("<%:Please enter a AT Command%>");
|
||
return false;
|
||
}
|
||
|
||
//对双引号进行特殊处理
|
||
at_command=at_command.replaceAll("\"","\\\"");
|
||
|
||
//发送AT命令
|
||
send(at_port,at_command);
|
||
return true;
|
||
}
|
||
|
||
// 清除AT命令
|
||
function clean_at_command(event)
|
||
{
|
||
document.getElementById("at_command").value='';
|
||
}
|
||
|
||
// 清除AT响应
|
||
function clean_response(event)
|
||
{
|
||
document.getElementById("response").value='';
|
||
}
|
||
|
||
// 设置AT串口选项
|
||
function set_at_port(at_ports,translation)
|
||
{
|
||
// 获取模组选择框元素
|
||
var modem_select = document.getElementById('modem_select');
|
||
// 记录所选
|
||
var selected=modem_select.value;
|
||
// 删除原来的选项
|
||
modem_select.options.length=0;
|
||
//遍历每一个AT串口
|
||
for (var port of at_ports)
|
||
{
|
||
//更新(key:AT串口,value:模块名称)
|
||
for (var key in port)
|
||
{
|
||
var option = document.createElement('option');
|
||
option.value = key;
|
||
var language=navigator.language;
|
||
if (port[key].includes("unknown"))
|
||
{
|
||
option.text = port[key].replace("unknown", key);
|
||
}
|
||
else
|
||
{
|
||
option.text = port[key];
|
||
}
|
||
modem_select.appendChild(option);
|
||
}
|
||
}
|
||
// 恢复原来的选择
|
||
for (let i = 0; i < modem_select.options.length; i++)
|
||
{
|
||
if(modem_select.options[i].value == selected)
|
||
{
|
||
modem_select.selectedIndex=i;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 无模组界面
|
||
function no_modems_view()
|
||
{
|
||
//更新提示信息
|
||
document.getElementById("info_message").innerHTML="<strong><%:No modems found%></strong>";
|
||
//显示提示信息
|
||
document.getElementById("cbi-info").style.display="block";
|
||
//隐藏模组选择界面
|
||
document.getElementById("cbi-modem").style.display="none";
|
||
//隐藏拨号模式界面
|
||
document.getElementById("cbi-mode").style.display="none";
|
||
//隐藏网络偏好界面
|
||
document.getElementById("cbi-network-prefer").style.display="none";
|
||
//隐藏模组自检界面
|
||
document.getElementById("cbi-modem-self-test").style.display="none";
|
||
//隐藏AT界面
|
||
document.getElementById("cbi-at").style.display="none";
|
||
}
|
||
|
||
// 有模组界面
|
||
function modems_view()
|
||
{
|
||
//显示模组选择界面
|
||
document.getElementById("cbi-modem").style.display="block";
|
||
//显示AT命令界面
|
||
document.getElementById("cbi-at").style.display="block";
|
||
//隐藏提示信息
|
||
// document.getElementById("cbi-info").style.display="none";
|
||
}
|
||
|
||
// 未适配模组界面
|
||
function not_adapted_modems_view()
|
||
{
|
||
// 更新提示信息
|
||
document.getElementById("info_message").innerHTML="<strong><%:Not adapted to this modem%></strong>";
|
||
// 显示提示信息
|
||
document.getElementById("cbi-info").style.display="block";
|
||
//隐藏拨号模式界面
|
||
document.getElementById("cbi-mode").style.display="none";
|
||
//隐藏网络偏好界面
|
||
document.getElementById("cbi-network-prefer").style.display="none";
|
||
//隐藏模组自检界面
|
||
document.getElementById("cbi-modem-self-test").style.display="none";
|
||
}
|
||
|
||
// 全功能界面
|
||
function all_function_view()
|
||
{
|
||
//显示拨号模式界面
|
||
document.getElementById("cbi-mode").style.display="block";
|
||
//显示网络偏好界面
|
||
document.getElementById("cbi-network-prefer").style.display="block";
|
||
//显示模组自检界面
|
||
document.getElementById("cbi-modem-self-test").style.display="block";
|
||
//隐藏提示信息
|
||
document.getElementById("cbi-info").style.display="none";
|
||
}
|
||
|
||
|
||
// 更新选项
|
||
function update_option(select_element,data,order)
|
||
{
|
||
//记录所选
|
||
var selected=select_element.value;
|
||
//删除原来的选项
|
||
select_element.options.length=0;
|
||
|
||
//是否有顺序
|
||
if (order)
|
||
{
|
||
//遍历每一条信息
|
||
for (var info of data)
|
||
{
|
||
//遍历每一条信息里的键
|
||
for (var key in info)
|
||
{
|
||
var option = document.createElement('option');
|
||
option.text = key;
|
||
option.value = info[key];
|
||
select_element.appendChild(option);
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
//遍历每一条信息里的键
|
||
for (var key of data)
|
||
{
|
||
var option = document.createElement('option');
|
||
option.text = key;
|
||
option.value = info[key];
|
||
select_element.appendChild(option);
|
||
}
|
||
}
|
||
|
||
//恢复原来的选择
|
||
for (let i = 0; i < select_element.options.length; i++)
|
||
{
|
||
if(select_element.options[i].value == selected)
|
||
{
|
||
select_element.selectedIndex=i;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
// 获取快捷命令
|
||
function get_quick_commands()
|
||
{
|
||
//获取快捷选项
|
||
var quick_option = document.querySelector('input[name="quick_option"]:checked').value;
|
||
//获取选中的模组
|
||
var at_port = document.getElementById("modem_select").value;
|
||
|
||
//获取AT命令
|
||
XHR.get('<%=luci.dispatcher.build_url("admin", "network", "modem", "get_quick_commands")%>', {"option":quick_option,"port":at_port},
|
||
function(x, data)
|
||
{
|
||
//获取模组选择框元素
|
||
var command_select = document.getElementById('command_select');
|
||
//更新选项
|
||
update_option(command_select,data["quick_commands"],true);
|
||
|
||
//显示有模组界面
|
||
modems_view();
|
||
}
|
||
);
|
||
}
|
||
|
||
// 全选网络偏好复选框
|
||
function all_choose_prefer_custom_config(status)
|
||
{
|
||
var checkboxes=document.getElementById('prefer_custom_config').querySelectorAll('input[type="checkbox"]');
|
||
for(checkbox of checkboxes)
|
||
{
|
||
//设置网络偏好复选框状态
|
||
checkbox.checked=status;
|
||
}
|
||
}
|
||
|
||
// 禁用网络偏好复选框
|
||
function disabled_prefer_custom_config(status)
|
||
{
|
||
var checkboxes=document.getElementById('prefer_custom_config').querySelectorAll('input[type="checkbox"]');
|
||
for(checkbox of checkboxes)
|
||
{
|
||
//禁用
|
||
checkbox.disabled=status;
|
||
}
|
||
}
|
||
|
||
// 禁用功能
|
||
function disabled_function(function_name,status)
|
||
{
|
||
//拨号模式
|
||
if (function_name=="mode")
|
||
{
|
||
modes=["qmi","ecm","mbim","rndis","ncm"]
|
||
for(mode of modes)
|
||
{
|
||
mode_element=document.getElementById('mode_option_'+mode)
|
||
if (mode_element!=null) {
|
||
mode_element.disabled=status;
|
||
}
|
||
}
|
||
|
||
//模式按钮
|
||
document.getElementById('mode_button').disabled=status;
|
||
}
|
||
//网络偏好
|
||
else if (function_name=="network_prefer")
|
||
{
|
||
//偏好选项
|
||
document.getElementById('prefer_option_auto').disabled=status;
|
||
document.getElementById('prefer_option_custom').disabled=status;
|
||
|
||
//网络偏好为自动则不启用
|
||
var prefer_option_auto = document.getElementById('prefer_option_auto');
|
||
if (!prefer_option_auto.checked)
|
||
{
|
||
//偏好复选框
|
||
disabled_prefer_custom_config(status);
|
||
}
|
||
|
||
//偏好按钮
|
||
document.getElementById('network_prefer_button').disabled=status;
|
||
}
|
||
}
|
||
|
||
// 设置拨号模式信息
|
||
function set_mode_info(mode_info,first_cache)
|
||
{
|
||
//获取当前拨号模式
|
||
var current_mode=mode_info["mode"];
|
||
//获取支持的拨号模式
|
||
var modes=mode_info["modes"];
|
||
|
||
//获取模式视图
|
||
var current_mode_view=current_mode.toUpperCase();
|
||
|
||
//设置当前拨号模式
|
||
document.getElementById('current_mode').innerHTML=current_mode_view;
|
||
|
||
if (first_cache)
|
||
{
|
||
//设置支持的拨号模式
|
||
var mode_option_view='';
|
||
for(mode of modes)
|
||
{
|
||
if (mode=="gobinet")
|
||
{
|
||
mode_option_view=mode_option_view.replace("QMI","QMI/GobiNet");
|
||
}
|
||
else
|
||
{
|
||
mode_option_view+='<span class="cbi-radio"><input type="radio" name="mode_option" id="mode_option_'+mode+'" value="'+mode+'"><span>'+mode.toUpperCase()+'</span></span> ';
|
||
}
|
||
}
|
||
document.getElementById('mode_option').innerHTML=mode_option_view;
|
||
|
||
//设置拨号模式选项
|
||
document.getElementById('mode_option_'+current_mode).checked=true;
|
||
}
|
||
}
|
||
|
||
// 设置拨号模式
|
||
function set_mode()
|
||
{
|
||
//禁用功能
|
||
disabled_function("mode",true);
|
||
|
||
//获取模式选项
|
||
var mode_config = document.querySelector('input[name="mode_option"]:checked').value;
|
||
//获取选中的模组
|
||
var at_port = document.getElementById("modem_select").value;
|
||
|
||
//设置偏好
|
||
XHR.get('<%=luci.dispatcher.build_url("admin", "network", "modem", "set_mode")%>', {"port":at_port,"mode_config":mode_config},
|
||
function(x, data)
|
||
{
|
||
//获取模组拨号模式
|
||
var current_mode=data;
|
||
|
||
//获取模式视图
|
||
var current_mode_view=current_mode.toUpperCase();
|
||
|
||
//设置当前拨号模式
|
||
document.getElementById('current_mode').innerHTML=current_mode_view;
|
||
|
||
//启用功能
|
||
disabled_function("mode",false);
|
||
}
|
||
);
|
||
}
|
||
|
||
// 获取当前网络视图
|
||
function get_current_prefer_view(network_prefer)
|
||
{
|
||
var current_prefer_view="";
|
||
|
||
//自动状态判断(全部选中为自动)
|
||
if (network_prefer["3G"]&&network_prefer["4G"]&&network_prefer["5G"])
|
||
{
|
||
//更新当前偏好
|
||
current_prefer_view="AUTO";
|
||
}
|
||
else
|
||
{
|
||
//更新当前偏好
|
||
for(key in network_prefer)
|
||
{
|
||
if (network_prefer[key]) {
|
||
current_prefer_view+=key+" ";
|
||
}
|
||
}
|
||
}
|
||
|
||
return current_prefer_view;
|
||
}
|
||
|
||
// 设置网络偏好信息
|
||
function set_network_prefer_info(network_prefer_info,first_cache)
|
||
{
|
||
//获取模组网络偏好
|
||
var network_prefer=network_prefer_info["network_prefer"];
|
||
|
||
//获取偏好视图
|
||
var current_prefer_view=get_current_prefer_view(network_prefer);
|
||
|
||
//设置当前网络偏好
|
||
document.getElementById('current_prefer').innerHTML=current_prefer_view;
|
||
|
||
//设置偏好选项和复选框
|
||
if (first_cache)
|
||
{
|
||
if (network_prefer["3G"]&&network_prefer["4G"]&&network_prefer["5G"])
|
||
{
|
||
//设置偏好选项
|
||
document.getElementById('prefer_option_auto').checked=true;
|
||
//更新偏好配置
|
||
all_choose_prefer_custom_config(true);
|
||
//禁用用偏好复选框
|
||
disabled_prefer_custom_config(true);
|
||
}
|
||
else
|
||
{
|
||
//设置偏好选项
|
||
document.getElementById('prefer_option_custom').checked=true;
|
||
//更新偏好配置
|
||
for (key in network_prefer)
|
||
{
|
||
//设置偏好配置
|
||
var prefer_config_element=document.getElementById('prefer_config_'+key.toLowerCase());
|
||
if (prefer_config_element!=null) {
|
||
prefer_config_element.checked=network_prefer[key];
|
||
}
|
||
}
|
||
//启用偏好复选框
|
||
disabled_prefer_custom_config(false);
|
||
}
|
||
}
|
||
}
|
||
|
||
// 设置模组自检信息
|
||
function set_modem_self_test_info(self_test_info)
|
||
{
|
||
// console.log(self_test_info);
|
||
|
||
//获取模组自检
|
||
// var self_test=self_test_info["self_test"];
|
||
|
||
// //获取自检视图
|
||
// var self_test_view=set_current_self_test_view(self_test);
|
||
// //获取
|
||
// var self_test_view=set_current_self_test_view(self_test);
|
||
|
||
// //设置当前电压信息
|
||
// document.getElementById('current_voltage').innerHTML=current_self_test_view;
|
||
document.getElementById('current_voltage').innerHTML=self_test_info/1000;
|
||
|
||
// 设置电压状态
|
||
var state = '';
|
||
var css = '';
|
||
if (self_test_info<3135)
|
||
{
|
||
state = "<%:Abnormal%>";
|
||
color = "red";
|
||
}
|
||
else if (self_test_info>3135 && self_test_info<3300)
|
||
{
|
||
state = "<%:Low%>";
|
||
color = "goldenrod";
|
||
}
|
||
else //大于3300(3.3V)
|
||
{
|
||
state = "<%:Normal%>";
|
||
color = "green";
|
||
}
|
||
var voltage_status=document.getElementById('voltage_status');
|
||
voltage_status.innerHTML=state;
|
||
voltage_status.style.color=color
|
||
|
||
// //设置当前温度信息
|
||
// document.getElementById('current_temperature').innerHTML=current_self_test_view;
|
||
}
|
||
|
||
// 设置网络偏好
|
||
function set_network_prefer()
|
||
{
|
||
//禁用功能
|
||
disabled_function("network_prefer",true);
|
||
|
||
//获取偏好选项
|
||
var prefer_option = document.querySelector('input[name="prefer_option"]:checked').value;
|
||
//获取选中的模组
|
||
var at_port = document.getElementById("modem_select").value;
|
||
|
||
//获取偏好配置
|
||
var network_prefer_config={};
|
||
if (prefer_option=="auto")
|
||
{
|
||
network_prefer_config["3G"]=1;
|
||
network_prefer_config["4G"]=1;
|
||
network_prefer_config["5G"]=1;
|
||
}
|
||
else
|
||
{
|
||
var checkboxes=document.getElementById('prefer_custom_config').querySelectorAll('input[type="checkbox"]');
|
||
for(checkbox of checkboxes)
|
||
{
|
||
network_prefer_config[checkbox.value.toUpperCase()]=Number(checkbox.checked);
|
||
}
|
||
}
|
||
|
||
//设置偏好
|
||
XHR.get('<%=luci.dispatcher.build_url("admin", "network", "modem", "set_network_prefer")%>', {"port":at_port,"prefer_config":network_prefer_config},
|
||
function(x, data)
|
||
{
|
||
//获取模组网络偏好
|
||
var network_prefer=data["network_prefer"];
|
||
|
||
//获取当前偏好视图
|
||
var current_prefer_view=get_current_prefer_view(network_prefer);
|
||
|
||
//设置模组当前网络偏好
|
||
document.getElementById('current_prefer').innerHTML=current_prefer_view;
|
||
|
||
//启用功能
|
||
disabled_function("network_prefer",false);
|
||
}
|
||
);
|
||
}
|
||
|
||
// 获取模组调试信息
|
||
function get_modem_debug_info(debug_params)
|
||
{
|
||
//获取选中的模组
|
||
var at_port = document.getElementById("modem_select").value;
|
||
|
||
//获取调试信息
|
||
XHR.get('<%=luci.dispatcher.build_url("admin", "network", "modem", "get_modem_debug_info")%>', {"port":at_port},
|
||
function(x, data)
|
||
{
|
||
var mode_info=data["mode_info"];
|
||
var network_prefer_info=data["network_prefer_info"];
|
||
var self_test_info=data["self_test_info"];
|
||
if (Object.keys(mode_info).length==0||Object.keys(network_prefer_info).length==0) {
|
||
//显示未适配模组界面
|
||
not_adapted_modems_view();
|
||
return false
|
||
}
|
||
|
||
//设置模式信息
|
||
set_mode_info(mode_info,debug_params.first_cache);
|
||
|
||
//设置网络偏好信息
|
||
set_network_prefer_info(network_prefer_info,debug_params.first_cache);
|
||
|
||
//设置模组自检信息
|
||
set_modem_self_test_info(self_test_info);
|
||
|
||
//设置第一次获取数据标志
|
||
debug_params.first_cache=false;
|
||
|
||
//显示全功能界面
|
||
all_function_view();
|
||
}
|
||
);
|
||
}
|
||
|
||
// 定时触发更新AT串口
|
||
XHR.poll(5,'<%=luci.dispatcher.build_url("admin", "network", "modem", "get_at_port")%>', null,
|
||
(function()
|
||
{
|
||
//缓存当前选择的模组
|
||
var modem_select_cache="";
|
||
var debug_params={first_cache:true};
|
||
return function(x, data)
|
||
{
|
||
var at_ports=data["at_ports"];
|
||
var translation=data["translation"];
|
||
|
||
//设置AT串口选项
|
||
set_at_port(at_ports,translation);
|
||
|
||
//获取快捷命令
|
||
if (Object.keys(at_ports).length==0)
|
||
{
|
||
//显示无模组界面
|
||
no_modems_view();
|
||
}
|
||
else
|
||
{
|
||
//获取当前的选择的模组名称
|
||
var modem_select_element = document.getElementById('modem_select');
|
||
var select_modem_name = modem_select_element.options[modem_select_element.selectedIndex].text;
|
||
|
||
if (select_modem_name != modem_select_cache)
|
||
{
|
||
//获取快捷选项
|
||
var quick_option = document.querySelector('input[name="quick_option"]:checked').value;
|
||
if (quick_option=="auto") {
|
||
get_quick_commands();
|
||
}
|
||
modem_select_cache=select_modem_name;
|
||
|
||
//设置第一次获取数据标志
|
||
debug_params.first_cache=true;
|
||
}
|
||
|
||
//获取模组调试信息
|
||
get_modem_debug_info(debug_params);
|
||
}
|
||
};
|
||
})()
|
||
);
|
||
|
||
//]]>
|
||
</script>
|
||
|
||
<div class="cbi-map" id="cbi-modem-debug">
|
||
<h2 id="content" name="content"><%:Modem Debug%></h2>
|
||
<div class="cbi-map-descr"><%:Debug Your Module%></div>
|
||
<head>
|
||
<style type="text/css">
|
||
/* table {
|
||
width: 100%;
|
||
border-spacing: 10px;
|
||
border: 0px;
|
||
} */
|
||
|
||
tr td:first-child {
|
||
width: 33%;
|
||
}
|
||
|
||
/* AT命令响应 */
|
||
/* #response_label {
|
||
font-size: 15px;
|
||
} */
|
||
|
||
/* 终端 */
|
||
textarea {
|
||
background:#373737;
|
||
border:none;
|
||
color:#FFF;
|
||
width: 100%;
|
||
}
|
||
|
||
#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;
|
||
}
|
||
</style>
|
||
</head>
|
||
|
||
<fieldset class="cbi-section" id="cbi-info" style="display: block;">
|
||
<div class="cbi-section fade-in">
|
||
<h3><%:Message%></h3>
|
||
<table class="table" id="message">
|
||
<tr class="tr">
|
||
<td colspan="2" class="td left">
|
||
<div align="left" id="info_message" style="font-size:1.875em">
|
||
<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle"/>
|
||
<%:Loading modem%>...
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
</fieldset>
|
||
|
||
<fieldset class="cbi-section" id="cbi-modem" style="display: none;">
|
||
<div class="cbi-section fade-in">
|
||
<!-- <legend><%:Modem Select%></legend> -->
|
||
<h3><%:Modem Select%></h3>
|
||
<div class="cbi-section-node">
|
||
<div class="cbi-value cbi-value-last">
|
||
<label class="cbi-value-title"><%:Modem Name%></label>
|
||
<div class="cbi-value-field">
|
||
<div class="cbi-checkbox">
|
||
<select name="modem_select" id="modem_select" class="cbi-input-select"></select>
|
||
</div>
|
||
<div class="cbi-value-description">
|
||
<%:Select a modem for debugging%>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</fieldset>
|
||
|
||
<!-- <fieldset class="cbi-section" id="cbi-mode" style="display: none;">
|
||
<div class="cbi-section">
|
||
<ul class="cbi-tabmenu">
|
||
<li class="cbi-tab" data-tab="traffic"><a href="#">流量分布</a></li>
|
||
<li class="cbi-tab-disabled" data-tab="layer7"><a href="#">应用层协议</a></li>
|
||
<li class="cbi-tab-disabled" data-tab="ipv6"><a href="#">IPv6</a></li>
|
||
<li class="cbi-tab-disabled" data-tab="export"><a href="#">导出</a></li>
|
||
</ul> -->
|
||
<!-- <div class="cbi-section-node cbi-section-node-tabbed" id="cbi-modem-bcfdc2df58a1440a9bab98c7d37ce93c" data-tab-group="0" data-initialized="true">
|
||
<div class="cbi-tabcontainer" id="container.modem.bcfdc2df58a1440a9bab98c7d37ce93c.general" data-tab="general" data-tab-title="常规设置" data-tab-active="true">
|
||
<div class="cbi-value" id="cbi-modem-bcfdc2df58a1440a9bab98c7d37ce93c-enable" data-index="1" data-depends="[]"><label class="cbi-value-title" for="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.enable">启用</label>
|
||
<div class="cbi-value-field">
|
||
<div id="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.enable" class="cbi-checkbox" data-idref="e234c82a"><input type="hidden" name="cbi.cbe.modem.bcfdc2df58a1440a9bab98c7d37ce93c.enable" value="1"><input id="cbe81b0aab" name="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.enable" type="checkbox" value="1" checked="" data-widget-id="widget.cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.enable"><label for="cbe81b0aab"></label></div>
|
||
</div></div>
|
||
<div class="cbi-value" id="cbi-modem-bcfdc2df58a1440a9bab98c7d37ce93c-remarks" data-index="2" data-depends="[]"><label class="cbi-value-title" for="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.remarks">备注</label>
|
||
<div class="cbi-value-field">
|
||
<div id="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.remarks" data-idref="30622a74"><input id="widget.cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.remarks" name="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.remarks" type="text" class="cbi-input-text" value="5GUSB"></div>
|
||
</div></div>
|
||
<div class="cbi-value cbi-value-last" id="cbi-modem-bcfdc2df58a1440a9bab98c7d37ce93c-network" data-index="3" data-depends="[]"><label class="cbi-value-title" for="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.network">移动网络</label>
|
||
<div class="cbi-value-field">
|
||
<div id="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.network" data-idref="f8c7e254"><select id="widget.cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.network" name="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.network" size="1" class="cbi-input-select"><option value="wwan0" selected="">wwan0 (FM150-AE)</option></select></div>
|
||
</div></div>
|
||
</div>
|
||
<div class="cbi-tabcontainer" id="container.modem.bcfdc2df58a1440a9bab98c7d37ce93c.advanced" data-tab="advanced" data-tab-title="高级设置" data-tab-active="false">
|
||
<div class="cbi-value" id="cbi-modem-bcfdc2df58a1440a9bab98c7d37ce93c-dial_tool" data-index="1" data-depends="[]"><label class="cbi-value-title" for="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.dial_tool">拨号工具</label>
|
||
<div class="cbi-value-field">
|
||
<div id="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.dial_tool" data-idref="184707a1"><select id="widget.cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.dial_tool" name="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.dial_tool" size="1" class="cbi-input-select"><option value="">自动选择</option><option value="quectel-CM">移远模组拨号工具</option><option value="mmcli" selected="">mmcli</option></select></div>
|
||
<div class="cbi-value-description">
|
||
After switching the dialing tool, it may be necessary to restart the module or restart the router to recognize the module.
|
||
</div></div></div>
|
||
<div class="cbi-value" id="cbi-modem-bcfdc2df58a1440a9bab98c7d37ce93c-pdp_type" data-index="2" data-depends="[]"><label class="cbi-value-title" for="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.pdp_type">网络类型</label>
|
||
<div class="cbi-value-field">
|
||
<div id="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.pdp_type" data-idref="74f51b28"><select id="widget.cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.pdp_type" name="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.pdp_type" size="1" class="cbi-input-select"><option value="ipv4">IPv4</option><option value="ipv6">IPv6</option><option value="ipv4v6" selected="">IPv4/IPv6</option></select></div>
|
||
</div></div>
|
||
<div class="cbi-value" id="cbi-modem-bcfdc2df58a1440a9bab98c7d37ce93c-apn" data-index="3" data-depends="[]"><label class="cbi-value-title" for="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.apn">接入点</label>
|
||
<div class="cbi-value-field">
|
||
<div id="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.apn" class="cbi-dropdown" optional="" tabindex="0" data-idref="a314df9e"><ul tabindex="-1"><li data-value="" selected="" display="0">自动选择</li><li data-value="cmnet">中国移动</li><li data-value="3gnet">中国联通</li><li data-value="ctnet">中国电信</li><li data-value="cbnet">中国广电</li><li data-value="5gscuiot">天际通</li><li data-value="-" unselectable=""><input type="text" class="create-item-input" placeholder="-- 自定义 --"></li></ul><span class="more" tabindex="-1">···</span><span class="open" tabindex="-1">▾</span><div><input type="hidden" name="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.apn" value=""></div></div>
|
||
</div></div>
|
||
<div class="cbi-value cbi-value-last" id="cbi-modem-bcfdc2df58a1440a9bab98c7d37ce93c-auth" data-index="4" data-depends="[]"><label class="cbi-value-title" for="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.auth">认证类型</label>
|
||
<div class="cbi-value-field">
|
||
<div id="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.auth" data-idref="8b4f94b8"><select id="widget.cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.auth" name="cbid.modem.bcfdc2df58a1440a9bab98c7d37ce93c.auth" size="1" class="cbi-input-select"><option value="none" selected="">无</option><option value="both">PAP/CHAP(均使用)</option><option value="pap">PAP</option><option value="chap">CHAP</option></select></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div> -->
|
||
<!-- </div>
|
||
</fieldset> -->
|
||
|
||
<fieldset class="cbi-section" id="cbi-mode" style="display: none;">
|
||
<div class="cbi-section cbi-tblsection">
|
||
<!-- <legend><%:Mode%></legend> -->
|
||
<h3><%:Mode%></h3>
|
||
<table class="table cbi-section-table">
|
||
<tbody>
|
||
<tr class="tr cbi-section-table-titles anonymous">
|
||
<th class="th cbi-section-table-cell"><%:Current%></th>
|
||
<th class="th cbi-section-table-cell"><%:Config%></th>
|
||
<th class="th cbi-section-table-cell cbi-section-actions"></th>
|
||
</tr>
|
||
<tr class="tr cbi-section-table-row cbi-rowstyle-1">
|
||
<td class="td cbi-value-field" data-title="<%:Current%>" id="current_mode"></td>
|
||
<td class="td cbi-value-field" data-title="<%:Config%>" id="mode_option">
|
||
<!-- <div>
|
||
<span class="cbi-radio">
|
||
<input type="radio" name="mode_option" id="mode_option_qmi" value="qmi" checked="true">
|
||
<span>QMI</span>
|
||
</span>
|
||
<span class="cbi-radio">
|
||
<input type="radio" name="mode_option" id="mode_option_ecm" value="ecm">
|
||
<span>ECM</span>
|
||
</span>
|
||
<span class="cbi-radio">
|
||
<input type="radio" name="mode_option" id="mode_option_mbim" value="mbim">
|
||
<span>MBIM</span>
|
||
</span>
|
||
<span class="cbi-radio">
|
||
<input type="radio" name="mode_option" id="mode_option_rndis" value="rndis">
|
||
<span>RNDIS</span>
|
||
</span>
|
||
<span class="cbi-radio">
|
||
<input type="radio" name="mode_option" id="mode_option_ncm" value="ncm">
|
||
<span>NCM</span>
|
||
</span>
|
||
</div> -->
|
||
</td>
|
||
<td class="td">
|
||
<div>
|
||
<button class="btn cbi-button cbi-button-apply" id="mode_button" onclick="set_mode()" alt="<%:Apply%>" title="<%:Apply%>"><%:Apply%></button>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</fieldset>
|
||
|
||
<fieldset class="cbi-section" id="cbi-network-prefer" style="display: none;">
|
||
<div class="cbi-section cbi-tblsection">
|
||
<!-- <legend><%:Network Preferences%></legend> -->
|
||
<h3><%:Network Preferences%></h3>
|
||
<table class="table cbi-section-table">
|
||
<tbody>
|
||
<tr class="tr cbi-section-table-titles anonymous">
|
||
<th class="th cbi-section-table-cell"><%:Current%></th>
|
||
<th class="th cbi-section-table-cell"><%:Option%></th>
|
||
<th class="th cbi-section-table-cell"><%:Config%></th>
|
||
<th class="th cbi-section-table-cell cbi-section-actions"></th>
|
||
</tr>
|
||
<tr class="tr cbi-section-table-row cbi-rowstyle-1">
|
||
<td class="td cbi-value-field" data-title="<%:Current%>" id="current_prefer"></td>
|
||
<td class="td cbi-value-field" data-title="<%:Option%>" id="prefer_option">
|
||
<div>
|
||
<span class="cbi-radio">
|
||
<input type="radio" name="prefer_option" id="prefer_option_auto" value="auto" checked="true">
|
||
<span><%:Auto%></span>
|
||
</span>
|
||
<span class="cbi-radio">
|
||
<input type="radio" name="prefer_option" id="prefer_option_custom" value="custom">
|
||
<span><%:Custom%></span>
|
||
</span>
|
||
</div>
|
||
</td>
|
||
<td class="td cbi-value-field" data-title="<%:Config%>" id="prefer_custom_config">
|
||
<div>
|
||
<span class="cbi-checkbox">
|
||
<input id="prefer_config_3g" type="checkbox" class="cbi-input-checkbox" value="3g">
|
||
<span><%:3G%></span>
|
||
</span>
|
||
<span class="cbi-checkbox">
|
||
<input id="prefer_config_4g" type="checkbox" class="cbi-input-checkbox" value="4g">
|
||
<span><%:4G%></span>
|
||
</span>
|
||
<span class="cbi-checkbox">
|
||
<input id="prefer_config_5g" type="checkbox" class="cbi-input-checkbox" value="5g">
|
||
<span><%:5G%></span>
|
||
</span>
|
||
</div>
|
||
</td>
|
||
<td class="td">
|
||
<div>
|
||
<button class="btn cbi-button cbi-button-apply" id="network_prefer_button" onclick="set_network_prefer()" alt="<%:Apply%>" title="<%:Apply%>"><%:Apply%></button>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</fieldset>
|
||
|
||
<fieldset class="cbi-section" id="cbi-modem-self-test" style="display: none;">
|
||
<div class="cbi-section fade-in">
|
||
<!-- <legend><%:Self Test%></legend> -->
|
||
<h3><%:Self Test%></h3>
|
||
<table class="table cbi-section-table">
|
||
<tbody>
|
||
<tr class="tr cbi-section-table-titles anonymous">
|
||
<th class="th cbi-section-table-cell"><%:Item%></th>
|
||
<th class="th cbi-section-table-cell"><%:Current%></th>
|
||
<th class="th cbi-section-table-cell"><%:Status%></th>
|
||
</tr>
|
||
<tr class="tr cbi-section-table-row cbi-rowstyle-1">
|
||
<td class="td cbi-value-field" data-title="<%:Item%>" id="voltage_label">电压</td>
|
||
<td class="td cbi-value-field" data-title="<%:Current%>" id="current_voltage"></td>
|
||
<td class="td cbi-value-field" data-title="<%:Status%>" id="voltage_status">-</td>
|
||
</tr>
|
||
<!-- <tr class="tr cbi-section-table-row cbi-rowstyle-2">
|
||
<td class="td cbi-value-field" data-title="<%:Item%>" id="temperature_label">温度</td>
|
||
<td class="td cbi-value-field" data-title="<%:Current%>" id="current_temperature">-</td>
|
||
<td class="td cbi-value-field" data-title="<%:Status%>" id="temperature_status">正常</td>
|
||
</tr> -->
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</fieldset>
|
||
|
||
<fieldset class="cbi-section" id="cbi-at" style="display: none;">
|
||
<div class="cbi-section fade-in">
|
||
<!-- <legend><%:AT Command%></legend> -->
|
||
<h3><%:AT Command%></h3>
|
||
<table class="table" id="at_command_info">
|
||
<tbody>
|
||
<!-- <tr class="tr">
|
||
<td class="td left"><%:Modem Select%></td>
|
||
<td class="td left"><select name="modem_select" id="modem_select" class="cbi-input-select"></select></td>
|
||
</tr> -->
|
||
<tr class="tr">
|
||
<td class="td left"><%:Quick Option%></td>
|
||
<td class="td left" id="quick_option_td">
|
||
<div>
|
||
<span class="cbi-radio">
|
||
<input type="radio" name="quick_option" value="auto" checked="true">
|
||
<span><%:Auto%></span>
|
||
</span>
|
||
<span class="cbi-radio">
|
||
<input type="radio" name="quick_option" value="custom">
|
||
<span><%:Custom%></span>
|
||
</span>
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
<tr class="tr">
|
||
<td class="td left"><%:Quick Commands%></td>
|
||
<td class="td left"><select name="command_select" id="command_select" class="cbi-input-select"></select></td>
|
||
</tr>
|
||
<tr class="tr">
|
||
<td class="td left"><%:Enter Command%></td>
|
||
<td class="td left">
|
||
<div>
|
||
<input type="text" id="at_command" class="cbi-input-text"></input>
|
||
</div>
|
||
<div>
|
||
<input class="cbi-button cbi-button-apply" type="button" value="<%:Send%>" onclick="send_at_command()" alt="<%:Send%>" title="<%:Send%>">
|
||
<input class="cbi-button cbi-button-reset" type="button" value="<%:Clean%>" onclick="clean_at_command()" alt="<%:Clean%>" title="<%:Clean%>">
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
<tr class="tr">
|
||
<td colspan="2" class="td left">
|
||
<div id="response_label"><%:Response%></div><br/>
|
||
<div><textarea readonly="readonly" id="response" rows="20" maxlength="160"></textarea></div>
|
||
<div class="cbi-page-actions">
|
||
<input class="btn cbi-button cbi-button-link" type="button" value="<%:Return to old page%>" onclick="location.href='/cgi-bin/luci/admin/network/modem/at_command_old'">
|
||
<input class="btn cbi-button cbi-button-link" type="button" value="<%:Custom quick commands%>" onclick="location.href='/cgi-bin/luci/admin/network/modem/quick_commands_config'">
|
||
<input class="cbi-button cbi-button-reset" type="button" value="<%:Clean%>" onclick="clean_response()" alt="<%:Clean%>" title="<%:Clean%>">
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</fieldset>
|
||
|
||
</div>
|
||
|
||
<%+footer%>
|