Files
web-alterflixhub/assets/admin_.login-BgKCe7lW.js
T
Bkk1234 e6c4ebff48 chore(publish): replace source tree with static export at repo root
Publish the prerendered static export (index.html, 404.html, cinema/,
c/, about/, for-cinemas/, for-film-lovers/, assets/, images/, og/,
sitemap.xml, robots.txt) as the site root and remove the React Router
+ Nitro source tree from this branch. Source remains available in
history at 0548772.

Note: public/sw.js here reports VERSION v2.0.5 while the removed source
tree (v2.1.0) was newer, and .gitignore was not carried over.
2026-11-22 22:24:36 +07:00

1 line
2.5 KiB
JavaScript

import{i as e,t}from"./react-B8IZ02wI.js";import{a as n,f as r}from"./components-LggAOTeO.js";import{t as i}from"./jsx-runtime-fBfwind-.js";import{a}from"./seo-CukKNP_H.js";var o=e(t(),1),s=i(),c=`w-full rounded-lg border border-[#303030] bg-[#141414] px-3 py-2 text-sm text-white outline-none focus:border-[#A92626]`;function l({loaderData:e}){return a({origin:e?.origin??``,title:`เข้าสู่ระบบหลังบ้าน — AlterFlixHub`,description:`หน้าสำหรับผู้ดูแลเว็บไซต์เท่านั้น`,path:`/admin/login`,noIndex:!0})}var u=n(function(){let e=r(),[t,n]=(0,o.useState)(``),[i,a]=(0,o.useState)(``),[l,u]=(0,o.useState)(null),[d,f]=(0,o.useState)(!1);async function p(n){n.preventDefault(),f(!0),u(null);try{let n=await fetch(`/api/admin/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({username:t,password:i})});if(!n.ok){let e=await n.json().catch(()=>({}));u(e.statusMessage??e.message??`เข้าสู่ระบบไม่สำเร็จ`);return}e(`/admin`)}catch{u(`เชื่อมต่อเซิร์ฟเวอร์ไม่ได้`)}finally{f(!1)}}return(0,s.jsx)(`div`,{className:`flex min-h-dvh items-center justify-center bg-[#0D0D0D] px-5 text-white`,children:(0,s.jsxs)(`form`,{onSubmit:p,className:`w-full max-w-sm rounded-2xl border border-[#303030] bg-[#141414] p-6`,children:[(0,s.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`เข้าสู่ระบบหลังบ้าน`}),(0,s.jsx)(`p`,{className:`mt-1 text-sm text-[#999]`,children:`AlterFlixHub · เฉพาะผู้ดูแล`}),(0,s.jsxs)(`label`,{className:`mt-6 block text-sm text-[#B3B3B3]`,children:[`ชื่อผู้ใช้`,(0,s.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),autoComplete:`username`,className:`mt-1 ${c}`})]}),(0,s.jsxs)(`label`,{className:`mt-4 block text-sm text-[#B3B3B3]`,children:[`รหัสผ่าน`,(0,s.jsx)(`input`,{type:`password`,value:i,onChange:e=>a(e.target.value),autoComplete:`current-password`,className:`mt-1 ${c}`})]}),l?(0,s.jsx)(`p`,{role:`alert`,className:`mt-4 text-sm text-[#D47272]`,children:l}):null,(0,s.jsx)(`button`,{type:`submit`,disabled:d,className:`mt-6 h-10 w-full rounded-lg bg-[#8F0808] text-sm font-medium transition hover:bg-[#a30a0a] disabled:opacity-60`,children:d?`กำลังเข้าสู่ระบบ…`:`เข้าสู่ระบบ`})]})})});export{u as default,l as meta};