PageSourceSearch

https://keynsg.com/assets/AdminList-BuxJgpSX.js

js keynsg.com collected 2026-10-09 22:03:40 UTC 6,852 bytes, 1 lines download raw bytes

1import{a as f,r as b,j as e,d as o,L as a,s as l,an as i}from"./index-qhnNN43I.js";import{e as j,c as N,d as y}from"./useArticles-Dvq7TUUI.js";import{L as w}from"./loader-circle-CQNTaQdr.js";import{R as v}from"./rotate-ccw-D96MI_KU.js";import{C as k}from"./circle-plus-D_uxS8HL.js";import{F as C}from"./file-text-DvhQNMlU.js";import{E as T}from"./eye-CmlSVHbS.js";import{P as A}from"./pencil-BDJND_R2.js";import{T as L}from"./trash-2-CGlGHdi4.js";import"./useQuery-q1lipnT3.js";import"./useMutation-WzPTtda1.js";import"./article-C6UtI39w.js";const S={strategy:"bg-blue-100 text-blue-800",hr:"bg-primary/10 text-primary",esg:"bg-green-100 text-green-800",si:"bg-orange-100 text-orange-800"},R={article:"📄",video:"🎬",audio:"🎧"},q=()=>{const{data:r=[],isLoading:c}=j(),x=N(),m=y(),u=f(),[d,n]=b.useState(!1),p=async()=>{if(window.confirm("오늘의 무료 토큰 사용 기록과 비로그인 열람 기록을 모두 초기화하시겠습니까?")){n(!0);try{const t=new Date;t.setUTCHours(0,0,0,0);const s=t.toISOString();await Promise.all([l.from("token_usage").delete().gte("used_at",s),l.from("anonymous_reads").delete().gte("read_at",s)]),i.success("무료 토큰이 초기화되었습니다")}catch{i.error("초기화 실패")}finally{n(!1)}}},h=(t,s)=>{window.confirm(`"${s}" 글을 삭제하시겠습니까?`)&&x.mutate(t)},g=(t,s)=>{m.mutate({slug:t,data:{status:s==="published"?"draft":"published"}})};return c?e.jsx("div",{className:"flex items-center justify-center py-24",children:e.jsx(w,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"글 관리"}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["총 ",r.length,"개의 글"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:p,disabled:d,className:"inline-flex items-center gap-2 border border-border text-muted-foreground px-4 py-2.5 rounded-xl text-sm font-semibold hover:bg-muted transition-colors disabled:opacity-50",children:[e.jsx(v,{className:o("w-4 h-4",d&&"animate-spin")}),"토큰 초기화"]}),e.jsx(a,{to:"/chronicle/editor/content/import",className:"inline-flex items-center gap-2 border border-border text-foreground px-4 py-2.5 rounded-xl text-sm font-semibold hover:bg-muted transition-colors",children:"CSV 가져ì˜
1¤ê¸°"}),e.jsxs(a,{to:"/chronicle/editor/content/new",className:"inline-flex items-center gap-2 bg-primary text-on-dark px-4 py-2.5 rounded-xl text-sm font-semibold hover:bg-primary/90 transition-colors shadow-sm",children:[e.jsx(k,{className:"w-4 h-4"}),"새 글쓰기"]})]})]}),r.length===0?e.jsxs("div",{className:"text-center py-24 text-muted-foreground border-2 border-dashed border-border rounded-2xl",children:[e.jsx(C,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),e.jsx("p",{className:"font-medium",children:"글이 없습니다"}),e.jsx("p",{className:"text-sm mt-1",children:"새 글쓰기를 시작해 보세요"})]}):e.jsx("div",{className:"bg-surface rounded-2xl border border-border/60 overflow-hidden shadow-sm",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-slate-50 border-b border-border/60",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-6 py-3.5 font-semibold text-muted-foreground uppercase tracking-wide text-xs w-14",children:"#"}),e.jsx("th",{className:"text-left px-4 py-3.5 font-semibold text-muted-foreground uppercase tracking-wide text-xs",children:"제목"}),e.jsx("th",{className:"text-left px-4 py-3.5 font-semibold text-muted-foreground uppercase tracking-wide text-xs w-28",children:"토픽"}),e.jsx("th",{className:"text-left px-4 py-3.5 font-semibold text-muted-foreground uppercase tracking-wide text-xs w-24",children:"형식"}),e.jsx("th",{className:"text-left px-4 py-3.5 font-semibold text-muted-foreground uppercase tracking-wide text-xs w-28",children:"저자"}),e.jsx("th",{className:"text-left px-4 py-3.5 font-semibold text-muted-foreground uppercase tracking-wide text-xs w-28",children:"날짜"}),e.jsx("th",{className:"text-left px-4 py-3.5 font-semibold text-muted-foreground uppercase tracking-wide text-xs w-24",children:"상태"}),e.jsx("th",{className:"text-right px-6 py-3.5 font-semibold text-muted-foreground uppercase tracking-wide text-xs w-32",children:"액션"})]})}),e.jsx("tbody",{className:"divide-y divide-border/40",children:r.map((t,s)=>e.jsxs("tr",{className:"hover:bg-slate-50/70 transition-colors group",children:[e.jsx("td",{className:"px-6 py-4 text-muted-foreground font-mono text-xs",children:s+1}),e.jsx("td",{className:"px-4 py-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[t.thumbnail&&e.jsx("img",{src:t.thumbnail,alt:"",className:"w-14 h-10 rounded-lg object-cover shrink-0 border border-border/40"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground line-clamp-2 leading-snug",children:t.title}),t.leadText&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1",children:t.leadText})]})]})}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("span",{className:o("px-2 py-0.5 rounded-md text-xs font-bold uppercase",S[t.topic]||"bg-slate-100 text-slate-700"),children:t.topic})}),e.jsx("td",{className:"px-4 py-4 text-muted-foreground",children:e.jsxs("span",{children:[R[t.format]," ",t.format]})}),e.jsx("td",{className:"px-4 py-4 text-muted-foreground",children:t.author}),e.jsx("td",{className:"px-4 py-4 text-muted-foreground text-xs",children:t.date}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("button",{onClick:()=>g(t.slug,t.status),className:o("px-2.5 py-1 rounded-full text-xs font-semibold transition-colors cursor-pointer",t.status==="published"?"bg-success/10 text-success hover:bg-success/20":"bg-slate-100 text-slate-600 hover:bg-slate-200"),children:t.status==="published"?"게시됨":"초안"})}),e.jsx("td",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(a,{to:`/chronicle/p/${t.slug}`,target:"_blank",className:"p-1.5 rounded-lg hover:bg-slate-200 text-muted-foreground hover:text-foreground transition-colors",title:"미리보기",children:e.jsx(T,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>u(`/chronicle/editor/content/${t.slug}`),className:"p-1.5 rounded-lg hover:bg-blue-100 text-muted-foreground hover:text-primary transition-colors",title:"수정",children:e.jsx(A,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>h(t.slug,t.title),className:"p-1.5 rounded-lg hover:bg-red-100 text-muted-foreground hover:text-red-600 transition-colors",title:"삭제",children:e.jsx(L,{className:"w-4 h-4"})})]})})]},t.slug))})]})})]})};export{q 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.