Files
duty-calendar/server/web/admin.html
T

167 lines
22 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html>
<html lang="ko">
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="theme-color" content="#26364d"><meta name="robots" content="noindex"><title>관리자 · 당직근무</title><link rel="icon" href="brand/favicon"><link rel="apple-touch-icon" href="brand/apple-touch"><link rel="stylesheet" href="assets/style.css"><link rel="stylesheet" href="assets/admin.css"><script src="assets/korean.js" defer></script><script src="assets/admin.js" defer></script></head>
<body class="admin">
<div id="gate" class="gate"><img src="brand/logo" alt="" width="56" height="56"><h1>당직근무 관리자</h1><p id="gate-message">로그인 상태를 확인하고 있습니다.</p><a id="gate-link" class="gate-link" href="./" hidden>홈페이지에서 로그인</a></div>
<div id="shell" class="shell" hidden>
<aside class="side">
<a class="side-brand" href="./"><img src="brand/logo" alt="" width="36" height="36"><span><b>당직근무</b><small>관리자</small></span></a>
<nav class="side-nav" aria-label="관리 메뉴">
<button data-view="overview" class="active"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 13h6V4H4zM14 20h6v-9h-6zM4 20h6v-4H4zM14 7h6V4h-6z"/></svg>현황</button>
<button data-view="notice"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 10v4h3l6 4V6L7 10zM16.5 9a4 4 0 0 1 0 6M19 6.5a7.5 7.5 0 0 1 0 11"/></svg>공지</button>
<button data-view="members"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 21a7 7 0 0 1 14 0M17 11a3 3 0 1 0-1-5.8M22 21a6 6 0 0 0-4-5.7"/></svg>회원</button>
<button data-view="companies"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 21V5l8-2v18M12 8l8 2v11M3 21h18M8 9v.01M8 13v.01M8 17v.01M16 13v.01M16 17v.01"/></svg>소속</button>
<button data-view="site"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 5h18v14H3zM3 9h18M7 13h6M7 16h4"/></svg>홈페이지</button>
<button data-view="guide"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 4h11l3 3v13H5zM8 4v5h7V4M8 13h8M8 17h5"/></svg>연동 안내</button>
<button data-view="board"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5h16v11H9l-5 4zM8 9h8M8 12h5"/></svg>게시판</button>
<button data-view="brand"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 4h16v16H4zM4 15l5-5 4 4 3-3 4 4M15.5 8.5h.01"/></svg>로고</button>
<button data-view="log"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 7v5l3 2M21 12a9 9 0 1 1-3-6.7M21 4v5h-5"/></svg>작업 기록</button>
</nav>
<div class="side-foot"><p id="me-name" class="me"></p><a href="./">홈페이지로</a><button id="admin-logout" class="text-button">로그아웃</button></div>
</aside>
<main class="panel">
<section id="view-overview" class="view">
<header class="view-head"><div><p class="eyebrow">운영 현황</p><h1>한눈에 보기</h1></div><button id="overview-refresh" class="secondary">새로 불러오기</button></header>
<div id="stat-grid" class="stat-grid"></div>
<div class="two-col">
<section class="card"><h2>서비스 정보</h2><dl id="service-info" class="info-list"></dl></section>
<section class="card"><h2>공휴일 자료</h2><dl id="holiday-info" class="info-list"></dl><button id="holiday-refresh" class="secondary">지금 확인</button><p class="small">자료 제공처를 바로 확인합니다. 실패해도 마지막으로 검증한 자료를 계속 씁니다. 1시간 안에 다시 확인하지는 않습니다.</p></section>
</div>
<div class="two-col">
<section class="card"><h2>저장된 자료</h2><p class="small">전체 개수만 셉니다. 회원 일정의 내용은 이 화면에서 열람하지 않습니다.</p><dl id="item-info" class="info-list"></dl></section>
<section class="card"><h2>최근 가입</h2><ul id="recent-members" class="plain-list"></ul></section>
</div>
</section>
<section id="view-notice" class="view" hidden>
<header class="view-head"><div><p class="eyebrow">공지 관리</p><h1>공지</h1></div><div class="head-actions"><a class="secondary-link" href="./" target="_blank" rel="noopener">홈페이지 열기</a><a class="secondary-link" href="board" target="_blank" rel="noopener">게시판 열기</a></div></header>
<section class="card stack"><h2>공지 띠</h2><p class="small">켜 두면 홈페이지 맨 위와 앱 첫 화면에 한 줄로 보입니다. 앱은 0.16.0부터 보이고 다음에 앱을 열 때 바뀝니다.</p>
<p class="eyebrow notice-preview-label">미리보기</p><div id="notice-preview" class="notice-preview"></div>
<form id="notice-form" class="site-form single compact"></form><button id="notice-save" form="notice-form" type="submit">공지 띠 저장</button></section>
<section class="card stack"><div class="card-head"><h2>공지사항 글</h2><button id="notice-new" type="button">새 공지 쓰기</button></div>
<p class="small">홈페이지 게시판의 공지사항에 올라갑니다. 누구나 읽을 수 있고 관리자만 씁니다. 고정한 글은 목록 맨 위에 보입니다.</p>
<div class="table-wrap"><table class="data-table"><thead><tr><th>제목</th><th>상태</th><th>쓴 때</th><th>관리</th></tr></thead><tbody id="notice-rows"></tbody></table></div>
<div class="pager"><button id="notice-prev" class="secondary">이전</button><span id="notice-page"></span><button id="notice-next" class="secondary">다음</button></div>
</section>
</section>
<section id="view-members" class="view" hidden>
<header class="view-head"><div><p class="eyebrow">회원 관리</p><h1>회원</h1></div><p id="member-total" class="count"></p></header>
<form id="member-filter" class="toolbar"><input id="member-q" type="search" maxlength="40" placeholder="아이디 또는 이름" aria-label="회원 검색"><select id="member-show" aria-label="회원 범위"><option value="all">전체</option><option value="admin">관리자</option><option value="suspended">이용 중지</option><option value="mustChange">비밀번호 변경 필요</option><option value="idle">30일 넘게 미접속</option><option value="company">소속 있음</option></select><select id="member-sort" aria-label="정렬"><option value="created">가입 최신순</option><option value="login">최근 접속순</option><option value="name">이름순</option></select><button type="submit">찾기</button></form>
<div class="table-wrap"><table class="data-table"><thead><tr><th>회원</th><th>권한</th><th>상태</th><th>소속</th><th>로그인 기기</th><th>가입</th><th>마지막 접속</th></tr></thead><tbody id="member-rows"></tbody></table></div>
<div class="pager"><button id="member-prev" class="secondary">이전</button><span id="member-page"></span><button id="member-next" class="secondary">다음</button></div>
</section>
<section id="view-companies" class="view" hidden>
<header class="view-head"><div><p class="eyebrow">소속 관리</p><h1>소속</h1></div><p id="company-total" class="count"></p></header>
<form id="company-filter" class="toolbar"><input id="company-q" type="search" maxlength="60" placeholder="소속 이름" aria-label="소속 검색"><button type="submit">찾기</button></form>
<div class="table-wrap"><table class="data-table"><thead><tr><th>소속</th><th>소속 관리자</th><th>인원</th><th>초대코드</th><th>만든 날</th></tr></thead><tbody id="company-rows"></tbody></table></div>
<div class="pager"><button id="company-prev" class="secondary">이전</button><span id="company-page"></span><button id="company-next" class="secondary">다음</button></div>
</section>
<section id="view-site" class="view" hidden>
<header class="view-head"><div><p class="eyebrow">홈페이지 설정</p><h1>문구와 공지</h1></div><button id="site-save" form="site-form" type="submit">저장</button></header>
<div class="site-layout">
<form id="site-form" class="site-form"></form>
<aside class="preview-wrap"><p class="eyebrow">미리보기</p><div id="pv-shell" class="preview">
<div class="pv-top"><img id="pv-logo" src="brand/logo" alt="" width="28" height="28"><span><b id="pv-brandName"></b><small id="pv-brandTagline"></small></span></div>
<div id="pv-notice" class="pv-notice" hidden></div>
<div class="pv-hero"><p id="pv-heroEyebrow" class="pv-eyebrow"></p><h2 id="pv-heroTitle"></h2><p id="pv-heroIntro" class="pv-intro"></p><span id="pv-downloadLabel" class="pv-button"></span><div class="pv-caption"><strong id="pv-captionTitle"></strong><p id="pv-captionText"></p></div></div>
<div class="pv-foot"><span id="pv-footerCredit"></span><span id="pv-registration"></span></div>
</div><p class="small">저장하면 홈페이지에 바로 반영됩니다. 열려 있는 화면은 새로고침하면 바뀝니다.</p></aside>
</div>
</section>
<section id="view-guide" class="view" hidden>
<header class="view-head"><div><p class="eyebrow">홈페이지 › 달력 연동 안내</p><h1>연동 안내</h1></div><div class="head-actions"><a class="secondary-link" href="guide" target="_blank" rel="noopener">안내 페이지 열기</a><button id="guide-save" form="guide-form" type="submit">저장</button></div></header>
<p class="small guide-help">빈 줄로 문단을 나눕니다. <b>1.</b> 로 시작하는 줄은 번호 목록, <b>-</b> 로 시작하는 줄은 점 목록이 됩니다. 별표 두 개로 감싼 글(**옵션**)은 굵게 보이고 https:// 주소는 링크가 됩니다. 저장하면 안내 페이지에 바로 반영됩니다.</p>
<form id="guide-form" class="site-form single"></form>
</section>
<section id="view-board" class="view" hidden>
<header class="view-head"><div><p class="eyebrow">홈페이지 › 게시판</p><h1>게시판</h1></div><div class="head-actions"><a class="secondary-link" href="board" target="_blank" rel="noopener">게시판 열기</a></div></header>
<div class="two-col">
<section class="card"><h2>게시판 종류</h2><p class="small">순서 숫자가 작은 것부터 위에 보입니다. 쉬게 한 게시판은 회원과 손님에게 보이지 않고 글은 그대로 남습니다.</p><div id="board-rows" class="board-rows"></div><button id="board-new" class="secondary">새 게시판 만들기</button></section>
<section class="card"><h2>게시판 전체 설정</h2><form id="board-settings-form" class="site-form single compact"></form><button id="board-settings-save" form="board-settings-form" type="submit">설정 저장</button></section>
</div>
<section class="card stack"><h2>글 관리</h2>
<form id="post-filter" class="toolbar"><select id="post-board" aria-label="게시판"><option value="">모든 게시판</option></select><select id="post-state" aria-label="상태"><option value="all">모든 상태</option><option value="open">보임</option><option value="hidden">숨김</option><option value="deleted">지움</option></select><input id="post-q" type="search" maxlength="40" placeholder="제목이나 내용" aria-label="글 찾기"><button type="submit">찾기</button></form>
<div class="table-wrap"><table class="data-table"><thead><tr><th>글</th><th>게시판</th><th>쓴 사람</th><th>상태</th><th>쓴 때</th><th>관리</th></tr></thead><tbody id="post-rows"></tbody></table></div>
<div class="pager"><button id="post-prev" class="secondary">이전</button><span id="post-page"></span><button id="post-next" class="secondary">다음</button></div>
</section>
<section class="card stack"><h2>댓글 관리</h2>
<form id="comment-filter" class="toolbar"><select id="comment-state" aria-label="상태"><option value="all">모든 상태</option><option value="open">보임</option><option value="hidden">숨김</option><option value="deleted">지움</option></select><button type="submit">보기</button></form>
<div class="table-wrap"><table class="data-table"><thead><tr><th>댓글</th><th>글</th><th>쓴 사람</th><th>상태</th><th>쓴 때</th><th>관리</th></tr></thead><tbody id="comment-rows"></tbody></table></div>
<div class="pager"><button id="comment-prev" class="secondary">이전</button><span id="comment-page"></span><button id="comment-next" class="secondary">다음</button></div>
</section>
</section>
<section id="view-brand" class="view" hidden>
<header class="view-head"><div><p class="eyebrow">브랜드 그림</p><h1>로고와 아이콘</h1></div><button id="brand-reset" class="secondary">기본 로고로 되돌리기</button></header>
<section class="card"><h2>지금 쓰는 로고</h2>
<div class="logo-row"><figure><img id="cur-512" alt="" width="128" height="128"><figcaption>앱 아이콘</figcaption></figure><figure><img id="cur-mask" class="round" alt="" width="96" height="96"><figcaption>둥근 홈 화면</figcaption></figure><figure><img id="cur-logo" class="rounded" alt="" width="40" height="40"><figcaption>홈페이지 로고</figcaption></figure><figure><img id="cur-fav" alt="" width="16" height="16"><figcaption>브라우저 탭</figcaption></figure></div>
<p id="brand-source" class="small"></p></section>
<div class="two-col">
<section class="card"><h2>그림 올리기</h2><p class="small">PNG·JPG·WebP 그림을 고르면 가운데를 정사각형으로 잘라 크기별 아이콘을 만듭니다. 512px 이상인 그림을 권합니다.</p><label>그림 파일<input id="logo-file" type="file" accept="image/png,image/jpeg,image/webp"></label></section>
<section id="gen-card" class="card" hidden><h2>후보 그림 만들기</h2><p id="gen-status" class="small"></p>
<label>그림 설명<textarea id="gen-prompt" rows="6" maxlength="1500"></textarea></label>
<div class="field-row"><label>장수<select id="gen-count"><option value="1">1장</option><option value="2" selected>2장</option><option value="3">3장</option><option value="4">4장</option></select></label><label>모델<input id="gen-model" maxlength="80" autocomplete="off"></label></div>
<div class="action-row"><button id="gen-start">후보 만들기</button><button id="gen-default" type="button" class="secondary">기본 설명으로</button></div><p id="gen-progress" class="small" role="status"></p></section>
</div>
<section id="apply-card" class="card apply-card" hidden><h2>적용 미리보기</h2>
<div class="logo-row"><figure><canvas id="pv-512" width="512" height="512"></canvas><figcaption>앱 아이콘</figcaption></figure><figure><canvas id="pv-mask" class="round" width="512" height="512"></canvas><figcaption>둥근 홈 화면</figcaption></figure><figure><canvas id="pv-64" class="rounded" width="64" height="64"></canvas><figcaption>홈페이지 로고</figcaption></figure><figure><canvas id="pv-16" width="16" height="16"></canvas><figcaption>브라우저 탭</figcaption></figure></div>
<div class="field-row"><label>확대(가장자리 잘라내기)<input id="apply-zoom" type="range" min="100" max="140" value="100"></label><label>여백<input id="apply-pad" type="range" min="0" max="20" value="0"></label><label>홈 화면 배경색<input id="apply-bg" type="color" value="#26364d"></label></div>
<p class="small">둥근 홈 화면과 아이폰 아이콘은 투명한 곳을 배경색으로 채웁니다. 그림 바깥 모서리가 흰색이면 확대로 잘라 내세요(자동으로 맞춰 둡니다).</p>
<div class="action-row"><button id="apply-save">이 그림으로 바꾸기</button><button id="apply-cancel" type="button" class="secondary">취소</button></div></section>
<section class="card"><h2>로고 후보</h2><p class="small">만든 후보는 최근 40장까지 보관합니다. 고르기를 누르면 위 미리보기에서 확인한 뒤 바꿀 수 있습니다.</p><div id="candidate-grid" class="candidate-grid"></div></section>
</section>
<section id="view-log" class="view" hidden>
<header class="view-head"><div><p class="eyebrow">작업 기록</p><h1>관리 작업 기록</h1></div><p id="log-total" class="count"></p></header>
<form id="log-filter" class="toolbar"><select id="log-area" aria-label="구분"><option value="all">전체</option><option value="member">회원</option><option value="company">소속</option><option value="site">홈페이지</option><option value="board">게시판</option><option value="system">시스템</option></select><button type="submit">보기</button></form>
<div class="table-wrap"><table class="data-table"><thead><tr><th>시각</th><th>관리자</th><th>구분</th><th>작업</th><th>대상</th><th>내용</th></tr></thead><tbody id="log-rows"></tbody></table></div>
<div class="pager"><button id="log-prev" class="secondary">이전</button><span id="log-page"></span><button id="log-next" class="secondary">다음</button></div>
</section>
</main>
</div>
<dialog id="notice-dialog" class="wide-dialog"><form id="notice-post-form"><div class="dialog-heading"><h2 id="notice-heading">새 공지</h2><button type="button" class="icon-button close" aria-label="닫기">×</button></div>
<label>제목<input id="np-title" maxlength="80" required></label>
<label>본문<textarea id="np-body" rows="10" maxlength="20000" required></textarea></label>
<label id="np-pin-label" class="check-label"><input id="np-pin" type="checkbox">공지사항 맨 위에 고정</label>
<p id="np-error" class="form-error" role="alert"></p>
<div class="dialog-actions"><button type="button" class="secondary close">취소</button><button id="np-submit" type="submit">올리기</button></div></form></dialog>
<dialog id="board-dialog"><form id="board-form"><div class="dialog-heading"><h2 id="board-heading">게시판</h2><button type="button" class="icon-button close" aria-label="닫기">×</button></div>
<label>주소 이름 (영어 소문자·숫자·-, 만든 뒤에는 바꿀 수 없음)<input id="bd-id" maxlength="20" pattern="[a-z][a-z0-9-]{1,19}" required></label>
<label>게시판 이름<input id="bd-name" maxlength="20" required></label>
<label>설명<input id="bd-description" maxlength="100"></label>
<div class="field-row"><label>순서<input id="bd-sort" type="number" min="0" max="9999" required></label><label>읽기<select id="bd-read"></select></label></div>
<div class="field-row"><label>글쓰기<select id="bd-write"></select></label><label>댓글<select id="bd-comment"></select></label></div>
<label class="check-label"><input id="bd-active" type="checkbox">사용 (끄면 쉬는 중)</label>
<p id="bd-error" class="form-error" role="alert"></p>
<div class="dialog-actions"><button type="button" class="secondary close">취소</button><button type="submit">저장</button></div></form></dialog>
<dialog id="member-dialog" class="wide-dialog"><div class="dialog-heading"><h2 id="md-title">회원</h2><button type="button" class="icon-button close" aria-label="닫기">×</button></div>
<dl id="md-info" class="info-list"></dl>
<form id="md-form"><h3>정보 수정</h3><p id="md-self" class="small" hidden>본인 계정의 권한과 이용 상태는 여기서 바꿀 수 없습니다. 홈페이지의 내 정보를 이용하세요.</p><label>이름<input id="md-name" maxlength="40" required></label><div class="field-row"><label>권한<select id="md-role"><option value="member">일반 회원</option><option value="admin">관리자</option></select></label><label>이용 상태<select id="md-active"><option value="yes">정상</option><option value="no">이용 중지</option></select></label></div><p class="small">권한을 바꾸거나 이용을 중지하면 그 회원의 모든 기기 로그인이 풀립니다.</p><div class="dialog-actions"><button type="submit">저장</button></div></form>
<h3>계정 조치</h3>
<div class="action-row"><button id="md-reset" class="secondary">복구 코드 발급</button><button id="md-logout" class="secondary">모든 기기 로그아웃</button><button id="md-delete" class="danger">회원과 일정 삭제</button></div>
<div id="md-reset-result" hidden><label>일회용 복구 코드<input id="md-reset-code" readonly></label><p class="small">24시간 안에 한 번만 쓸 수 있습니다. 회원 본인을 확인한 뒤 전달하세요.</p></div>
<p id="md-error" class="form-error" role="alert"></p>
<h3>이 회원의 관리 기록</h3><ul id="md-history" class="plain-list"></ul>
</dialog>
<dialog id="company-dialog" class="wide-dialog"><div class="dialog-heading"><h2 id="cd-title">소속</h2><button type="button" class="icon-button close" aria-label="닫기">×</button></div>
<dl id="cd-info" class="info-list"></dl>
<form id="cd-rename" class="field-row"><input id="cd-name" maxlength="60" required aria-label="소속 이름"><button type="submit" class="secondary">이름 변경</button></form>
<h3>구성원</h3>
<div class="table-wrap"><table class="data-table"><thead><tr><th>회원</th><th>가입</th><th>상태</th><th></th></tr></thead><tbody id="cd-members"></tbody></table></div>
<div class="action-row"><button id="cd-revoke" class="secondary">초대코드 종료</button><button id="cd-delete" class="danger">소속 삭제</button></div>
<p class="small">소속을 삭제해도 회원과 개인 달력은 남습니다. 소속 근무 교환과 인수인계 기록은 함께 지워집니다.</p>
<p id="cd-error" class="form-error" role="alert"></p>
</dialog>
<dialog id="confirm-dialog"><h2>확인</h2><p id="confirm-message"></p><div class="dialog-actions"><button id="confirm-cancel" class="secondary">취소</button><button id="confirm-accept">확인</button></div></dialog>
<div id="toast" class="toast" role="status" hidden></div>
</body>
</html>