Initial commit

This commit is contained in:
Tony Klink 2024-01-12 09:35:31 -06:00
commit 9fe412be11
Signed by: klink
GPG key ID: 85175567C4D19231
58 changed files with 6215 additions and 0 deletions

66
templates/index.html Normal file
View file

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Registration</title>
</head>
<body>
<div id="app">
<h1>Create new user</h1>
<form action="/register" method="post" id="signup">
<h1>Sign Up</h1>
<div class="field">
<label for="name">Name:</label>
<input type="text" id="name" name="name" placeholder="Enter your profile name" />
<small></small>
</div>
<div class="field">
<label for="email">PubKey:</label>
<input type="text" id="pubkey" name="pubkey" placeholder="Enter your pubkey" />
<small></small>
</div>
<button type="submit">Register</button>
</form>
</div>
</body>
<script>
const form = document.getElementById('signup');
form.addEventListener('submit', async (event) => {
// stop form submission
event.preventDefault();
const name = form.elements['name'];
const pubkey = form.elements['pubkey'];
// getting the element's value
let userName = name.value;
let pubKey = pubkey.value;
console.log(`${userName}:${pubKey}`);
const data = { name: userName, pubkey: pubKey};
// Send user data
await postJSON(data);
});
async function postJSON(data) {
try {
const response = await fetch("http://localhost:8085/register", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
const result = await response.json();
console.log("Success:", result);
} catch (error) {
console.error("Error:", error);
}
}
</script>
</html>

70
templates/index.stpl Normal file
View file

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<title>Registration</title>
</head>
<body>
<div id="app">
<h1>Create new user</h1>
<form action="/register" method="post" id="signup">
<h1>Sign Up</h1>
<div class="field">
<label for="name">Name:</label>
<input type="text" id="name" name="name" placeholder="Enter your profile name" />
<small></small>
</div>
<div class="field">
<label for="email">PubKey:</label>
<input type="text" id="pubkey" name="pubkey" placeholder="Enter your pubkey" />
<small></small>
</div>
<button type="submit">Register</button>
</form>
</div>
</body>
<script>
const form = document.getElementById('signup');
form.addEventListener('submit', async (event) => {
// stop form submission
event.preventDefault();
const name = form.elements['name'];
const pubkey = form.elements['pubkey'];
// getting the element's value
let userName = name.value;
let pubKey = pubkey.value;
console.log(`${userName}:${pubKey}`);
const data = { name: userName, pubkey: pubKey};
// Send user data
await postJSON(data);
});
async function postJSON(data) {
try {
const response = await fetch("http://localhost:8085/register", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
const result = await response.json();
console.log("Success:", result);
} catch (error) {
console.error("Error:", error);
}
}
</script>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}