Compare commits

...

11 Commits

14 changed files with 891 additions and 153 deletions

View File

@@ -4,7 +4,7 @@
- 프로젝트명: 10 Minute Planner 웹 UI
- 기술 스택: Vue 3 + Vite + TailwindCSS + JavaScript
- 현재 기준 버전: `v0.1.49` 준비 중
- 현재 기준 버전: `v0.1.56`
- Git 원격 저장소: `https://git.sori.studio/zenn/planner.sori.studio.git`
## 기준 디자인
@@ -38,6 +38,7 @@
- 백엔드 Dockerfile: `backend/Dockerfile`
- nginx 프록시 설정: `deploy/nginx/default.conf`
- 실행 가이드 문서: `README.md`
- 사이트 기본 메타 태그와 파비콘/링크 이미지: `index.html`, `public/assets/favicon.png`, `public/assets/og-image.png`
- Tailwind 설정은 완료되어 있으며, 이 프로젝트의 스타일링 기준으로 유지한다.
- 현재 선택 날짜는 시스템 날짜 기준으로 시작한다.
- `COMMENT`, `TASKS`, `MEMO`는 화면에서 바로 편집할 수 있다.
@@ -49,6 +50,11 @@
- `TIME TABLE`은 우클릭 드래그 시 선택된 블록을 지우는 방식으로도 편집할 수 있다.
- `TIME TABLE` 숫자 영역은 선택/드래그로 텍스트가 잡히지 않도록 막아두었다.
- `TOTAL TIME`은 타임테이블에서 선택된 블록 수를 기준으로 자동 계산된다.
- `TIME TABLE` 라벨은 왼쪽 클릭 시 현재 날짜 타임테이블을 복사하고, 오른쪽 클릭 시 붙여넣기 메뉴를 연다.
- `TIME TABLE` 라벨 오른쪽의 `?` 아이콘으로 복사/붙여넣기 사용법을 바로 볼 수 있다.
- 타임테이블 복사/붙여넣기 결과는 오른쪽 아래 상태 토스트로 바로 안내한다.
- 모바일과 태블릿처럼 `TIME TABLE`이 아래로 내려가는 구간에서는 6칸 그리드가 남는 폭을 더 넓게 채우도록 조정했다.
- 미니 달력의 월 이동, 연도 선택, 날짜 버튼은 `mousedown.prevent`로 포커스만 잡히고 실제 이동은 두 번째 클릭에 되는 느낌을 줄이도록 보정했다.
- 달력은 연/월 이동이 가능하며, 현재 보이는 월과 선택된 날짜 상태를 분리해서 관리한다.
- 달력 상단은 월 좌우 화살표, 클릭형 연도 선택, `TODAY` 버튼 구조로 동작한다.
- 입력 내용이 있는 날짜는 달력 하단에 빨간 점으로 표시된다.
@@ -121,92 +127,10 @@
## 다음 권장 작업
- `TODO.md` 기준으로 작은 단위씩 구현을 진행한다.
- 목표나 통계 기능보다 먼저, 플래너 본문의 입력과 상호작용을 우선 구현한다.
- 통계 화면 구현은 현재 `localStorage`으로 먼저 진행해도 된다.
- DB는 기능 탐색 속도를 해치지 않는 선에서, 저장 레이어를 분리할 수 있는 적절한 시점에 붙이는 것이 좋다.
- 현재 기준 추천 백엔드 방향은 `Vue 프론트엔드 + Node.js API + PostgreSQL`이다.
- Docker 배포를 시작하는 시점이므로 SQLite보다 PostgreSQL을 기본 저장소로 유지하는 편이 낫다.
- 현재 인증 방식은 Bearer 토큰 기반의 간단한 세션 구조이며, 추후 쿠키/리프레시 토큰 전략으로 확장할 수 있다.
- 다음 프론트 단계에서는 `src/lib/plannerStorage.js`를 유지하되, 인증 이후 백엔드 저장소 adapter를 추가해서 `localStorage`와 전환 가능하게 만드는 흐름이 좋다.
- 현재 프론트는 인증만 연결된 상태이고, 플래너 저장은 아직 `localStorage` 기준이다.
- 로그인 상태에서는 플래너 수정 시 날짜별 서버 저장을 예약하고, 로그인 직후에는 서버 데이터를 먼저 가져오도록 연결하기 시작했다.
- 현재는 로컬 저장도 계속 유지하면서 서버 저장을 병행하는 과도기 구조다.
- 로그인 시 서버 플래너 데이터로 `plannerRecords`를 교체하고, 로그아웃 시에는 로컬 저장 기반 데이터로 다시 복귀하도록 정리했다.
- 이로 인해 다른 사용자 로그인 시 이전 로컬 데이터가 서버 계정 데이터와 섞일 위험을 줄였다.
- 로그인 상태에서 특정 날짜의 플래너 내용을 완전히 비우면, 서버 저장 대신 해당 날짜 엔트리를 삭제하도록 정리했다.
- 현재는 로그인 전 플래너 진입을 막고, 인증 후에만 실제 플래너/통계 화면을 사용하도록 변경했다.
- 클라우드 저장 상태는 헤더가 아니라 오른쪽 하단의 작은 토스트 형태로 표시되도록 변경했다.
- 저장 완료 토스트는 한 줄짜리의 작은 상태 문구로 줄여서 존재감을 낮췄다.
- D-DAY는 플래너 안에서 목표를 고르는 구조가 아니라, GOALS 화면에서 목표와 표시 기간을 먼저 설정하는 구조로 정리했다.
- 플래너 화면 오른쪽 패널에서는 현재 날짜에 적용된 목표가 있을 때만 D-DAY 토글을 켤 수 있고, 목표 검색 UI는 제거했다.
- 목표는 `active_from`, `active_until` 기간을 가질 수 있고, 현재 날짜가 그 범위에 들어올 때만 플래너 본문 D-DAY 후보가 된다.
- TASK LABELS도 별도 버튼 2개 대신 동일한 토글 UI로 단순화했다. ON이면 01~15를 채우고 OFF이면 비운다.
- SETTINGS 화면이 추가되어 닉네임, 이메일, 비밀번호 변경을 분리해서 관리할 수 있다.
- 백엔드에는 `/api/auth/profile`, `/api/auth/password`, `/api/goals/:goalId` 수정 API가 추가되었다.
- 백엔드에는 `/api/goals/:goalId` 삭제 API도 추가되었다.
- 왼쪽 사이드, 플래너 본문 래퍼, 오른쪽 정보 패널 모두 둥근 카드 톤으로 맞춰서 화면 전체의 통일감을 높였다.
- 플래너 집중 보기에서는 본문과 오른쪽 패널이 각각 독립 스크롤되도록 바뀌어서 동시에 참조하기 쉽다.
- TASK LABELS, D-DAY 토글은 공통 사이즈의 스위치로 통일했고, `translate` 기반 애니메이션으로 부드럽게 움직이게 했다.
- 목표 생성 폼은 기본적으로 `표시 시작일 = 오늘`, `표시 종료일 = 목표일` 흐름으로 자동 채워진다.
- D-DAY 기간은 서로 겹칠 수 없고, 프론트와 백엔드 모두 중복 기간을 감지하면 저장을 막는다.
- 현재 날짜에 적용된 목표가 있는 경우 D-DAY는 기본적으로 보이고, 해당 날짜에서만 토글로 숨길 수 있다.
- 목표 상태 개념은 제거했고, 목표는 기간이 있으면 곧바로 D-DAY 후보가 되는 단순 구조로 정리했다.
- GOALS 화면에서는 수정 중인 카드가 시각적으로 강조되고, 목표 삭제 버튼이 추가되었다.
- 목표 삭제 시 과거 날짜를 포함해 어떤 날짜에서도 해당 목표는 더 이상 표시되지 않는다.
- 우측 패널의 `PREV SNAPSHOT`은 선택 날짜 이전의 가장 최근 기록을 읽어서 날짜, 집중 시간, 완료 개수, 코멘트 또는 대표 작업을 보여준다.
- 우측 패널의 `READ NEXT`는 다음 날 첫 작업, 오늘의 미완료 작업, 오늘 코멘트를 기반으로 이어보기 문구를 자동 생성한다.
- 백엔드는 SQLite 파일 기반 구조에서 PostgreSQL 연결 구조로 교체되었다.
- `planner_entries.payload`는 문자열이 아니라 PostgreSQL `JSONB`로 저장되도록 바뀌었다.
- `docker-compose.yml` 기준으로 `postgres`, `backend`, `frontend(nginx)` 3개 서비스 초안이 추가되었다.
- 프론트는 nginx에서 `/api`를 백엔드로 프록시하는 구조라서, 배포 시 브라우저가 별도 API 포트를 직접 알 필요가 없다.
- 프론트 API 클라이언트는 `VITE_API_BASE_URL` 끝에 `/api`가 포함되어 있어도 `/api/api/...` 중복 주소가 생기지 않도록 정규화한다.
- 로그인 실패 시에는 내부 라우트 문자열이나 서버 경로를 그대로 노출하지 않고, 사용자용 안내 문구만 보여준다.
- 비로그인 상태에서는 왼쪽 사이드 내비게이션을 숨기고, 중앙 로그인 안내 화면만 보여주도록 정리했다.
- 배포용 `docker-compose.yml`과 별도로 개발용 `docker-compose.dev.yml`을 추가했다.
- 개발용 compose는 프론트 `5173`, 백엔드 `3001`, PostgreSQL `5432`를 열고, 소스 마운트 + Vite HMR + Node watch 기반으로 자동 반영된다.
- 개발/배포 실행 방법은 루트 `README.md`에 먼저 적고, `HANDOFF.md`에는 변경 이유와 주의사항 위주로 남긴다.
- API 클라이언트는 body가 없는 `GET`, `DELETE` 요청에 `Content-Type: application/json`을 붙이지 않도록 수정했다. 날짜 선택 시 발생하던 `Body cannot be empty...` 오류는 이 문제였다.
- 날짜 이동 중 목표 자동 보정으로 `goalEnabled`만 꺼지는 경우에는, 실제 내용이 없는 기록이라면 클라우드 동기화 토스트를 띄우지 않도록 정리했다.
- 집중 보기에서 오른쪽 패널 폭을 넓혀 `1920x1080` 기준 활용도를 높였고, `TASK LABELS / D-DAY / CALENDAR`는 상단 고정 영역으로 올렸다.
- `STATS``NEXT DAY`는 반반 카드가 아니라 각각 한 줄씩 쓰도록 바꿔서 날짜 길이에 따라 높이가 흔들리는 문제를 줄였다.
- 미니 달력은 42칸 기준으로 렌더링하고, 요일 헤더를 `SUN ~ SAT` 순서로 고정해서 일요일 시작 달력 기준을 더 명확하게 맞췄다.
- 집중 보기 오른쪽 패널은 다시 정리해서 `왼쪽 컬럼: CALENDAR / TASK LABELS / D-DAY`, `오른쪽 컬럼: STATS / NEXT DAY`, `하단 전체 폭: READ NEXT / PREV SNAPSHOT` 구조로 맞췄다.
- 달력은 과하게 키우지 않고 컴팩트한 크기를 유지한 채, 우측 정보 패널 내부 배치만 다시 조정하는 쪽으로 방향을 잡았다.
- `PRINT 2-UP`은 브라우저/프린터 기본 여백 차이로 오른쪽 페이지가 잘릴 수 있어서, 프레임 폭과 스케일을 조금 더 보수적으로 줄여 안정성을 높였다.
- 플래너 집중 보기 반응형 기준은 `1620px 이상: 우측 패널 2열`, `1280px 이상 ~ 1619px 이하: 우측 패널 1열 + 최대 360px`, `1280px 미만: 우측 패널 오버레이` 구조로 다시 정리했다.
- 오버레이 구간에서는 본문 오른쪽 위의 `OPEN SIDE PANEL` 버튼으로 패널을 열고, 배경 클릭이나 `CLOSE` 버튼으로 닫는다.
- `2 PAGE SPREAD`는 화면 폭을 기준으로 배율을 자동 계산해서 오른쪽 페이지가 잘리는 현상을 줄이는 방향으로 조정했다.
- `1280px` 미만에서는 왼쪽 내비게이션도 본문 위에 쌓이지 않고 `MENU` 버튼으로 여는 드로어형 패널로 전환된다.
- 태블릿/모바일 구간에서는 `왼쪽 내비게이션 드로어 + 오른쪽 정보 패널 오버레이 + 본문 단일 컬럼` 조합으로 보는 흐름을 기본값으로 삼는다.
- 통계 화면과 우측 `FOCUSED TIME` 요약처럼 사용자에게 보여주는 집중 시간 표기는 `00H 00M` 대신 `00시간 00분` 한글 형식으로 바꿨다.
- 좌측 메뉴 드로어와 우측 정보 패널 오버레이는 이제 열고 닫힐 때 페이드 + 슬라이드 애니메이션이 적용된다.
- 모바일처럼 좁은 화면에서는 본문 래퍼 패딩을 조금 줄이고, 우측 패널 열기 버튼 문구를 `INFO`로 축약해 밀도를 낮췄다.
- 플래너 본문은 작은 화면에서 상단 정보 영역이 세로로 쌓이고, `TIME TABLE`이 아래로 내려가도록 조정했다.
- 모바일 구간에서는 TASKS / MEMO 행 높이와 좌우 패딩을 조금 줄여 입력 밀도를 낮췄고, 타임테이블은 필요할 때만 최소 가로 스크롤이 생기도록 바뀌었다.
- 미니 달력은 모바일 구간에서 패딩, 월 이동 버튼, 요일 헤더, 날짜 셀 크기를 한 단계 더 줄여서 카드 내부 밀도를 정리했다.
- 연도 선택 팝오버는 좁은 화면에서 카드 전체 폭을 활용하고, 넓은 화면에서는 기존 우측 드롭다운 폭을 유지한다.
- 플래너 본문 안의 `TOTAL TIME` 라벨도 `총 시간`으로 바꿔서 영어 라벨을 줄였다.
- 사용자 노출 메뉴 문구는 `보기 방식 / 날짜 이동 / 인쇄 / 1페이지 + 정보 / 2페이지 펼침 / 이전 날 / 다음 날 / 1장 인쇄 / 2장 인쇄`처럼 한글 중심으로 정리하기 시작했다.
- 2페이지 펼침 보기 배율 계산에서 데스크톱 여유 폭을 더 보수적으로 잡아, `1920px` 근처에서 우측 페이지가 잘려 가로 스크롤이 생기던 문제를 줄이는 방향으로 조정했다.
- 달력 날짜 버튼은 셀 안쪽에 고정 크기 원형 버튼으로 다시 배치해서 모바일에서 서로 겹쳐 보이는 현상을 줄였다.
- 좌측 상단 소개 영역은 개발 설명 문장을 빼고, 서비스 소개용 짧은 카피와 배지 스타일로 다시 구성했다.
- 달력 날짜 버튼은 의도상 원형이며, 현재는 `size` 고정 기준으로 다시 맞춰서 타원처럼 보이는 인상을 줄이는 방향으로 정리했다.
- 플래너 본문, 2페이지 펼침, 인쇄 전용 `PlannerPage` 모두 `총 시간` 값은 `00시간 00분` 한글 포맷으로 통일했다.
- 모바일 대응 이후 인쇄에서 `TIME TABLE`이 사라지던 문제를 막기 위해, print 시에는 `PlannerPage` 내부 레이아웃을 다시 가로 배치로 고정하고 타임테이블 오버플로를 해제하도록 보정했다.
- 인쇄 레이아웃은 추가로 미세 조정해 `COMMENT` 영역이 잘리지 않도록 textarea 높이/행간을 print 전용으로 풀고, `1-UP` / `2-UP` 배율도 프레임 실측 기준으로 다시 계산했다.
- `TODO.md`는 중복 체크 항목을 정리했고, 인증 확장을 위해 `이메일 인증 / 비밀번호 재설정 / rate limit / 메일 인프라` 작업을 별도 항목으로 추가했다.
- 메일 발송은 현재 Resend 기준으로 운영한다. 도메인 정책이나 플랜 조건이 실제 운영과 어긋나는 시점이 오면 그때 대체 수단을 재검토한다.
- 현재 인증 메일/재설정 메일은 실제 발송 대신 개발용 `previewUrl`을 응답으로 돌려주는 단계다. 프론트 UI 연결과 실제 메일러 연결은 다음 단계에서 마무리하면 된다.
- 미니 달력 날짜 버튼은 원형 비율이 흔들리지 않도록 고정 `width/height` 기준으로 다시 맞췄다.
- 플래너 본문 D-DAY 텍스트는 3줄까지만 보이고, 넘치면 말줄임 처리되도록 정리했다.
- 목표가 없는 빈 날짜에서는 `D-DAY 사용` 토글이 저장 상태와 무관하게 `OFF + 비활성`처럼 보이도록 보정했다.
- 관리자 전용 `ADMIN` 메뉴와 기본 대시보드가 추가되었다. 현재는 사용자 수, 최근 접속, 문서 수, 목표 수, 계정별 최종 접속일을 읽기 전용으로 확인할 수 있다.
- `users` 테이블에 `login_id`, `role`, `last_login_at` 컬럼이 추가되었다.
- 관리자 계정은 이제 이메일이 아니라 별도 자동 생성 계정으로 관리한다.
- 관리자 계정은 서버 시작 시 `ADMIN_ACCOUNT_ID`, `ADMIN_ACCOUNT_PASSWORD`, `ADMIN_ACCOUNT_EMAIL`, `ADMIN_ACCOUNT_NICKNAME` 환경변수 조합으로 자동 생성된다.
- 관리자 아이디와 비밀번호는 저장소 문서에 실제 값을 남기지 않고, Docker 배포 시 루트 `.env` 같은 비공개 환경변수 파일에서만 관리한다.
- 관리자 대시보드는 현재 읽기 전용이며, 계정 정지/삭제/강제 로그아웃 같은 실제 운영 액션은 아직 없다.
- 목표 화면에 완료 처리와 보관 상태를 분리해서, 진행 중 목표와 지난 목표를 더 명확하게 나눈다.
- `READ NEXT`의 자동 제안 규칙을 더 자연스럽게 다듬고, 빈 상태 문구도 상황별로 정리한다.
- 공유용 이미지 저장 기능을 인쇄 레이아웃과 같은으로 설계하고 구현한다.
- 로그인/인증 관련 rate limit 정책을 정해서 무차별 대입 시도를 방어한다.
- 배포용 `docker-compose.yml`은 현재 PostgreSQL 외부 포트 `45432`, 프론트 외부 포트 `48081` 기준이며, DB 계정/비밀번호는 루트 `.env`에서 주입한다.
- 설정 화면의 보조 메모 카드는 주석 처리되어 현재는 보이지 않는다.
- 비로그인 랜딩 카드는 상단 고정이 아니라 화면 중앙에 오도록 정렬을 수정했다.
@@ -231,6 +155,7 @@
- 프론트는 `/verify-email?token=...` 진입 시 인증을 바로 확정하고 로그인 모달에 결과 메시지를 띄운다. `/reset-password?token=...`은 기존처럼 비밀번호 재설정 모달을 연다.
- 로그인 모달에는 `이메일 인증 메일 다시 보내기` 버튼이 추가되었다. 이메일 주소를 입력한 상태에서 바로 인증 메일 재전송을 요청할 수 있어, 가입 후 메일을 못 받은 사용자가 로그인 단계에서 막히지 않게 했다.
- 인증 메일 재전송 버튼은 항상 보이지 않는다. 로그인 모달에서 이메일 인증 관련 안내 메시지가 보일 때만 메시지 박스 오른쪽에 함께 노출한다.
- 인증 메일 재전송 버튼은 현재 `이메일 인증을 완료한 뒤 로그인해 주세요.` 안내가 있을 때만 표시한다. 인증 완료 메시지나 일반 안내 문구에서는 보이지 않도록 조건을 좁혔다.
- SETTINGS 화면에 일반 사용자 전용 `회원 탈퇴` 카드가 추가되었다. 현재 비밀번호 확인 후 계정, 플래너 기록, 목표, 세션, 인증 토큰이 함께 삭제된다. 기본 관리자 계정은 이 경로에서 삭제하지 못하게 막는다.
- `/api/auth/logout`이 추가되어 로그아웃 시 프론트 저장 토큰만 지우는 것이 아니라 서버 세션도 함께 폐기한다.
- SETTINGS 화면 왼쪽 카드에 현재 기기 로그인 유지 방식(`로그인 유지` 또는 브라우저 세션만 유지), 최근 로그인 시각, 이메일 인증 상태를 보여준다.
@@ -257,6 +182,9 @@
- `BEST DAY`는 선택 기간 안에서 집중 시간이 가장 긴 날짜를 고르고, `RECENT RECORDS`는 선택 기간 안의 기록을 날짜 내림차순으로 최대 5개 보여준다.
- `CARRYOVER TASK` 선택 모달은 ESC로 닫힌다. 이월 배지의 시작일 안내는 오른쪽 패널 메시지 대신 배지 옆 팝업으로 표시한다.
- 통계의 `BEST DAY`, `RECENT RECORDS` 기준 설명은 본문 문장 대신 물음표 가이드 팝업으로 제공한다.
- 운영 링크 미리보기용 title/description/Open Graph/Twitter Card 메타 태그를 추가했다. 루트 PNG 요청이 앞단 프록시에서 403이 나는 환경을 피하기 위해 파비콘은 `/assets/favicon.png`, 링크 카드 이미지는 `/assets/og-image.png` 경로로 제공한다.
- 모바일 focus 화면에서는 플래너 바깥 래핑 카드의 padding을 제거해 플래너 자체 여백만 남긴다.
- 모바일 타임테이블은 일반 터치/스크롤 중에는 칠하지 않고, 약 420ms 롱터치가 성립된 뒤에만 드래그 편집을 시작한다.
## 갱신 규칙

