test databases notification
parent
528ab4b7c2
commit
74680522c9
|
|
@ -1,6 +1,7 @@
|
||||||
import { Router } from "express";
|
import { Router } from "express";
|
||||||
import * as configFunctions from "../helpers/functions.config.js";
|
import * as configFunctions from "../helpers/functions.config.js";
|
||||||
import * as authenticationFunctions from "../helpers/functions.authentication.js";
|
import * as authenticationFunctions from "../helpers/functions.authentication.js";
|
||||||
|
import { useTestDatabases } from "../data/databasePaths.js";
|
||||||
export const router = Router();
|
export const router = Router();
|
||||||
const getSafeRedirectURL = (possibleRedirectURL = "") => {
|
const getSafeRedirectURL = (possibleRedirectURL = "") => {
|
||||||
const urlPrefix = configFunctions.getProperty("reverseProxy.urlPrefix");
|
const urlPrefix = configFunctions.getProperty("reverseProxy.urlPrefix");
|
||||||
|
|
@ -31,7 +32,8 @@ router.route("/")
|
||||||
response.render("login", {
|
response.render("login", {
|
||||||
userName: "",
|
userName: "",
|
||||||
message: "",
|
message: "",
|
||||||
redirect: request.query.redirect
|
redirect: request.query.redirect,
|
||||||
|
useTestDatabases
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -76,7 +78,8 @@ router.route("/")
|
||||||
response.render("login", {
|
response.render("login", {
|
||||||
userName,
|
userName,
|
||||||
message: "Login Failed",
|
message: "Login Failed",
|
||||||
redirect: redirectURL
|
redirect: redirectURL,
|
||||||
|
useTestDatabases
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,11 @@ import * as configFunctions from "../helpers/functions.config.js";
|
||||||
|
|
||||||
import * as authenticationFunctions from "../helpers/functions.authentication.js";
|
import * as authenticationFunctions from "../helpers/functions.authentication.js";
|
||||||
|
|
||||||
|
import { useTestDatabases } from "../data/databasePaths.js";
|
||||||
|
|
||||||
import type * as recordTypes from "../types/recordTypes";
|
import type * as recordTypes from "../types/recordTypes";
|
||||||
|
|
||||||
|
|
||||||
export const router = Router();
|
export const router = Router();
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -53,7 +56,8 @@ router.route("/")
|
||||||
response.render("login", {
|
response.render("login", {
|
||||||
userName: "",
|
userName: "",
|
||||||
message: "",
|
message: "",
|
||||||
redirect: request.query.redirect
|
redirect: request.query.redirect,
|
||||||
|
useTestDatabases
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -113,7 +117,8 @@ router.route("/")
|
||||||
response.render("login", {
|
response.render("login", {
|
||||||
userName,
|
userName,
|
||||||
message: "Login Failed",
|
message: "Login Failed",
|
||||||
redirect: redirectURL
|
redirect: redirectURL,
|
||||||
|
useTestDatabases
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
108
views/login.ejs
108
views/login.ejs
|
|
@ -2,16 +2,16 @@
|
||||||
<html class="has-background-grey" id="is-login-page" lang="en" style="background-image:url('<%= urlPrefix + configFunctions.getProperty("application.backgroundURL") %>')">
|
<html class="has-background-grey" id="is-login-page" lang="en" style="background-image:url('<%= urlPrefix + configFunctions.getProperty("application.backgroundURL") %>')">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>
|
<title>
|
||||||
Login: <%= configFunctions.getProperty("application.applicationName") %>
|
Login: <%= configFunctions.getProperty("application.applicationName") %>
|
||||||
</title>
|
</title>
|
||||||
|
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
|
||||||
<link rel="icon" href="<%= urlPrefix %>/images/favicon.png" />
|
<link rel="icon" href="<%= urlPrefix %>/images/favicon.png" />
|
||||||
<link rel="stylesheet" href="<%= urlPrefix %>/stylesheets/style.css" />
|
<link rel="stylesheet" href="<%= urlPrefix %>/stylesheets/style.css" />
|
||||||
<link rel="stylesheet" href="<%= urlPrefix %>/lib/fa/css/all.min.css" />
|
<link rel="stylesheet" href="<%= urlPrefix %>/lib/fa/css/all.min.css" />
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
@ -27,51 +27,57 @@
|
||||||
<%= configFunctions.getProperty("application.applicationName") %>
|
<%= configFunctions.getProperty("application.applicationName") %>
|
||||||
</h1>
|
</h1>
|
||||||
<form id="form--login" method="post" action="<%= urlPrefix %>/login">
|
<form id="form--login" method="post" action="<%= urlPrefix %>/login">
|
||||||
<input name="_csrf" type="hidden" value="<%= csrfToken %>" />
|
<input name="_csrf" type="hidden" value="<%= csrfToken %>" />
|
||||||
<input name="redirect" type="hidden" value="<%= redirect %>" />
|
<input name="redirect" type="hidden" value="<%= redirect %>" />
|
||||||
|
|
||||||
<div class="field has-addons">
|
<div class="field has-addons">
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<span class="button is-static"><%= configFunctions.getProperty("application.userDomain") %>\</span>
|
<span class="button is-static"><%= configFunctions.getProperty("application.userDomain") %>\</span>
|
||||||
|
</div>
|
||||||
|
<div class="control is-expanded">
|
||||||
|
<input class="input" id="login--userName" name="userName" type="text" placeholder="User Name" value="<%= userName %>" aria-label="User Name" autofocus required />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control is-expanded">
|
<div class="field">
|
||||||
<input class="input" id="login--userName" name="userName" type="text" placeholder="User Name" value="<%= userName %>" aria-label="User Name" autofocus required />
|
<label class="sr-only" for="login--password">Password</label>
|
||||||
|
<div class="control has-icons-left has-tooltip-right" data-tooltip="Password" >
|
||||||
|
<input class="input" id="login--password" name="password" type="password" placeholder="Password" required />
|
||||||
|
<span class="icon is-small is-left">
|
||||||
|
<i class="fas fa-key" aria-hidden="true"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<% if (useTestDatabases) { %>
|
||||||
<div class="field">
|
<div class="message is-small is-warning">
|
||||||
<label class="sr-only" for="login--password">Password</label>
|
<p class="message-body has-text-centered">
|
||||||
<div class="control has-icons-left has-tooltip-right" data-tooltip="Password" >
|
Testing databases in use!
|
||||||
<input class="input" id="login--password" name="password" type="password" placeholder="Password" required />
|
</p>
|
||||||
<span class="icon is-small is-left">
|
</div>
|
||||||
<i class="fas fa-key" aria-hidden="true"></i>
|
<% } %>
|
||||||
</span>
|
<div class="level is-mobile">
|
||||||
|
<div class="level-left has-text-danger">
|
||||||
|
<% if (message !== "") { %>
|
||||||
|
<span class="icon">
|
||||||
|
<i class="fas fa-exclamation-triangle" aria-hidden="true"></i>
|
||||||
|
</span>
|
||||||
|
<span><%= message %></span>
|
||||||
|
<% } %>
|
||||||
|
</div>
|
||||||
|
<div class="level-right has-text-right">
|
||||||
|
<button class="button is-link" type="submit">
|
||||||
|
<span class="icon">
|
||||||
|
<i class="fas fa-sign-in-alt" aria-hidden="true"></i>
|
||||||
|
</span>
|
||||||
|
<span>Log In</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="level is-mobile">
|
|
||||||
<div class="level-left has-text-danger">
|
|
||||||
<% if (message !== "") { %>
|
|
||||||
<span class="icon">
|
|
||||||
<i class="fas fa-exclamation-triangle" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
<span><%= message %></span>
|
|
||||||
<% } %>
|
|
||||||
</div>
|
|
||||||
<div class="level-right has-text-right">
|
|
||||||
<button class="button is-link" type="submit">
|
|
||||||
<span class="icon">
|
|
||||||
<i class="fas fa-sign-in-alt" aria-hidden="true"></i>
|
|
||||||
</span>
|
|
||||||
<span>Log In</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
<hr />
|
<hr />
|
||||||
<div class="has-text-right has-text-grey is-size-7">
|
<div class="has-text-right has-text-grey is-size-7">
|
||||||
Build <%= buildNumber %><br />
|
Build <%= buildNumber %><br />
|
||||||
<a class="has-text-grey" href="https://cityssm.github.io/general-licence-manager/" target="_blank" rel="nofollow noreferrer">Help</a>
|
<a class="has-text-grey" href="https://cityssm.github.io/general-licence-manager/" target="_blank" rel="nofollow noreferrer">Help</a>
|
||||||
<a class="has-text-grey ml-4" href="https://github.com/cityssm/general-licence-manager" target="_blank" rel="noreferrer">GitHub</a>
|
<a class="has-text-grey ml-4" href="https://github.com/cityssm/general-licence-manager" target="_blank" rel="noreferrer">GitHub</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -79,11 +85,11 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
try {
|
try {
|
||||||
window.localStorage.clear();
|
window.localStorage.clear();
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue