-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettingWindow.html
More file actions
89 lines (81 loc) · 2.29 KB
/
settingWindow.html
File metadata and controls
89 lines (81 loc) · 2.29 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Setting</title>
<link rel="stylesheet" href="css/materialize.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div id="loader-icon" class="loadingio-spinner-dual-ring-feiuukm7xkk">
<div class="ldio-au0hf2wldqb">
<div></div>
<div>
<div></div>
</div>
</div>
</div>
<div class="container">
<form>
<div>
<label>IP</label>
<input type="text" id="ip" value="192.168.0.52" >
</div>
<div>
<label>Comm Key</label>
<input type="password" id="key" value="123456" >
</div>
<div>
<label>WEB CMS</label>
<input type="text" id="web" value="https://cmsqu.com" >
</div>
<div>
<label>API CMS</label>
<input type="text" id="api" value="" >
</div>
<div>
<button type="submit" class="waves-effect waves-light btn green" >Save</button>
</div>
</form>
<br>
<div>
<p class="note"></p>
</div>
</div>
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
<script src="js/jquery-3.5.1.min.js"></script>
<script src="js/materialize.min.js"></script>
<script>
const electron = require('electron');
const {ipcRenderer} = electron;
var item = electron.remote.getCurrentWindow().custom;
var ip = $("#ip"),key = $("#key"), web = $("#web"), api = $("#api");
if(item){
ip.val(item.ip);
key.val(item.key);
web.val(item.web);
api.val(item.api)
}
$("form").on("submit", function (e) {
e.preventDefault();
$(".note").html("");
$("#loader-icon").show();
let json = {
ip:ip.val(),
key:key.val(),
web:web.val(),
api:api.val()
}
ipcRenderer.send("setting", json);
});
ipcRenderer.on('progress', function(event, message){
let note = $(".note").html();
note += message;
$(".note").html(note);
if(message == "done"){
$("#loader-icon").hide();
}
});
</script>
</body>
</html>