Initial commit for management
This commit is contained in:
1
public/consts.js
Normal file
1
public/consts.js
Normal file
@@ -0,0 +1 @@
|
||||
const backendURL = "http://127.0.0.1:8080";
|
||||
73
public/index.html
Normal file
73
public/index.html
Normal file
@@ -0,0 +1,73 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<center>
|
||||
<h1>Kno-Logic Management Portal</h1>
|
||||
<form>
|
||||
<table border="black">
|
||||
<th colspan="2">
|
||||
Login
|
||||
</th>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="email">Email: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="email" name="email">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="password">Password: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" id="password" name="password">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<center><button type="button" onclick="login()">Login</button></center>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<a href="/manage/register.html">Register</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</center>
|
||||
</body>
|
||||
|
||||
<script src="./consts.js"></script>
|
||||
|
||||
<script>
|
||||
function login() {
|
||||
let email = document.getElementById("email").value;
|
||||
let password = document.getElementById("password").value;
|
||||
|
||||
(async () => {
|
||||
const rawResponse = await fetch(backendURL + '/v1/user/login', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({ email: email, password: password })
|
||||
});
|
||||
const content = await rawResponse.text();
|
||||
|
||||
console.log(content);
|
||||
})();
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
</html>
|
||||
59
public/manageHome.html
Normal file
59
public/manageHome.html
Normal file
@@ -0,0 +1,59 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<center>
|
||||
<h1>Kno-Logic Management Portal</h1>
|
||||
<table border="black">
|
||||
<th colspan="4">
|
||||
Home
|
||||
</th>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="/manage/manageHome.html">Home</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/manage/managePosts.html">Manage Posts</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/manage/manageCategories.html">Manage Categories</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/manage/manageHome.html">Analytics</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
</body>
|
||||
|
||||
<script src="./consts.js"></script>
|
||||
|
||||
<script>
|
||||
function login() {
|
||||
let email = document.getElementById("email").value;
|
||||
let password = document.getElementById("password").value;
|
||||
|
||||
(async () => {
|
||||
const rawResponse = await fetch(backendURL + '/v1/user/login', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({ email: email, password: password })
|
||||
});
|
||||
const content = await rawResponse.text();
|
||||
|
||||
console.log(content);
|
||||
})();
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
</html>
|
||||
84
public/register.html
Normal file
84
public/register.html
Normal file
@@ -0,0 +1,84 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<center>
|
||||
<h1>Kno-Logic Management Portal</h1>
|
||||
<form>
|
||||
<table border="black">
|
||||
<th colspan="2">
|
||||
Register
|
||||
</th>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="email">Name: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="name" name="name">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="email">Email: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="email" id="email" name="email">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="password">Password: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" id="password" name="password">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<center><button type="button" onclick="login()">Login</button></center>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<a href="/manage/index.html">Log In</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</center>
|
||||
</body>
|
||||
|
||||
<script src="./consts.js"></script>
|
||||
|
||||
<script>
|
||||
function login() {
|
||||
let name = document.getElementById("name").value;
|
||||
let email = document.getElementById("email").value;
|
||||
let password = document.getElementById("password").value;
|
||||
|
||||
(async () => {
|
||||
const rawResponse = await fetch(backendURL + '/v1/user/create', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({ name: name, email: email, password: password })
|
||||
});
|
||||
const content = await rawResponse.text();
|
||||
|
||||
alert(content);
|
||||
|
||||
console.log(content);
|
||||
})();
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user