-
Notifications
You must be signed in to change notification settings - Fork 18
/
timeout.htm
201 lines (193 loc) · 5.81 KB
/
timeout.htm
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
<!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">
body
{
background-color: #000000;
color: #999999;
font-family: Arial, sans-serif;
}
#blueIrisIcon
{
float: left;
margin: 0px 15px 10px 0px;
width: 64px;
height: 64px;
}
a
{
color: #9999ff;
border: 1px solid #9999ff;
border-radius: 3px;
padding: 10px;
background-color: rgba(255,255,255,0.0);
}
a:visited
{
color: #9999ff;
}
a:hover
{
color: #bbbbff;
background-color: rgba(255,255,255,0.1);
}
svg
{
fill: currentColor;
width: 24px;
height: 24px;
vertical-align: middle;
margin-right: 10px;
}
</style>
</head>
<body>
<div>
<p><img id="blueIrisIcon" src="applet/logos/launcher-icon256_ios.webp" alt="Blue Iris" /></p>
<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>
<p style="margin-top: 24px;">
<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>
</p>
</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>