-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feature(admin.html): ํ์ด์ง ์ฌ๋ผ๊ฐ๋์ง ํ์ธ
- Loading branch information
Showing
5 changed files
with
300 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>ํ์ํฉ๋๋ค</title> | ||
</head> | ||
<body> | ||
<h1 id="welcomeMessage"></h1> <!-- ID๋ฅผ ์ถ๊ฐํ์ฌ JavaScript์์ ์ ๊ทผ ๊ฐ๋ฅํ๊ฒ ํจ --> | ||
</body> | ||
|
||
<script> | ||
// ์ธ์ ์คํ ๋ฆฌ์ง์์ userName์ ๊ฐ์ ธ์ด | ||
const userName = sessionStorage.getItem('userName'); | ||
|
||
// userName์ด ์กด์ฌํ๋ ๊ฒฝ์ฐ ํ์ ๋ฉ์์ง๋ฅผ ์ค์ | ||
if (userName) { | ||
document.getElementById('welcomeMessage').innerText = userName + '๋ ํ์ํฉ๋๋ค!'; | ||
} else { | ||
document.getElementById('welcomeMessage').innerText = 'ํ์ํฉ๋๋ค!'; | ||
} | ||
</script> | ||
</html> |
47 changes: 47 additions & 0 deletions
47
linkmind/src/main/resources/templates/basic/linkListPage.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!DOCTYPE html> | ||
<html xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Links</title> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"> | ||
<style> | ||
.link-container { | ||
display: flex; | ||
flex-direction: column; | ||
margin: 20px; | ||
} | ||
|
||
.link-item { | ||
border: 1px solid #ccc; | ||
border-radius: 5px; | ||
padding: 10px; | ||
margin: 5px 0; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.link-thumbnail { | ||
width: 50px; | ||
height: 50px; | ||
margin-right: 10px; | ||
border-radius: 5px; | ||
} | ||
|
||
.link-title { | ||
font-size: 18px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div th:if="${links.size() == 0}"> | ||
<h3>๋งํฌ๊ฐ ํ์ฌ ์์ต๋๋ค!</h3> | ||
</div> | ||
<div class="link-container"> | ||
<h1>Links List</h1> | ||
<div th:each="link : ${links}" class="link-item"> | ||
<img th:src="${link.thumbnailUrl}" alt="Thumbnail" class="link-thumbnail"/> | ||
<span class="link-title" th:text="${link.title}"></span> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
101 changes: 101 additions & 0 deletions
101
linkmind/src/main/resources/templates/basic/qrForm.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<!DOCTYPE html> | ||
<html xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>์ ๋ ฅํผ ํ์ด์ง</title> | ||
<style> | ||
body { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
margin: 0; | ||
background-color: #f0f8ff; /* ๋ฐฐ๊ฒฝ์ ์กฐ์ ๊ฐ๋ฅ */ | ||
} | ||
|
||
.form-container { | ||
text-align: center; | ||
} | ||
|
||
.input-field { | ||
border: 1px solid #ccc; | ||
border-radius: 5px; | ||
padding: 10px; | ||
font-size: 1rem; | ||
width: 300px; | ||
margin-bottom: 15px; | ||
} | ||
|
||
.submit-button { | ||
background-color: #add8e6; /* ์ฐํ ํ๋์ */ | ||
border: none; | ||
border-radius: 5px; | ||
color: white; | ||
padding: 15px 30px; | ||
font-size: 1.2rem; | ||
cursor: pointer; | ||
transition: background-color 0.3s; | ||
} | ||
|
||
.submit-button:hover { | ||
background-color: #87ceeb; /* ๋ฒํผ ํธ๋ฒ ์์ */ | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
|
||
<h1>QR ์ฝ๋๋ฅผ ๊ด๋ฆฌ์ ๋์ค์ฝ๋์์ ๋ฑ๋กํ์ จ๋์?</h1> | ||
|
||
<div class="form-container"> | ||
|
||
<h2>์ ๋ ฅ์ฝ๋๋ฅผ ์ ๋ ฅํ์ธ์!</h2> | ||
<form id="codeForm"> | ||
<input type="text" class="input-field" placeholder="์ฝ๋๋ฅผ ์ ๋ ฅํ์ธ์" id="code"/> | ||
<br> | ||
<button class="submit-button" type="submit">์ ์ถ</button> | ||
</form> | ||
</div> | ||
|
||
<script> | ||
document.getElementById('codeForm').addEventListener('submit', function(event) { | ||
event.preventDefault(); // ๊ธฐ๋ณธ ํผ ์ ์ถ ๋ฐฉ์ง | ||
|
||
const code = document.getElementById('code').value; | ||
|
||
// JSON ๋ฐ์ดํฐ ์์ฑ | ||
const data = { | ||
code: code, | ||
}; | ||
|
||
// AJAX ์์ฒญ | ||
fetch('/admin/verify-code', { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
body: JSON.stringify(data) | ||
}) | ||
.then(response => { | ||
if (response.ok) { | ||
return response.json(); | ||
} | ||
throw new Error('๋คํธ์ํฌ ์๋ต์ด ์ข์ง ์์ต๋๋ค.'); | ||
}) | ||
.then(data => { | ||
console.log(data); // ์๋ฒ์์ ๋ฐํํ ๋ฐ์ดํฐ ์ฒ๋ฆฌ | ||
alert(data.data.userName); // ์๋ฅผ ๋ค์ด, ์ฑ๊ณต ๋ฉ์์ง ํ์ | ||
if (data.redirectUrl) { // ๋ฆฌ๋ค์ด๋ ํธ URL์ด ์๋ ๊ฒฝ์ฐ | ||
// userName์ ์ธ์ ์คํ ๋ฆฌ์ง์ ์ ์ฅ | ||
sessionStorage.setItem('userName', data.data.userName); | ||
window.location.href = data.redirectUrl; // ๋ฆฌ๋ค์ด๋ ํธ | ||
} | ||
}) | ||
.catch(error => { | ||
console.error('๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค:', error); | ||
}); | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<!DOCTYPE html> | ||
<html xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>๋ก๊ทธ์ธ ํ์ด์ง</title> | ||
<style> | ||
body { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
margin: 0; | ||
background-color: #f0f8ff; /* ๋ฐฐ๊ฒฝ์ ์กฐ์ ๊ฐ๋ฅ */ | ||
} | ||
|
||
.form-container { | ||
text-align: center; | ||
border: 1px solid #ccc; | ||
border-radius: 10px; | ||
padding: 20px; | ||
background-color: white; | ||
} | ||
|
||
.input-field { | ||
border: 1px solid #ccc; | ||
border-radius: 5px; | ||
padding: 10px; | ||
font-size: 1rem; | ||
width: 300px; | ||
margin-bottom: 15px; | ||
} | ||
|
||
.submit-button { | ||
background-color: #add8e6; /* ์ฐํ ํ๋์ */ | ||
border: none; | ||
border-radius: 5px; | ||
color: white; | ||
padding: 15px 30px; | ||
font-size: 1.2rem; | ||
cursor: pointer; | ||
transition: background-color 0.3s; | ||
} | ||
|
||
.submit-button:hover { | ||
background-color: #87ceeb; /* ๋ฒํผ ํธ๋ฒ ์์ */ | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<div class="form-container"> | ||
<h1>๋ก๊ทธ์ธ</h1> | ||
<form id="loginForm" th:action="@{/admin/register}" method="post" onsubmit="submitForm(event)"> | ||
<input type="text" class="input-field" placeholder="์์ด๋๋ฅผ ์ ๋ ฅํ์ธ์" th:name="'username'" required/> | ||
<br> | ||
<input type="password" class="input-field" placeholder="๋น๋ฐ๋ฒํธ๋ฅผ ์ ๋ ฅํ์ธ์" th:name="'password'" required/> | ||
<br> | ||
<button class="submit-button" type="submit">๋ก๊ทธ์ธ</button> | ||
</form> | ||
</div> | ||
|
||
<script> | ||
async function submitForm(event) { | ||
event.preventDefault(); // ๊ธฐ๋ณธ ํผ ์ ์ถ ๋ฐฉ์ง | ||
|
||
const formData = new FormData(document.getElementById('loginForm')); | ||
const jsonData = Object.fromEntries(formData.entries()); // FormData๋ฅผ JSON์ผ๋ก ๋ณํ | ||
|
||
const response = await fetch('/admin/register', { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json' // JSON ํ์์ผ๋ก ์ ์ก | ||
}, | ||
body: JSON.stringify(jsonData) // JSON ๋ฌธ์์ด๋ก ๋ณํ | ||
}); | ||
|
||
if (response.ok) { | ||
const data = await response.json(); | ||
window.location.href = data.redirectUrl; // ๋ฆฌ๋ค์ด๋ ํธ URL๋ก ์ด๋ | ||
} else { | ||
// ์ค๋ฅ ์ฒ๋ฆฌ | ||
console.error('Registration failed:', response.statusText); | ||
} | ||
} | ||
</script> | ||
|
||
</body> | ||
</html> |
42 changes: 42 additions & 0 deletions
42
linkmind/src/main/resources/templates/basic/text-basic.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>๋ฒํผ ์ ํ ํ์ด์ง</title> | ||
<style> | ||
body { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
margin: 0; | ||
background-color: #f0f8ff; /* ๋ฐฐ๊ฒฝ์ ์กฐ์ ๊ฐ๋ฅ */ | ||
} | ||
.button-container { | ||
text-align: center; | ||
} | ||
.button { | ||
background-color: #add8e6; /* ์ฐํ ํ๋์ */ | ||
border: none; | ||
border-radius: 5px; | ||
color: white; | ||
padding: 15px 30px; | ||
font-size: 1.2rem; | ||
cursor: pointer; | ||
transition: background-color 0.3s; | ||
} | ||
.button:hover { | ||
background-color: #87ceeb; /* ๋ฒํผ ํธ๋ฒ ์์ */ | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<div class="button-container"> | ||
<button class="button" th:onclick="|location.href='@{/basic/hi}'|" type="button">๊ฐ๋ฐ์ ๋ฐฑ ์คํผ์ค</button> | ||
<br><br> | ||
<button class="button" th:onclick="|location.href='@{/swagger-ui/index.html#/}'|" type="button">์๋</button> | ||
</div> | ||
|
||
</body> | ||
</html> |