-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
63 lines (63 loc) · 1.36 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>Cyber Vis</title>
<link rel="stylesheet" type="text/css" href="main.css">
<style>
pre {
background-color: #eee;
height: 500px;
width: 1000px;
word-wrap: break-word;
overflow: auto;
}
#title {
width: 100%;
float: left;
margin: 0 0 0 0;
padding: 0;
list-style: none;
}
#title li {
float: left;
}
#time {
width: 150px;
margin-left: 30px;
}
#sip {
width: 130px;
}
#sport {
width: 90px;
}
#dip {
width: 105px;
}
#dport {
width: 150px;
}
</style>
<script src="http://10.103.69.112/socket.io/socket.io.js"></script>
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
</head>
<body>
<ul id="title">
<li id="time">Time</li>
<li id="sip">Source IP</li>
<li id="sport">Source Port</li>
<li id="dip">Destination IP</li>
<li id="dport">Destination Port</li>
</ul>
<pre id="log"></pre>
<script>
var socket = io.connect('http://10.103.69.112');
socket.on('news', function (data) {
$('#log').append(data.data);
//scroll the div to follow last line added!
var objDiv = document.getElementById("log");
objDiv.scrollTop = objDiv.scrollHeight;
});
</script>
</body>
</html>