View File

@@ -18,6 +18,7 @@
- [x] `TIME TABLE`을 마우스 드래그로 칠할 수 있게 만든다.
- [x] `TIME TABLE` 드래그가 여러 줄을 지나가더라도 시간 흐름 기준으로 연속 선택되도록 처리한다.
- [x] 선택된 `TIME TABLE` 구간을 기준으로 `TOTAL TIME`을 자동 계산한다.
- [x] 원하는 날짜의 `TIME TABLE`을 다른 날짜로 복사할 수 있게 한다.
## 2단계: 달력과 이동 기능
@@ -33,6 +34,7 @@
- [x] 달력 상단은 좌우 화살표로 월 이동하는 구조가 더 적합하다.
- [x] 연도 클릭 시 연도 선택 UI가 열려야 한다.
- [x] 오늘 날짜로 즉시 돌아가는 버튼이 필요하다.
- [x] 모바일에서 플래너 래핑 카드 여백을 줄이고 타임테이블은 롱터치 후 드래그로만 편집되게 한다.
## 3단계: 목표와 회고 기능
@@ -87,6 +89,7 @@
- [ ] 공유를 위한 이미지 저장 기능을 추가한다.
- [x] Docker 배포 구조를 정리한다.
- [x] UGREEN NAS 기준 `docker-compose.yml` 초안을 작성한다.
- [x] 운영 링크 미리보기용 사이트 제목/소개글 메타 태그와 파비콘을 추가한다.
- [x] 백엔드 기본 스캐폴딩을 추가한다.
- [x] PostgreSQL 전환 초안을 적용한다.
- [x] 로그인 화면 문구와 관리자 정보 노출 지점을 일반 사용자 기준으로 정리한다.
@@ -102,5 +105,5 @@
- [x] 서버 세션을 명시적으로 폐기하는 로그아웃 API를 추가한다.
- [x] 메일 발송 인프라와 발신 도메인 정책을 Resend 기준으로 확정한다.
- [x] 관리자 페이지에서 계정 비활성화 / 강제 로그아웃 / 삭제 기능을 추가한다.
- [ ] 관리자 페이지에서 사용자별 문서 상세 조회 기능을 추가한다.
- [ ] 관리자 페이지에서 검색 / 정렬 / 필터 UX를 추가한다.
- [x] 관리자 페이지에서 사용자별 문서 상세 조회 기능을 추가한다.
- [x] 관리자 페이지에서 검색 / 정렬 / 필터 UX를 추가한다.

