-
Notifications
You must be signed in to change notification settings - Fork 32
/
rtc.html
80 lines (79 loc) · 2.26 KB
/
rtc.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Raft over webRTC</title>
<link rel="stylesheet" type="text/css" href="web/demo.css"/>
</head>
<body>
<header><h1>Raft Distributed Consensus Algorithm over webRTC</h1></header>
<br>
Create more nodes using this link: <a id="node_link" href="" target="_blank">Loading</a>
<br><br>
<table border=1 style="width: 100%">
<tr>
<td>
Term
</td>
<td>
State
</td>
<td>
Cluster Size
</td>
<td>
Log Length
</td>
<td>
Request Votes Sent/Received
</td>
<td>
Append Entries Sent/Received
</td>
</tr>
<tr>
<td id=term>
</td>
<td id=state>
</td>
<td id=cluster_size>
</td>
<td id=log_length>
</td>
<td id=rv_count>
</td>
<td id=ae_count>
</td>
</tr>
</table>
<div>
<textarea id='messages' rows=20></textarea>
</div>
<!--<script src="http://cdn.peerjs.com/0.3/peer.js"></script>-->
<!--<script src="https://skyway.io/dist/0.3/peer.js"></script>-->
<script type="text/javascript" src="peer.js"></script>
<script type="text/javascript" src="jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="base.js"></script>
<script type="text/javascript" src="local.js"></script>
<script type="text/javascript" src="rtc.js"></script>
<script type="text/javascript">
window.onload = function () {
if (!location.queryParams.paused) {
startRtc({}, startRaft);
}
}
</script>
<script>
if (location.queryParams.twst_address) {
console.log("rtc.html: loading twst_client.js");
document.write('<script src="/node_modules/twst/twst_client.js"><\/script>');
}
</script>
</body>
</html>