-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
111 lines (104 loc) · 3.09 KB
/
index.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
106
107
108
109
110
111
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Fixinator</title>
<meta http-equiv="Content-Security-Policy" content="default-src 'none';script-src 'sha256-aczgh8GVXIDjB6B1do7F8hj75X0JSgVvkRd1p/pyAnM=';img-src 'self';connect-src http://127.0.0.1:8584; style-src 'sha256-kTHfUlJxUem3XDbILyjo4YyEZulVUuPMuxljR5Ur3+U='">
<style>
body {
background-color: #212529;
color: white;
font-family: "SF Pro", "Helvetica Neue",Roboto,Helvetica,Arial,sans-serif;;
}
#status { font-size: 8px; color:#212529; }
#main {
max-width: 500px;
margin: auto;
text-align: center;
}
@keyframes pulse_animation {
0% { transform: scale(1); }
30% { transform: scale(1); }
40% { transform: scale(1.08); }
50% { transform: scale(1); }
60% { transform: scale(1); }
70% { transform: scale(1.05); }
80% { transform: scale(1); }
100% { transform: scale(1); }
}
#icon {
max-width: 80%;
animation-name: pulse_animation;
animation-duration: 5000ms;
transform-origin:70% 70%;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
/* https://github.com/tobiasahlin/SpinKit */
.spinner {
width: 40px;
height: 40px;
margin: 50px auto;
background-color: #fbeeca;
border-radius: 100%;
-webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
animation: sk-scaleout 1.0s infinite ease-in-out;
}
@-webkit-keyframes sk-scaleout {
0% { -webkit-transform: scale(0) }
100% {
-webkit-transform: scale(1.0);
opacity: 0;
}
}
@keyframes sk-scaleout {
0% {
-webkit-transform: scale(0);
transform: scale(0);
} 100% {
-webkit-transform: scale(1.0);
transform: scale(1.0);
opacity: 0;
}
}
</style>
</head>
<body>
<div id="main">
<img src="boot/icon.png" id="icon">
<p id="message">Fixinator is Starting Up...</p>
<div class="spinner"></div>
<div id="status"></div>
</div>
</body>
<script>
// Ping the server until it starts, once it does, open it
var commandbox_port = window.location.search;
commandbox_port = commandbox_port.replace("?port=", "");
var pingUrl = `http://127.0.0.1:${commandbox_port}`;
var errorCount = 0;
setInterval(ping, 1000);
function ping() {
if (errorCount > 600) {
//shouldnt take longer than 10min, something wrong
document.body.innerText="Unable to start commandbox";
return;
}
fetch(pingUrl).then(function(response) {
if (response.status == 200) {
window.location.href = pingUrl;
} else {
errorCount++;
setStatusMessage(errorCount + " response status " + response.status);
}
}).catch(function(err) {
errorCount++;
setStatusMessage(errorCount + "");
//console.log(err);
});
}
function setStatusMessage(msg) {
document.getElementById("status").innerText = msg;
}
</script>
</html>