gitea, notion webhook
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

65 lines
2.4 KiB

<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>slack-notifier · 유저 매핑 관리</title>
<script src="https://unpkg.com/htmx.org@2.0.4"></script>
<style>
body { font-family: system-ui, -apple-system, sans-serif; max-width: 760px; margin: 40px auto; padding: 0 16px; color: #222; }
h1 { font-size: 1.4rem; }
p.desc { color: #666; font-size: .9rem; }
table { border-collapse: collapse; width: 100%; margin-top: 8px; }
th, td { border: 1px solid #e2e2e2; padding: 8px 10px; text-align: left; font-size: .92rem; }
th { background: #fafafa; }
.row { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
input { padding: 7px 9px; border: 1px solid #ccc; border-radius: 6px; flex: 1; min-width: 180px; }
button { padding: 7px 14px; border: 0; border-radius: 6px; background: #4a154b; color: #fff; cursor: pointer; }
button.del { background: #b00020; padding: 4px 10px; font-size: .85rem; }
</style>
</head>
<body>
<h1>유저 매핑 관리</h1>
<p class="desc">
소스(Gitea/Notion <b>이메일</b> 또는 <b>로그인명</b>) → <b>Slack 이메일</b> 오버라이드.<br>
이메일 자동 매칭이 실패하거나, 시스템 간 이메일이 다를 때 사용합니다.
</p>
<form class="row"
hx-post="/admin/mappings"
hx-target="#mapping-table"
hx-swap="outerHTML"
hx-on::after-request="if(event.detail.successful) this.reset()">
<input name="source" placeholder="gitea/notion 이메일 또는 로그인" required>
<input name="slack_email" type="email" placeholder="slack 이메일" required>
<button type="submit">추가</button>
</form>
{{template "table" .}}
</body>
</html>
{{define "table"}}
<table id="mapping-table">
<thead>
<tr><th>소스 (이메일/로그인)</th><th>Slack 이메일</th><th></th></tr>
</thead>
<tbody>
{{range .Mappings}}
<tr>
<td>{{.Source}}</td>
<td>{{.SlackEmail}}</td>
<td>
<button class="del"
hx-delete="/admin/mappings/{{.Source}}"
hx-target="#mapping-table"
hx-swap="outerHTML"
hx-confirm="'{{.Source}}' 매핑을 삭제할까요?">삭제</button>
</td>
</tr>
{{else}}
<tr><td colspan="3" style="color:#888;text-align:center;">등록된 매핑이 없습니다.</td></tr>
{{end}}
</tbody>
</table>
{{end}}