-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspeed.html
executable file
·92 lines (82 loc) · 2.36 KB
/
speed.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
81
82
83
84
85
86
87
88
89
90
91
92
<html>
<head>
<!--<script type="text/javascript" src="dygraph-combined.js"></script>-->
<link rel="stylesheet" href="dygraph.css">
<link rel="icon" href="dashboard/images/favicon.png" type="image/png" />
<script type="text/javascript" src="dygraph.min.js"></script>
<title>Bredbandet hastighet</title>
</head>
<body>
<h2 id="networkSpeed">Network Speed1</h2>
<div id="graphdiv1" style="width:600px; height:300px;"></div>
<script type="text/javascript">
g1 = new Dygraph(document.getElementById("graphdiv1"),
"data/data.csv",
{
showRangeSelector:false
});
</script>
<h2 id="networkSpeed">Network Speed2</h2>
<p>Uses speedtest-cli (https://github.com/sivel/speedtest-cli) to check speed</p>
<div id="network_speed" style="width:750px; height:350px;"></div>
<p><b>Display: </b>
<input type=checkbox id=0 onClick="checkboxChanged(this)" checked>
<label for="0"> Ping</label>
<input type=checkbox id=1 onClick="checkboxChanged(this)" checked>
<label for="1"> Download</label>
<input type=checkbox id=2 onClick="checkboxChanged(this)" checked>
<label for="2"> Upload</label>
<input type=checkbox id=annotate onClick="annotationsChanged(this)" checked>
<label for="annotate"> Annotations</label>
</p>
<script type="text/javascript">
var annotations = [
{
series: "Download",
x: "2016-02-02 13:27",
shortText: "Download",
text: "Download",
cssClass: 'annotation'
},
{
series: "Ping",
x: "2016-02-02 13:27",
shortText: "Ping",
text: "Ping",
cssClass: 'annotation'
},
{
series: "Upload",
x: "2016-02-02 13:27",
shortText: "Upload",
text: "Upload",
cssClass: 'annotation'
}
];
stockchart = new Dygraph(
document.getElementById('network_speed'),
"data/data.csv",
{
//showRoller: true,
//customBars: true,
showRangeSelector:true,
labelsKMB: true,
drawCallback: function(g, is_initial) {
if (!is_initial) return;
g.setAnnotations( annotations );
}
}
);
function checkboxChanged(el) {
stockchart.setVisibility(el.id, el.checked);
}
function annotationsChanged(el) {
if (el.checked) {
stockchart.setAnnotations(annotations);
} else {
stockchart.setAnnotations([]);
}
}
</script>
</body>
</html>