Files
duty-calendar/server/web/admin.html
T
블리어 caed7675c7 제미나이 구독 그림을 로고 후보로 넣는 운영 도구와 확대 조절 추가
메인 서버의 제미나이 구독(Antigravity CLI)으로 만든 그림을 서버에서 바로 넣는 brand_import.py를 추가했다. add-candidate는 그림을 관리자 로고 후보에 넣고 apply는 크기별 PNG 다섯 장으로 로고를 바꾼다. 관리자 화면과 같은 검사와 저장 순서를 쓰고 관리 작업 기록에 남긴다. 그림마다 비용이 드는 API 키 방식은 운영에서 쓰지 않고 안내 문구도 그에 맞췄다.

관리자 로고 적용 화면에 확대(가장자리 잘라내기) 조절을 넣었다. 둥근 사각형 바깥 모서리가 흰 그림은 모서리와 가장자리 색 차이로 알아보고 16% 확대와 가장자리 배경색으로 자동 맞춘다. 쓰이지 않게 된 모서리 색 함수는 뺐다.

검사: test_site_admin 9개 통과(새 운영 도구 시험: 관리자 아닌 아이디 거절·후보 추가·크기 틀린 PNG 거절·적용·기록 순서). 시험 서버에서 제미나이 그림을 올려 자동 확대와 배경색이 맞는 것을 화면으로 확인했다.

운영 반영 뒤 제미나이로 만든 로고 후보 4장(달력과 초승달·낮밤 교대·당직 칸 강조·달력과 시계)을 넣고 1번(달력과 초승달)을 로고로 적용했다.
2026-11-24 01:44:02 +00:00

113 lines
14 KiB
HTML
Raw 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/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="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="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-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 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-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 class="card"><h2>제미나이로 만들기</h2><p id="gemini-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="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="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>