feat(logs): date filter + clear log endpoints

- API GET /api/logs now accepts from_ts / to_ts (unix epoch, half-open
  [from, to)) so callers can scope by arbitrary time range.
- API DELETE /api/logs added. Same from_ts / to_ts semantics. No params
  = wipe everything and reset the AUTOINCREMENT counter.
- Dashboard Logs page: date picker that scopes both the view and the
  delete button to the selected day in the user's local timezone. The
  clear button is red and confirms before deleting; label switches
  between "전체 로그 초기화" and "<날짜> 하루치 삭제".
This commit is contained in:
2026-05-23 17:55:58 +09:00
parent 8312cfe861
commit 7362b45846
4 changed files with 116 additions and 5 deletions

View File

@@ -32,5 +32,11 @@ export const api = {
).toString()
return req('/logs' + (q ? `?${q}` : ''))
},
clearLogs: (params = {}) => {
const q = new URLSearchParams(
Object.fromEntries(Object.entries(params).filter(([, v]) => v !== '' && v != null))
).toString()
return req('/logs' + (q ? `?${q}` : ''), { method: 'DELETE' })
},
restart: () => req('/proxy/restart', { method: 'POST' }),
}