PageSourceSearch

https://bacctrack-7ha7hyw7.manus.space/assets/AdminLeaderboardPage-BKMyiif-.js

js bacctrack-7ha7hyw7.manus.space collected 2026-10-03 05:02:09 UTC 6,818 bytes, 1 lines download raw bytes

1import{t as i,b as c,r as o,j as e}from"./index-C3Qps0S4.js";import{T as p}from"./trophy-C56YBVkm.js";import{S as m}from"./save-DgLGcrQc.js";import{S as u}from"./settings-Cj6VgvAK.js";const h={enabled:{label:"เปิดใช้ระบบ Leaderboard",desc:"เปิด/ปิดระบบกระดานผู้นำทั้งหมด",type:"boolean"},live_feed_enabled:{label:"เปิด Live Feed",desc:"แสดงสถิติสำเร็จล่าสุดแบบ real-time",type:"boolean"},min_usage_count:{label:"จำนวนใช้ขั้นต่ำ",desc:"ต้องใช้สูตรกี่ครั้งถึงจะแสดงบน Leaderboard",type:"number"},min_win_rate:{label:"Win Rate ขั้นต่ำ (%)",desc:"Win Rate ขั้นต่ำที่ต้องมีถึงจะแสดง",type:"number"},update_interval:{label:"ช่วงอัปเดต (วินาที)",desc:"ความถี่ในการรีเฟรชข้อมูล",type:"number"},show_top_users:{label:"จำนวนผู้ใช้ Top",desc:"จำนวนผู้ใช้ที่แสดงบนกระดานผู้นำ",type:"number"},show_live_feed_count:{label:"จำนวน Live Feed",desc:"จำนวนรายการ Live Feed ที่แสดง",type:"number"}};function f(){const{data:t,refetch:g}=i.leaderboard.settings.useQuery(),r=i.leaderboard.adminUpdateSettings.useMutation({onSuccess:()=>{c.success("บันทึกสำเร็จ"),g()},onError:()=>c.error("เกิดข้อผิดพลาด")}),[s,n]=o.useState({});o.useEffect(()=>{t&&n(t)},[t]);const x=a=>{r.mutate({key:a,value:s[a]||""})},b=()=>{Object.keys(s).forEach(a=>{s[a]!==t?.[a]&&r.mutate({key:a,value:s[a]})})};return e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:45",className:"space-y-4 pb-4",children:[e.jsx("div",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:47",className:"glass-card-orange rounded-2xl p-4",children:e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:48",className:"flex items-center gap-3",children:[e.jsx(p,{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:49",className:"w-7 h-7 text-yellow-400"}),e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:50",children:[e.jsx("h1",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:51",className:"text-lg font-bold text-white",children:"ตั้งค่า Leaderboard"}),e.jsx("p",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:52",className:"text-xs text-gray-400",children:"จัดการระบบกระดานผู้นำ"})]})]})}),e.jsx("div",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:58",className:"space-y-3",children:Object.entries(h).map(([a,l])=>e.jsx("div",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:60",className:"glass-card rounded-xl p-4",children:e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:61",className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:62",children:[e.jsx("p",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:63",className:"text-sm font-medium text-white",children:l.label}),e.jsx("p",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:64",className:"text-[10px] text-gray-500",children:l.desc})]}),l.type==="boolean"?e.jsx("button",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:67",onClick:()=>{const d=s[a]==="true"?"false":"true";n({...s,[a]:d}),r.mutate({key:a,value:d})},className:`w-12 h-6 rounded-full transition-all relative ${s[a]==="true"?"bg-green-500":"bg-gray-700"}`,children:e.jsx("div",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:77",className:`w-5 h-5 rounded-full bg-white absolute top-0.5 transition-all ${s[a]==="true"?"left-6":"left-0.5"}`})}):e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:84",className:"flex items-center gap-2",children:[e.jsx("input",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:85",type:"number",value:s[a]||"",onChange:d=>n({...s,[a]:d.target.value}),className:"w-20 bg-gray-800 border border-gray-700 rounded-lg px-2 py-1 text-sm text-white text-center"}),e.jsx("button",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:91",onClick:()=>x(a),className:"p-1.5 rounded-lg bg-orange-500/20 text-orange-400 hover:bg-orange-500/30 transition-colors",children:e.jsx(m,{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:95",className:"w-3.5 h-3.5"})})]})]})},a))}),e.jsxs("button",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:105",onClick:b,className:"w-full py-3 rounded-xl bg-gradient-to-r from-orange-500 to-amber-500 text-white font-medium text-sm flex items-center justify-center gap-2 hover:shadow-[0_0_15px_rgba(245,158,11,0.3)] transition-all active:scale-[0.97]",children:[e.jsx(m,{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:109",className:"w-4 h-4"}),"บันทึกทั้งหมด"]}),e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:114",className:"glass-card rounded-xl p-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:115",className:"flex items-center gap-2 mb-2",children:[e.jsx(u,{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:116",className:"w-4 h-4 text-gray-400"}),e.jsx("p",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:117",className:"text-xs font-medium text-gray-300",children:"หมายเหตุ"})]}),e.jsxs("ul",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:119",className:"space-y-1 text-[10px] text-gray-500",children:[e.jsx("li",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:120",children:"• ปิดระบบ Leaderboard จะซ่อนบอร์ดทั้งหน้าหลักและหน้า Leaderboard"}),e.jsx("li",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:121",children:"• ผู้ใช้ที่มีจำนวนใช้น้อยกว่าขั้นต่ำจะไม่แสดงบนบอร์ด"}),e.jsx("li",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:122",children:"• ผู้ใช้สามารถซ่อนตัวเองจากบอร์ดได้ในหน้าà¹
1‚ปรไฟล์"}),e.jsx("li",{"data-loc":"client/src/pages/admin/AdminLeaderboardPage.tsx:123",children:"• ข้อมูลจะอัปเดตอัตโนมัติตามช่วงเวลาที่ตั้งไว้"})]})]})]})}export{f 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.