View File

@@ -112,6 +112,89 @@ export async function registerAdminRoutes(app) {
}
})
app.get('/api/admin/users/:userId/detail', async (request, reply) => {
const adminUser = await requireAdminUser(request, reply)
if (!adminUser) {
return
}
const userIdResult = adminUserIdSchema.safeParse(request.params.userId)
if (!userIdResult.success) {
return reply.code(400).send({
message: '대상 사용자 값이 올바르지 않습니다.',
})
}
const userId = userIdResult.data
const detailResult = await db.execute(sql`
select
u.id,
u.nickname,
u.email,
u.role,
u.disabled_at as "disabledAt",
u.created_at as "createdAt",
u.updated_at as "updatedAt",
u.email_verified_at as "emailVerifiedAt",
u.last_login_at as "lastLoginAt",
count(distinct pe.id)::int as "plannerEntryCount",
count(distinct g.id)::int as "goalCount",
count(distinct s.id)::int as "activeSessionCount"
from users u
left join planner_entries pe on pe.user_id = u.id
left join goals g on g.user_id = u.id
left join auth_sessions s on s.user_id = u.id and s.expires_at > now()
where u.id = ${userId}
group by u.id
limit 1
`)
const detailUser = detailResult.rows[0]
if (!detailUser) {
return reply.code(404).send({
message: '대상 사용자를 찾을 수 없습니다.',
})
}
const plannerEntriesResult = await db.execute(sql`
select
entry_date as "entryDate",
payload,
created_at as "createdAt",
updated_at as "updatedAt"
from planner_entries
where user_id = ${userId}
order by entry_date desc
limit 12
`)
const goalsResult = await db.execute(sql`
select
id,
title,
target_date as "targetDate",
active_from as "activeFrom",
active_until as "activeUntil",
color,
created_at as "createdAt",
updated_at as "updatedAt"
from goals
where user_id = ${userId}
order by updated_at desc, id desc
limit 20
`)
return {
user: detailUser,
plannerEntries: plannerEntriesResult.rows,
goals: goalsResult.rows,
}
})
app.put('/api/admin/users/:userId/status', async (request, reply) => {
const adminUser = await requireAdminUser(request, reply)

View File

@@ -3,7 +3,32 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>10분 플래너</title>
<meta name="theme-color" content="#f5f2eb" />
<meta
name="description"
content="10분 단위로 하루를 기록하고 계획하는 차분한 종이 다이어리형 플래너입니다."
/>
<meta property="og:type" content="website" />
<meta property="og:locale" content="ko_KR" />
<meta property="og:site_name" content="10 Minute Planner" />
<meta property="og:title" content="10 Minute Planner" />
<meta
property="og:description"
content="10분 단위로 하루를 기록하고 계획하는 차분한 종이 다이어리형 플래너입니다."
/>
<meta property="og:image" content="/assets/og-image.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="1731" />
<meta property="og:image:height" content="909" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="10 Minute Planner" />
<meta
name="twitter:description"
content="10분 단위로 하루를 기록하고 계획하는 차분한 종이 다이어리형 플래너입니다."
/>
<meta name="twitter:image" content="/assets/og-image.png" />
<link rel="icon" type="image/png" href="/assets/favicon.png" />
<title>10 Minute Planner</title>
</head>
<body class="bg-stone-100">
<div id="app"></div>

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "ten-minute-planner",
"version": "0.1.49",
"version": "0.1.56",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "ten-minute-planner",
"version": "0.1.49",
"version": "0.1.56",
"dependencies": {
"vue": "^3.5.13"
},

View File

@@ -1,7 +1,7 @@
{
"name": "ten-minute-planner",
"private": true,
"version": "0.1.49",
"version": "0.1.56",
"type": "module",
"scripts": {
"dev": "vite",

BIN
public/assets/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
public/assets/og-image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@@ -11,6 +11,7 @@ import StatsDashboard from './components/StatsDashboard.vue'
import {
deleteAdminUser,
fetchAdminOverview,
fetchAdminUserDetail,
revokeAdminUserSessions,
updateAdminUserStatus,
} from './lib/adminApi'
@@ -43,6 +44,7 @@ const GUIDE_TOOLTIP_STORAGE_KEY = 'ten-minute-guide-tooltips-hidden'
const DDAY_DISABLED_STORAGE_KEY = 'ten-minute-dday-disabled-dates'
const CARRYOVER_CHECK_POLICY_STORAGE_KEY = 'ten-minute-carryover-check-policy'
const CARRYOVER_CHECK_POLICIES = ['ask', 'all', 'current']
const TIMETABLE_CLIPBOARD_PREFIX = 'TEN_MINUTE_TIMETABLE:'
const screenMode = ref('planner')
const viewMode = ref('focus')
const printLayout = ref('single')
@@ -114,6 +116,7 @@ const hiddenGuideTooltips = ref(readHiddenGuideTooltips())
const ddayDisabledDateKeys = ref(readDdayDisabledDateKeys())
const adminBusy = ref(false)
const adminActionUserId = ref(null)
const adminDetailBusy = ref(false)
const adminMessage = ref('')
const adminOverview = ref({
totalUsers: 0,
@@ -127,6 +130,16 @@ const adminOverview = ref({
})
const adminUsers = ref([])
const adminRecentLogins = ref([])
const adminSelectedUserId = ref(null)
const adminUserDetail = ref(null)
const timetableClipboard = ref(null)
const timetableContextMenu = ref({
open: false,
x: 0,
y: 0,
dateKey: '',
record: null,
})
const hours = [
'6', '7', '8', '9', '10', '11', '12',
@@ -516,6 +529,7 @@ const secondaryDate = computed(() => {
})
const secondaryPlanner = computed(() => getPlannerRecord(secondaryDate.value))
const secondaryDateKey = computed(() => toKey(secondaryDate.value))
function getDateDisplay(date) {
const main = `${date.getFullYear()}. ${`${date.getMonth() + 1}`.padStart(2, '0')}. ${`${date.getDate()}`.padStart(2, '0')}.`
@@ -653,7 +667,7 @@ const showVerificationResend = computed(() => {
return false
}
return authMessage.value.includes('이메일 인증')
return authMessage.value.includes('이메일 인증을 완료한 뒤 로그인해 주세요.')
})
const filteredGoals = computed(() => {
const query = goalQuery.value.trim().toLowerCase()
@@ -908,6 +922,11 @@ function handleGlobalKeydown(event) {
event.preventDefault()
closeCarryoverCheckPrompt()
}
if (event.key === 'Escape' && timetableContextMenu.value.open) {
event.preventDefault()
closeTimetableContextMenu()
}
}
function clearTasks(record, indexes) {
@@ -965,6 +984,115 @@ function carryIncompleteTasksToNextDay() {
: `${nextDateLabel} 빈칸 ${copyCount}개까지만 이월했습니다.`
}
function normalizeTimetableClipboard(candidate) {
if (!candidate || typeof candidate !== 'object') {
return null
}
const sourceDateKey = typeof candidate.sourceDateKey === 'string' ? candidate.sourceDateKey : ''
const timetable = Array.isArray(candidate.timetable) ? candidate.timetable : []
if (!sourceDateKey || timetable.length !== timetableCellCount || timetable.some((value) => typeof value !== 'boolean')) {
return null
}
return {
sourceDateKey,
timetable: [...timetable],
}
}
async function copyTimetableToClipboard(record, sourceDateKey) {
const clipboardPayload = normalizeTimetableClipboard({
sourceDateKey,
timetable: record.timetable,
})
if (!clipboardPayload) {
setSyncFeedback('local', '복사할 타임테이블을 찾지 못했습니다.')
return
}
timetableClipboard.value = clipboardPayload
let copiedToSystemClipboard = false
try {
if (typeof navigator !== 'undefined' && navigator.clipboard?.writeText) {
await navigator.clipboard.writeText(
`${TIMETABLE_CLIPBOARD_PREFIX}${JSON.stringify(clipboardPayload)}`,
)
copiedToSystemClipboard = true
}
} catch (error) {
copiedToSystemClipboard = false
}
setSyncFeedback(
'local',
copiedToSystemClipboard
? `${createDateLabel(sourceDateKey)} 타임테이블을 클립보드에 저장했습니다.`
: `${createDateLabel(sourceDateKey)} 타임테이블을 앱 안에 복사했습니다.`,
)
}
function pasteTimetableFromClipboard(record, targetDateKey, clipboardPayload = timetableClipboard.value) {
const normalizedClipboard = normalizeTimetableClipboard(clipboardPayload)
if (!normalizedClipboard) {
setSyncFeedback('local', '붙여넣을 타임테이블이 없습니다.')
return
}
record.timetable = [...normalizedClipboard.timetable]
schedulePlannerSyncForRecord(record)
timetableClipboard.value = normalizedClipboard
setSyncFeedback(
'local',
normalizedClipboard.timetable.some(Boolean)
? `${createDateLabel(normalizedClipboard.sourceDateKey)} 타임테이블을 ${createDateLabel(targetDateKey)}에 붙여넣었습니다.`
: `${createDateLabel(normalizedClipboard.sourceDateKey)} 타임테이블이 비어 있어 ${createDateLabel(targetDateKey)}도 비웠습니다.`,
)
}
async function handleTimetableHeaderAction(record, dateKey) {
closeTimetableContextMenu()
await copyTimetableToClipboard(record, dateKey)
}
function openTimetableContextMenu(record, dateKey, event) {
timetableContextMenu.value = {
open: true,
x: event.clientX,
y: event.clientY,
dateKey,
record,
}
}
function closeTimetableContextMenu() {
timetableContextMenu.value = {
open: false,
x: 0,
y: 0,
dateKey: '',
record: null,
}
}
function pasteTimetableToContextTarget() {
const { record, dateKey } = timetableContextMenu.value
if (!record || !dateKey) {
closeTimetableContextMenu()
return
}
pasteTimetableFromClipboard(record, dateKey)
closeTimetableContextMenu()
}
function updateMemo(record, { index, value }) {
record.memo[index].text = value
schedulePlannerSyncForRecord(record)
@@ -1715,6 +1843,8 @@ function clearAuthenticatedState() {
adminMessage.value = ''
adminUsers.value = []
adminRecentLogins.value = []
adminSelectedUserId.value = null
adminUserDetail.value = null
accountDeleteMessage.value = ''
adminOverview.value = {
totalUsers: 0,
@@ -1757,6 +1887,8 @@ async function loadAdminDashboard() {
if (!authToken.value || !isAdmin.value) {
adminUsers.value = []
adminRecentLogins.value = []
adminSelectedUserId.value = null
adminUserDetail.value = null
adminMessage.value = ''
return
}
@@ -1776,6 +1908,35 @@ async function loadAdminDashboard() {
}
}
async function loadAdminUserDetail(userId) {
if (!authToken.value || !isAdmin.value) {
return
}
adminDetailBusy.value = true
try {
const result = await fetchAdminUserDetail(authToken.value, userId)
adminSelectedUserId.value = userId
adminUserDetail.value = result
adminMessage.value = ''
} catch (error) {
adminMessage.value = error.message || '사용자 상세 정보를 불러오지 못했습니다.'
} finally {
adminDetailBusy.value = false
}
}
function selectAdminUser(user) {
if (adminSelectedUserId.value === user.id && adminUserDetail.value) {
adminSelectedUserId.value = null
adminUserDetail.value = null
return
}
void loadAdminUserDetail(user.id)
}
async function toggleAdminUserStatus(user) {
const willDisable = !user.disabledAt
const confirmed = window.confirm(
@@ -1794,6 +1955,9 @@ async function toggleAdminUserStatus(user) {
const result = await updateAdminUserStatus(authToken.value, user.id, willDisable)
adminMessage.value = result.message || '계정 상태를 변경했습니다.'
await loadAdminDashboard()
if (adminSelectedUserId.value === user.id) {
await loadAdminUserDetail(user.id)
}
} catch (error) {
adminMessage.value = error.message || '계정 상태를 변경하지 못했습니다.'
} finally {
@@ -1814,6 +1978,9 @@ async function revokeAdminSessions(user) {
const result = await revokeAdminUserSessions(authToken.value, user.id)
adminMessage.value = result.message || '사용자 세션을 정리했습니다.'
await loadAdminDashboard()
if (adminSelectedUserId.value === user.id) {
await loadAdminUserDetail(user.id)
}
} catch (error) {
adminMessage.value = error.message || '사용자 세션을 종료하지 못했습니다.'
} finally {
@@ -1834,6 +2001,10 @@ async function removeAdminUser(user) {
const result = await deleteAdminUser(authToken.value, user.id)
adminMessage.value = result.message || '사용자 계정을 삭제했습니다.'
await loadAdminDashboard()
if (adminSelectedUserId.value === user.id) {
adminSelectedUserId.value = null
adminUserDetail.value = null
}
} catch (error) {
adminMessage.value = error.message || '사용자 계정을 삭제하지 못했습니다.'
} finally {
@@ -2794,8 +2965,8 @@ onBeforeUnmount(() => {
/>
</Transition>
<div class="scrollbar-hide print-target border border-white/60 bg-white/45 xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-3" :class="isCompactMobile ? 'rounded-[24px] p-3' : 'rounded-[28px] p-4'">
<div v-if="isOverlayFocusSidebar" class="mb-4 flex justify-end">
<div class="scrollbar-hide print-target border border-white/60 bg-white/45 xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-3" :class="isCompactMobile ? 'rounded-[24px] p-2' : 'rounded-[28px] p-4'">
<div v-if="isOverlayFocusSidebar" class="mb-3 flex justify-end px-2 sm:px-0">
<button
type="button"
class="rounded-full border border-stone-200 bg-white px-4 py-2 text-[11px] font-bold tracking-[0.16em] text-stone-700 transition hover:border-stone-400 hover:text-ink"
@@ -2804,27 +2975,29 @@ onBeforeUnmount(() => {
{{ isCompactMobile ? 'INFO' : 'OPEN SIDE PANEL' }}
</button>
</div>
<PlannerPage
:date-main="selectedDateDisplay.main"
:date-weekday="selectedDateDisplay.weekday"
:date-weekday-tone="selectedDateDisplay.weekdayTone"
:dday="plannerDday"
:show-dday="showPlannerDday"
:comment="planner.comment"
:total-time="formatTotalTimeKorean(planner)"
:tasks="planner.tasks"
:memo="planner.memo"
:hours="hours"
:timetable="planner.timetable"
@update:comment="updateComment(planner, $event)"
@update:task-label="updateTaskLabel(planner, $event)"
@update:task-title="updateTaskTitle(planner, $event)"
@toggle:task="toggleTask(planner, $event)"
@clear:tasks="clearTasks(planner, $event)"
@update:memo-label="updateMemoLabel(planner, $event)"
@update:memo="updateMemo(planner, $event)"
@update:timetable="updateTimetable(planner, $event)"
/>
<PlannerPage
:date-main="selectedDateDisplay.main"
:date-weekday="selectedDateDisplay.weekday"
:date-weekday-tone="selectedDateDisplay.weekdayTone"
:dday="plannerDday"
:show-dday="showPlannerDday"
:comment="planner.comment"
:total-time="formatTotalTimeKorean(planner)"
:tasks="planner.tasks"
:memo="planner.memo"
:hours="hours"
:timetable="planner.timetable"
@update:comment="updateComment(planner, $event)"
@update:task-label="updateTaskLabel(planner, $event)"
@update:task-title="updateTaskTitle(planner, $event)"
@toggle:task="toggleTask(planner, $event)"
@clear:tasks="clearTasks(planner, $event)"
@update:memo-label="updateMemoLabel(planner, $event)"
@update:memo="updateMemo(planner, $event)"
@update:timetable="updateTimetable(planner, $event)"
@timetable-action="handleTimetableHeaderAction(planner, selectedDateKey)"
@timetable-contextmenu="openTimetableContextMenu(planner, selectedDateKey, $event)"
/>
</div>
<aside
@@ -3144,6 +3317,8 @@ onBeforeUnmount(() => {
@update:memo-label="updateMemoLabel(planner, $event)"
@update:memo="updateMemo(planner, $event)"
@update:timetable="updateTimetable(planner, $event)"
@timetable-action="handleTimetableHeaderAction(planner, selectedDateKey)"
@timetable-contextmenu="openTimetableContextMenu(planner, selectedDateKey, $event)"
/>
</div>
<div class="print-hidden overflow-hidden" :style="spreadPageFrameStyle">
@@ -3168,6 +3343,8 @@ onBeforeUnmount(() => {
@update:memo-label="updateMemoLabel(secondaryPlanner, $event)"
@update:memo="updateMemo(secondaryPlanner, $event)"
@update:timetable="updateTimetable(secondaryPlanner, $event)"
@timetable-action="handleTimetableHeaderAction(secondaryPlanner, secondaryDateKey)"
@timetable-contextmenu="openTimetableContextMenu(secondaryPlanner, secondaryDateKey, $event)"
/>
</div>
</div>
@@ -3223,10 +3400,14 @@ onBeforeUnmount(() => {
class="scrollbar-hide print-hidden xl:h-full xl:overflow-y-auto"
:summary="adminOverview"
:users="adminUsers"
:selected-user-id="adminSelectedUserId"
:user-detail="adminUserDetail"
:recent-logins="adminRecentLogins"
:busy="adminBusy"
:action-busy-user-id="adminActionUserId"
:detail-busy="adminDetailBusy"
:message="adminMessage"
@select-user="selectAdminUser"
@toggle-user-status="toggleAdminUserStatus"
@revoke-user-sessions="revokeAdminSessions"
@delete-user="removeAdminUser"
@@ -3282,6 +3463,42 @@ onBeforeUnmount(() => {
</div>
</div>
<div
v-if="timetableContextMenu.open"
class="print-hidden fixed inset-0 z-40"
@click="closeTimetableContextMenu"
@contextmenu.prevent="closeTimetableContextMenu"
>
<section
class="absolute z-50 min-w-[220px] rounded-[24px] border border-stone-200 bg-white p-3 shadow-[0_24px_80px_rgba(28,25,23,0.18)]"
:style="{
left: `${Math.min(timetableContextMenu.x, windowWidth - 236)}px`,
top: `${timetableContextMenu.y}px`,
}"
@click.stop
@contextmenu.prevent
>
<p class="px-2 pb-2 text-[10px] font-bold uppercase tracking-[0.2em] text-stone-500">Time Table Menu</p>
<button
type="button"
class="flex w-full items-center justify-between rounded-2xl px-3 py-3 text-left text-sm font-semibold transition"
:class="timetableClipboard ? 'text-stone-800 hover:bg-[#f7f2ea]' : 'cursor-not-allowed text-stone-400'"
:disabled="!timetableClipboard"
@click="pasteTimetableToContextTarget"
>
<span>현재 날짜에 붙여넣기</span>
<span class="text-[10px] font-bold tracking-[0.14em] text-stone-400">
{{ timetableClipboard ? '준비됨' : '비어 있음' }}
</span>
</button>
<p
class="mt-2 rounded-2xl bg-[#faf7f2] px-3 py-3 text-[11px] font-semibold leading-5 text-stone-500"
>
{{ timetableClipboard ? `${createDateLabel(timetableClipboard.sourceDateKey)} 타임테이블이 복사되어 있습니다.` : '먼저 다른 날짜의 TIME TABLE 라벨을 왼쪽 클릭해 복사해 주세요.' }}
</p>
</section>
</div>
<AuthDialog
:open="authDialogOpen"
:mode="authMode"
@@ -3449,7 +3666,7 @@ onBeforeUnmount(() => {
leave-to-class="translate-y-2 opacity-0"
>
<div
v-if="isAuthenticated && syncToastVisible"
v-if="syncToastVisible"
class="pointer-events-none fixed bottom-5 right-5 z-40 max-w-[240px] rounded-full border border-stone-200/70 bg-white/80 px-3 py-2 shadow-[0_10px_24px_rgba(28,25,23,0.08)] backdrop-blur"
>
<p

View File

@@ -1,4 +1,6 @@
<script setup>
import { computed, ref } from 'vue'
const props = defineProps({
summary: {
type: Object,
@@ -8,6 +10,14 @@ const props = defineProps({
type: Array,
required: true,
},
selectedUserId: {
type: Number,
default: null,
},
userDetail: {
type: Object,
default: null,
},
recentLogins: {
type: Array,
required: true,
@@ -24,14 +34,23 @@ const props = defineProps({
type: Number,
default: null,
},
detailBusy: {
type: Boolean,
default: false,
},
})
const emit = defineEmits([
'select-user',
'toggle-user-status',
'revoke-user-sessions',
'delete-user',
])
const userSearch = ref('')
const userStatusFilter = ref('all')
const userSort = ref('lastLoginDesc')
function formatDate(value) {
if (!value) {
return '기록 없음'
@@ -51,6 +70,83 @@ function formatDate(value) {
minute: '2-digit',
}).format(date)
}
function getPlannerSummary(payload) {
if (!payload || typeof payload !== 'object') {
return {
comment: '코멘트 없음',
taskCount: 0,
completedCount: 0,
memoCount: 0,
}
}
const tasks = Array.isArray(payload.tasks) ? payload.tasks : []
const memo = Array.isArray(payload.memo) ? payload.memo : []
const activeTasks = tasks.filter((task) => task?.title?.trim?.())
return {
comment: payload.comment?.trim?.() || '코멘트 없음',
taskCount: activeTasks.length,
completedCount: activeTasks.filter((task) => task.checked).length,
memoCount: memo.filter((item) => item?.text?.trim?.() || item?.label?.trim?.()).length,
}
}
const filteredUsers = computed(() => {
const search = userSearch.value.trim().toLowerCase()
const filtered = props.users.filter((user) => {
const matchesSearch = !search
|| String(user.id).includes(search)
|| user.nickname?.toLowerCase().includes(search)
|| user.email?.toLowerCase().includes(search)
if (!matchesSearch) {
return false
}
switch (userStatusFilter.value) {
case 'active':
return !user.disabledAt && user.isActiveRecently
case 'disabled':
return Boolean(user.disabledAt)
case 'unverified':
return !user.emailVerifiedAt
case 'admin':
return user.role === 'admin'
case 'member':
return user.role !== 'admin'
default:
return true
}
})
return [...filtered].sort((left, right) => {
switch (userSort.value) {
case 'plannerDesc':
return right.plannerEntryCount - left.plannerEntryCount || right.id - left.id
case 'goalDesc':
return right.goalCount - left.goalCount || right.id - left.id
case 'createdDesc':
return new Date(right.createdAt || 0).getTime() - new Date(left.createdAt || 0).getTime() || right.id - left.id
case 'nicknameAsc':
return String(left.nickname || '').localeCompare(String(right.nickname || ''), 'ko')
case 'lastLoginDesc':
default:
return new Date(right.lastLoginAt || right.createdAt || 0).getTime()
- new Date(left.lastLoginAt || left.createdAt || 0).getTime()
|| right.id - left.id
}
})
})
const filteredUsersSummary = computed(() => {
const total = filteredUsers.value.length
const disabled = filteredUsers.value.filter((user) => user.disabledAt).length
const active = filteredUsers.value.filter((user) => !user.disabledAt && user.isActiveRecently).length
return { total, disabled, active }
})
</script>
<template>
@@ -143,6 +239,53 @@ function formatDate(value) {
{{ message }}
</p>
<div class="mt-5 grid gap-3 rounded-[24px] border border-stone-200 bg-[#fcfaf6] p-4 md:grid-cols-[minmax(0,1.2fr)_180px_180px]">
<label class="grid gap-2">
<span class="text-[10px] font-bold uppercase tracking-[0.18em] text-stone-500">검색</span>
<input
v-model="userSearch"
type="text"
placeholder="닉네임, 이메일, ID 검색"
class="h-11 rounded-2xl border border-stone-200 bg-white px-4 text-sm font-semibold text-stone-700 outline-none transition placeholder:text-stone-400 focus:border-stone-400"
/>
</label>
<label class="grid gap-2">
<span class="text-[10px] font-bold uppercase tracking-[0.18em] text-stone-500">상태 필터</span>
<select
v-model="userStatusFilter"
class="h-11 rounded-2xl border border-stone-200 bg-white px-4 text-sm font-semibold text-stone-700 outline-none transition focus:border-stone-400"
>
<option value="all">전체 사용자</option>
<option value="active">최근 활동</option>
<option value="disabled">비활성화</option>
<option value="unverified">미인증</option>
<option value="member">일반 사용자</option>
<option value="admin">관리자</option>
</select>
</label>
<label class="grid gap-2">
<span class="text-[10px] font-bold uppercase tracking-[0.18em] text-stone-500">정렬</span>
<select
v-model="userSort"
class="h-11 rounded-2xl border border-stone-200 bg-white px-4 text-sm font-semibold text-stone-700 outline-none transition focus:border-stone-400"
>
<option value="lastLoginDesc">최근 접속순</option>
<option value="plannerDesc">문서 많은 </option>
<option value="goalDesc">목표 많은 </option>
<option value="createdDesc">최근 가입순</option>
<option value="nicknameAsc">이름순</option>
</select>
</label>
</div>
<div class="mt-4 flex flex-wrap items-center gap-2 text-[11px] font-bold tracking-[0.12em] text-stone-500">
<span class="rounded-full bg-white px-3 py-2">표시 {{ filteredUsersSummary.total }}</span>
<span class="rounded-full bg-white px-3 py-2">활동 {{ filteredUsersSummary.active }}</span>
<span class="rounded-full bg-white px-3 py-2">비활성 {{ filteredUsersSummary.disabled }}</span>
</div>
<div class="mt-5 overflow-hidden rounded-[24px] border border-stone-200 bg-white">
<div class="hidden grid-cols-[84px_minmax(0,1.2fr)_110px_150px_90px_90px_150px_190px] gap-3 border-b border-stone-200 bg-[#f8f4ed] px-5 py-4 text-[10px] font-bold uppercase tracking-[0.18em] text-stone-500 xl:grid">
<span>ID</span>
@@ -157,7 +300,7 @@ function formatDate(value) {
<div class="divide-y divide-stone-200">
<article
v-for="user in users"
v-for="user in filteredUsers"
:key="user.id"
class="px-5 py-4"
>
@@ -166,6 +309,13 @@ function formatDate(value) {
<div>
<p class="text-sm font-semibold text-stone-900">{{ user.nickname }}</p>
<p class="mt-1 text-xs font-semibold text-stone-500">{{ user.email }}</p>
<button
type="button"
class="mt-2 text-[11px] font-bold tracking-[0.12em] text-stone-500 underline underline-offset-4 transition hover:text-stone-900"
@click="emit('select-user', user)"
>
{{ selectedUserId === user.id ? '상세 닫기' : '상세 보기' }}
</button>
</div>
<p class="text-sm font-semibold text-stone-700">{{ user.role }}</p>
<p class="text-sm font-semibold text-stone-700">{{ formatDate(user.lastLoginAt) }}</p>
@@ -231,13 +381,129 @@ function formatDate(value) {
</article>
<div
v-if="!busy && users.length === 0"
v-if="!busy && filteredUsers.length === 0"
class="px-5 py-10 text-center text-sm font-semibold text-stone-500"
>
표시할 사용자가 없습니다.
조건에 맞는 사용자가 없습니다.
</div>
</div>
</div>
<section class="border-t border-stone-200 bg-[#fcfaf6] px-5 py-5">
<div class="flex items-center justify-between gap-4">
<div>
<p class="text-[11px] font-bold uppercase tracking-[0.24em] text-stone-500">사용자 상세</p>
<p class="mt-2 text-sm font-semibold text-stone-500">선택한 사용자의 최근 플래너 기록과 목표를 확인합니다.</p>
</div>
<div
v-if="detailBusy"
class="rounded-full bg-stone-900 px-4 py-2 text-[11px] font-bold tracking-[0.16em] text-white"
>
불러오는 ...
</div>
</div>
<div
v-if="userDetail?.user"
class="mt-5 grid gap-5 xl:grid-cols-[minmax(0,1.15fr)_minmax(320px,0.85fr)]"
>
<div class="rounded-[24px] border border-stone-200 bg-white p-5">
<div class="flex items-center justify-between gap-4">
<div>
<p class="text-lg font-semibold text-stone-900">{{ userDetail.user.nickname }}</p>
<p class="mt-1 text-sm font-semibold text-stone-500">{{ userDetail.user.email }}</p>
</div>
<div class="flex flex-wrap justify-end gap-2">
<span class="rounded-full bg-stone-100 px-3 py-1 text-[10px] font-bold tracking-[0.14em] text-stone-600">{{ userDetail.user.role }}</span>
<span
class="rounded-full px-3 py-1 text-[10px] font-bold tracking-[0.14em]"
:class="userDetail.user.disabledAt ? 'bg-rose-100 text-rose-700' : 'bg-emerald-100 text-emerald-700'"
>
{{ userDetail.user.disabledAt ? '비활성화' : '사용 가능' }}
</span>
</div>
</div>
<div class="mt-5 grid gap-3 md:grid-cols-3">
<div class="rounded-2xl border border-stone-200 bg-[#fbf7f0] px-4 py-4">
<p class="text-[10px] font-bold tracking-[0.16em] text-stone-500">최근 로그인</p>
<p class="mt-2 text-sm font-semibold text-stone-800">{{ formatDate(userDetail.user.lastLoginAt) }}</p>
</div>
<div class="rounded-2xl border border-stone-200 bg-[#fbf7f0] px-4 py-4">
<p class="text-[10px] font-bold tracking-[0.16em] text-stone-500">문서 / 목표</p>
<p class="mt-2 text-sm font-semibold text-stone-800">{{ userDetail.user.plannerEntryCount }} / {{ userDetail.user.goalCount }}</p>
</div>
<div class="rounded-2xl border border-stone-200 bg-[#fbf7f0] px-4 py-4">
<p class="text-[10px] font-bold tracking-[0.16em] text-stone-500">활성 세션</p>
<p class="mt-2 text-sm font-semibold text-stone-800">{{ userDetail.user.activeSessionCount }}</p>
</div>
</div>
<div class="mt-6">
<p class="text-[11px] font-bold uppercase tracking-[0.2em] text-stone-500">최근 플래너 기록</p>
<div class="mt-3 space-y-3">
<article
v-for="entry in userDetail.plannerEntries"
:key="entry.entryDate"
class="rounded-2xl border border-stone-200 bg-[#fffdfa] px-4 py-4"
>
<div class="flex items-center justify-between gap-3">
<p class="text-sm font-semibold text-stone-900">{{ entry.entryDate }}</p>
<p class="text-[11px] font-semibold text-stone-500">{{ formatDate(entry.updatedAt) }}</p>
</div>
<p class="mt-3 text-sm font-semibold leading-6 text-stone-700">{{ getPlannerSummary(entry.payload).comment }}</p>
<div class="mt-3 flex flex-wrap gap-2 text-[11px] font-bold tracking-[0.12em] text-stone-500">
<span>작업 {{ getPlannerSummary(entry.payload).taskCount }}</span>
<span>완료 {{ getPlannerSummary(entry.payload).completedCount }}</span>
<span>메모 {{ getPlannerSummary(entry.payload).memoCount }}</span>
</div>
</article>
<p
v-if="userDetail.plannerEntries.length === 0"
class="rounded-2xl border border-dashed border-stone-300 bg-white px-4 py-4 text-sm font-semibold text-stone-500"
>
아직 작성한 플래너 기록이 없습니다.
</p>
</div>
</div>
</div>
<div class="rounded-[24px] border border-stone-200 bg-white p-5">
<p class="text-[11px] font-bold uppercase tracking-[0.2em] text-stone-500">목표 목록</p>
<div class="mt-3 space-y-3">
<article
v-for="goal in userDetail.goals"
:key="goal.id"
class="rounded-2xl border border-stone-200 bg-[#fffdfa] px-4 py-4"
>
<div class="flex items-center justify-between gap-3">
<p class="text-sm font-semibold text-stone-900">{{ goal.title }}</p>
<span class="rounded-full border border-stone-200 px-3 py-1 text-[10px] font-bold tracking-[0.12em] text-stone-500">
{{ goal.targetDate }}
</span>
</div>
<div class="mt-3 flex flex-wrap gap-2 text-[11px] font-bold tracking-[0.12em] text-stone-500">
<span>표시 시작 {{ goal.activeFrom || '미설정' }}</span>
<span>표시 종료 {{ goal.activeUntil || '미설정' }}</span>
</div>
</article>
<p
v-if="userDetail.goals.length === 0"
class="rounded-2xl border border-dashed border-stone-300 bg-white px-4 py-4 text-sm font-semibold text-stone-500"
>
등록된 목표가 없습니다.
</p>
</div>
</div>
</div>
<div
v-else
class="mt-5 rounded-[24px] border border-dashed border-stone-300 bg-white px-5 py-10 text-center text-sm font-semibold text-stone-500"
>
사용자 목록에서 `상세 보기` 눌러 기록과 목표를 확인해 주세요.
</div>
</section>
</section>
</div>
</section>

View File

@@ -1,5 +1,5 @@
<script setup>
import { onBeforeUnmount, ref } from 'vue'
import { computed, nextTick, onBeforeUnmount, ref } from 'vue'
const props = defineProps({
title: {
@@ -28,17 +28,52 @@ const emit = defineEmits(['dismiss'])
const open = ref(false)
const rootRef = ref(null)
const buttonRef = ref(null)
const popupStyle = ref({})
const isCompactButtonLabel = computed(() => String(props.buttonLabel || '').trim().length <= 1)
function close() {
open.value = false
}
function toggle() {
function updatePopupPosition() {
if (!open.value || !buttonRef.value || typeof window === 'undefined') {
return
}
const rect = buttonRef.value.getBoundingClientRect()
const viewportWidth = window.innerWidth
const preferredWidth = Math.min(256, Math.max(196, viewportWidth - 24))
const horizontalPadding = 12
let left = rect.left
if (left + preferredWidth > viewportWidth - horizontalPadding) {
left = viewportWidth - preferredWidth - horizontalPadding
}
if (left < horizontalPadding) {
left = horizontalPadding
}
popupStyle.value = {
left: `${left}px`,
top: `${rect.bottom + 8}px`,
width: `${preferredWidth}px`,
maxWidth: `calc(100vw - ${horizontalPadding * 2}px)`,
}
}
async function toggle() {
if (!props.visible) {
return
}
open.value = !open.value
if (open.value) {
await nextTick()
updatePopupPosition()
}
}
function closeFromOutside(event) {
@@ -56,10 +91,14 @@ function dismiss() {
if (typeof window !== 'undefined') {
window.addEventListener('pointerdown', closeFromOutside)
window.addEventListener('resize', updatePopupPosition)
window.addEventListener('scroll', updatePopupPosition, true)
}
onBeforeUnmount(() => {
window.removeEventListener('pointerdown', closeFromOutside)
window.removeEventListener('resize', updatePopupPosition)
window.removeEventListener('scroll', updatePopupPosition, true)
})
</script>
@@ -67,11 +106,13 @@ onBeforeUnmount(() => {
<span
v-if="visible"
ref="rootRef"
class="relative inline-flex"
class="relative inline-flex print:hidden"
>
<button
ref="buttonRef"
type="button"
class="flex h-5 w-5 items-center justify-center rounded-full border border-stone-300 bg-white text-[10px] font-bold text-stone-500 transition hover:border-stone-500 hover:text-stone-900 focus-visible:ring-2 focus-visible:ring-stone-900 focus-visible:ring-offset-2"
class="inline-flex shrink-0 items-center justify-center whitespace-nowrap border border-stone-300 bg-white text-[10px] font-bold text-stone-500 transition hover:border-stone-500 hover:text-stone-900 focus-visible:ring-2 focus-visible:ring-stone-900 focus-visible:ring-offset-2"
:class="isCompactButtonLabel ? 'h-5 w-5 rounded-full' : 'min-h-[22px] rounded-full px-2 py-1 leading-none'"
aria-label="가이드 보기"
:aria-expanded="open"
@click.stop="toggle"
@@ -79,21 +120,24 @@ onBeforeUnmount(() => {
{{ buttonLabel }}
</button>
<span
v-if="open"
class="absolute left-0 top-7 z-50 w-64 rounded-2xl border border-stone-200 bg-white p-4 text-left shadow-[0_18px_50px_rgba(28,25,23,0.16)]"
@pointerdown.stop
>
<span class="block text-[10px] font-bold uppercase tracking-[0.2em] text-stone-500">{{ title }}</span>
<span class="mt-2 block text-[11px] font-semibold leading-5 tracking-[0.04em] text-stone-700">{{ description }}</span>
<button
v-if="dismissible"
type="button"
class="mt-3 rounded-full border border-stone-200 px-3 py-2 text-[10px] font-bold tracking-[0.14em] text-stone-600 transition hover:border-stone-500 hover:text-stone-900"
@click="dismiss"
<Teleport to="body">
<span
v-if="open"
class="fixed z-[120] rounded-2xl border border-stone-200 bg-white p-4 text-left shadow-[0_18px_50px_rgba(28,25,23,0.16)] print:hidden"
:style="popupStyle"
@pointerdown.stop
>
이상 보지 않기
</button>
</span>
<span class="block text-[10px] font-bold uppercase tracking-[0.2em] text-stone-500">{{ title }}</span>
<span class="mt-2 block break-words text-[11px] font-semibold leading-5 tracking-[0.04em] text-stone-700">{{ description }}</span>
<button
v-if="dismissible"
type="button"
class="mt-3 rounded-full border border-stone-200 px-3 py-2 text-[10px] font-bold tracking-[0.14em] text-stone-600 transition hover:border-stone-500 hover:text-stone-900"
@click="dismiss"
>
이상 보지 않기
</button>
</span>
</Teleport>
</span>
</template>

View File

@@ -48,6 +48,7 @@ function selectYear(year) {
<button
type="button"
class="flex h-9 w-9 items-center justify-center rounded-full border border-stone-200 text-xs font-bold text-stone-600 transition hover:border-stone-400 hover:text-ink sm:h-auto sm:w-auto sm:px-2 sm:py-1"
@mousedown.prevent
@click="emit('shift-month', -1)"
>
@@ -57,6 +58,7 @@ function selectYear(year) {
<button
type="button"
class="rounded-full px-2 py-1 text-[10px] font-semibold tracking-[0.16em] text-stone-500 transition hover:bg-stone-100 hover:text-ink sm:text-[11px]"
@mousedown.prevent
@click="isYearPickerOpen = !isYearPickerOpen"
>
{{ yearLabel }}
@@ -65,6 +67,7 @@ function selectYear(year) {
<button
type="button"
class="flex h-9 w-9 items-center justify-center rounded-full border border-stone-200 text-xs font-bold text-stone-600 transition hover:border-stone-400 hover:text-ink sm:h-auto sm:w-auto sm:px-2 sm:py-1"
@mousedown.prevent
@click="emit('shift-month', 1)"
>
@@ -74,6 +77,7 @@ function selectYear(year) {
<button
type="button"
class="shrink-0 self-start rounded-full border border-stone-200 px-3 py-2 text-[10px] font-bold tracking-[0.14em] text-stone-600 transition hover:border-stone-400 hover:text-ink sm:self-auto"
@mousedown.prevent
@click="emit('go-today')"
>
TODAY
@@ -87,6 +91,7 @@ function selectYear(year) {
<button
type="button"
class="rounded-full border border-stone-200 px-2 py-1 text-xs font-bold text-stone-600 transition hover:border-stone-400 hover:text-ink"
@mousedown.prevent
@click="emit('shift-year', -12)"
>
@@ -97,6 +102,7 @@ function selectYear(year) {
<button
type="button"
class="rounded-full border border-stone-200 px-2 py-1 text-xs font-bold text-stone-600 transition hover:border-stone-400 hover:text-ink"
@mousedown.prevent
@click="emit('shift-year', 12)"
>
@@ -109,6 +115,7 @@ function selectYear(year) {
type="button"
class="rounded-xl border px-3 py-2 text-[11px] font-semibold transition"
:class="year === currentYearNumber ? 'border-ink bg-ink text-white' : 'border-stone-200 text-stone-700 hover:border-stone-400 hover:bg-stone-50'"
@mousedown.prevent
@click="selectYear(year)"
>
{{ year }}
@@ -139,6 +146,7 @@ function selectYear(year) {
: 'border-stone-200 bg-stone-50 text-stone-700 hover:border-stone-400 hover:bg-white',
day.isCurrentMonth ? '' : 'opacity-35',
]"
@mousedown.prevent
@click="emit('select', day.date)"
>
<span>{{ day.label }}</span>

View File

@@ -66,11 +66,18 @@ const emit = defineEmits([
'update:memo-label',
'update:memo',
'update:timetable',
'timetable-action',
'timetable-contextmenu',
])
const LONG_PRESS_DELAY_MS = 420
const TOUCH_MOVE_CANCEL_DISTANCE = 10
let dragState = null
let timetableTouchTimer = null
let taskSelectionDrag = null
const selectedTaskIndexes = ref(new Set())
const pendingTimetableTouchIndex = ref(null)
function shouldShowTaskPlaceholder(index) {
return index === 0 && props.tasks.every((task) => !task.title.trim())
@@ -88,6 +95,37 @@ function buildTimedRange(baseTimetable, startIndex, endIndex, nextValue) {
return nextTimetable
}
function clearTimetableTouchTimer() {
if (timetableTouchTimer) {
window.clearTimeout(timetableTouchTimer)
timetableTouchTimer = null
}
}
function beginTimetableDrag(index, shouldFill) {
dragState = {
startIndex: index,
baseTimetable: [...props.timetable],
nextValue: shouldFill,
isActive: true,
isTouchPending: false,
}
pendingTimetableTouchIndex.value = null
emit('update:timetable', buildTimedRange(dragState.baseTimetable, index, index, dragState.nextValue))
}
function getTimetableCellIndexAtPoint(clientX, clientY) {
const cell = document.elementFromPoint(clientX, clientY)?.closest('[data-timetable-index]')
const index = Number(cell?.dataset.timetableIndex)
return Number.isInteger(index) ? index : null
}
function getTimetableCellIndexFromPointer(event) {
return getTimetableCellIndexAtPoint(event.clientX, event.clientY)
}
function startTimetableDrag(index, event) {
if (props.readonly) {
return
@@ -99,17 +137,41 @@ function startTimetableDrag(index, event) {
const shouldFill = event.button === 2 ? false : !props.timetable[index]
dragState = {
startIndex: index,
baseTimetable: [...props.timetable],
nextValue: shouldFill,
if (event.pointerType === 'touch') {
clearTimetableTouchTimer()
pendingTimetableTouchIndex.value = index
dragState = {
startIndex: index,
baseTimetable: [...props.timetable],
nextValue: shouldFill,
isActive: false,
isTouchPending: true,
touchStartX: event.clientX,
touchStartY: event.clientY,
pointerId: event.pointerId,
}
event.currentTarget?.setPointerCapture?.(event.pointerId)
timetableTouchTimer = window.setTimeout(() => {
if (!dragState?.isTouchPending || dragState.pointerId !== event.pointerId) {
return
}
dragState.isTouchPending = false
dragState.isActive = true
pendingTimetableTouchIndex.value = null
emit('update:timetable', buildTimedRange(dragState.baseTimetable, index, index, dragState.nextValue))
}, LONG_PRESS_DELAY_MS)
return
}
emit('update:timetable', buildTimedRange(dragState.baseTimetable, index, index, dragState.nextValue))
event.preventDefault()
beginTimetableDrag(index, shouldFill)
}
function moveTimetableDrag(index) {
if (props.readonly || !dragState) {
if (props.readonly || !dragState?.isActive) {
return
}
@@ -119,7 +181,75 @@ function moveTimetableDrag(index) {
)
}
function moveTimetableDragFromPointer(event) {
if (props.readonly || !dragState) {
return
}
if (dragState.isTouchPending) {
const movedX = Math.abs(event.clientX - dragState.touchStartX)
const movedY = Math.abs(event.clientY - dragState.touchStartY)
if (movedX > TOUCH_MOVE_CANCEL_DISTANCE || movedY > TOUCH_MOVE_CANCEL_DISTANCE) {
stopTimetableDrag()
}
return
}
if (!dragState.isActive) {
return
}
if (event.pointerType === 'touch') {
event.preventDefault()
}
const index = getTimetableCellIndexFromPointer(event)
if (index !== null) {
moveTimetableDrag(index)
}
}
function moveTimetableDragFromTouch(event) {
if (props.readonly || !dragState) {
return
}
const touch = event.touches[0]
if (!touch) {
return
}
if (dragState.isTouchPending) {
const movedX = Math.abs(touch.clientX - dragState.touchStartX)
const movedY = Math.abs(touch.clientY - dragState.touchStartY)
if (movedX > TOUCH_MOVE_CANCEL_DISTANCE || movedY > TOUCH_MOVE_CANCEL_DISTANCE) {
stopTimetableDrag()
}
return
}
if (!dragState.isActive) {
return
}
event.preventDefault()
const index = getTimetableCellIndexAtPoint(touch.clientX, touch.clientY)
if (index !== null) {
moveTimetableDrag(index)
}
}
function stopTimetableDrag() {
clearTimetableTouchTimer()
pendingTimetableTouchIndex.value = null
dragState = null
}
@@ -230,12 +360,22 @@ function clearSelectedTasks(event) {
clearTaskSelection()
}
window.addEventListener('pointermove', moveTimetableDragFromPointer)
window.addEventListener('pointerup', stopTimetableDrag)
window.addEventListener('pointercancel', stopTimetableDrag)
window.addEventListener('touchmove', moveTimetableDragFromTouch, { passive: false })
window.addEventListener('touchend', stopTimetableDrag)
window.addEventListener('touchcancel', stopTimetableDrag)
window.addEventListener('pointermove', moveTaskSelectionFromPointer)
window.addEventListener('pointerup', stopTaskSelection)
window.addEventListener('keydown', clearSelectedTasks)
onBeforeUnmount(() => {
window.removeEventListener('pointermove', moveTimetableDragFromPointer)
window.removeEventListener('pointerup', stopTimetableDrag)
window.removeEventListener('pointercancel', stopTimetableDrag)
window.removeEventListener('touchmove', moveTimetableDragFromTouch)
window.removeEventListener('touchend', stopTimetableDrag)
window.removeEventListener('touchcancel', stopTimetableDrag)
window.removeEventListener('pointermove', moveTaskSelectionFromPointer)
window.removeEventListener('pointerup', stopTaskSelection)
window.removeEventListener('keydown', clearSelectedTasks)
@@ -304,7 +444,7 @@ onBeforeUnmount(() => {
</div>
<div class="planner-sheet__body flex flex-col gap-5 py-[10px] lg:flex-row lg:gap-4">
<div class="planner-sheet__lists flex w-full flex-1 flex-col gap-[21px] lg:w-[394px]">
<div class="planner-sheet__lists flex w-full flex-1 flex-col gap-[26px] print:gap-[21px] lg:w-[394px]">
<section>
<div class="flex items-center gap-2 text-muted">
<span class="shrink-0">TASKS</span>
@@ -408,16 +548,32 @@ onBeforeUnmount(() => {
</div>
<section class="planner-sheet__timetable w-full shrink-0 lg:w-[210px]">
<div class="flex items-center gap-2 text-muted">
<div v-if="!props.readonly" class="flex items-center gap-2 text-muted">
<button
type="button"
class="shrink-0 text-left transition hover:text-ink"
@click="emit('timetable-action')"
@contextmenu.prevent="emit('timetable-contextmenu', $event)"
>
<span class="shrink-0">TIME TABLE</span>
</button>
<span class="h-px flex-1 bg-ink"></span>
<GuideTooltip
title="Time Table"
description="먼저 원하는 날짜의 TIME TABLE 제목을 클릭해 타임테이블을 저장하세요. 그다음 붙여넣을 날짜로 이동해서 TIME TABLE 제목을 마우스 오른쪽 클릭하면 손쉽게 같은 내용을 붙여넣을 수 있습니다."
:dismissible="false"
/>
</div>
<div v-else class="flex items-center gap-2 text-muted">
<span class="shrink-0">TIME TABLE</span>
<span class="h-px flex-1 bg-ink"></span>
</div>
<div class="planner-sheet__timetable-scroll overflow-x-auto pb-1">
<div class="planner-sheet__timetable-grid min-w-[210px]">
<div class="planner-sheet__timetable-grid min-w-[210px] w-full">
<div
v-for="(hour, index) in hours"
:key="`${hour}-${index}`"
class="flex h-[25px] border-b sm:h-[30px]"
class="grid h-[25px] grid-cols-[30px_repeat(6,minmax(0,1fr))] border-b sm:h-[30px] lg:grid-cols-[30px_repeat(6,30px)]"
:class="index === hours.length - 1 ? 'border-ink' : 'border-line'"
>
<div
@@ -429,10 +585,14 @@ onBeforeUnmount(() => {
<div
v-for="quarter in 6"
:key="quarter"
:class="props.timetable[index * 6 + quarter - 1] ? 'bg-stone-800/90' : 'bg-transparent'"
class="h-full w-[30px] cursor-crosshair border-r border-dashed border-line transition-colors last:border-r-0 touch-none select-none"
:data-timetable-index="index * 6 + quarter - 1"
:class="[
props.timetable[index * 6 + quarter - 1] ? 'bg-stone-800/90' : 'bg-transparent',
pendingTimetableTouchIndex === index * 6 + quarter - 1 ? 'ring-1 ring-inset ring-stone-500/70' : '',
]"
class="h-full cursor-crosshair touch-pan-y select-none border-r border-dashed border-line transition-colors last:border-r-0"
@contextmenu.prevent
@pointerdown.prevent="startTimetableDrag(index * 6 + quarter - 1, $event)"
@pointerdown="startTimetableDrag(index * 6 + quarter - 1, $event)"
@pointerenter="moveTimetableDrag(index * 6 + quarter - 1)"
/>
</div>

View File

@@ -24,6 +24,10 @@ export async function fetchAdminOverview(token) {
return request('/api/admin/overview', token)
}
export async function fetchAdminUserDetail(token, userId) {
return request(`/api/admin/users/${userId}/detail`, token)
}
export async function updateAdminUserStatus(token, userId, disabled) {
return request(`/api/admin/users/${userId}/status`, token, {
method: 'PUT',