-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainWindow.html
88 lines (76 loc) · 2.56 KB
/
mainWindow.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
84
85
86
87
88
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Absence CMS</title>
<link rel="stylesheet" href="css/materialize.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="section no-pad-bot" id="index-banner">
<div class="container">
<h2 class="header center orange-text">Solution Absence CMS</h2>
<div class="row center">
<h5 class="header col s12 light">Automation absence service to our cloud system</h5>
</div>
<div class="row center">
<a href="" id="connect" class="btn-large waves-effect waves-light red">Not Connected</a>
</div>
<br><br>
</div>
</div>
<div class="container" id="list" style="display: none">
<table class="striped">
<thead>
<tr>
<th>#</th>
<th>PIN</th>
<th>Name</th>
<th>Date Time</th>
<th>Verified</th>
<th>Status</th>
<th>Workcode</th>
</tr>
</thead>
<tbody class="body"></tbody>
</table>
<div id="test"></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;
let custom = electron.remote.getCurrentWindow().custom || {};
if(custom.hasOwnProperty("logs")) {
let items = custom.logs;
let users = custom.users;
if(custom.isConnected){
$("#connect").html("Connected");
$("#connect").removeClass("red");
$("#connect").addClass("green");
}
if(items.length > 0){
$("#list").show();
let html = '';
for(var i = 0; i < items.length;i++){
html += `<tr><td>${i+1}</td><td>${items[i].PIN}</td><td>${items[i].Name}</td><td>${items[i].DateTime}</td><td>${items[i].Verified}</td><td>${items[i].Status}</td><td>${items[i].WorkCode}</td></tr>`;
}
$(".body").html(html)
} else {
$("#notconnected").show();
}
}
function display_c(){
var refresh=1000; // Refresh rate in milli seconds
mytime=setTimeout('display_ct()',refresh)
}
function display_ct() {
var x = new Date()
document.getElementById('ct').innerHTML = x;
display_c();
}
</script>
</body>
</html>