Merge branch 'IoTS-1.0.0-M1' of https://github.com/wso2/carbon-device-mgt-plugins into IoTS-1.0.0-M1

charithag 9 years ago
commit 8a89411fd2

@ -0,0 +1,32 @@
{
"appName": "IoT Server",
"cachingEnabled": true,
"debuggingEnabled": false,
"permissionRoot": "/",
"loginUri": "${app.context}/login",
"adminServicesUrl": "https://${server.ip}:${server.https_port}/admin/services/",
"authModule": {
"enabled": true,
"login": {
"onSuccess": {
"script": "/app/modules/login.js",
"page": "cdmf.page.dashboard"
},
"onFail": {
"script": "/app/modules/login.js",
"page": "cdmf.page.sign-in"
}
},
"logout": {
"onSuccess": {
"page": "cdmf.page.sign-in"
},
"onFail": {
"page": "cdmf.page.dashboard"
}
},
"sso": {
"enabled": false
}
}
}

@ -1,5 +1,6 @@
{ {
"version": "1.0.0", "version": "1.0.0",
"uri": "/register", "uri": "/register",
"isAnonymous": true,
"layout": "uuf.layout.sign-in" "layout": "uuf.layout.sign-in"
} }

@ -1,50 +0,0 @@
function post(path, method) {
method = method || "post"; // Set method to post by default if not specified.
form.submit();
}
$( document ).ready(function() {
var currentHash = window.location.hash,
submitPath = $("#signInForm").attr("action");
if(currentHash=="#auth-failed") {
$('.wr-validation-summary p').text("Sorry!, Please make sure to enter correct username and password");
$('.wr-validation-summary').removeClass("hidden");
}else if(currentHash=="#error"){
$('.wr-validation-summary p').text("Sorry!, Error occured");
$('.wr-validation-summary').removeClass("hidden");
}
$('#signIn').click(function(){
var username = $("input#username").val(),
password = $("input#password").val();
if (!username) {
$('.wr-validation-summary p').text("Sorry!, Username cannot be empty.");
$('.wr-validation-summary').removeClass("hidden");
} else if (!password){
$('.wr-validation-summary p').text("Sorry!, Password cannot be empty.");
$('.wr-validation-summary').removeClass("hidden");
} else {
post(submitPath,"POST");
}
});
});
function submitLoginForm() {
var submitPath = $("#signInForm").attr("action");
$('form input').keypress(function() {
if(e.which == 10 || e.which == 13) {
if (!username) {
alert()
$('.wr-validation-summary p').text("Sorry!, Username cannot be empty.");
$('.wr-validation-summary').removeClass("hidden");
} else if (!password){
$('.wr-validation-summary p').text("Sorry!, Password cannot be empty.");
$('.wr-validation-summary').removeClass("hidden");
} else {
post(submitPath,"POST");
}
}
});
}

@ -1,44 +1,5 @@
<div class="container col-md-12 col-lg-3 col-centered wr-content wr-login col-centered"> {{#zone "signInForm-below"}}
<div id="register-link-wrapper" style="float: right; padding-top: 10px;">
<p class="page-sub-title">Login</p> <a href="{{@app.context}}/register" class="pull-right create-account">Create an account</a>
<hr/>
<!-- validation -->
<span class="wr-validation-summary hidden">
<p>Login failed. Check your credentials and try again.</p>
</span>
<div class="panel-body">
<form id="signInForm" method="POST"
class="{{defineZone "signInForm-class" scope="protected"}}"
action="{{@app.context}}/api/user/login">
<div class="wr-input-control">
<label class="wr-input-label">Username *</label>
<input type="text" name="username" class="form-control" placeholder="User Name"
id="username" autofocus="autofocus" />
</div>
<div class="wr-input-control">
<label class="wr-input-label">Password *</label>
<input type="password" name="password" class="form-control"
id="password" placeholder="Password" />
</div>
<div class="wr-input-control wr-btn-grp">
<button class="wr-btn btn-download-agent" id="signIn">&nbsp;&nbsp;&nbsp;&nbsp;Login&nbsp;&nbsp;&nbsp;&nbsp;</button>
</div>
<div class="form-group">
{{#if showRememberMe}}
<span class="pull-left">
<input type="checkbox" name="rememberMe" value="remember"> Remember me
</span>
{{/if}}
{{#if showCreateAccount}}
<a id="createAccount"
href="{{@app.context}}/register"
class="pull-right create-account">Create an account</a>
{{/if}}
</div>
</form>
</div> </div>
</div>
</div>
{{#zone "bottomLoginJs"}}
{{js "js/login.js" }}
{{/zone}} {{/zone}}

Loading…
Cancel
Save