aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/nms.gathering.org/ping.css13
-rw-r--r--web/nms.gathering.org/ping.html25
-rw-r--r--web/nms.gathering.org/ping.js22
3 files changed, 37 insertions, 23 deletions
diff --git a/web/nms.gathering.org/ping.css b/web/nms.gathering.org/ping.css
new file mode 100644
index 0000000..1045a4a
--- /dev/null
+++ b/web/nms.gathering.org/ping.css
@@ -0,0 +1,13 @@
+.switchname {
+ position: absolute;
+ font-family: sans-serif;
+ font-size: small;
+ white-space: nowrap;
+}
+.rot {
+ -webkit-transform: rotate(-90deg);
+ -webkit-transform-origin: 0% 0%;
+ transform: rotate(-90deg);
+ transform-origin: 0% 0%;
+ bottom: -14px;
+}
diff --git a/web/nms.gathering.org/ping.html b/web/nms.gathering.org/ping.html
index 8205077..3aea383 100644
--- a/web/nms.gathering.org/ping.html
+++ b/web/nms.gathering.org/ping.html
@@ -1,25 +1,20 @@
<html>
+ <head>
+ <title>Ping? Pong!</title>
+ </head>
<body>
- <style>
-.switchname {
- position: absolute;
- font-family: sans-serif;
- font-size: small;
- white-space: nowrap;
-}
-.rot {
- -webkit-transform: rotate(-90deg);
- -webkit-transform-origin: 0% 0%;
- transform: rotate(-90deg);
- transform-origin: 0% 0%;
- bottom: -14px;
-}
-</style>
+ <link rel="stylesheet" href="/ping.css">
<p id="playground">
<svg id="lines" width="1280" height="736" style="position: absolute; top: 0; left: 0; z-index: 1">
</svg>
<img src="tg14-salkart.png" alt="" id="map" />
</p>
+ <script>
+ // These are used by ping.js, below.
+ var switches_url = "/switches-json.pl";
+ var ping_url = "/ping-json.pl";
+ var draw_linknets = true;
+ </script>
<script type="text/javascript" src="ping.js"></script>
</body>
</html>
diff --git a/web/nms.gathering.org/ping.js b/web/nms.gathering.org/ping.js
index ce3d99f..c3d2c63 100644
--- a/web/nms.gathering.org/ping.js
+++ b/web/nms.gathering.org/ping.js
@@ -22,11 +22,11 @@ function json_request(url, func, repeat_ms) {
}
function get_switches() {
- json_request('/switches-json.pl', draw_switches, 1000);
+ json_request(switches_url, draw_switches, 1000);
}
function get_ping() {
- json_request('/ping-json.pl', update_ping, 1000);
+ json_request(ping_url, update_ping, 1000);
}
function draw_switches(json) {
@@ -53,9 +53,11 @@ function draw_switches(json) {
parseInt(s['height']));
}
- for (var i = 0; i < json['linknets'].length; ++i) {
- var linknet = json['linknets'][i];
- create_linknet(linknet['linknet'], linknet['switch1'], linknet['switch2']);
+ if (draw_linknets) {
+ for (var i = 0; i < json['linknets'].length; ++i) {
+ var linknet = json['linknets'][i];
+ create_linknet(linknet['linknet'], linknet['switch1'], linknet['switch2']);
+ }
}
setTimeout(get_switches, 60000);
@@ -137,9 +139,13 @@ function really_update_ping(json) {
if (json['switches']) {
for (var switchnum in switches) {
if (json['switches'][switchnum]) {
- switches[switchnum].style.background =
- gradient_from_latency(json['switches'][switchnum]['latency'],
- json['switches'][switchnum]['latency_secondary']);
+ if (json['switches'][switchnum]['color']) {
+ switches[switchnum].style.background = json['switches'][switchnum]['color'];
+ } else {
+ switches[switchnum].style.background =
+ gradient_from_latency(json['switches'][switchnum]['latency'],
+ json['switches'][switchnum]['latency_secondary']);
+ }
} else {
switches[switchnum].style.background = '#0000ff';
}
his file 'description' to name the repository.MimesBrønn
aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/plugins/interlock/README
blob: ca15b35d27ac3f4f5600ac6404075ab696099032 (plain)
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130