✨ Feat: [#103] mail 서버 계정 기능 완료
This commit is contained in:
114
mail/templates/mail/signup.html
Normal file
114
mail/templates/mail/signup.html
Normal file
@@ -0,0 +1,114 @@
|
||||
<!doctype html>
|
||||
<html lang="ko">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<title>메일 계정 신청</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: system-ui, sans-serif;
|
||||
max-width: 720px;
|
||||
margin: 40px auto;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.card {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 12px;
|
||||
padding: 18px;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
margin-top: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
margin-top: 6px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
button {
|
||||
margin-top: 16px;
|
||||
padding: 10px 14px;
|
||||
border: 0;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ok {
|
||||
margin-top: 14px;
|
||||
padding: 12px;
|
||||
border-radius: 10px;
|
||||
background: #eef;
|
||||
}
|
||||
|
||||
.err {
|
||||
margin-top: 14px;
|
||||
padding: 12px;
|
||||
border-radius: 10px;
|
||||
background: #fee;
|
||||
}
|
||||
|
||||
small {
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>메일 계정 신청</h1>
|
||||
<div class="card">
|
||||
<p><small>HTTPS에서만 사용하세요. 생성 즉시 반영됩니다.</small></p>
|
||||
|
||||
<label>아이디(메일주소 앞부분)</label>
|
||||
<input id="local" placeholder="예: seungmin" autocomplete="username" />
|
||||
|
||||
<label>비밀번호</label>
|
||||
<input id="password" type="password" placeholder="10자 이상 권장" autocomplete="new-password" />
|
||||
|
||||
<label>초대코드</label>
|
||||
<input id="invite" placeholder="관리자에게 받은 코드" />
|
||||
|
||||
<button id="btn">제출</button>
|
||||
|
||||
<div id="msg"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const msg = (type, text) => {
|
||||
const el = document.getElementById('msg');
|
||||
el.className = type;
|
||||
el.textContent = text;
|
||||
};
|
||||
|
||||
document.getElementById('btn').addEventListener('click', async () => {
|
||||
const local = document.getElementById('local').value.trim();
|
||||
const password = document.getElementById('password').value;
|
||||
const invite = document.getElementById('invite').value.trim();
|
||||
|
||||
msg('', '');
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/mail/request/', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ local, password, invite })
|
||||
});
|
||||
const data = await res.json();
|
||||
if (!res.ok) throw new Error(data.detail || '요청 실패');
|
||||
|
||||
msg('ok', data.message);
|
||||
} catch (e) {
|
||||
msg('err', e.message);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user