-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
83 lines (73 loc) · 2.48 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Graph App Example</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/build/pure-min.css">
<style>
#root {
margin: 20px;
}
</style>
</head>
<body>
<div id="root">
<form class="pure-form pure-form-aligned" onsubmit="return false">
<div class="pure-control-group">
<label for="arguments">Arguments</label>
<input id="arguments" type="text" placeholder="Arguments">
<span class="pure-form-message-inline">Comma-separated arguments to pass to the test jar</span>
</div>
<div class="pure-control-group">
<label for="options">Options</label>
<input id="options" type="text" placeholder="Options">
<span class="pure-form-message-inline">Comma-separated options (eg. -DmyProperty=value, -Xdebug)</span>
</div>
<div class="pure-controls">
<button type="submit" class="pure-button" onclick="executeJar()">Execute jar</button>
<button type="submit" class="pure-button" onclick="executeClass()">Execute 'Main' class</button>
</div>
<h3>Result</h3>
<pre><code id="stdout"></code></pre>
<pre><code id="stderr"></code></pre>
</form>
</div>
<script>
function parseArguments() {
const text = window.arguments.value;
return text.split(',');
}
function parseOptions() {
const text = window.options.value;
return text.split(',');
}
function showResult({stdout, stderr}) {
window.stdout.innerText = stdout;
window.stderr.innerText = stderr;
}
function executeJar() {
const parameters = {
jar: "./test.jar",
options: parseOptions(),
classpath: [],
arguments: parseArguments()
};
window.neo4jDesktopApi.executeJava(parameters)
.then(showResult);
}
function executeClass() {
const parameters = {
class: "Main",
options: parseOptions(),
classpath: ['./test.jar'],
arguments: parseArguments()
};
window.neo4jDesktopApi.executeJava(parameters)
.then(showResult);
}
</script>
</body>
</html>