-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocsRetrievalErrorManual.html
105 lines (99 loc) · 2.85 KB
/
docsRetrievalErrorManual.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Alma Print Daemon 2.2.0</title>
</head>
<style>
#notification {
position: fixed;
bottom: 20px;
left: 20px;
width: 200px;
padding: 20px;
border-radius: 5px;
background-color: white;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}
.hidden {
display: none;
}
#updateCheck {
position: fixed;
bottom: 20px;
left: 20px;
width: 200px;
padding: 20px;
border-radius: 5px;
background-color: white;
}
.hidden {
display: none;
}
</style>
<body>
<form>
<h4>
Error retrieving Alma documents to print. Check the log for details.<br>
Click <button type=submit>Print now</button> to try again.
<br>
<br>
<button type="button" id="displayConfig" onclick="javascript:displayConfigPage()"> Update Configuration</button>
</h4>
<div id="updateCheck">
<button type="button" id="checkForUpdate" onclick="javascript:checkForSoftwareUpdate()"> Check for Update</button>
</div>
<div id="notification" class="hidden">
<p id="message"></p>
<button id="close-button" onClick="closeNotification()" class="hidden">
Close
</button>
<button id="restart-button" onClick="restartApp()" class="hidden">
Restart
</button>
</div>
<script>
const electron = require('electron');
const {ipcRenderer} = electron;
const form = document.querySelector('form');
form.addEventListener('submit', submitForm);
function submitForm(e){
e.preventDefault();
ipcRenderer.send('print-now');
}
function displayConfigPage() {
ipcRenderer.send('display-config');
}
function checkForSoftwareUpdate() {
ipcRenderer.send('check-for-update');
}
const notification = document.getElementById('notification');
const message = document.getElementById('message');
const restartButton = document.getElementById('restart-button');
ipcRenderer.on('update_available', () => {
ipcRenderer.removeAllListeners('update_available');
message.innerText = 'A new update is available. Downloading now...';
notification.classList.remove('hidden');
});
ipcRenderer.on('update_not_available', () => {
ipcRenderer.removeAllListeners('update_not_available');
console.log ('Sofware is up-to-date');
message.innerText = 'Your software is up to date.';
notification.classList.remove('hidden');
});
ipcRenderer.on('update_downloaded', () => {
ipcRenderer.removeAllListeners('update_downloaded');
message.innerText = 'Update Downloaded. It will be installed on restart. Restart now?';
restartButton.classList.remove('hidden');
notification.classList.remove('hidden');
});
function closeNotification() {
notification.classList.add('hidden');
}
function restartApp() {
ipcRenderer.send('restart_app');
}
</script>
</form>
</body>
</html>