-
Notifications
You must be signed in to change notification settings - Fork 0
/
loghistory.html
81 lines (61 loc) · 1.95 KB
/
loghistory.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
<html>
<head>
<title>Data Logs</title>
<meta name=viewport content='width=370'>
<script src="Chart.min.js"></script>
<script src="utils.js"></script>
</head>
<body bgcolor=#ffffff text=#000000 link=#ff0000 vlink=#880000 alink=#00ff00>
<script type="text/javascript" src="loglist.json"></script>
<script type="text/javascript" src="makeplot.js"></script>
<h2> Data Logs</h2>
<script type="text/javascript" src="links.js"></script>
<div style="width:450px;">
<canvas id="canvas"></canvas>
</div>
<div id='navArea'>
<p>Select data file</p>
<form id='the_form' action='loghistory.html' method='GET'>
<input id='button' type='submit' value='Submit'>
</form>
</div>
<script>
var httpRequest = new XMLHttpRequest();
httpRequest.onreadystatechange = function() {
if (httpRequest.readyState === 4) {
if (httpRequest.status === 200) {
//console.log(httpRequest.responseText);
//document.data = JSON.parse(httpRequest.responseText.slice(7, httpRequest.responseText.length));
//init = data.init;
//console.log(init);
//show_page();
//return data;
}
}
};
var splitUrl = window.location.toString().split('?val=');
if (splitUrl.length === 2) {
var getfile = splitUrl[1];
//console.log(getfile);
httpRequest.open('GET', getfile, false);
httpRequest.send();
//console.log('response');
//console.log(httpRequest.responseText);
var data = JSON.parse(httpRequest.responseText.slice(7, httpRequest.responseText.length));
//console.log(data);
plot_it();
}
</script>
<script>
var navArea = document.getElementById('the_form');
var theButton = document.getElementById('button');
var content = document.createElement("select");
content.name = 'val';
for (var j=0; j<loglist.length; j++) {
content.options.add( new Option(loglist[j], loglist[j]) );
}
content.value = getfile;
navArea.insertBefore(content, theButton);
</script>
</body>
</html>