mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Moved submodules and every stuff into seperate folders neatly #4
This commit is contained in:
parent
7e44ca30f1
commit
ae91801fbd
51 changed files with 0 additions and 799 deletions
25
src/sharedViews/404.ejs
Executable file
25
src/sharedViews/404.ejs
Executable file
|
@ -0,0 +1,25 @@
|
|||
<html>
|
||||
|
||||
<body bgcolor="#212127">
|
||||
|
||||
<head>
|
||||
<style>
|
||||
body {
|
||||
font: normal 14px Verdana;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #9999ff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<center>
|
||||
<h1>404</h1>
|
||||
|
||||
<iframe width="660" height="465" src="https://www.youtube-nocookie.com/embed/qLrnkK2YEcE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
</center>
|
||||
</body>
|
||||
|
||||
</html>
|
204
src/sharedViews/login.ejs
Normal file
204
src/sharedViews/login.ejs
Normal file
|
@ -0,0 +1,204 @@
|
|||
<html>
|
||||
<body bgcolor="#222426">
|
||||
<head>
|
||||
<title>Frylabs</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.6" />
|
||||
<style>
|
||||
a {
|
||||
color: lightblue;
|
||||
}
|
||||
.center {
|
||||
width: 380px;
|
||||
height: 340px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
overflow: none;
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
.text {
|
||||
font-size: 18px;
|
||||
color: white;
|
||||
margin: 20px;
|
||||
}
|
||||
.title {
|
||||
margin: 20px;
|
||||
font-size: 50px;
|
||||
font-weight: bold;
|
||||
color: white;
|
||||
}
|
||||
.inputContainer {
|
||||
width: 100%;
|
||||
}
|
||||
.showpwContainer {
|
||||
color: white;
|
||||
width: 40px;
|
||||
cursor: pointer;
|
||||
}
|
||||
input[type=text], input[type=password], textarea {
|
||||
font-size: 20px;
|
||||
color: #ffffff;
|
||||
background-color: #181a1b;
|
||||
width: 100%;
|
||||
padding: 12px 20px;
|
||||
margin: 8px 0;
|
||||
box-sizing: border-box;
|
||||
border: 2px solid #333333;
|
||||
text-align: center;
|
||||
}
|
||||
input[type=text], input[type=password]:focus {
|
||||
border: 2px solid #000;
|
||||
}
|
||||
button {
|
||||
background-color: #9999ff;
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 16px 32px;
|
||||
text-decoration: none;
|
||||
margin: 4px 2px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.ircLinkContainer {
|
||||
display: flex;
|
||||
justify-content: flex-end
|
||||
}
|
||||
.ircLink {
|
||||
color: #9999ff;
|
||||
font-size: 12px;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
#feedback {
|
||||
display: none;
|
||||
}
|
||||
#feedbackTextArea {
|
||||
text-align: left;
|
||||
font-size: 16px;
|
||||
height: 160px;
|
||||
resize: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<div class='center'>
|
||||
<div class='title'>
|
||||
Frylabs
|
||||
</div>
|
||||
<div id='feedback'>
|
||||
<textarea placeholder='Feedback' id='feedbackTextArea'></textarea>
|
||||
<div class='ircLinkContainer' >
|
||||
<a class='ircLink' href='<%= devel? 'http' : 'https' %>://qmining.frylabs.net/irc?loginClick'>IRC chatszoba</a>
|
||||
</div>
|
||||
<button id='sendFeedbackButton' onclick="SendFeedback(this)">Submit</button>
|
||||
</div>
|
||||
<div id='form'>
|
||||
<div class='inputContainer'>
|
||||
<input onkeyup="PWKeyUp(this)" type='text' id='pw' name='pw' autocomplete="off" autofocus/>
|
||||
<input type='hidden' id='cid' name='pw' autocomplete="off"/>
|
||||
</div>
|
||||
<div class='ircLinkContainer' >
|
||||
<a class='ircLink' onclick='ShowFeedback()'>Contact</a>
|
||||
</div>
|
||||
<button id='sendButton' onclick="Login(this)">Login</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
function PWKeyUp (inputField) {
|
||||
if (event.keyCode === 13) {
|
||||
event.preventDefault();
|
||||
Login(document.getElementById('sendButton'))
|
||||
}
|
||||
}
|
||||
function HandleFeedbackResp (resp) {
|
||||
document.getElementById('sendButton').innerText = 'Submit'
|
||||
const textNode = document.getElementById('text')
|
||||
const feedback = document.getElementById('feedback').style.display = "none";
|
||||
if (resp.success) {
|
||||
textNode.innerText = 'Visszajelzés elküldve'
|
||||
} else {
|
||||
textNode.innerText = 'Szerver oldali hiba :c'
|
||||
}
|
||||
}
|
||||
async function SendFeedback (button) {
|
||||
const feedback = document.getElementById('feedbackTextArea').value
|
||||
button.innerText = '...'
|
||||
const rawResponse = await fetch('<%= devel? 'http' : 'https' %>://api.frylabs.net/postfeedback', {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
description: feedback,
|
||||
fromLogin: true
|
||||
})
|
||||
})
|
||||
if (!rawResponse.ok) {
|
||||
document.getElementById('text').innerText = 'Internal server error'
|
||||
button.innerText = 'Submit'
|
||||
}
|
||||
try {
|
||||
rawResponse.json()
|
||||
.then((resp) => {
|
||||
HandleFeedbackResp(resp)
|
||||
})
|
||||
} catch (e) {
|
||||
document.getElementById('text').innerText = 'Invalid data recieved from server'
|
||||
button.innerText = 'Submit'
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
function ShowFeedback () {
|
||||
const form = document.getElementById('form').style.display = "none";
|
||||
const feedback = document.getElementById('feedback').style.display = "block";
|
||||
document.getElementById('text').innerText = 'Ha szeretnél választ kapni akkor kérdésed mellé írd be e-mailed, vagy kattints a lenti "IRC" linkre. Jelszót meglévő felhasználóktól kérj! E-mail esetén válasz spam-be is érkezhet!'
|
||||
}
|
||||
function HandleResp (resp) {
|
||||
document.getElementById('sendButton').innerText = 'Login'
|
||||
const textNode = document.getElementById('text')
|
||||
if (resp.result === 'success') {
|
||||
location.reload()
|
||||
textNode.innerText = resp.msg
|
||||
} else {
|
||||
textNode.innerText = resp.msg
|
||||
}
|
||||
}
|
||||
async function Login(button) {
|
||||
button.innerText = '...'
|
||||
const rawResponse = await fetch('<%= devel? 'http' : 'https' %>://api.frylabs.net/login', {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
pw: document.getElementById('pw').value,
|
||||
cid: document.getElementById('cid').value
|
||||
})
|
||||
})
|
||||
if (!rawResponse.ok) {
|
||||
document.getElementById('text').innerText = 'Internal server error'
|
||||
button.innerText = 'Login'
|
||||
}
|
||||
try {
|
||||
rawResponse.json()
|
||||
.then((resp) => {
|
||||
HandleResp(resp)
|
||||
})
|
||||
} catch (e) {
|
||||
document.getElementById('text').innerText = 'Invalid data recieved from server'
|
||||
button.innerText = 'Login'
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue