-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrenderer.js
42 lines (31 loc) · 1.35 KB
/
renderer.js
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
window.addEventListener('DOMContentLoaded', () => {
document.getElementById('button').addEventListener('click', () => {
let state = document.getElementById('button').value
if(window.store.get('serverAddress')!== "" && window.store.get('config')!== ""){
if(state == "Start Xray"){
document.getElementById('button').value = "Stop Xray"
window.ipcRender.send('runScript');
}
else{
window.ipcRender.send('stopScript');
document.getElementById('button').value = "Start Xray"
}
}else {
document.getElementById('button').style = "color:red;"
}
})
const configTextarea = document.getElementById("config");
configTextarea.onchange = function() {
window.store.set('config', this.value);
console.log(window.store.get('config'));
console.log(this.value)
}
configTextarea.value = window.store.get('config')
const serverAddressText = document.getElementById("serverAddress");
serverAddressText.onchange = function() {
window.store.set('serverAddress', this.value);
console.log(window.store.get('serverAddress'));
console.log(this.value)
}
serverAddressText.value = window.store.get('serverAddress')
})