板卡常用前端 数据表操作
两年前写的,现在看,有点想吐, 数据操作表,调试设备用
采用外挂的方法,以前设备的接口命令,简易,换个UI展示很容易
自己写着玩的,公司部分产品再用,前端展示,不涉密
index.html
<!doctype html>
<html><head><meta charset="UTF-8" /><title>Device Dashboard</title><link rel="stylesheet" type="text/css" href="themes/gray/easyui.css" /><link rel="stylesheet" type="text/css" href="themes/icon.css" /><link rel="stylesheet" type="text/css" href="www/demo.css" /><script type="text/javascript" src="jquery.min.js"></script><script type="text/javascript" src="jquery.easyui.min.js"></script><script type="text/javascript" src="www/js/dataGrid.js"></script><script type="text/javascript" src="www/js/cgiOperator.js"></script><script type="text/javascript" src="www/js/index.js"></script></head><body><br /><div class="easyui-layout" fit="true"><div id="tb" style="height: auto"><aid="refresh"href="javascript:void(0)"class="easyui-linkbutton"data-options="iconCls:'icon-reload',plain:true"onclick="reload()">Refresh</a><aid="save"href="javascript:void(0)"class="easyui-linkbutton"data-options="iconCls:'icon-save',plain:true"onclick="edit()">Save</a><aid="cancel"href="javascript:void(0)"class="easyui-linkbutton"data-options="iconCls:'icon-undo',plain:true"onclick="cancel()">Cancel</a><aid="view"href="javascript:void(0)"class="easyui-linkbutton"data-options="iconCls:'icon-search',plain:true"onclick="getChanges()">View changes</a><ahref="javascript:void(0)"class="easyui-linkbutton"data-options="iconCls:'icon-reload',plain:true"onclick="chinese()">中文</a><ahref="javascript:void(0)"class="easyui-linkbutton"data-options="iconCls:'icon-reload',plain:true"onclick="english()">ENGLISH</a></div><br /><divclass="easyui-layout"style="width: 1300px; height: 960px"fit="true"><divdata-options="region:'west',title:'Menu directory'"style="width: 250px"border="false"border="false"><ul id="tt" class="easyui-tree"><li data-options="state:'open'"><span class="dev_info">Device Information</span><ul><li><a id="SystemInfo">Base Information</a></li></ul></li><li data-options="state:'open'"><span class="dev_status">Device Status</span><ul><li><a id="MiscInfo">Misc Status</a></li><li><a id="AlarmInfo">Alarm Status</a></li></ul></li><li data-options="state:'open'"><span class="dev_setup">Device Setup</span><ul><li><a id="NetWorkConfig">Network Setup</a></li><li><a id="RadioConfigCommon">RF Common Setup</a></li><li data-options="state:'open'"><span id="5G setup">5G NR Setup</span><ul><li><a id="CarrierConfigOne">Band 1 Slots Setup</a></li><li><a id="CarrierConfigTwo">Band 2 Slots Setup</a></li></ul></li></ul></li><li data-options="state:'open'"><span class="Factorty">Factory Calibration</span><ul><li><a id="FactorySetup">Calibration Setup</a></li></ul></li></ul></div><divid="CenterBlock"data-options="region:'center',title:'Access Unit Equipment'"><divid="HomeIndex"class="easyui-tabs"style="width: auto; height: 800px"><div title="Home" style="padding: 10px"><tableid="dg"class="easyui-datagrid"style="width: auto; height: 720px"data-options="checkOnSelect:false,selectOnCheck:false,onClickCell: onClickCell,"><thead><tr><thdata-options="field:'selectRows',width:40,align:'center',checkbox:true"></th><thdata-options="field:'paramsName',width:400,align:'left'">name</th><thdata-options="field:'paramsValue',width:200,align:'left',editor:{type:'textbox'}">value</th><thdata-options="field:'UpdateTime',width:280,align:'center'">update time</th></tr></thead></table></div></div></div></div></div></body>
</html>
index.js
//cgi request url information tag is directions ajax
var cacheDataParaList = undefined;
var cacheDataParaListArray = new Array();
var cacheData = undefined;
var cacheDataArray = new Array();
var DEBUG = 0;
var ZH_TABLE = undefined;
var TableType = undefined;var NetWorkConfigArgs = new Array();
var NetWorkConfigFilterIndex = [1];var SystemInfoArgs = new Array();
var SystemFilterIndex = [0];var AlarmInfoArgs = new Array();
var AlarmFilterIndex = [100];var AlarmConfigArgs = new Array();
var AlarmConfigFilterIndex = [99];var CarrierConfigOneArgs = new Array();
var CarrierConfigOneFilterIndex = [2];var CarrierConfigTwoArgs = new Array();
var CarrierConfigTwoFilterIndex = [3];var RadioConfigCommonArgs = new Array();
var RadioConfigCommonFilterIndex = [4];var RadioConfigOneArgs = new Array();
var RadioConfigOneFilterIndex = [5];var RadioConfigTwoArgs = new Array();
var RadioConfigTwoFilterIndex = [6];var RadioConfigThreeArgs = new Array();
var RadioConfigThreeFilterIndex = [7];var RadioConfigFourArgs = new Array();
var RadioConfigFourFilterIndex = [8];var OptInfoArgs = new Array();
var OptInfoFilterIndex = [9];var MiscInfoArgs = new Array();
var MiscInfoFilterIndex = [0xa];var FactorySetupArgs = new Array();
var FactorySetupFilterIndex = [0x2b];var cgi_config = "cgi-bin/wsgi.py";function FilterIndex(IndexArray, index) {for (var i = 0; i < IndexArray.length; i++) {if (index == IndexArray[i]) {return true;}}return false;
}function ajaxPost(url_t, msg, func) {$.ajax({url: url_t,type: "POST", //对数据的请求指令使用post的请求方式data: msg,async: false,success: function(data, status) {// $.messager.alert("Successful", "Operator Successful");func(data, status);},error: function(data, status) {$.messager.alert("Failed", "Operator Failed");},});
}function RequestFromBoaParaList() {ajaxPost(cgi_config, "cmd=para_list&nodata", function(data, status) {cacheDataParaList = data;});
}function ajaxJson(url_t) {$.ajax({url: url_t,type: "GET", //对数据的请求指令使用post的请求方式async: false,dataType: "json",success: function(data, status) {// $.messager.alert("Successful", "Operator Successful");ZH_TABLE = data;},error: function(data, status) {$.messager.alert("Failed", "Operator Failed");},});
}function ajaxJsonPost(url_t, msg, func) {$.ajax({url: url_t,type: "POST", //对数据的请求指令使用post的请求方式data: msg,async: false,dataType: json,success: function(data, status) {// $.messager.alert("Successful", "Operator Successful");func(data, status);},error: function(data, status) {$.messager.alert("Failed", "Operator Failed");},});
}var DevList = undefined;function RequestDeviceList() {ajaxPost(cgi_config, "cmd=device_list&nodata", function(data, status) {console.log("REQUESTDEVICELIST: " + status);DevList = data;});
}function TreeNodeAdd() {var data = [{ text: "DeviceList", children: [{ text: "LocalDevice" }] }];var data_leaf = data[0].children;RequestDeviceList();if (DevList != undefined) {console.log(DevList);let tmp = DevList.split("&");for (var i = 1; i < tmp.length - 1; i++) {console.log(tmp[i]);data_leaf.push({ text: tmp[i] });}}console.log(data_leaf);// init tree for every node$("#ptt").tree({ data: data });
}function RequestFromBoaReadPara() {ajaxPost(cgi_config, "cmd=read&nodata", function(data, status) {console.log("RequestFromBoaReadPara: " + status);cacheData = data;});
}//may payload some data from client
function RequestFromBoaWritePara(WriteCmd, Error) {ajaxPost(cgi_config, "cmd=write&" + WriteCmd, function(data, status) {Error = data;});
}function ParaListData2Params(RemoteDataArray, ParamsDataArray) {var tmp = undefined;var tmpCOMMA = undefined;var tmpArrayEQ = new Array();var tmpArrayCOMMA = new Array();for (var i = 1; i < RemoteDataArray.length; i++) {if (RemoteDataArray[i] === "") {continue;}tmp = RemoteDataArray[i];tmpArrayEQ = tmp.split("=");ParamsDataArray[i].index = tmpArrayEQ[0];tmpCOMMA = tmpArrayEQ[1];tmpArrayCOMMA = tmpCOMMA.split(",");ParamsDataArray[i].name = tmpArrayCOMMA[0];ParamsDataArray[i].type = tmpArrayCOMMA[1];ParamsDataArray[i].coff = tmpArrayCOMMA[2];ParamsDataArray[i].attr = tmpArrayCOMMA[3];ParamsDataArray[i].len = tmpArrayCOMMA[4];}
}function ParaRead2Params(RemoteDataArray, ParamsDataArray) {var tmp = undefined;var tmpArrayEQ = new Array();for (var i = 1; i < RemoteDataArray.length; i++) {tmp = RemoteDataArray[i];tmpArrayEQ = tmp.split("=");ParamsDataArray[i].index = tmpArrayEQ[0];ParamsDataArray[i].value = tmpArrayEQ[1];}
}function clearCacheGlobData() {cacheData = undefined;cacheDataArray = null;cacheDataParaList = undefined;cacheDataParaListArray = null;
}function ParamsType() {var tmp_index = undefined;OptInfoArgs.length = 0;SystemInfoArgs.length = 0;AlarmInfoArgs.length = 0;AlarmConfigArgs.length = 0;NetWorkConfigArgs.length = 0;RadioConfigCommonArgs.length = 0;RadioConfigFourArgs.length = 0;RadioConfigOneArgs.length = 0;RadioConfigTwoArgs.length = 0;RadioConfigThreeArgs.length = 0;CarrierConfigOneArgs.length = 0;CarrierConfigTwoArgs.length = 0;MiscInfoArgs.length = 0;FactorySetupArgs.length = 0;for (var i = 0; i < ParamsDataArray.length; i++) {tmp_index = parseInt(ParamsDataArray[i].attr);if (FilterIndex(SystemFilterIndex, tmp_index)) {SystemInfoArgs.push(ParamsDataArray[i]);} else if (FilterIndex(OptInfoFilterIndex, tmp_index)) {OptInfoArgs.push(ParamsDataArray[i]);} else if (FilterIndex(AlarmFilterIndex, tmp_index)) {AlarmInfoArgs.push(ParamsDataArray[i]);} else if (FilterIndex(AlarmConfigFilterIndex, tmp_index)) {AlarmConfigArgs.push(ParamsDataArray[i]);} else if (FilterIndex(RadioConfigCommonFilterIndex, tmp_index)) {RadioConfigCommonArgs.push(ParamsDataArray[i]);} else if (FilterIndex(RadioConfigOneFilterIndex, tmp_index)) {RadioConfigOneArgs.push(ParamsDataArray[i]);} else if (FilterIndex(RadioConfigTwoFilterIndex, tmp_index)) {RadioConfigTwoArgs.push(ParamsDataArray[i]);} else if (FilterIndex(RadioConfigThreeFilterIndex, tmp_index)) {RadioConfigThreeArgs.push(ParamsDataArray[i]);} else if (FilterIndex(RadioConfigFourFilterIndex, tmp_index)) {RadioConfigFourArgs.push(ParamsDataArray[i]);} else if (FilterIndex(CarrierConfigOneFilterIndex, tmp_index)) {CarrierConfigOneArgs.push(ParamsDataArray[i]);} else if (FilterIndex(CarrierConfigTwoFilterIndex, tmp_index)) {CarrierConfigTwoArgs.push(ParamsDataArray[i]);} else if (FilterIndex(NetWorkConfigFilterIndex, tmp_index)) {NetWorkConfigArgs.push(ParamsDataArray[i]);} else if (FilterIndex(MiscInfoFilterIndex, tmp_index)) {MiscInfoArgs.push(ParamsDataArray[i]);} else if (FilterIndex(FactorySetupFilterIndex, tmp_index)) {FactorySetupArgs.push(ParamsDataArray[i]);}}
}var ParamsDataArray = new Array();$(function() {clearCacheGlobData();clearDataTable();RequestFromBoaParaList();cacheDataParaListArray = cacheDataParaList.split("&");console.log(cacheDataParaListArray);RequestFromBoaReadPara();cacheDataArray = cacheData.split("&");console.log(cacheDataArray);if (cacheDataParaListArray.length != cacheDataArray.length) {$.messager.alert("Error", "Parameter list incomplete");} else {$.messager.alert("Success", "SUCCESSFULL");}for (var i = 0; i < cacheDataArray.length; i++) {ParamsDataArray.push(new ParamsData("0", "0", "0", "0", "0", "0", "0"));}ParaListData2Params(cacheDataParaListArray, ParamsDataArray);ParaRead2Params(cacheDataArray, ParamsDataArray);//default zhajaxJson("zhTable.json");//reload with chineseif (ZH_TABLE != undefined) {console.log("ZH_TABLE");console.log(ZH_TABLE);}for (var i = 0; i < ParamsDataArray.length; i++) {if (ParamsDataArray[i].name == 0) {continue;}if (ParamsDataArray[i].index === ZH_TABLE[i].ID) {ParamsDataArray[i].name = ZH_TABLE[i].NAME;console.log(ZH_TABLE[i].NAME);}if (DEBUG) {console.log(ParamsDataArray[i].NAME);}}for (var i = 0; i < ParamsDataArray.length; i++) {if (ParamsDataArray[i].type == "uint1" && ParamsDataArray[i].len > 1) {console.log("FilterArray: ");console.log(ParamsDataArray[i]);continue;}if (ParamsDataArray[i].type != "str" && ParamsDataArray[i].coff != 1) {ParamsDataArray[i].value =parseInt(ParamsDataArray[i].value) / parseInt(ParamsDataArray[i].coff);}if (ParamsDataArray[i].type == "sint1") {if (ParamsDataArray[i].value > 127) {ParamsDataArray[i].value = ParamsDataArray[i].value - 255;}}if (ParamsDataArray[i].type == "sint2") {if (ParamsDataArray[i].value > 32767) {ParamsDataArray[i].value = ParamsDataArray[i].value - 65535;}}if (ParamsDataArray[i].type == "sint4") {if (ParamsDataArray[i].value > 2147483647) {ParamsDataArray[i].value =ParamsDataArray[i].value - 2147483647 * 2 - 1;}}}ParamsType();console.log(ParamsDataArray);var DeviceInfo = new Object();DeviceInfo.SystemInfo = new CenterBlockClass("#SystemInfo","SystemInfoTable",SystemInfoArgs,);DeviceInfo.AlarmInfo = new CenterBlockClass("#AlarmInfo","AlarmInfoTable",AlarmInfoArgs,);DeviceInfo.OptInfo = new CenterBlockClass("#OptInfo","OptInfoTable",OptInfoArgs,);var DeviceConfig = new Object();DeviceConfig.NetWorkConfig = new CenterBlockClass("#NetWorkConfig","NetConfigTable",NetWorkConfigArgs,);DeviceConfig.AlarmConfig = new CenterBlockClass("#AlarmConfig","AlarmConfigTable",AlarmConfigArgs,);DeviceConfig.RadioConfigCommon = new CenterBlockClass("#RadioConfigCommon","RadioConfigCommonTable",RadioConfigCommonArgs,);DeviceConfig.RadioConfigOne = new CenterBlockClass("#RadioConfigOne","RadioConfigOneTable",RadioConfigOneArgs,);DeviceConfig.RadioConfigTwo = new CenterBlockClass("#RadioConfigTwo","RadioConfigTwoTable",RadioConfigTwoArgs,);DeviceConfig.RadioConfigThree = new CenterBlockClass("#RadioConfigThree","RadioConfigThreeTable",RadioConfigThreeArgs,);DeviceConfig.RadioConfigFour = new CenterBlockClass("#RadioConfigFour","RadioConfigFourTable",RadioConfigFourArgs,);DeviceConfig.CarrierConfigOne = new CenterBlockClass("#CarrierConfigOne","CarrierConfigOneTable",CarrierConfigOneArgs,);DeviceConfig.CarrierConfigTwo = new CenterBlockClass("#CarrierConfigTwo","CarrierConfigTwoTable",CarrierConfigTwoArgs,);DeviceConfig.MiscInfo = new CenterBlockClass("#MiscInfo","MiscInfoTable",MiscInfoArgs,);DeviceConfig.FactorySetup = new CenterBlockClass("#FactorySetup","FactorySetupTable",FactorySetupArgs,);var CenterBlockEvent = new Array();CenterBlockEvent["SystemInfo"] = DeviceInfo.SystemInfo;CenterBlockEvent["AlarmInfo"] = DeviceInfo.AlarmInfo;CenterBlockEvent["OptInfo"] = DeviceInfo.OptInfo;CenterBlockEvent["NetWorkConfig"] = DeviceConfig.NetWorkConfig;CenterBlockEvent["AlarmConfig"] = DeviceConfig.AlarmConfig;CenterBlockEvent["RadioConfigCommon"] = DeviceConfig.RadioConfigCommon;CenterBlockEvent["RadioConfigOne"] = DeviceConfig.RadioConfigOne;CenterBlockEvent["RadioConfigTwo"] = DeviceConfig.RadioConfigTwo;CenterBlockEvent["RadioConfigThree"] = DeviceConfig.RadioConfigThree;CenterBlockEvent["RadioConfigFour"] = DeviceConfig.RadioConfigFour;CenterBlockEvent["CarrierConfigOne"] = DeviceConfig.CarrierConfigOne;CenterBlockEvent["CarrierConfigTwo"] = DeviceConfig.CarrierConfigTwo;CenterBlockEvent["MiscInfo"] = DeviceConfig.MiscInfo;CenterBlockEvent["FactorySetup"] = DeviceConfig.FactorySetup;$("#tt").tree({onClick: function(node) {var index = node.text;var ack_index = index.split('"');var txt = ack_index[2];var tmp_txt = txt.split(">");$("#HomeIndex").tabs("select", FirstTmp);var tab = $("#HomeIndex").tabs("getSelected");$("#HomeIndex").tabs("update", {tab: tab,options: {title: tmp_txt,},});do {if (ack_index[1] == undefined) {break;}FirstTmp = txt;clearDataTable();TableType = CenterBlockEvent[ack_index[1]].type;DrawTable(CenterBlockEvent[ack_index[1]].args);} while (0);},});
});
dataGrid.js
var editIndex = undefined;
var SystemInfoData = undefined;
var AlarmInfoData = undefined;
var NetWorkConfigData = undefined;
var RadioConfigData = undefined;
var checked = undefined;function AddDataGrid(ParamsData) {$("#dg").datagrid("appendRow", {paramsIndex: ParamsData.index,paramsName: ParamsData.name,paramsCoff: ParamsData.coff,paramsAttr: ParamsData.attr,paramsType: ParamsData.type,paramsValue: ParamsData.value,paramsLength: ParamsData.len,UpdateTime:new Date().getFullYear() +"-" +(new Date().getMonth() + 1) +"-" +new Date().getDate() +" " +new Date().getHours() +":" +new Date().getMinutes() +":" +new Date().getSeconds(),});
}function endEditing() {if (editIndex == undefined) {return true;}if ($("#dg").datagrid("validateRow", editIndex)) {$("#dg").datagrid("endEdit", editIndex);editIndex = undefined;return true;} else {return false;}
}function onClickCell(index, field) {if (editIndex != index) {if (endEditing()) {$("#dg").datagrid("selectRow", index).datagrid("beginEdit", index);var ed = $("#dg").datagrid("getEditor", { index: index, field: field });if (ed) {($(ed.target).data("textbox")? $(ed.target).textbox("textbox"): $(ed.target)).focus();}editIndex = index;} else {setTimeout(function() {$("#dg").datagrid("selectRow", editIndex);}, 0);}}
}// 更新客户端数据库
function cancel() {$.messager.confirm("Info:", "Whether to cancel the check?", function(r) {if (r) {$(":checked").removeAttr("checked");}});
}// 更新客户端数据库
function edit() {endEditing();$.messager.confirm("Info:","Please confirm the submission configuration?",function(r) {if (r) {checked = $("#dg").datagrid("getChecked");console.log(checked);var CmdWrite = "";var tmp = 0;for (var i = 0; i < checked.length; i++) {if (checked[i].paramsType == "uint1" && checked[i].paramsLength > 1) {console.log("FilterArray: ");console.log(checked[i]);tmp = checked[i].paramsValue;CmdWrite += checked[i].paramsIndex + "=" + tmp + "&";continue;}if (checked[i].paramsType != "str") {tmp =parseFloat(checked[i].paramsCoff) *parseFloat(checked[i].paramsValue);} else {tmp = checked[i].paramsValue;}CmdWrite += checked[i].paramsIndex + "=" + tmp + "&";}console.log(CmdWrite);var err = undefined;RequestFromBoaWritePara(CmdWrite, err);} else {$(":checked").removeAttr("checked");}},);
}
function zhBar() {$("#SystemInfo").text("系统基本信息");$("#MiscInfo").text("基础状态");$("#AlarmInfo").text("告警状态");$("#dev setup").text("设备初始化");$("#NetWorkConfig").text("网络设置");$("#RadioConfigCommon").text("射频常用设置");$("#CarrierConfigOne").text("载波 一");$("#CarrierConfigTwo").text("载波 二");$("#FactorySetup").text("工厂初始化设置");
}function enBar() {$("#SystemInfo").text("Base Infomation");$("#MiscInfo").text("Misc Info");$("#AlarmInfo").text("Alarm Info");$("#dev setup").text("Device Setup");$("#NetWorkConfig").text("NetWorkConfig");$("#RadioConfigCommon").text("RadioConfigCommon");$("#CarrierConfigOne").text("CarrierConfigOne");$("#CarrierConfigTwo").text("CarrierConfigTwo");$("#FactorySetup").text("FactorySetup");
}CH = true;
EN = false;
function chinese() {zhBar();RequestFromBoaReadPara();cacheDataArray = cacheData.split("&");console.log(cacheDataArray);CH = true;EN = false;if (cacheDataParaListArray.length !== cacheDataArray.length) {$.messager.alert("Error", "Parameter list incomplete");} else {$.messager.alert("Success", "Get the full parameter list");}ParaListData2Params(cacheDataParaListArray, ParamsDataArray);ParaRead2Params(cacheDataArray, ParamsDataArray);ajaxJson("zhTable.json");//reload with chineseif (ZH_TABLE != undefined) {console.log("CHINESE ZH_TABLE");console.log(ZH_TABLE);}for (var i = 0; i < ParamsDataArray.length; i++) {if (ParamsDataArray[i].name == 0) {continue;}if (ParamsDataArray[i].index === ZH_TABLE[i].ID) {ParamsDataArray[i].name = ZH_TABLE[i].NAME;console.log(ZH_TABLE[i].NAME);}if (DEBUG) {console.log(ParamsDataArray[i].NAME);}}for (var i = 0; i < ParamsDataArray.length; i++) {if (ParamsDataArray[i].type === "uint1" && ParamsDataArray[i].len > 1) {console.log("FilterArray: ");console.log(ParamsDataArray[i]);continue;}if (ParamsDataArray[i].type !== "str" && ParamsDataArray[i].coff !== 1) {ParamsDataArray[i].value =parseInt(ParamsDataArray[i].value) / parseInt(ParamsDataArray[i].coff);}if (ParamsDataArray[i].type === "sint1") {if (ParamsDataArray[i].value > 127) {ParamsDataArray[i].value = ParamsDataArray[i].value - 255;}}if (ParamsDataArray[i].type == "sint2") {if (ParamsDataArray[i].value > 32767) {ParamsDataArray[i].value = ParamsDataArray[i].value - 65535;}}if (ParamsDataArray[i].type == "sint4") {if (ParamsDataArray[i].value > 2147483647) {ParamsDataArray[i].value =ParamsDataArray[i].value - 2147483647 * 2 - 1;}}}ParamsType();var TableTmp = undefined;if (TableType == "SystemInfoTable") {TableTmp = SystemInfoArgs;} else if (TableType == "AlarmInfoTable") {TableTmp = AlarmInfoArgs;} else if (TableType == "OptInfoTable") {TableTmp = OptInfoArgs;} else if (TableType == "NetConfigTable") {TableTmp = NetWorkConfigArgs;} else if (TableType == "AlarmConfigTable") {TableTmp = AlarmConfigArgs;} else if (TableType == "RadioConfigCommonTable") {TableTmp = RadioConfigCommonArgs;} else if (TableType == "RadioConfigOneTable") {TableTmp = RadioConfigOneArgs;} else if (TableType == "RadioConfigTwoTable") {TableTmp = RadioConfigTwoArgs;} else if (TableType == "RadioConfigThreeTable") {TableTmp = RadioConfigThreeArgs;} else if (TableType == "RadioConfigFourTable") {TableTmp = RadioConfigFourArgs;} else if (TableType == "CarrierConfigOneTable") {TableTmp = CarrierConfigOneArgs;} else if (TableType == "CarrierConfigTwoTable") {TableTmp = CarrierConfigTwoArgs;} else if (TableType == "MiscInfoTable") {TableTmp = MiscInfoArgs;} else if (TableType == "FactorySetupTable") {TableTmp = FactorySetupArgs;}//coef calc for valueconsole.log(TableTmp);clearDataTable();DrawTable(TableTmp);
}function english() {enBar();RequestFromBoaReadPara();cacheDataArray = cacheData.split("&");console.log(cacheDataArray);CH = false;EN = true;if (cacheDataParaListArray.length != cacheDataArray.length) {$.messager.alert("Error", "Parameter list incomplete");} else {$.messager.alert("Success", "Get the full parameter list");}ParaListData2Params(cacheDataParaListArray, ParamsDataArray);ParaRead2Params(cacheDataArray, ParamsDataArray);for (var i = 0; i < ParamsDataArray.length; i++) {if (ParamsDataArray[i].type == "uint1" && ParamsDataArray[i].len > 1) {console.log("FilterArray: ");console.log(ParamsDataArray[i]);continue;}if (ParamsDataArray[i].type != "str" && ParamsDataArray[i].coff != 1) {ParamsDataArray[i].value =parseInt(ParamsDataArray[i].value) / parseInt(ParamsDataArray[i].coff);}if (ParamsDataArray[i].type == "sint1") {if (ParamsDataArray[i].value > 127) {ParamsDataArray[i].value = ParamsDataArray[i].value - 255;}}if (ParamsDataArray[i].type == "sint2") {if (ParamsDataArray[i].value > 32767) {ParamsDataArray[i].value = ParamsDataArray[i].value - 65535;}}if (ParamsDataArray[i].type == "sint4") {if (ParamsDataArray[i].value > 2147483647) {ParamsDataArray[i].value =ParamsDataArray[i].value - 2147483647 * 2 - 1;}}}ParamsType();var TableTmp = undefined;if (TableType === "SystemInfoTable") {TableTmp = SystemInfoArgs;} else if (TableType === "AlarmInfoTable") {TableTmp = AlarmInfoArgs;} else if (TableType === "OptInfoTable") {TableTmp = OptInfoArgs;} else if (TableType === "NetConfigTable") {TableTmp = NetWorkConfigArgs;} else if (TableType === "AlarmConfigTable") {TableTmp = AlarmConfigArgs;} else if (TableType === "RadioConfigCommonTable") {TableTmp = RadioConfigCommonArgs;} else if (TableType === "RadioConfigOneTable") {TableTmp = RadioConfigOneArgs;} else if (TableType == "RadioConfigTwoTable") {TableTmp = RadioConfigTwoArgs;} else if (TableType == "RadioConfigThreeTable") {TableTmp = RadioConfigThreeArgs;} else if (TableType == "RadioConfigFourTable") {TableTmp = RadioConfigFourArgs;} else if (TableType == "CarrierConfigOneTable") {TableTmp = CarrierConfigOneArgs;} else if (TableType == "CarrierConfigTwoTable") {TableTmp = CarrierConfigTwoArgs;} else if (TableType == "MiscInfoTable") {TableTmp = MiscInfoArgs;} else if (TableType == "FactorySetupTable") {TableTmp = FactorySetupArgs;}//coef calc for valueconsole.log(TableTmp);clearDataTable();DrawTable(TableTmp);
}function reload() {if (CH) {chinese();} else if (EN) {english();}
}function getChanges() {$.messager.show({title: "Modified data that has been submitted",height: 400,width: 800,msg: JSON.stringify(checked),showType: "slide",timeout: 5000000000,style: {right: "",bottom: "",},});
}function clearDataTable() {$("#dg").datagrid("loadData", { total: 0, rows: [] });
}//add data table
function DrawTable(ParamsDataArrayN) {for (var i = 0; i < ParamsDataArrayN.length; i++) {if (ParamsDataArrayN[i].name != "0") {AddDataGrid(ParamsDataArrayN[i]);}}
}
cgiOperator.js
class ParamsData {constructor(index, name, coff, attr, type, value, len) {this.index = index;this.name = name;this.coff = coff;this.attr = attr;this.type = type;this.value = value;this.len = len;this.time = (new Date()).getHours()+":"+(new Date()).getMinutes()+":"+(new Date()).getSeconds();}
}class CenterBlockClass {constructor(index, type, args) {this.index = index;this.type = type;this.args = args;}
}var FirstTmp = "Home";
function setCenterBlockEvent(CenterBlockClass) {$(CenterBlockClass.index).click(function () {var txt = $(this).text();$("#HomeIndex").tabs("select", FirstTmp);var tab = $("#HomeIndex").tabs("getSelected");$("#HomeIndex").tabs("update", {tab: tab,options: {title: txt,},});FirstTmp = txt;clearDataTable();TableType = CenterBlockClass.type;DrawTable(CenterBlockClass.args);});
}
显示看很勉强
现在看尴尬的扣脚,勉强可用
python -m http.server 5090
python server 验证 网页
cgi 还挺容易的,都可以动态修改,看到显示的变化
相关文章:

板卡常用前端 数据表操作
两年前写的,现在看,有点想吐, 数据操作表,调试设备用 采用外挂的方法,以前设备的接口命令,简易,换个UI展示很容易 自己写着玩的,公司部分产品再用,前端展示,不涉密 index.html <!doctype html> <html><head><meta chars…...

基于AVR128单片机世界电子时钟的设计
一、系统方案 上电初始化完成系统初始化,液晶滚动显示北京、莫斯科、东京、伦敦、巴黎、纽约等六个城市的标准时间,显示的内容包括地区名及相应地区的年、月、日、星期、时、分、秒。 使用K1按键控制滚动显示或稳定显示某个地区的时间。 使用K3、K4、K5按…...

Electron学习2 使用Electron-vue和Vuetify UI库
Electron学习2 使用Electron-vue和Vuetify UI库 一、Electron-vue简介二、安装yarn三、创建Electron-vue项目1. 关于 electron-builder2. 安装脚手架3. 运行4. 打包应用程序 四、background.js说明1. 引入模块和依赖:2. 注册协议:3. 创建窗口函数&#x…...
Java“牵手”根据商品分类ID获取速卖通商品分类详情页面数据获取方法,速卖通API实现批量商品数据抓取示例
速卖通商城是一个网上购物平台,售卖各类商品,包括服装、鞋类、家居用品、美妆产品、电子产品等。要获取速卖通商品分类详情和商品列表和商品详情页面数据,您可以通过开放平台的接口或者直接访问速卖通商城的网页来获取商品分类详情信息。以下…...

QT 使用图表
目录 1、概念 1.1 坐标轴-QAbstractAxis 1.2 系列-QAbstractSeries 1.3 图例-Legend 1.4 图表-QChart 1.5 视图-QChartView 2、 QT 折线图 2.1 Qt 折线图介绍 2.2 Qt 折线图实现 Qt 图表是专门用来数据可视化的控件 Qt 图表包含折线、饼图、棒图、散点图、范围图等。…...

SSRF 服务器端请求伪造
文章目录 SSRF(curl)网址访问通过file协议访问本地文件dict协议扫描内网主机开放端口 SSRF(file_get_content)网站访问http协议请求内网资源通过file协议访问本地文件 SSRF(Server-Side Request Forgery:服务器端请求伪造) 其形成的原因大都是由于服务端提供了从其他服务器应用…...

shell 05(shell索引数组变量)
一、数组 shell 支持数组 (Array),数组是若干数据的集合,其中的每一份数据都称为数组的元素. 注意Bash shell 只支持一维数组,不支持多维数组。 在 Shell 中,用括号( )来表示数组,数组元素之间用空格来分隔. 语法为&…...

爬虫异常处理:异常捕获与容错机制设计
作为一名专业的爬虫程序员,每天使用爬虫IP面对各种异常情况是我们每天都会遇到的事情。 在爬取数据的过程中,我们经常会遇到网络错误、页面结构变化、被反爬虫机制拦截等问题。在这篇文章中,我将和大家分享一些关于如何处理爬虫异常情况的经…...

Python自动化小技巧21——实现PDF转word功能(程序制作)
案例背景 为什么这个年代PDF转word,某wps居然还要收费.....很多软件都可以实现这个功能,但是效果都有好有坏,而且有的还付费,很麻烦。 那就用python实现这个功能吧,然后把代码打包为.exe的程序,这样随便在…...

Vue使用Element的表格Table显示树形数据,多选框全选无法选中全部节点
使用Element的组件Table表格,当使用树形数据再配合上多选框,如下: 会出现一种问题,点击左上方全选,只能够选中一级树节点,子节点无法被选中,如图所示: 想要实现点击全选就选中所有的…...

SpringBoot生成和解析二维码完整工具类分享(提供Gitee源码)
前言:在日常的开发工作当中可能需要实现一个二维码小功能,我参考了网上很多关于SpringBoot生成二维码的教程,最终还是自己封装了一套完整生成二维码的工具类,可以支持基础的黑白二维码、带颜色的二维码、带Logo的二维码、带颜色和…...
Redis的基本知识(偏八股)
前言 本文篇概念,着重介绍Redis的执行效率、功能作用、数据类型、 执行效率 江湖上都流传这Redis的执行效率是挺快的,那为什么说它快呢?有以下几个原因: 基于内存单线程模型高效数据结构非阻塞I/O 基于内存: 内存的读写效率是…...

react使用antd的table组件,实现点击弹窗显示对应列的内容
特别提醒:不能在table的columns的render里面设置弹窗组件渲染,因为这会导致弹窗显示的始终是最后一行的内容,因为这样渲染的结果是每一行都会重新渲染一遍这个弹窗并且会给传递一个content的值,渲染到最后一行的时候,就…...

c++代码代码逻辑走查
自助生物采集代码 C部分流程...

CSS scoped 属性的原理
scoped 一、scoped 是什么?二、实现原理 一、scoped 是什么? 在 Vue 组件中,为了使样式私有化(模块化),不对全局造成污染,可以在 style 标签上添加 scoped 属性以表示它的只属于当下的模块&am…...
git 查看某个分支是从哪个分支拉出来的
原文链接:https://blog.csdn.net/allanGold/article/details/102478157 git reflog show 分支名git reflog --datelocal | grep 分支名git reflog --datelocal | grep 分支名 $ git reflog --datelocal | grep release3 5c50761 HEAD{Thu Jun 29 12:53:45 2023}: c…...
vue helloworld.vue 点击按钮弹出 dialog,并给dialog传值
1 DataAnalysisVue.Vue -->应该组件文件名和 name: 的名字一致 <template><div><el-dialog :title"dataAnalysisMsg" :visible.sync"dataAnalysisvalue" :before-close"handleClose"><span>{{ dataAnalysisMsg }}&l…...

html动态爱心代码【三】(附源码)
目录 前言 特效 内容修改 完整代码 总结 前言 七夕马上就要到了,为了帮助大家高效表白,下面再给大家带来了实用的HTML浪漫表白代码(附源码)背景音乐,可用于520,情人节,生日,表白等场景,可直…...
mmseg——报错解决:RuntimeError: CUDA error: an illegal memory access was encountered
可能解决方法汇总 GitHub issue相关汇总RuntimeError: CUDA error while trainingCUDA error: an illegal memory access was encountered记录使用mmseg时在计算交叉熵损失遇到的RuntimeError问题与解决方案...

AWS复制EC2文件到S3,g4dn.2xlarge没有NVIDIA GPU 驱动问题
1、给instances权限 action > Security > modify IAM role 把提前创建好的role给这个instance即可 2、复制到bucket aws s3 cp gogo.tar.gz s3://ee547finalbucket不需要手动安装GPU驱动 如果要自己安装,参考https://docs.aws.amazon.com/AWSEC2/latest/U…...
变量 varablie 声明- Rust 变量 let mut 声明与 C/C++ 变量声明对比分析
一、变量声明设计:let 与 mut 的哲学解析 Rust 采用 let 声明变量并通过 mut 显式标记可变性,这种设计体现了语言的核心哲学。以下是深度解析: 1.1 设计理念剖析 安全优先原则:默认不可变强制开发者明确声明意图 let x 5; …...
linux 错误码总结
1,错误码的概念与作用 在Linux系统中,错误码是系统调用或库函数在执行失败时返回的特定数值,用于指示具体的错误类型。这些错误码通过全局变量errno来存储和传递,errno由操作系统维护,保存最近一次发生的错误信息。值得注意的是,errno的值在每次系统调用或函数调用失败时…...
Unit 1 深度强化学习简介
Deep RL Course ——Unit 1 Introduction 从理论和实践层面深入学习深度强化学习。学会使用知名的深度强化学习库,例如 Stable Baselines3、RL Baselines3 Zoo、Sample Factory 和 CleanRL。在独特的环境中训练智能体,比如 SnowballFight、Huggy the Do…...
在web-view 加载的本地及远程HTML中调用uniapp的API及网页和vue页面是如何通讯的?
uni-app 中 Web-view 与 Vue 页面的通讯机制详解 一、Web-view 简介 Web-view 是 uni-app 提供的一个重要组件,用于在原生应用中加载 HTML 页面: 支持加载本地 HTML 文件支持加载远程 HTML 页面实现 Web 与原生的双向通讯可用于嵌入第三方网页或 H5 应…...

Selenium常用函数介绍
目录 一,元素定位 1.1 cssSeector 1.2 xpath 二,操作测试对象 三,窗口 3.1 案例 3.2 窗口切换 3.3 窗口大小 3.4 屏幕截图 3.5 关闭窗口 四,弹窗 五,等待 六,导航 七,文件上传 …...

打手机检测算法AI智能分析网关V4守护公共/工业/医疗等多场景安全应用
一、方案背景 在现代生产与生活场景中,如工厂高危作业区、医院手术室、公共场景等,人员违规打手机的行为潜藏着巨大风险。传统依靠人工巡查的监管方式,存在效率低、覆盖面不足、判断主观性强等问题,难以满足对人员打手机行为精…...

快速排序算法改进:随机快排-荷兰国旗划分详解
随机快速排序-荷兰国旗划分算法详解 一、基础知识回顾1.1 快速排序简介1.2 荷兰国旗问题 二、随机快排 - 荷兰国旗划分原理2.1 随机化枢轴选择2.2 荷兰国旗划分过程2.3 结合随机快排与荷兰国旗划分 三、代码实现3.1 Python实现3.2 Java实现3.3 C实现 四、性能分析4.1 时间复杂度…...

在Zenodo下载文件 用到googlecolab googledrive
方法:Figshare/Zenodo上的数据/文件下载不下来?尝试利用Google Colab :https://zhuanlan.zhihu.com/p/1898503078782674027 参考: 通过Colab&谷歌云下载Figshare数据,超级实用!!࿰…...
stm32进入Infinite_Loop原因(因为有系统中断函数未自定义实现)
这是系统中断服务程序的默认处理汇编函数,如果我们没有定义实现某个中断函数,那么当stm32产生了该中断时,就会默认跑这里来了,所以我们打开了什么中断,一定要记得实现对应的系统中断函数,否则会进来一直循环…...
Java中栈的多种实现类详解
Java中栈的多种实现类详解:Stack、LinkedList与ArrayDeque全方位对比 前言一、Stack类——Java最早的栈实现1.1 Stack类简介1.2 常用方法1.3 优缺点分析 二、LinkedList类——灵活的双端链表2.1 LinkedList类简介2.2 常用方法2.3 优缺点分析 三、ArrayDeque类——高…...