Last active
April 17, 2024 19:26
-
-
Save m0veax/b0f79cf64540b85c80e0e9dec26925de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta charset="UTF-8"> | |
<title></title> | |
<script> | |
if (navigator.appName === 'Microsoft Internet Explorer') { | |
var bVersion = ((navigator.appVersion).split(";"))[1]; | |
var bNum = Number((bVersion.split("MSIE"))[1]); | |
if (bNum && bNum <= 7) { | |
window.location.href = 'browserWarning.html'; | |
} | |
} | |
</script> | |
<link rel="stylesheet" href="tpweb.css"> | |
<link rel="stylesheet" href="login.css"> | |
</head> | |
<body> | |
<div id="loginPage" class="hide"> | |
<!--header | |
=============================================--> | |
<div id="header"> | |
<span id="headerLeft" class="pull-left"> | |
<a href = "http://www.tp-link.com" target = "_blank"><i class="icon-logo"></i></a> | |
<span id="deviceName" ></span> | |
</span> | |
<div class="dropdown language pull-right hide"> | |
<select id="langSel" class="language pull-right" style="display: none;"> | |
<option id="english" value="en"></option> | |
<option id="chinese" value="cn"></option> | |
</select> | |
<span class="dropdown-toggle"></span> | |
<span class="arrow bottom"></span> | |
<ul class="dropdown-menu hide"> | |
<li></li> | |
<li></li> | |
</ul> | |
</div> | |
<div class="clearfix"></div> | |
</div><!--/Header--> | |
<div id="content"> | |
<!--status--> | |
<div id="loginStatus" class="section-status"> | |
<span id="statusLbl"></span> | |
<div class="content-group"> | |
<label id="connectionStatusLbl" class="content-label"></label> | |
<label id="connection"></label> | |
<img id="linkingImg" src="images/link.gif"/> | |
</div> | |
<div id="netTypeDiv" class="content-group"> | |
<label id="networkTypeLbl" class="content-label"></label> | |
<label id="networkType"></label> | |
</div> | |
<div id="simStatDiv" class="content-group hide"> | |
<label id="simStatusLbl" class="content-label"></label> | |
<label id="simStatus"></label> | |
</div> | |
<div class="content-group"> | |
<label id="ssidStatusLbl" class="content-label"></label> | |
<label id="ssid"></label> | |
</div> | |
<div class="content-group"> | |
<label id="wirelessBandLbl" class="content-label"></label> | |
<label id="wirelessBand"></label> | |
</div> | |
<div class="content-group"> | |
<label id="currentClientsLbl" class="content-label"></label> | |
<label id="curClients"></label> | |
</div><div class="content-group"> | |
<label id="totalDataLbl" class="content-label"></label> | |
<label id="totalData"></label> | |
<label id="totalDataUnit"></label> | |
</div> | |
</div> | |
<!--status--> | |
<!--login--> | |
<div id="loginContainer"> | |
<div id="login"> | |
<div class="login-group"> | |
<div class="loginIcon"> | |
<i class="icon-username"></i> | |
</div> | |
<input id="username" type="text" maxlength="15" class="loginInput"/> | |
</div> | |
<div class="login-group"> | |
<div class="loginIcon"> | |
<i class="icon-password"></i> | |
</div> | |
<input id="password" type="password" maxlength="15" class="loginInput"/> | |
</div> | |
</div> | |
<button id="loginBtn" class="btn btn-success"></button> | |
<div id="noteDiv"> | |
</div> | |
</div><!--login--> | |
</div><!--Content--> | |
<script src="libs.min.js"></script> | |
<script src="tpweb.min.js"></script> | |
<script src="login.min.js"></script> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ============================================================= | |
* Copyright (c) 2014 TP-LINK Technologies Co., Ltd. | |
* | |
* @version: 0.0.1 | |
* @author: TP-Mobile Web Team | |
* =============================================================*/ | |
function langSwitch() { | |
callJSON( | |
WEB_MODULE, | |
ACTION.SET_LANGUAGE, | |
{ | |
language: $('#langSel').val() | |
}, | |
function (a) { | |
0 === a.result && | |
window.location.reload() | |
} | |
) | |
} | |
function initLanguage() { | |
callJSON( | |
WEB_MODULE, | |
ACTION.GET_LANGUAGE, | |
null, | |
function (a) { | |
$('#langSel').val(a.language), | |
$.i18n.setLocale(a.language) | |
}, | |
null, | |
null, | |
!1 | |
), | |
$.i18n.elementLocalization('body', [ | |
'label', | |
'span', | |
'button', | |
'option' | |
]), | |
$.i18n.switchFont() | |
} | |
function checkParams() { | |
- 1 !== location.search.indexOf('timeout') ? $('#noteDiv').text($.i18n.prop('sessionTimeout')).show() : - 1 !== location.search.indexOf('kickedOut') && | |
$('#noteDiv').text($.i18n.prop('kickedOut')).show() | |
} | |
var WEB_MODULE = 'webServer', | |
ACTION = { | |
GET_LANGUAGE: 0, | |
SET_LANGUAGE: 1 | |
}, | |
firstLoad = !0, | |
simpleStatus = { | |
moduleName: 'status', | |
connStatus: { | |
disable: 0, | |
disconnected: 1, | |
connecting: 2, | |
disconnecting: 3, | |
connected: 4 | |
}, | |
networkType: { | |
noSevrice: 0, | |
gsm: 1, | |
wcdma: 2, | |
lte: 3, | |
tdscdma: 4, | |
cdma1x: 5, | |
cdmaevdo: 6 | |
}, | |
simStatus: { | |
invalid: 0, | |
noSim: 1, | |
error: 2, | |
ready: 3, | |
pinReq: 4, | |
pinVerified: 5, | |
pukReq: 6, | |
permanentLock: 7 | |
}, | |
loadData: function (a) { | |
switch ( | |
$('#deviceName').text(a.deviceInfo.model), | |
a.wan.connectStatus | |
) { | |
case simpleStatus.connStatus.connected: | |
$('#connection').text($.i18n.prop('connectedStatus')).removeClass('warnLabel').addClass('okLabel'), | |
$('#linkingImg').hide(); | |
break; | |
case simpleStatus.connStatus.disconnected: | |
$('#connection').text($.i18n.prop('disconnectedStatus')).addClass('warnLabel').removeClass('okLabel'), | |
$('#linkingImg').hide(); | |
break; | |
case simpleStatus.connStatus.connecting: | |
$('#connection').text($.i18n.prop('connectingStatus')).removeClass('warnLabel okLabel'), | |
$('#linkingImg').show(); | |
break; | |
case simpleStatus.connStatus.disconnecting: | |
$('#connection').text($.i18n.prop('disconnectingStatus')).removeClass('warnLabel okLabel'), | |
$('#linkingImg').show(); | |
break; | |
default: | |
$('#connection').text($.i18n.prop('connectedStatus')).removeClass('warnLabel').addClass('okLabel'), | |
$('#linkingImg').hide() | |
} | |
if ( | |
simpleStatus.connStatus.disconnected === a.wan.connectStatus || | |
simpleStatus.connStatus.connecting === a.wan.connectStatus | |
) { | |
switch (a.wan.simStatus) { | |
case simpleStatus.simStatus.invalid: | |
$('#simStatus').text($.i18n.prop('simInvalid')).addClass('warnLabel'); | |
break; | |
case simpleStatus.simStatus.noSim: | |
$('#simStatus').text($.i18n.prop('noSim')).addClass('warnLabel'); | |
break; | |
case simpleStatus.simStatus.error: | |
$('#simStatus').text($.i18n.prop('simErr')).addClass('warnLabel'); | |
break; | |
case simpleStatus.simStatus.ready: | |
$('#simStatus').text($.i18n.prop('simReady')).removeClass('warnLabel'); | |
break; | |
case simpleStatus.simStatus.pinReq: | |
$('#simStatus').text($.i18n.prop('pinReq')).removeClass('warnLabel'); | |
break; | |
case simpleStatus.simStatus.pinVerified: | |
$('#simStatus').text($.i18n.prop('pinVerified')).removeClass('warnLabel'); | |
break; | |
case simpleStatus.simStatus.pukReq: | |
$('#simStatus').text($.i18n.prop('pukReq')).removeClass('warnLabel'); | |
break; | |
case simpleStatus.simStatus.permanentLock: | |
$('#simStatus').text($.i18n.prop('permanentLock')).addClass('warnLabel'); | |
break; | |
default: | |
$('#simStatus').text($.i18n.prop('simInvalid')).addClass('warnLabel') | |
} | |
$('#networkType').parent().hide(), | |
$('#simStatus').parent().show() | |
} else { | |
switch (a.wan.networkType) { | |
case simpleStatus.networkType.noService: | |
$('#networkType').text($.i18n.prop('noService')); | |
break; | |
case simpleStatus.networkType.lte: | |
$('#networkType').text($.i18n.prop('lteType')); | |
break; | |
case simpleStatus.networkType.wcdma: | |
$('#networkType').text($.i18n.prop('wcdmaType')); | |
break; | |
case simpleStatus.cdma1x: | |
$('#networkType').text($.i18n.prop('cdma1xType')); | |
break; | |
case simpleStatus.cdmaevdo: | |
$('#networkType').text($.i18n.prop('cdmaevdoType')); | |
break; | |
case simpleStatus.networkType.tdscdma: | |
$('#networkType').text($.i18n.prop('tdscdmaType')); | |
break; | |
case simpleStatus.networkType.gsm: | |
$('#networkType').text($.i18n.prop('gsmType')); | |
break; | |
default: | |
$('#networkType').text($.i18n.prop('noService')) | |
} | |
$('#simStatus').parent().hide(), | |
$('#networkType').parent().show() | |
} | |
a.wlan.bandType ? $('#wirelessBand').text('5GHz') : $('#wirelessBand').text('2.4GHz'), | |
$('#ssid').text(a.wlan.ssid), | |
$('#curClients').text('' + a.connectedDevices.number), | |
a.wan.enablePaymentDay && | |
$('#totalDataLbl').text($.i18n.prop('monthDataLbl')); | |
var b = byteAdapt(a.wan.totalStatistics); | |
$('#totalData').text('' + b[0]), | |
$('#totalDataUnit').text('' + b[1]), | |
firstLoad && | |
($('#loginPage').show(), $('#username').focus(), firstLoad = !1) | |
}, | |
setContent: function () { | |
getConfigJSON(simpleStatus.moduleName, simpleStatus.loadData) | |
}, | |
main: function () { | |
this.setContent(), | |
setInterval(simpleStatus.setContent, 10000) | |
} | |
}, | |
login = { | |
moduleName: 'authenticator', | |
loadData: function (a) { | |
1 === a.result && | |
'0.0.0.0' !== a.authedIP && | |
$('#noteDiv').text($.i18n.prop('onlyOne')).show(), | |
checkParams(), | |
$('#username').focus() | |
}, | |
listener: function (a) { | |
a && | |
a() | |
}, | |
setAdminContent: function () { | |
getConfigJSON(this.moduleName, this.loadData), | |
callJSON(login.moduleName, 2, null, login.onCheckLocked) | |
}, | |
loginCallback: function (a) { | |
switch (a) { | |
case AUTH_RES.success: | |
window.location.href = 'settings.html'; | |
break; | |
case AUTH_RES.pwdWrong: | |
$('#noteDiv').text($.i18n.prop('pswWrong')).show(), | |
callJSON(login.moduleName, 2, null, login.onCheckLocked); | |
break; | |
default: | |
$('#noteDiv').text($.i18n.prop('unknownResult')).show() | |
} | |
}, | |
onCheckLocked: function (a) { | |
0 === a.result && | |
0 === a.remainAttempts && | |
( | |
$('#username').prop('disabled', !0), | |
$('#password').prop('disabled', !0), | |
$('#noteDiv').text($.i18n.prop('loginLocked')).show() | |
) | |
}, | |
doLogin: function () { | |
var a = $('#username').val(), | |
b = $('#password').val(); | |
return a && | |
b ? ( | |
$('#noteDiv').hide(), | |
AuthModel.login(a, b, login.loginCallback), | |
void 0 | |
) : ( | |
$('#noteDiv').text($.i18n.prop('emptyInputErr')).show(), | |
void 0 | |
) | |
}, | |
setupListeners: function () { | |
$('#loginBtn').on('click', login.doLogin), | |
$('#password').bind( | |
'keyup', | |
function () { | |
var a = window.event || | |
arguments[0]; | |
a.returnValue = !1; | |
var b = a.keyCode || | |
a.which; | |
13 === b && | |
$('#loginBtn').click() | |
} | |
) | |
}, | |
main: function () { | |
this.listener(login.setupListeners), | |
this.setAdminContent() | |
} | |
}; | |
$( | |
function () { | |
initLanguage(), | |
$('#langSel').dropdown({ | |
onChanged: langSwitch | |
}).dropdown('refreshText'), | |
$('#username').val(''), | |
$('#username').prop('disabled', !1), | |
$('#password').val(''), | |
$('#password').prop('disabled', !1), | |
simpleStatus.main(), | |
setDocInfo(), | |
login.main() | |
} | |
); | |
var g_curPageID = 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment