-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
61 lines (50 loc) · 1.61 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TimeLine of FANUC Robot Alarm History</title>
<script src="node_modules/vis/dist/vis.js"></script>
<link href="node_modules/vis/dist/vis.css" rel="stylesheet" type="text/css" />
<script type = "text/javascript">
var data = null;
var parser = require('./lib/parser/parser');
function openFileDialog(){
var remote = require('electron').remote;
var dialog = remote.dialog;
var fs = require('fs');
document.getElementById('select-file').addEventListener('click',function(){
dialog.showOpenDialog(function (fileNames) {
if(fileNames === undefined){
console.log("No file selected");
}else{
console.log( fileNames[0] );
var par = new parser(fileNames[0]);
var items = new vis.DataSet(par.getDataSet());
var container = document.getElementById('visualization');
var options = {};
// Create the timeline!
var timeline = new vis.Timeline(container, items, options);
}
});
},false);
}
</script>
<style>
body, html {
font-family: arial, sans-serif;
font-size: 8px;
}
</style>
</head>
<body>
<div id="visualization"></div>
<script>
</script>
<div style="text-align:center;">
<input type="button" value="Open File" id="select-file" onClick="openFileDialog();"/>
</div>
</body>
</html>