44 lines
1.7 KiB
HTML
44 lines
1.7 KiB
HTML
<!DOCTYPE html>
|
|
<html style="width: 100%; height: 100%;">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Login</title>
|
|
|
|
<script src="../../node_modules/jquery/dist/jquery.min.js"></script>
|
|
|
|
<script src="../../node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
|
<link rel="stylesheet" href="../../node_modules/bootstrap/dist/css/bootstrap.min.css">
|
|
</head>
|
|
|
|
<body
|
|
style="padding-left: 20%; padding-right: 20%; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-evenly; align-items: center;">
|
|
<input type="text" class="form-control" id="username" placeholder="Username">
|
|
<input type="password" class="form-control" id="password" placeholder="Password">
|
|
<div style="display: flex; flex-direction: row; justify-content: space-between; width: 100%;">
|
|
<button type="button" class="btn btn-outline-danger" id="cancel">Cancel</button>
|
|
<button type="submit" class="btn btn-primary" id="submit">Login</button>
|
|
</div>
|
|
<script>
|
|
const { ipcRenderer } = require("electron");
|
|
|
|
function submit() {
|
|
ipcRenderer.send("login-submit", {
|
|
username: document.getElementById("username").value,
|
|
password: document.getElementById("password").value,
|
|
});
|
|
};
|
|
|
|
document.getElementById("username").focus();
|
|
document.getElementById("password").onkeypress = (ev) => {
|
|
if (ev.key == "Enter") {
|
|
submit();
|
|
}
|
|
};
|
|
document.getElementById("submit").onclick = submit;
|
|
document.getElementById("cancel").onclick = () => { ipcRenderer.send("login-cancel") };
|
|
</script>
|
|
</body>
|
|
|
|
</html> |