-
Notifications
You must be signed in to change notification settings - Fork 9
/
ui.html
48 lines (43 loc) · 1.35 KB
/
ui.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
<!doctype html>
<html>
<head>
<style>
div {
display: flex;
flex-direction: column;
align-items: center;
word-break: break-all;
}
#detail {
width: 400px;
}
</style>
</head>
<body>
<div>
<h1 id="status">Loading...</h1>
<div id="detail"></div>
<form id="form">
<input type="number" maxlength=6 id="code" />
<input type="submit" />
</form>
</div>
<script>
document.getElementById("form").style.display = "none";
const { ipcRenderer } = require('electron');
ipcRenderer.on('status', (event, arg) => {
document.getElementById("status").innerHTML = arg;
})
ipcRenderer.on('detail', (event, arg) => {
document.getElementById("detail").innerHTML = arg;
})
ipcRenderer.on('showform', (event, arg) => {
document.getElementById("form").style.display = arg;
})
document.getElementById("form").onsubmit = function() {
code = document.getElementById("code").value;
ipcRenderer.send('code', code);
}
</script>
</body>
</html>