-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathtimeout.htm
More file actions
274 lines (259 loc) · 7.25 KB
/
timeout.htm
File metadata and controls
274 lines (259 loc) · 7.25 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="shortcut icon" href="applet/logos/launcher-icon48.png" type="image/png">
<link rel="apple-touch-icon" href="applet/logos/launcher-icon256_ios.webp" type="image/png">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Timeout - %%SYSNAME%% UI3</title>
<style type="text/css">
html, body
{
margin: 0;
padding: 0;
height: 100%;
}
body
{
background-color: #000000;
color: #999999;
font-family: Arial, sans-serif;
min-height: 100vh;
min-height: 100dvh;
max-height: 100vh;
max-height: 100dvh;
overflow: hidden;
display: flex;
flex-direction: column;
box-sizing: border-box;
padding: clamp(8px, 2.5vmin, 20px);
gap: clamp(8px, 2vmin, 18px);
}
.header
{
display: flex;
align-items: flex-start;
gap: clamp(8px, 2vmin, 15px);
flex-shrink: 1;
min-height: 0;
text-overflow: ellipsis;
}
#blueIrisIcon
{
width: clamp(40px, 11vmin, 72px);
height: clamp(40px, 11vmin, 72px);
flex-shrink: 0;
}
.header-text
{
flex: 1;
min-width: 0;
overflow-y: auto;
height: 100%;
}
h2
{
font-size: clamp(0.95em, 3.2vmin, 1.5em);
margin: 0 0 0.35em 0;
line-height: 1.2;
}
p
{
font-size: clamp(0.8em, 2.4vmin, 1em);
margin: 0.35em 0;
line-height: 1.3;
}
.reconnect-container
{
flex: 1 1 0;
display: flex;
min-height: clamp(80px, 25vmin, 160px);
}
#reconnect
{
flex: 1;
color: #9999ff;
border: 1px solid #9999ff;
border-radius: 8px;
background-color: rgba(255,255,255,0.0);
text-decoration: none;
display: flex;
align-items: center;
justify-content: center;
font-size: clamp(1em, 4.5vmin, 1.75em);
font-weight: bold;
padding: clamp(10px, 2vmin, 20px);
text-align: center;
-webkit-tap-highlight-color: rgba(255,255,255,0.2);
transition: background-color 0.15s, color 0.15s;
}
#reconnect:visited
{
color: #9999ff;
}
#reconnect:hover
{
color: #bbbbff;
background-color: rgba(255,255,255,0.1);
}
#reconnect:active
{
color: #ddddff;
background-color: rgba(255,255,255,0.2);
}
#reconnect svg
{
fill: currentColor;
width: clamp(22px, 6vmin, 44px);
height: clamp(22px, 6vmin, 44px);
margin-right: clamp(8px, 1.5vmin, 14px);
flex-shrink: 0;
}
</style>
</head>
<body>
<div class="header">
<img id="blueIrisIcon" src="applet/logos/launcher-icon256_ios.webp" alt="Blue Iris" />
<div class="header-text">
<div id="idleTimeout">
<h2>%%SYSNAME%% - Web Interface Timeout</h2>
<p>You have been idle too long, and were redirected here to save resources.</p>
<p>The idle timeout can be adjusted in "UI Settings" under UI3's Main Menu.</p>
</div>
<div id="serverSessionLimit" style="display: none;">
<h2>%%SYSNAME%% - Session Limit Reached</h2>
<p>Your session has reached the time limit configured for your user account in Blue Iris Settings > Users.</p>
</div>
<div id="serverDailyLimit" style="display: none;">
<h2>%%SYSNAME%% - Daily Limit Reached</h2>
<p>Your user account has reached the daily time limit configured in Blue Iris Settings > Users.</p>
</div>
</div>
</div>
<div class="reconnect-container">
<a id="reconnect" href="/">
<svg id="svg_mio_Refresh" viewBox="4 4 16 16">
<path d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z" />
</svg>Click here to reconnect
</a>
</div>
<script type="text/javascript">
var local_bi_session = "%%SESSION%%";
if (!local_bi_session || (local_bi_session.length === 11 && local_bi_session.startsWith("%") && local_bi_session.endsWith("%") && local_bi_session.indexOf("SESSION") === 2))
local_bi_session = "";
if (navigator.cookieEnabled)
NavRemoveUrlParams("session");
var UrlParameters =
{
loaded: false,
parsed_url_params: {},
Get: function (key)
{
if (!this.loaded)
{
var params = this.parsed_url_params;
window.location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (str, key, value) { params[key.toLowerCase()] = decodeURIComponent(value); })
this.loaded = true;
}
if (typeof this.parsed_url_params[key.toLowerCase()] !== 'undefined')
return this.parsed_url_params[key.toLowerCase()];
return "";
}
};
function Initialize()
{
var serverSessionLimit = UrlParameters.Get("serverSessionLimit");
if (serverSessionLimit === "1")
{
var ele_idleTimeout = document.getElementById("idleTimeout");
ele_idleTimeout.parentNode.removeChild(ele_idleTimeout);
var ele_sessionLimit = document.getElementById("serverSessionLimit");
ele_sessionLimit.style.display = "block";
}
else
{
var serverDailyLimit = UrlParameters.Get("serverDailyLimit");
if (serverDailyLimit === "1")
{
var ele_idleTimeout = document.getElementById("idleTimeout");
ele_idleTimeout.parentNode.removeChild(ele_idleTimeout);
var ele_dailyLimit = document.getElementById("serverDailyLimit");
ele_dailyLimit.style.display = "block";
}
}
var path = UrlParameters.Get("path");
if (path === "")
path = "/";
// Remove any existing sessions from the path
path = path.replace(/&session=[^&?#%]+/gi, '');
path = path.replace(/\?session=[^&?#%]+/gi, '?');
// Add the current session to the path if necessary
if (local_bi_session && !navigator.cookieEnabled)
path += (path.indexOf("?") < 0 ? "?" : "&") + "session=" + local_bi_session;
document.getElementById("reconnect").setAttribute("href", path);
// Attempt to use history navigation instead of
document.getElementById("reconnect").addEventListener("click", function (event)
{
if (linkClicked)
{
event.preventDefault();
return false;
}
linkClicked = true;
var navTimeout = setTimeout(function ()
{
if (!isUnloading)
location.href = path;
}, 200);
try
{
if (history.length > 1)
{
history.back();
event.preventDefault();
return false;
}
}
catch (ex) { }
//clearTimeout(navTimeout);
});
};
var linkClicked = false;
var isUnloading = false;
window.addEventListener('beforeunload', function ()
{
isUnloading = true;
});
/**
* Changes the current URL by removing the specified query string parameter(s) from it.
* @returns {String} Returns null if successful, otherwise returns the new URL if changing the history state failed.
*/
function NavRemoveUrlParams()
{
var url = RemoveUrlParams.apply(this, arguments);
try { history.replaceState(history.state, "", url); return null; } catch (ex) { return url; }
}
function RemoveUrlParams()
{
var s = location.search;
for (var i = 0; i < arguments.length; i++)
{
var param = arguments[i];
var rx = new RegExp('(&|\\?)' + param + '=[^&?#%]+', 'gi');
s = s.replace(rx, "");
while (s.indexOf("&") === 0)
{
if (s.length > 1)
s = s.substr(1);
else
s = "";
}
if (s.length > 0 && s.indexOf("?") === -1)
s = "?" + s;
}
return location.origin + location.pathname + s + location.hash;
}
Initialize();
</script>
</body>
</html>