local/app/MainControlBinary files differ
local/app/NetModuleBinary files differ
local/bin/export.sh
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,9 @@ #!/bin/sh sqlite3 /work/iot_cfg.db ".headers on " "select d.name as 设å¤åç§°,'1.3.6.1.4.1.27116.'||d.id||'.'||a.passcode as OID, d.id as 设å¤ID, a.passcode as ééå·, a.name as æ°æ®åç§°,a.note as 夿³¨ from device d left join accuracy a on d.id=a.id where uploadFlag=0" > /tmp/oid_list.csv sqlite3 /work/iot_cfg.db "SELECT name as 设å¤åç§°, '1.3.6.1.4.1.27116.'||id||'.3' as OID, id as 设å¤ID, 3 as ééå· , 'ç¶æ' as æ°æ®åç§°, '0-æ£å¸¸;1-åè¦' as 夿³¨ FROM ioDevice ;" >> /tmp/oid_list.csv sed -i 's/|/,/g' /tmp/oid_list.csv /usr/local/bin/snmp_cfg -f /work/snmp.json /tmp/oid_list.csv local/bin/snmp_cfgBinary files differ
local/bin/snmp_val.sh
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,33 @@ #!/bin/sh # è·åä¼ å ¥ç OID OID="$1" jsoner=./jsoner #echo "èæ¬è¢«è°ç¨, OID: $OID" chn=${OID##*.} id=${OID%.*} id=${id##*.} #echo "id: $id chn: $chn" chn=`expr $chn - 1 ` #echo "$jsoner -g /tmp/$id value-$chn.value" val=`$jsoner -g /tmp/$id value-$chn.value` ret=$? #echo "ret = $ret" if [ $ret -eq 0 ] then RESPONSE="{\"type\": \"OctetString\", \"value\": \"$val\" }" echo "$RESPONSE" else # é»è®¤è¿å RESPONSE="{\"type\": \"OctetString\", \"value\": \"noData\"}" echo "$RESPONSE" fi local/default/app.ini
@@ -9,5 +9,5 @@ mul=MulticastIP lk=linkage rtsp=rtsp export applist=" $main $dc $net $gate $svr " export applist=" $main $dc $net $gate $svr $lk" local/default/snmp.json
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,29 @@ { "script_handler": "/usr/local/bin/snmp_val.sh", "oids": [ { "oid": "1.3.6.1.4.1.71116.1.1", "name": "temphum", "type": "Integer", "description": "status" }, { "oid": "1.3.6.1.4.1.71116.1.2", "name": "temphum", "type": "OctetString", "description": "warn status" }, { "oid": "1.3.6.1.4.1.71116.1.4", "name": "temphum", "type": "OctetString", "description": "temp" }, { "oid": "1.3.6.1.4.1.71116.3.4", "name": "temphum", "type": "OctetString", "description": "hum" } ] } local/default/sysConfig.json
@@ -4,6 +4,7 @@ "menu3DVld": "0", "linkage": "0", "etcPlat": "0", "snmp": 0, "name": "å¨ç¯çæ§ç³»ç»", "opPhone": "4006271116", "opVendor": "飿£è´è¿ä¿¡æ¯ææ¯è¡ä»½æéå ¬å¸", local/version
@@ -1,3 +1,3 @@ 2025-05-29-v001 2025-06-13-v001 type=1 IGD5300 local/www/cgi-bin/do/do
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,42 @@ #!/bin/sh #æ§è¡URLçåæ°å½ä»¤ #ä¾ï¼http://192.168.1.123/cgi-bin/do/do?sqlite3 /work/iot_cfg.db "select * from alarm" export PATH=/sbin:/usr/sbin:$PATH echo -en "Content-type: text/html; charset=utf-8\n\n" #***************************************************** source ../bin/env.sh db="../bin/db" jsoner="../bin/jsoner" # 1. è·ååæ°é»è¾ if [ "$REQUEST_METHOD" = "GET" ]; then # ä»URLè·ååæ°ï¼æ ¼å¼ï¼?key=valueï¼ params="$QUERY_STRING" # å ç½®ç¯å¢åé[5,7](@ref) elif [ "$REQUEST_METHOD" = "POST" ]; then # 仿 åè¾å ¥è¯»åPOSTæ°æ® read -t 5 params # 5ç§è¶ æ¶é²æ¢é»å¡[6](@ref) else echo "error: Unsupported method" exit 1 fi # 2. åæ°éªè¯ä¸è¾åº if [ -z "$params" ]; then echo "error: No parameters received" else # ç®æè§£ç å¤çï¼ç©ºæ ¼åç¹æ®åç¬¦ï¼ decoded_params=$(echo "$params" | sed -e 's/%20/ /g' -e 's/%22/"/g' -e 's/%2F/\//g' -e 's/+/ /g') # å½ä»¤å符串åå ¥æä»¶ echo "$decoded_params" > /tmp/.cmd fi #3. æ§è¡å½ä»¤ data=`sh /tmp/.cmd` if [ $? -eq 0 ] then echo "{\"code\":\"success\",\"result\":\"$data\"}" else echo "{\"code\":\"error\",\"result\":\"$data\"}" fi local/www/cgi-bin/download/download.cgiBinary files differ
local/www/cgi-bin/register/query_sn
@@ -1,5 +1,6 @@ #!/bin/sh # æ¥è¯¢-串å£è®¾å¤ export PATH=/sbin:/usr/sbin:$PATH echo -en "Content-type: text/html; charset=utf-8\n\n" #***************************************************** source ../bin/env.sh @@ -11,7 +12,11 @@ #echo "query device list: $content" >> log tmp=`sqlite3 /work/iot_cfg.db "select id from machine"` if [ "$tmp" = "" ];then /usr/local/script/update_sn > /dev/null fi sn=`sqlite3 /work/iot_cfg.db "select id from machine"` local/www/cgi-bin/snmp/download
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,17 @@ #!/bin/sh # 端å£é ç½®-æ¥è¯¢ echo -en "Content-type: text/html; charset=utf-8\n\n" #***************************************************** source ../bin/env.sh db="../bin/db" file="/tmp/oid_list.csv" if [ -f "$file" ] then echo "{\"code\":\"success\"}" else echo "{\"code\":\"error\"}" fi local/www/cgi-bin/snmp/enable
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,24 @@ #!/bin/sh #SNMP模ç»ç¶ææ¥è¯¢ export PATH=/sbin:/usr/sbin:$PATH echo -en "Content-type: text/html; charset=utf-8\n\n" #***************************************************** source ../bin/env.sh db="../bin/db" jsoner="../bin/jsoner" read content enable=`$jsoner $content enable` cfg=`jsoner -g /work/sysConfig.json snmp` if [ "$enable" == "true" ] then `jsoner -s /work/sysConfig.json snmp "1"` > /dev/null else `jsoner -s /work/sysConfig.json snmp "0"` > /dev/null fi echo "{\"code\": \"success\"}" local/www/cgi-bin/snmp/query
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,20 @@ #!/bin/sh #SNMP模ç»ç¶ææ¥è¯¢ export PATH=/sbin:/usr/sbin:$PATH echo -en "Content-type: text/html; charset=utf-8\n\n" #***************************************************** source ../bin/env.sh db="../bin/db" enable=`jsoner -g /work/sysConfig.json snmp` if [ "$enable" == "1" ] then echo "{\"enable\": true}" else echo "{\"enable\": false}" fi local/www/cgi-bin/state/query-device
@@ -10,26 +10,30 @@ # å®ä¹è¦æä½çæä»¶ file="/tmp/device_status" # çæä¸´æ¶æä»¶ temp_file=$(mktemp) delete_pattern=$(mktemp) cat $file # è·åéè¦å é¤çè¡å·èå´ï¼åä¸è¡+å½åè¡+åä¸è¡ï¼ awk '/^[[:space:]]*"id"[[:space:]]*:[[:space:]]*"25[67]"[[:space:]]*,/ { start = NR - 1 > 0 ? NR - 1 : 1 end = NR + 3 for (i = start; i <= end; i++) print i }' "$file" | sort -nu > "$delete_pattern" exit # æ§è¡è¿æ»¤å¹¶æ¾ç¤ºç»æ awk 'NR == FNR {del[$1]; next} !(FNR in del)' "$delete_pattern" "$file" | tee "$temp_file" # # çæä¸´æ¶æä»¶ # temp_file=$(mktemp) # delete_pattern=$(mktemp) # å¯éï¼å¦æè¦ç´æ¥ä¿®æ¹åæä»¶ï¼åæ¶ä»¥ä¸æ³¨é # mv "$temp_file" "$file" # # è·åéè¦å é¤çè¡å·èå´ï¼åä¸è¡+å½åè¡+åä¸è¡ï¼ # awk '/^[[:space:]]*"id"[[:space:]]*:[[:space:]]*"25[67]"[[:space:]]*,/ { # start = NR - 1 > 0 ? NR - 1 : 1 # end = NR + 3 # for (i = start; i <= end; i++) # print i # }' "$file" | sort -nu > "$delete_pattern" # æ¸ çä¸´æ¶æä»¶ rm "$delete_pattern" "$temp_file" # # æ§è¡è¿æ»¤å¹¶æ¾ç¤ºç»æ # awk 'NR == FNR {del[$1]; next} !(FNR in del)' "$delete_pattern" "$file" | tee "$temp_file" # # å¯éï¼å¦æè¦ç´æ¥ä¿®æ¹åæä»¶ï¼åæ¶ä»¥ä¸æ³¨é # # mv "$temp_file" "$file" # # æ¸ çä¸´æ¶æä»¶ # rm "$delete_pattern" "$temp_file" local/www/cgi-bin/sys-set/systemSpace
@@ -6,7 +6,7 @@ db="../bin/db" jsoner="../bin/jsoner" path="/work" path="/work/data" df_output=$(df -h $path | tail -n 1) local/www/cgi-bin/warn-list/update
@@ -19,4 +19,4 @@ fi sn=`$jsoner $content sn` `msg alarm $id` > /dev/null `msg alarm $sn` > /dev/null local/www/detail-jmkt.html
@@ -473,23 +473,6 @@ function renderValue(type,item) { var result = item.value; // if(type == "2002" || type == "2020" || type == "2022"){ // if(item.passcode >= 8 && item.passcode <= 998){ // result = (item.value=="0"?"æ£å¸¸":"åè¦"); // if(item.passcode == 16){ // if(item.value=="0"){ // result = "éé£"; // } // if(item.value=="1"){ // result = "å¶ç"; // } // if(item.value=="2"){ // result = "å¶å·"; // } // // result = (item.value=="0"?"å ³é":"å¼å¯"); // } // } // } var str = ""; if(item.note && item.note.length > 0){ local/www/detail-mj.html
@@ -14,158 +14,6 @@ <body class="pdgxq-body"> <div class="i-container"> <!-- <div class="jmkt-main">--> <!-- <div class="layui-fluid">--> <!-- <div class="pdgxq-m1 layui-row layui-col-space20">--> <!-- <div class="layui-col-lg5 layui-col-md5">--> <!-- <div class="pdgxq-m1-left pdgxq-m1-box" style="height: 730px">--> <!-- <div class="pdgxq-H">--> <!-- <h3><i></i>æè¿å¼é¨è®°å½</h3>--> <!-- </div>--> <!-- <div class="pdgxq-table jmkt-table-wrap">--> <!-- <table class="layui-table pdgxq-table1" lay-skin="nob">--> <!-- <colgroup>--> <!-- <col width="30%">--> <!-- <col width="30%">--> <!-- <col width="40%">--> <!-- <col>--> <!-- </colgroup>--> <!-- <thead>--> <!-- <tr>--> <!-- <th>å¡å·/å§å</th>--> <!-- <th>å¼é¨è¯´æ</th>--> <!-- <th>å¼é¨æ¶é´</th>--> <!-- </tr>--> <!-- </thead>--> <!-- <tbody>--> <!-- <tr>--> <!-- <td>1001/å¼ ä¸</td>--> <!-- <td>1å·é¨-å·å¡å¼é¨</td>--> <!-- <td>2020-04-26 12:30:56</td>--> <!-- </tr>--> <!-- <tr>--> <!-- <td>1002/æå</td>--> <!-- <td>2å·é¨-æçº¹å¼é¨</td>--> <!-- <td>2020-04-25 12:35:28</td>--> <!-- </tr>--> <!-- <tr>--> <!-- <td>1003/çäº</td>--> <!-- <td>3å·é¨-å¯ç å¼é¨</td>--> <!-- <td>2020-04-25 12:35:28</td>--> <!-- </tr>--> <!-- <tr>--> <!-- <td>1002/æå</td>--> <!-- <td>2å·é¨-æçº¹å¼é¨</td>--> <!-- <td>2020-04-25 12:35:28</td>--> <!-- </tr>--> <!-- <tr>--> <!-- <td>1003/çäº</td>--> <!-- <td>3å·é¨-å¯ç å¼é¨</td>--> <!-- <td>2020-04-25 12:35:28</td>--> <!-- </tr>--> <!-- <tr>--> <!-- <td>1002/æå</td>--> <!-- <td>2å·é¨-æçº¹å¼é¨</td>--> <!-- <td>2020-04-25 12:35:28</td>--> <!-- </tr>--> <!-- <tr>--> <!-- <td>1003/çäº</td>--> <!-- <td>3å·é¨-å¯ç å¼é¨</td>--> <!-- <td>2020-04-25 12:35:28</td>--> <!-- </tr>--> <!-- <tr>--> <!-- <td>1003/çäº</td>--> <!-- <td>3å·é¨-å¯ç å¼é¨</td>--> <!-- <td>2020-04-25 12:35:28</td>--> <!-- </tr>--> <!-- <tr>--> <!-- <td>1003/çäº</td>--> <!-- <td>3å·é¨-å¯ç å¼é¨</td>--> <!-- <td>2020-04-25 12:35:28</td>--> <!-- </tr>--> <!-- <tr>--> <!-- <td>1003/çäº</td>--> <!-- <td>3å·é¨-å¯ç å¼é¨</td>--> <!-- <td>2020-04-25 12:35:28</td>--> <!-- </tr>--> <!-- <tr>--> <!-- <td>1003/çäº</td>--> <!-- <td>3å·é¨-å¯ç å¼é¨</td>--> <!-- <td>2020-04-25 12:35:28</td>--> <!-- </tr>--> <!-- <tr>--> <!-- <td>1003/çäº</td>--> <!-- <td>3å·é¨-å¯ç å¼é¨</td>--> <!-- <td>2020-04-25 12:35:28</td>--> <!-- </tr>--> <!-- </tbody>--> <!-- </table>--> <!-- </div><!–pdgxq-table end–>--> <!-- </div>--> <!-- </div><!–pdgxq-m1-left end–>--> <!-- <div class="layui-col-lg7 layui-col-md7">--> <!-- <div class="pdgxq-m1-right pdgxq-m1-box">--> <!-- <div class="pdgxq-H">--> <!-- <h3><i></i>ç»è®¡ä¿¡æ¯</h3>--> <!-- </div>--> <!-- <div class="lsyg-jkxx-box">--> <!-- <div class=" layui-row">--> <!-- <div class="layui-col-lg6 layui-col-md6">--> <!-- <div class="mj-item mj-item1">--> <!-- <img src="./images/mj-bg1-img.png" class="mj-item-img"/>--> <!-- <div class="mj-itemCon">--> <!-- <h4>忥å¼é¨æ¬¡æ°</h4>--> <!-- <p>5</p>--> <!-- </div>--> <!-- </div>--> <!-- </div>--> <!-- <div class="layui-col-lg6 layui-col-md6">--> <!-- <div class="mj-item mj-item2">--> <!-- <img src="./images/mj-bg1-img.png" class="mj-item-img"/>--> <!-- <div class="mj-itemCon">--> <!-- <h4>è¿7天å¼é¨æ¬¡æ°</h4>--> <!-- <p>20</p>--> <!-- </div>--> <!-- </div>--> <!-- </div>--> <!-- </div>--> <!-- </div><!–lsyg-jkxx-box end–>--> <!-- </div>--> <!-- <div style="padding-top: 20px">--> <!-- <div class="pdgxq-m2-right pdgxq-m2-box">--> <!-- <h3>设å¤åºæ¬ä¿¡æ¯</h3>--> <!-- <p>设å¤åç§°ï¼æºæ¿é¨ç¦</p>--> <!-- <p>设å¤ç¶æï¼æ¿æ´»</p>--> <!-- <p>è¿ç»´ååï¼é£æ£è´è¿ä¿¡æ¯ææ¯è¡ä»½æéå ¬å¸</p>--> <!-- <div class="pdgxq-phone">--> <!-- <h4>è¿ç»´çµè¯</h4>--> <!-- <p>400-627-1116</p>--> <!-- </div>--> <!-- </div>--> <!-- </div>--> <!-- </div><!–pdgxq-m1-left end–>--> <!-- </div><!–pdgxq-m1 end–>--> <!-- </div>--> <!-- </div><!–jmkt-main end–>--> <div class="jmkt-main"> <div class="layui-fluid"> @@ -182,9 +30,9 @@ <p></p> <p>设å¤åç§°ï¼<span id="deviceName">æªç¥è®¾å¤#1</span></p> <p>设å¤ç¶æï¼<span id="deviceVld">æ¿æ´»</span></p> <p>è¿ç»´ååï¼<span id="opVendor"></span></p> <p style="display: none;">è¿ç»´ååï¼<span id="opVendor"></span></p> <div class="pdgxq-phone"> <div class="pdgxq-phone" style="display: none;"> <h4>è¿ç»´çµè¯</h4> <p id="opPhone"></p> </div> @@ -200,15 +48,15 @@ <div class="pdgxq-m1-right pdgxq-m1-box" style="height: 730px"> <div class="pdgxq-H"> <h3><i></i>å¼é¨è®°å½</h3> <!-- <div id="open" class="jmkt-tit-more" onclick="sendAction();">--> <!-- <button type="button" class="layui-btn layui-btn-normal pop-complete-btn"--> <!-- style="background-color: #46b8da;color: #ffffff;">å¼é¨</button>--> <!-- </div>--> <div id="open" class="jmkt-tit-more" onclick="sendAction();"> <button type="button" class="layui-btn layui-btn-normal pop-complete-btn" style="background-color: #46b8da;color: #ffffff;">å¼é¨</button> </div> </div> <div class="pdgxq-group clearfix"> <div class="pdgxq-group clearfix" style=""> <div class="pdgxq-group-item jmkt-chuli"> <span id="warnState">æ </span>è¦åç¶æ <span id="warnState">å ³é¨</span>åè¦ç¶æ </div> <div class="pdgxq-group-item jmkt-yichuli"> <span id="conState">æ£å¸¸</span>éè®¯ç¶æ @@ -268,6 +116,8 @@ </div><!--pdgxq-m1 end--> </div> </div> <!--i-container end--> @@ -297,21 +147,21 @@ $("#deviceName").html(device.name); $("#deviceVld").html(device.vld==0?'æ¿æ´»':'åç¨'); queryRecord(deviceId); //setInterval(function () { setInterval(function () { // queryRecord(deviceId); // // queryData(deviceId); //},5000); queryData(deviceId); },5000); } function queryData(deviceId,device) { function queryData(deviceId) { console.log("======é¨ç¦é¡µé¢-æ¥è¯¢å®æ¶======"); var data = {id: deviceId}; $.post("./cgi-bin/detail/query-data", JSON.stringify(data), function (data, status) { if ("success" == status) { console.log('---------è·åå°ç设å¤å®æ¶æ°æ®-----' + data); renderInfo(data,device); renderInfo(data); } else { console.log("æ°æ®æ¥è¯¢åºéï¼è¯·éæ°æä½ï¼"); window.parent.notify("æ°æ®æ¥è¯¢åºéï¼è¯·éæ°æä½ï¼"); @@ -320,25 +170,20 @@ }; //å¼å§æ¸²æå®æ¶æ°æ® function renderInfo(deviceData, device) { console.log("--------渲æå®æ¶æ°æ®-------é¨ç¦id="+device.id); console.log(deviceData); //设å¤åºæ¬ä¿¡æ¯ $("#deviceName").html(device.name); $("#deviceVld").html(device.vld==0?'æ¿æ´»':'åç¨'); function renderInfo(deviceData) { //çæ§å±æ§å®æ¶æ°æ®æ¸²æ var list = deviceData.value; if(list !=null && list.length>0){ $.each(list,function(index,item) { //éè®¯ç¶æ if (item.passcode == 1) { $("#conState").html(item.value == 0 ? "æ£å¸¸" : "å¼å¸¸"); $("#conState").html(item.value == 0 ? "æ£å¸¸" : "é讯å¼å¸¸"); $("#warnState").html(item.value == 0 ? "æ£å¸¸" : "é讯å¼å¸¸"); } //è¦åç¶æ if (item.passcode == 2) { $("#warnState").html(item.value == 0 ? "æ " : "æ¥è¦"); } // //é¨ç¦ç¶æ // if (item.passcode == 4) { // $("#warnState").html(item.value == 0 ? "å ³é¨" : "å¼é¨"); // } }); } @@ -361,6 +206,15 @@ function queryRecord(id) { console.log("--------æ¥çé¨ç¦åå²è®°å½-------é¨ç¦id="+id); var param = {"id": id}; // $.post("./cgi-bin/record-his/query", JSON.stringify(param), function (data, status) { // if ("success" == status) { // //渲æå岿°æ®å表 // renderRecordInfo(data); // }else { // window.parent.notify("é¨ç¦æ°æ®æ¥è¯¢åºéï¼è¯·éæ°æä½ï¼"); // } // }, "json"); $.post("./cgi-bin/record-his/query-by-id", JSON.stringify(param), function (data, status) { if ("success" == status) { //渲æå岿°æ®å表 @@ -372,46 +226,74 @@ } //å¼å§æ¸²æ function renderRecordInfo(dataList) { console.log(dataList); var li = dataList; console.log(li); console.log(li.length); //é¨ç¦å岿°æ®æ¸²æ var html=""; if(dataList !=null && dataList.length>0){ if(li != null && li.length > 0){ var list; $.each(dataList,function(index,item){ $.each(li,function(index,item){ if(item.value){ list = eval(item.value); if(list !=null && list.length>0){ var tag1 = ''; //å¡å·/å§å var tag2 = ''; //é¨å· var tag3 = ''; //å¼é¨ç±»å var tag4 = ''; //å¼é¨æ¶é´ $.each(list,function(index,item){ if(item.passcode == 3){ tag2 = item.value + 'å·é¨-'; for (var i = 0; i < list.length; i++) { var cur = list[i]; if (cur.passcode == 3) { tag2 = cur.value + 'å·é¨-'; } if(item.passcode == 5){ tag1 = item.value; if (cur.passcode == 5) { tag1 = cur.value; } if(item.passcode == 6){ tag3 = item.value; if (cur.passcode == 6) { tag3 = cur.value; } if(item.passcode == 7){ tag4 = item.value.substring(0,4) + "-" + item.value.substring(4,6) + "-" + item.value.substring(6,8) + " " + item.value.substring(8,10) + ":" + item.value.substring(10,12)+ ":" + item.value.substring(12,14); if (cur.passcode == 7) { // tag4 = cur.value.substring(0, 4) + "-" + // cur.value.substring(4, 6) + "-" + // cur.value.substring(6, 8) + " " + // cur.value.substring(8, 10) + ":" + // cur.value.substring(10, 12) + ":" + // cur.value.substring(12, 14); tag4 = cur.value; } }); } html += "<tr><td>"+ tag1 +"</td><td>" + tag2 + tag3 + "</td><td>" + tag4 + "</td></tr>"; } } }); }else { html += "<tr><td colspan='3'>ææ æ°æ®</td></tr>"; // html += "<tr><td colspan='3'>ææ æ°æ®</td></tr>"; } $("#listData").html(html); } function sendAction() { if (confirm('æ¯å¦è¿è¡å¼é¨æä½ï¼')){ var param = {"id": deviceId,"passcode":8,"value":1}; console.log("======å¼é¨æä½å½ä»¤åé======"); // console.log(JSON.stringify(param)); // $.post("./cgi-bin/action/open-door", JSON.stringify(param), function (data, status) { // // }, "json"); $.ajaxSettings.async = false; $.post("./cgi-bin/file/action-control", JSON.stringify(param), function (data, status) { }, "json"); window.parent.notify("å½ä»¤åéæåï¼"); } return false; } </script> </body> local/www/detail-ups.html
@@ -203,7 +203,7 @@ } html += "<tr><td>"+cur.name+"</td><td>"+str+"</td><td>"+time+"</td></tr>"; }else{ html += "<tr><td>"+cur.name+"</td><td>"+renderValue(device.id,device.type,cur.passcode,cur.value)+"</td><td>"+time+"</td></tr>"; html += "<tr><td>"+cur.name+"</td><td>"+renderValue(device.type,cur)+"</td><td>"+time+"</td></tr>"; //渲æå表 @@ -284,7 +284,7 @@ } html += "<tr><td>"+cur.name+"</td><td>"+str+"</td><td>"+time+"</td></tr>"; }else{ html += "<tr><td>"+cur.name+"</td><td>"+renderValue(device.id,device.type,cur.passcode,cur.value)+"</td><td>"+time+"</td></tr>"; html += "<tr><td>"+cur.name+"</td><td>"+renderValue(device.type,cur)+"</td><td>"+time+"</td></tr>"; //渲æå表 // html += "<tr><td>"+cur.name+"</td><td>"+(cur.value?cur.value:"")+"</td><td>"+time+"</td></tr>"; @@ -357,139 +357,8 @@ } } function renderValue(id,type,code,value) { var res = value; // if(type == "1001"){ // if(code == 3 || code == 5){ // res = value+"V"; // } // else if(code == 4 || code == 6){ // res = value+"A"; // } // else if(code == 7){ // res = value+"Hz"; // } // else if(code == 8){ // res = value+"%"; // } // else if(code == 9){ // res = value+"â"; // } // else if(code == 10){ // if(value == 0){ // res = "å¸çµä¾çµ" // } // if(value == 1){ // res = "çµæ± ä¾çµ" // } // } // else if(code == 11){ // if(value == 0){ // res = "æ£å¸¸" // } // if(value == 1){ // res = "æè·¯" // } // if(value == 2){ // res = "çµæ± ä¾çµ" // } // } // else if(code == 12){ // res = value+"V"; // } // else if(code == 13){ // res = value+"%"; // } // else if(code == 14){ // res = value+"min"; // } // else if(code >= 15 && code < 999){ // res = value == "0"?"æ£å¸¸":"åè¦"; // } // } // // if(type == "1002"){ // if(code >= 3 && code <= 5){ // res = value+"V"; // } // else if(code >= 6 && code <= 8){ // res = value+"A"; // } // else if(code >= 9 && code <= 11){ // res = value+"V"; // } // else if(code >= 12 && code <= 14){ // res = value+"A"; // } // else if(code == 15){ // res = value+"Hz"; // } // else if(code >= 16 && code <= 18){ // res = value+"%"; // } // else if(code == 19){ // res = value+"â"; // } // else if(code == 20){ // if(value == 0){ // res = "å¸çµä¾çµ" // } // if(value == 1){ // res = "çµæ± ä¾çµ" // } // if(value == 2){ // res = "ä¸ä¾çµ" // } // if(value == 3){ // res = "èåä¾çµ" // } // if(value == 4){ // res = "æè·¯ä¾çµ" // } // } // else if(code == 21){ // if(value == 0){ // res = "æ£å¸¸" // } // if(value == 1){ // res = "æè·¯" // } // if(value == 2){ // res = "çµæ± ä¾çµ" // } // } // else if(code == 22){ // res = value+"V"; // } // else if(code == 23){ // res = value+"%"; // } // else if(code == 24){ // res = value+"min"; // } // else{ // if(code >= 25 && code <= 998){ // res = value == 0 ? "æ£å¸¸" : "åè¦"; // if(value != 0 && value != 1){ // res = value; // } // // // if(code >= 25 && code <= 27){ // // res = value + "V"; // // } // // if(code >= 28 && code <= 30){ // // res = value + "KW"; // // } // // if(code >= 31 && code <= 35){ // // res = value + "Hz"; // // } // // } // // } // } function renderValue(type,cur) { var res = cur.value; var str = ""; if(cur.note && cur.note.length > 0){ local/www/download.html
ÎļþÒÑɾ³ý local/www/js/page/device-net.js
@@ -272,7 +272,7 @@ libnamezh: $("#device-libname option[value='"+ $("#device-libname").val() +"']").text(), type: $("#device-type").val(), vld: $("#device-vld").val(), userName: $("#dev-libname").val(), userName: $("#device-userName").val(), passwd: $("#device-passwd").val(), // userName: $("#dev-libname").val(), taskNo: $("#device-taskNo").val(), local/www/sys-param-set.html
@@ -39,10 +39,11 @@ <li class="layui-this"><span>端å£è®¾ç½®</span></li> <li class=""><span>å¹³å°è®¾ç½®</span></li> <li class=""><span>ç½ç»è®¾ç½®</span></li> <li class=""><span>åå¨ç®¡ç</span></li> <li class=""><span>åå¨è®¾ç½®</span></li> <li class=""><span>è·¯ç±è¡¨</span></li> <li class=""><span>å½å¯é ç½®</span></li> <li class=""><span>MQTT</span></li> <li class=""><span>SNMP</span></li> <li id="etc" class="" style="display: none;"><span>é«éETCçå¹³å°é ç½®</span></li> </ul> <div class="layui-tab-content"> @@ -75,6 +76,10 @@ data-id="sys-mqtt-conf.html" seamless></iframe> </div> <div class="layui-tab-item"> <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="sys-snmp-conf.html" frameborder="0" data-id="sys-snmp-conf.html" seamless></iframe> </div> <div class="layui-tab-item"> <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="sys-etc-param.html" frameborder="0" data-id="sys-etc-param.html" seamless></iframe> </div> local/www/sys-register.html
@@ -57,7 +57,7 @@ <div class="layui-card" style="height: 270px;"> <div class="layui-card-header layui-row"> <div class="layui-col-md11"> æ³¨åæºæ¢°ç æ³¨åæºå¨ç </div> <div class="layui-col-md1"> <button class="layui-btn layui-btn-normal" style="height: 25px;line-height: 25px;" local/www/sys-snmp-conf.html
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,190 @@ <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="renderer" content="webkit"> <title>æºè½è¿ç»´ç®¡çç³»ç»-SNMP</title> <link rel="stylesheet" type="text/css" href="plugins/layui/css/layui.css" /> <link rel="stylesheet" type="text/css" href="css/page/device-control.css" /> <style> .layui-col-md4 { width: 100%; } .layui-inline { margin-left: unset; } .layui-layer-dialog .layui-layer-content { border-bottom: solid 1px #eae5e5; } .btns button{ width: 120px; } </style> </head> <body class="pdgxq-body"> <div class="i-container"> <div class="jmkt-main"> <div class="layui-fluid"> <div class="pdgxq-m1 layui-row layui-col-space20"> <!--pdgxq-m1-left end--> <div class="layui-col-lg12 layui-col-md12 img-main" id="img-main" style="padding: 20px;"> <div class="pdgxq-m1-left pdgxq-m1-box" style="width: 100%;"> <form class="layui-form" id="form-param" lay-filter="form-param" action=""> <div class="layui-row" style="padding: 20px 0;"> <div class="layui-col-md4"> <div class="layui-inline" style="margin-left: -16%"> <label class="layui-form-label">SNMP模ç»ï¼</label> <div class="layui-input-block"> <input type="checkbox" id="enable" name="enable" lay-skin="switch" lay-filter="switch" lay-text="å¯ç¨|åç¨"> </div> </div> </div> <div class="layui-col-md4"> <div class="layui-inline"> <label class="layui-form-label">çæ¬å·ï¼</label> <div class="layui-input-block"> <input id="ver" type="text" name="ver" value="V2.0" class="layui-input" readonly> </div> </div> </div> <div class="layui-col-md4"> <div class="layui-inline"> <label class="layui-form-label">å ±ç¨ä½åç§°ï¼</label> <div class="layui-input-block"> <input id="publicName" type="text" name="publicName" value="public" class="layui-input" readonly> </div> </div> </div> <div class="layui-col-md4"> <div class="layui-inline"> <label class="layui-form-label">端å£å·ï¼</label> <div class="layui-input-block"> <input id="port" type="text" name="port" value="161" class="layui-input" readonly> </div> </div> </div> <div class="layui-col-md4" style=""> <div class="layui-inline"> <div class="layui-input-block btns" style="margin-left: 15px"> <button style="margin-right: 50px; font-size: 16px" class="layui-btn layui-btn-warm" onclick="javaScript:downLoadF(); return false;">导åºOID表 </button> </div> </div> </div> </div> </form> </div> </div> </div> <!--pdgxq-m1 end--> </div> </div> <!--jmkt-main end--> </div> <!--i-container end--> <script type="text/javascript" src="js/jquery.min.js"></script> <script src="plugins/layui/layui.js"></script> <script src="js/constant.js"></script> <script type="text/javascript"> var layer;// å®ä¹å ¨å±åé var form; var laydate; $(function () { layui.use(['layer', 'form', 'laydate'], function () { layer = layui.layer; form = layui.form; laydate = layui.laydate; form.on('switch(switch)', function(data){ //å¼å ³ç¶ææ¹åæ¶è§¦å changeStatus(this.checked); }); query(); }); }); function query() { $.ajaxSettings.async = false; $.get("./cgi-bin/snmp/query", function (data, status) { if ("success" == status) { form.val('form-param', { "enable": data.enable//0-å¯ç¨ï¼1-ç¦ç¨ }); form.render(); } else { window.parent.parent.notify("ç³»ç»è·åçæ§è®¾å¤ä¿¡æ¯å¤±è´¥ï¼"); } }, "json"); } /** * ä¿®æ¹ç¶æ * @param enable true or false */ function changeStatus(enable) { var obj = {"enable":enable}; $.post("./cgi-bin/snmp/enable", JSON.stringify(obj), function (data, status) { if (data.code == "success") { //window.parent.parent.notify("æ°æ®ä¿åæå"); window.parent.parent.notify("SNMP模ç»ç¶æä¿åæå"); } else { window.parent.parent.notify("æ°æ®ä¿ååºéï¼è¯·éæ°æä½ï¼"+data.msg+"ï¼"); } }, "json"); } //å¯¼åº function downLoadF() { $.ajaxSettings.async = false; $.get("./cgi-bin/snmp/download", function (data, status) { if ("success" == data.code) { downLoadF2(); }else{ window.parent.parent.notify("çæoid表åºé"); } }, "json"); } function downLoadF2() { var fileName = "oid_list.csv"; var url = "./cgi-bin/download/download.cgi?filename=/temp/oid_list.csv"; // 对äº<a>æ ç¾ï¼åªæ Firefox å Chromeï¼å æ ¸ï¼ æ¯æ download 屿§ if ('download' in document.createElement('a')) { // æ¯æaæ ç¾downloadçæµè§å¨ var link = document.createElement('a'); // å建aæ ç¾ link.download = fileName;// aæ ç¾æ·»å 屿§ link.style.display = 'none'; // link.href = URL.createObjectURL(blob); link.href = url; document.body.appendChild(link); link.click(); // æ§è¡ä¸è½½ URL.revokeObjectURL(link.href); // éæ¾url document.body.removeChild(link); // éæ¾æ ç¾ } else { // å ¶ä»æµè§å¨ navigator.msSaveBlob(url, fileName); } } </script> </body> </html> local/www/upload.html
ÎļþÒÑɾ³ý upgrade/app.tgzBinary files differ