Blame view
wave/earthquake.php
2.69 KB
cf76164e6 20190709 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
<!DOCTYPE html> <html> <head> <?php $str = shell_exec("ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'"); echo ($str == '') ? "eth0 not exist!!":""; $str = ($str == '') ? "127.0.0.1":$str; ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.js"></script> <script src="/socket.io/socket.io.js"></script> <script> $(document).ready(function() { $('.text_bold_nounderline').hide(); }); window.onload = function () { var socket = io.connect(); var time = (new Date()).getTime(); var keep = 0; var clock_array = new Array(); socket.on('date', function(data) { $('#date').text(data.date); var str = data.date.split(","); var str1 = str[17].split(" "); clock_array.push(str1[1]); if(str1[1] >= 0){ $('.text_bold_nounderline').show(); $('.clock').text(str1[1]); $('.deep').text(str1[0]); var strtime = str[0]+"-"+str[1]+"-"+str[2]+" "+str[3]+":"+str[4]+":"+str[5]; var location = str[7]+","+str[6]; $('.time').text(strtime); $('.information').text(", Location ["+location+"], Depth "+str[8]+", Magnitude "+str[9]+",WarnLevel "+str[15]+", ServerCode "+str[16]); if(keep < 1){ $('#iframe').attr('src','http://<?=$str?>/wave/map1.php?event=1&clock='+clock_array[0]+'&strtime='+strtime+'&location='+location+'&level='+str[13]); keep = 1; } if(str1[1] == 0){ keep = 0; } }else if(str1[1] == -1 && str1[0] == -1){ location.href="http://<?=$str?>:10200/earthquake.html"; }else{ $('.text_bold_nounderline').hide(); if(keep == 1){ $('#iframe').attr('src','http://<?=$str?>/wave/map1.php?event=1&clock='+clock_array[0]); keep = 0; } } console.log(keep); }); $(document).ready(function(){ $('#text').keypress(function(e){ socket.emit('client_data', { 'letter': String.fromCharCode(e.charCode) }); }); }); } </script> <title>EEW</title> </head> <body> <p><span class="text_bold_nounderline">Comedown <font class="clock" style="font-color:red;"></font> Seconds(s), Intensity <font class="deep" style="font-color:red;"></font></span></p> <div id="allmap"> <iframe id="iframe" width="100%" height="500px" src="http://<?=$str?>/wave/map1.php"></iframe> </div> <p><font class="time" style="font-size:18px;"></font><font class="information"></font></p> <!--<div id="r-result"> <input type="button" onclick="add_overlay()" value="添加覆盖物" /> <input type="button" onclick="remove_overlay();" value="删除覆盖物" /> </div>--> <div id="date"></div> </body> </html> |