Add one-time authentication code tool for Station client
This commit is contained in:
parent
dfa0998be8
commit
27ca27c5be
9
nbproject/mplheader.txt
Normal file
9
nbproject/mplheader.txt
Normal file
@ -0,0 +1,9 @@
|
||||
<#if licenseFirst??>
|
||||
${licenseFirst}
|
||||
</#if>
|
||||
${licensePrefix}This Source Code Form is subject to the terms of the Mozilla Public
|
||||
${licensePrefix}License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
${licensePrefix}file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
<#if licenseLast??>
|
||||
${licenseLast}
|
||||
</#if>
|
@ -3,5 +3,6 @@ auxiliary.org-netbeans-modules-cordova.phonegap=false
|
||||
file.reference.BusinessMobile-test=test
|
||||
file.reference.BusinessMobile-www=www
|
||||
files.encoding=UTF-8
|
||||
project.licensePath=./nbproject/mplheader.txt
|
||||
site.root.folder=${file.reference.BusinessMobile-www}
|
||||
test.folder=${file.reference.BusinessMobile-test}
|
||||
|
4
www/icons/ic_lock.svg
Normal file
4
www/icons/ic_lock.svg
Normal file
@ -0,0 +1,4 @@
|
||||
<svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 389 B |
@ -132,6 +132,9 @@ function setnavbar(type, title, returnscreen) {
|
||||
navbar.fadeOut(150, function () {
|
||||
switch (type) {
|
||||
case "home":
|
||||
navbar.html('<span class="navbar-brand" style="color: white;">Business</span><span class="navbar-brand pull-right"><span onclick="openscreen(\'mobilecode\', \'FADE\')"><img src="icons/ic_lock.svg" alt="" /></span> <span onclick="openscreen(\'otp\', \'FADE\')"><img src="icons/ic_vpn_key.svg" alt="" /></span> <span onclick="openscreen(\'settings\', \'FADE\')"><img src="icons/ic_settings.svg" alt="" /></span></span>');
|
||||
break;
|
||||
case "setup":
|
||||
navbar.html('<span class="navbar-brand" style="color: white;">Business</span><span class="navbar-brand pull-right"><span onclick="openscreen(\'otp\', \'FADE\')"><img src="icons/ic_vpn_key.svg" alt="" /></span> <span onclick="openscreen(\'settings\', \'FADE\')"><img src="icons/ic_settings.svg" alt="" /></span></span>');
|
||||
break;
|
||||
case "settings":
|
||||
|
37
www/views/mobilecode.html
Normal file
37
www/views/mobilecode.html
Normal file
@ -0,0 +1,37 @@
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<h3 id="code" style="text-align: center;"></h3>
|
||||
<div class="pull-right">
|
||||
<button class="btn btn-primary" onclick="gencode()"><i class="fa fa-refresh"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
setnavbar("app", "Login Code", "home");
|
||||
|
||||
function gencode() {
|
||||
$.post(localStorage.getItem("syncurl"), {
|
||||
username: localStorage.getItem("username"),
|
||||
key: localStorage.getItem("key"),
|
||||
action: "gencode"
|
||||
}, function (data) {
|
||||
if (data.status === 'OK') {
|
||||
$("#code").text("B-" + data.code);
|
||||
} else {
|
||||
navigator.notification.alert(data.msg, null, "Error", 'Dismiss');
|
||||
}
|
||||
}, "json").fail(function () {
|
||||
navigator.notification.alert("Could not connect to the server. Try again later.", null, "Error", 'Dismiss');
|
||||
openscreen("homeloaderror");
|
||||
});
|
||||
}
|
||||
|
||||
gencode();
|
||||
</script>
|
@ -146,5 +146,5 @@
|
||||
}
|
||||
}
|
||||
|
||||
setnavbar("home");
|
||||
setnavbar("setup");
|
||||
</script>
|
@ -38,5 +38,5 @@
|
||||
});
|
||||
}
|
||||
|
||||
setnavbar("home");
|
||||
setnavbar("setup");
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user