PageSourceSearch

https://sannosuke.jp/assets/SMSDeliveryLogsPage-20261004_155452-CYyE-stq.js

js sannosuke.jp collected 2026-10-05 03:43:31 UTC 7,337 bytes, 1 lines download raw bytes

1import{r as e,j as s,aI as t,X as a,ae as r,aR as l,aH as i,aS as n}from"./react-vendor-20261004_155452-CMD9Mu4L.js";import{ap as d}from"./vendor-20261004_155452-C99PGm5B.js";import{a8 as o}from"./app-services-20261004_155452-CqhrjBLd.js";import{u as c}from"./useSocketQuery-20261004_155452-DyRT4qvF.js";import{T as m,b as x,c as j,d as h,e as u,f}from"./table-20261004_155452-Vc2gl7aJ.js";import{z as p,E as g,B as N,ak as b,p as v,G as w,O as y,Q as S,R as F}from"./index-20261004_155452-i5YY-Rmq.js";import{f as P}from"./dateFormatJST-20261004_155452-BO36cawP.js";import{A as _}from"./AdminPagination-20261004_155452-DMfSgrVO.js";import"./date-utils-20261004_155452-BABpr51X.js";import"./socket-manager-20261004_155452-ZWL0JEUH.js";import"./socket-io-20261004_155452-CfF5R5HA.js";import"./auth-20261004_155452-HLcqn2jx.js";import"./tanstack-20261004_155452-DKr4WzMb.js";import"./firebase-20261004_155452-bkCdcoUk.js";import"./ui-components-20261004_155452-DP5C5l_T.js";function T({logs:e}){const t=e=>{const t=(e=>{switch(e){case"delivered":return{label:"送信受付",variant:"default",className:"bg-green-600"};case"pending":return{label:"送信待機",variant:"secondary"};case"failed":return{label:"送信失敗",variant:"destructive"};default:return{label:"不明",variant:"outline"}}})(e);return s.jsx(p,{variant:t.variant,className:t.className,children:t.label})};return s.jsx("div",{className:"rounded-md border",children:s.jsxs(m,{children:[s.jsx(x,{children:s.jsxs(j,{children:[s.jsx(h,{children:"送信日時"}),s.jsx(h,{children:"ユーザー氏名"}),s.jsx(h,{children:"電話番号"}),s.jsx(h,{children:"配信ステータス"}),s.jsx(h,{children:"MessageID"}),s.jsx(h,{children:"失敗理由"})]})}),s.jsx(u,{children:0===e.length?s.jsx(j,{children:s.jsxs(f,{colSpan:6,className:"text-center text-muted-foreground py-6",children:[s.jsx("div",{children:"未検証の OTP 記録はありません"}),s.jsx("div",{className:"text-xs mt-1",children:"検証に使われた OTP は設計上その場で削除されます (使用済 OTP の永続記録なし)"})]})}):e.map(e=>s.jsxs(j,{children:[s.jsx(f,{className:"font-mono text-sm whitespace-nowrap",children:P(e.createdAt,"datetime")}),s.jsx(f,{className:"whitespace-nowrap",children:e.userName||"-"}),s.jsx(f,{className:"font-mono whitespace-nowrap",children:e.phoneNumber}),s.jsx(f,{className:"whitespace-nowrap",children:t(e.deliveryStatus)}),s.jsx(f,{className:"font-mono text-xs max-w-xs truncate",children:e.snsMessageId||"-"}),s.jsx(f,{className:"min-w-[12rem] max-w-md",children:e.deliveryFailedReason?s.jsx("span",{className:"text-sm text-red-600",children:e.deliveryFailedReason}):"-"})]},e.id))})]})})}function k({filters:e,onFiltersChange:r,onReset:l}){return s.jsxs("div",{className:"flex flex-wrap gap-4 mb-6 p-4 bg-muted/50 rounded-lg",children:[s.jsxs("div",{className:"flex-1 min-w-[200px]",children:[s.jsx("label",{htmlFor:"sms-filter-phone",className:"text-sm font-medium mb-2 block",children:"電話番号"}),s.jsxs("div",{className:"relative",children:[s.jsx(t,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(g,{id:"sms-filter-phone",type:"text",placeholder:"080-1234-5678",value:e.phoneNumber,onChange:s=>r({...e,phoneNumber:s.target.value}),className:"pl-9"})]})]}),s.jsxs("div",{className:"flex-1 min-w-[150px]",children:[s.jsx("label",{htmlFor:"sms-filter-date-from",className:"text-sm font-medium mb-2 block",children:"開始日"}),s.jsx(g,{id:"sms-filter-date-from",type:"date",value:e.dateFrom,onChange:s=>r({...e,dateFrom:s.target.value})})]}),s.jsxs("div",{className:"flex-1 min-w-[150px]",children:[s.jsx("label",{htmlFor:"sms-filter-date-to",className:"text-sm font-medium mb-2 block",children:"終了日"}),s.jsx(g,{id:"sms-filter-date-to",type:"date",value:e.dateTo,onChange:s=>r({...e,dateTo:s.target.value})})]}),s.jsx("div",{className:"flex items-end",children:s.jsxs(N,{variant:"outline",onClick:l,children:[s.jsx(a,{className:"mr-2 h-4 w-4"}),"リセット"]})})]})}function L(){const{logs:t,pagination:a,stats:m,isLoading:x,isLoadingStats:j,page:h,setPage:u,filters:f,setFilters:p}=function(){const[s,t]=e.useState(1),[a,r]=e.useState({phoneNumber:"",dateFrom:"",dateTo:""}),{data:l,isLoading:i,error:n,refetch:d}=c({queryKey:["sms-delivery-logs",s,a],queryFn:()=>o.getLogs({page:s,limit:50,...a}),socketEvents:"sms:log_added",subscribe:{event:"sms-logs:subscribe"},unsubscribe:{event:"sms-logs:unsubscribe"}}),{data:m,isLoading:x}=c({queryKey:["sms-delivery-stats"],queryFn:()=>o.getStats(),socketEvents:"sms:log_added"});return{logs:l?.logs||[],pagination:l?.pagination,stats:m,isLoading:i,isLoadingStats:x,error:n,page:s,setPage:t,filters:a,setFilters:r,refetch:d}}();return s.jsxs(s.Fragment,{children:[s.jsx(d,{children:s.jsx("title",{children:"SMS / OTP 配信ステータス | 管理"})}
1),s.jsx(b,{header:{title:"SMS / OTP 配信ステータス",subtitle:"SMS 認証 OTP の配信状況。検証成功した OTP は設計上即時削除されるため、保留中・配信失敗の OTP のみ表示されます。"},useCard:!1,children:s.jsxs("div",{className:"space-y-6",children:[j||!m?s.jsx(v,{size:"sm"}):s.jsxs("div",{children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[s.jsxs(w,{children:[s.jsxs(y,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(S,{className:"text-sm font-medium",children:"残存OTP記録"}),s.jsx(r,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(F,{children:s.jsx("div",{className:"text-2xl font-bold",children:m.total.toLocaleString()})})]}),s.jsxs(w,{children:[s.jsxs(y,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(S,{className:"text-sm font-medium",children:"送信成功・未検証"}),s.jsx(l,{className:"h-4 w-4 text-green-600"})]}),s.jsx(F,{children:s.jsx("div",{className:"text-2xl font-bold text-green-600",children:m.delivered.toLocaleString()})})]}),s.jsxs(w,{children:[s.jsxs(y,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(S,{className:"text-sm font-medium",children:"配信待機の記録"}),s.jsx(i,{className:"h-4 w-4 text-yellow-600"})]}),s.jsx(F,{children:s.jsx("div",{className:"text-2xl font-bold text-yellow-600",children:m.pending.toLocaleString()})})]}),s.jsxs(w,{children:[s.jsxs(y,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(S,{className:"text-sm font-medium",children:"送信失敗の記録"}),s.jsx(n,{className:"h-4 w-4 text-red-600"})]}),s.jsx(F,{children:s.jsx("div",{className:"text-2xl font-bold text-red-600",children:m.failed.toLocaleString()})})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"※ 成功率は表示しません。検証成功した OTP は記録ごと削除され、送信失敗も多くは記録前に エラー応答となるため、残存記録から算出した成功率は実態を表さないためです。"})]}),s.jsx(k,{filters:f,onFiltersChange:p,onReset:()=>{p({phoneNumber:"",dateFrom:"",dateTo:""}),u(1)}}),x?s.jsx(v,{size:"sm"}):s.jsxs(s.Fragment,{children:[s.jsx(T,{logs:t}),a&&s.jsx(_,{total:a.total,currentPage:h,totalPages:a.totalPages,pageSize:a.limit,onPrevious:()=>u(h-1),onNext:()=>u(h+1)})]})]})})]})}export{L as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.