Skip to content

Commit

Permalink
Merge branch 'release' into 'master'
Browse files Browse the repository at this point in the history
Release

See merge request !1
  • Loading branch information
Ramesh committed Feb 9, 2018
2 parents 8c4cbde + 8ff596c commit 8ec45f7
Show file tree
Hide file tree
Showing 6 changed files with 1,547 additions and 3 deletions.
8 changes: 8 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ module.exports = class extends Generator {
initializing() {
var done = this.async();
fullname().then(name => {
// Checking name should contain some value, not undefined or null
name = (name ? name : '');
// Checking whether there are any newlines/line breaks
let match = /\r|\n/.exec(name);
if (match) {
// Replacing with empty value for all newlines/line breaks
name = name.replace(/[\r\n]+/g, '');
}
this.options.author = name;
done();
});
Expand Down
58 changes: 58 additions & 0 deletions app/templates/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,30 @@
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>oeCloud app</title>
<script>
function loginAndBrowse() {
var loginFailedDivId = document.getElementById('login-failed-div');
loginFailedDivId.style.display = "none";
var oReq = new XMLHttpRequest();
oReq.addEventListener("load", function (event) {
var response = (event.target.response);
response = JSON.parse(response);
if (response && response.access_token) {
localStorage.swagger_accessToken = response.access_token;
window.location.href = "/explorer";
} else {
loginFailedDivId.style.display = "block";
}
});
oReq.open("POST", "/auth/local");
oReq.setRequestHeader("Content-type", "application/json");
var payload = {
"username": "admin",
"password": "admin"
};
oReq.send(JSON.stringify(payload));
}
</script>
<link rel="icon" href="favicon.ico">
<style>
@font-face {
Expand Down Expand Up @@ -134,6 +158,10 @@
color: #666;
font-family: Rubik-Light
}

.code-style {
background-color: #eff0f1
}
</style>
</head>

Expand All @@ -149,6 +177,36 @@
</div>
</div>

</section>
<section class="small">
<div class="main-text">
<div>Login as admin and continue to oecloud.io API Explorer</div>
<div class="sub-text">
<br>
<button onclick="loginAndBrowse()">Browse APIs as Admin</button>
</div>
<div id="login-failed-div" class="sub-text" style="display: none">
<p>Seems default admin user is not created, Follow below Steps
<ul>
<li>Stop Server</li>
<li>set CREATE_ADMIN environment variable to true
<br>
<code class="code-style">
$ export CREATE_ADMIN=true
</code>
</li>
<li>Start Server
<br>
<code class="code-style">
$ node .
</code>
</li>
</ul>
</p>

</div>
</div>

</section>
<section class="small">
<div class="container">
Expand Down
2 changes: 1 addition & 1 deletion app/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"main": "server/server.js",
"dependencies": {
"loopback-component-storage-mongo": "git+https://github.com/raghav135/loopback-component-storage-mongo.git#master",
"oe-cloud": "^1.1.0",
"oe-cloud": "^1.2.0",
"passport": "0.2.2",
"passport-facebook": "1.0.3",
"passport-google-oauth": "0.1.5",
Expand Down
Loading

0 comments on commit 8ec45f7

Please sign in to comment.