refactor(media): แยกรูปออกจาก code — รูปทั้งหมดอยู่บน object storage

code อยู่ใน git · รูปอยู่บน SeaweedFS (https://storage.hobbypj.com/hobbypj/alterflixhub/)

- อัปโหลด images/ (21 ไฟล์) + og/ (1 ไฟล์) ขึ้น storage แล้วตรวจ sha256 ตรงทุกไฟล์
- แทนที่อ้างอิง 894 จุด ใน 37 ไฟล์: /images/… → <storage>/images/…, /og/… → <storage>/og/…
  (absolute URL ทุกที่ รวม JSON-LD/og:image/twitter:image และ placeholder ในหลังบ้าน)
- ลบ images/ + og/ ออกจาก repo · สำเนาในเครื่องย้ายไป media/ (gitignored)
- scripts/media-to-storage.py: สคริปต์ที่ใช้ย้าย (บันทึกวิธี + ใช้ซ้ำได้เมื่อเปลี่ยน base)
- scripts/media-sync.py: --check / --upload รูปขึ้น storage (basic auth หรือ SSH tunnel ไป filer)
- sw.js: bump v2.1.6 + แคชรูปจาก storage แบบ cache-first (isMedia/mediaCacheFirst) กันออฟไลน์แล้วรูปหาย
- docker/traefik-storage-alterflixhub.yml: router เปิดอ่านสาธารณะเฉพาะ /hobbypj/alterflixhub/
  (host storage บังคับ Basic auth ทั้ง host — ต้องมี router priority 300 + CORS ก่อน)
- docs/media-storage.md: วิธีอัปโหลด/เพิ่มรูป + ข้อกำหนดฝั่ง Traefik
- .gitignore/.dockerignore: กัน media/, images/, og/ กลับเข้า repo/image

ไอคอน PWA (icon-*.png, favicon.svg) ยังอยู่ใน repo — ต้อง same-origin ให้ติดตั้ง PWA ได้
This commit is contained in:
Bkk1234 committed 2026-11-27 02:08:19 +07:00
1 parent bc0e7a963e
commit ddfb0a5053
67 files changed
+442 -104

No files matched your search

+1 -1
View File
@@ -1 +1 @@
import{i as e,t}from"./react-B8IZ02wI.js";import{u as n}from"./components-LggAOTeO.js";import{a as r,o as i,r as a,t as o}from"./IconCheck-B3jDJthn.js";import{t as s}from"./jsx-runtime-fBfwind-.js";import{n as c}from"./messages-nFlHChGW.js";import{t as l}from"./createReactComponent-C-DRqPhY.js";import{n as u}from"./footer-icons-kTf1LTdH.js";var d=l(`outline`,`chevron-down`,`ChevronDown`,[[`path`,{d:`M6 9l6 6l6 -6`,key:`svg-0`}]]),f=e(t(),1),p=`2000px 0px -6% 0px`,m=.06;function h(e=0){let t=(0,f.useRef)(null),[n,r]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{let e=t.current;if(!e)return;if(typeof IntersectionObserver>`u`){r(!0);return}let n=new IntersectionObserver(e=>{for(let t of e){let e=t.rootBounds?.top??0,i=t.boundingClientRect.bottom<=e;if(!(!t.isIntersecting&&!i)){r(!0),n.disconnect();break}}},{threshold:m,rootMargin:p});return n.observe(e),()=>n.disconnect()},[]),{ref:t,revealed:n,style:{"--fx-delay":`${Math.max(0,e)}ms`}}}var g=s();function _({children:e,kind:t=`rise`,delay:n=0,className:r}){let{ref:i,revealed:a,style:o}=h(n);return(0,g.jsx)(`div`,{ref:i,"data-reveal":t,"data-revealed":a?``:void 0,style:o,className:r,children:e})}var v={background:`#0D0D0D`,surface:`#1B1B1B`,surfaceRaised:`#1F1F1F`,surfaceChip:`#242424`,surfaceMuted:`#E8E8E8`,border:`#332B2B`,borderSubtle:`#303030`,brand:`#8F0808`,brandBright:`#A92626`,brandText:`#D47272`,brandGlow:`#4C0404`,textPrimary:`#FFFFFF`,textMuted:`#B3B3B3`,textSubtle:`#999999`,glowSoft:`rgba(143,8,8,0.4)`,pillGradient:`linear-gradient(180deg, rgba(143,8,8,0.3) 0%, rgba(27,27,27,0) 100%)`,flagGradient:`linear-gradient(#A51931 0 17%, #F4F5F8 17% 34%, #2D2A4A 34% 66%, #F4F5F8 66% 83%, #A51931 83%)`},y={wordmark:`AlterFlixHub`,fontFamily:`'Jersey 15', sans-serif`,color:`#8F0808`,sizes:{sm:`text-2xl`,md:`text-4xl`}};function b(e=`md`){return`font-['Jersey_15'] leading-none ${y.sizes[e]}`}function x({className:e=``,size:t=`md`}){return(0,g.jsx)(`span`,{className:`${b(t)} ${e}`,style:{fontFamily:y.fontFamily,color:y.color},children:y.wordmark})}function S(){let{site:e}=r(),{messages:t}=a();return(0,g.jsx)(`footer`,{className:`relative z-10 mx-auto w-full max-w-[1440px] px-5 pb-6 md:px-[108px]`,children:(0,g.jsxs)(`div`,{className:`flex flex-col items-center gap-3 border-t border-white/10 pt-4 sm:flex-row sm:justify-between`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,g.jsx)(x,{size:`sm`}),(0,g.jsxs)(`nav`,{"aria-label":`เมนูล่าง`,className:`flex items-center gap-3 text-xs`,children:[(0,g.jsx)(i,{to:`/for-film-lovers`,className:`text-[#B3B3B3] transition hover:text-white`,children:t.nav.forFilmLovers}),(0,g.jsx)(i,{to:`/for-cinemas`,className:`text-[#B3B3B3] transition hover:text-white`,children:t.nav.forCinemas}),(0,g.jsx)(i,{to:`/about`,className:`text-[#B3B3B3] transition hover:text-white`,children:t.nav.about})]})]}),(0,g.jsx)(`div`,{className:`flex flex-wrap items-center justify-center gap-1.5`,children:e.footer.map(e=>{let t=u(e.icon_name),n=e.href.startsWith(`http`);return(0,g.jsx)(`a`,{href:e.href||`#`,"aria-label":e.label,title:e.label,target:n?`_blank`:void 0,rel:n?`noreferrer`:void 0,className:`flex size-8 items-center justify-center rounded-full bg-white/90 text-[#0D0D0D] transition hover:bg-white`,children:(0,g.jsx)(t,{size:18})},e.id)})}),(0,g.jsx)(`p`,{className:`text-xs text-[#999]`,children:`Copyright © AlterFlixHub`})]})})}function C(){return(0,g.jsx)(`span`,{className:`block h-4 w-[21px] shrink-0 rounded-[1px]`,style:{background:v.flagGradient}})}function w(){return(0,g.jsxs)(`span`,{className:`relative block h-4 w-[21px] shrink-0 overflow-hidden rounded-[1px]`,style:{background:`#012169`},children:[(0,g.jsx)(`span`,{className:`absolute inset-0`,style:{background:`linear-gradient(45deg, transparent 44%, #F4F5F8 44% 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, #F4F5F8 44% 56%, transparent 56%)`}}),(0,g.jsx)(`span`,{className:`absolute inset-0`,style:{background:`linear-gradient(90deg, transparent 40%, #F4F5F8 40% 60%, transparent 60%), linear-gradient(0deg, transparent 33%, #F4F5F8 33% 67%, transparent 67%)`}}),(0,g.jsx)(`span`,{className:`absolute inset-0`,style:{background:`linear-gradient(90deg, transparent 44%, #C8102E 44% 56%, transparent 56%), linear-gradient(0deg, transparent 40%, #C8102E 40% 60%, transparent 60%)`}})]})}var T={th:C,en:w};function E(){let{locale:e,setLocale:t,messages:n}=a(),[r,i]=(0,f.useState)(!1),s=(0,f.useRef)(null),l=(0,f.useRef)(null);(0,f.useEffect)(()=>{if(!r)return;s.current?.querySelector(`[role="menuitemradio"][aria-checked="true"]`)?.focus();function e(e){s.current?.contains(e.target)||i(!1)}function t(e){e.key===`Escape`&&(i(!1),l.current?.focus())}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]);let u=c.find(t=>t.locale===e)??c[0],p=T[u.locale];function m(e){if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)retLine truncated
import{i as e,t}from"./react-B8IZ02wI.js";import{u as n}from"./components-LggAOTeO.js";import{a as r,o as i,r as a,t as o}from"./IconCheck-B3jDJthn.js";import{t as s}from"./jsx-runtime-fBfwind-.js";import{n as c}from"./messages-nFlHChGW.js";import{t as l}from"./createReactComponent-C-DRqPhY.js";import{n as u}from"./footer-icons-kTf1LTdH.js";var d=l(`outline`,`chevron-down`,`ChevronDown`,[[`path`,{d:`M6 9l6 6l6 -6`,key:`svg-0`}]]),f=e(t(),1),p=`2000px 0px -6% 0px`,m=.06;function h(e=0){let t=(0,f.useRef)(null),[n,r]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{let e=t.current;if(!e)return;if(typeof IntersectionObserver>`u`){r(!0);return}let n=new IntersectionObserver(e=>{for(let t of e){let e=t.rootBounds?.top??0,i=t.boundingClientRect.bottom<=e;if(!(!t.isIntersecting&&!i)){r(!0),n.disconnect();break}}},{threshold:m,rootMargin:p});return n.observe(e),()=>n.disconnect()},[]),{ref:t,revealed:n,style:{"--fx-delay":`${Math.max(0,e)}ms`}}}var g=s();function _({children:e,kind:t=`rise`,delay:n=0,className:r}){let{ref:i,revealed:a,style:o}=h(n);return(0,g.jsx)(`div`,{ref:i,"data-reveal":t,"data-revealed":a?``:void 0,style:o,className:r,children:e})}var v={background:`#0D0D0D`,surface:`#1B1B1B`,surfaceRaised:`#1F1F1F`,surfaceChip:`#242424`,surfaceMuted:`#E8E8E8`,border:`#332B2B`,borderSubtle:`#303030`,brand:`#8F0808`,brandBright:`#A92626`,brandText:`#D47272`,brandGlow:`#4C0404`,textPrimary:`#FFFFFF`,textMuted:`#B3B3B3`,textSubtle:`#999999`,glowSoft:`rgba(143,8,8,0.4)`,pillGradient:`linear-gradient(180deg, rgba(143,8,8,0.3) 0%, rgba(27,27,27,0) 100%)`,flagGradient:`linear-gradient(#A51931 0 17%, #F4F5F8 17% 34%, #2D2A4A 34% 66%, #F4F5F8 66% 83%, #A51931 83%)`},y={wordmark:`AlterFlixHub`,fontFamily:`'Jersey 15', sans-serif`,color:`#8F0808`,sizes:{sm:`text-2xl`,md:`text-4xl`}};function b(e=`md`){return`font-['Jersey_15'] leading-none ${y.sizes[e]}`}function x({className:e=``,size:t=`md`}){return(0,g.jsx)(`span`,{className:`${b(t)} ${e}`,style:{fontFamily:y.fontFamily,color:y.color},children:y.wordmark})}function S(){let{site:e}=r(),{messages:t}=a();return(0,g.jsx)(`footer`,{className:`relative z-10 mx-auto w-full max-w-[1440px] px-5 pb-6 md:px-[108px]`,children:(0,g.jsxs)(`div`,{className:`flex flex-col items-center gap-3 border-t border-white/10 pt-4 sm:flex-row sm:justify-between`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,g.jsx)(x,{size:`sm`}),(0,g.jsxs)(`nav`,{"aria-label":`เมนูล่าง`,className:`flex items-center gap-3 text-xs`,children:[(0,g.jsx)(i,{to:`/for-film-lovers`,className:`text-[#B3B3B3] transition hover:text-white`,children:t.nav.forFilmLovers}),(0,g.jsx)(i,{to:`/for-cinemas`,className:`text-[#B3B3B3] transition hover:text-white`,children:t.nav.forCinemas}),(0,g.jsx)(i,{to:`/about`,className:`text-[#B3B3B3] transition hover:text-white`,children:t.nav.about})]})]}),(0,g.jsx)(`div`,{className:`flex flex-wrap items-center justify-center gap-1.5`,children:e.footer.map(e=>{let t=u(e.icon_name),n=e.href.startsWith(`http`);return(0,g.jsx)(`a`,{href:e.href||`#`,"aria-label":e.label,title:e.label,target:n?`_blank`:void 0,rel:n?`noreferrer`:void 0,className:`flex size-8 items-center justify-center rounded-full bg-white/90 text-[#0D0D0D] transition hover:bg-white`,children:(0,g.jsx)(t,{size:18})},e.id)})}),(0,g.jsx)(`p`,{className:`text-xs text-[#999]`,children:`Copyright © AlterFlixHub`})]})})}function C(){return(0,g.jsx)(`span`,{className:`block h-4 w-[21px] shrink-0 rounded-[1px]`,style:{background:v.flagGradient}})}function w(){return(0,g.jsxs)(`span`,{className:`relative block h-4 w-[21px] shrink-0 overflow-hidden rounded-[1px]`,style:{background:`#012169`},children:[(0,g.jsx)(`span`,{className:`absolute inset-0`,style:{background:`linear-gradient(45deg, transparent 44%, #F4F5F8 44% 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, #F4F5F8 44% 56%, transparent 56%)`}}),(0,g.jsx)(`span`,{className:`absolute inset-0`,style:{background:`linear-gradient(90deg, transparent 40%, #F4F5F8 40% 60%, transparent 60%), linear-gradient(0deg, transparent 33%, #F4F5F8 33% 67%, transparent 67%)`}}),(0,g.jsx)(`span`,{className:`absolute inset-0`,style:{background:`linear-gradient(90deg, transparent 44%, #C8102E 44% 56%, transparent 56%), linear-gradient(0deg, transparent 40%, #C8102E 40% 60%, transparent 60%)`}})]})}var T={th:C,en:w};function E(){let{locale:e,setLocale:t,messages:n}=a(),[r,i]=(0,f.useState)(!1),s=(0,f.useRef)(null),l=(0,f.useRef)(null);(0,f.useEffect)(()=>{if(!r)return;s.current?.querySelector(`[role="menuitemradio"][aria-checked="true"]`)?.focus();function e(e){s.current?.contains(e.target)||i(!1)}function t(e){e.key===`Escape`&&(i(!1),l.current?.focus())}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]);let u=c.find(t=>t.locale===e)??c[0],p=T[u.locale];function m(e){if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)retLine truncated
+1 -1
View File
@@ -1,4 +1,4 @@
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{r as a,t as o}from"./messages-nFlHChGW.js";import{t as s}from"./createReactComponent-C-DRqPhY.js";import{t as c}from"./footer-icons-kTf1LTdH.js";import{n as l,t as u}from"./contact-link-BLAvkJkh.js";import{a as d}from"./seo-CukKNP_H.js";import{a as f,f as p,t as m,y as h}from"./cinemas-CTA3vCte.js";var g=s(`outline`,`arrow-down`,`ArrowDown`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M18 13l-6 6`,key:`svg-1`}],[`path`,{d:`M6 13l6 6`,key:`svg-2`}]]),_=s(`outline`,`arrow-up`,`ArrowUp`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M18 11l-6 -6`,key:`svg-1`}],[`path`,{d:`M6 11l6 -6`,key:`svg-2`}]]),v=s(`outline`,`grip-vertical`,`GripVertical`,[[`path`,{d:`M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}],[`path`,{d:`M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-3`}],[`path`,{d:`M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-4`}],[`path`,{d:`M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-5`}]]),y=s(`outline`,`photo-up`,`PhotoUp`,[[`path`,{d:`M15 8h.01`,key:`svg-0`}],[`path`,{d:`M12.5 21h-6.5a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v6.5`,key:`svg-1`}],[`path`,{d:`M3 16l5 -5c.928 -.893 2.072 -.893 3 0l3.5 3.5`,key:`svg-2`}],[`path`,{d:`M14 14l1 -1c.679 -.653 1.473 -.829 2.214 -.526`,key:`svg-3`}],[`path`,{d:`M19 22v-6`,key:`svg-4`}],[`path`,{d:`M22 19l-3 -3l-3 3`,key:`svg-5`}]]),b=s(`outline`,`plus`,`Plus`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M5 12l14 0`,key:`svg-1`}]]),x=s(`outline`,`sort-ascending-letters`,`SortAscendingLetters`,[[`path`,{d:`M15 10v-5c0 -1.38 .62 -2 2 -2s2 .62 2 2v5m0 -3h-4`,key:`svg-0`}],[`path`,{d:`M19 21h-4l4 -7h-4`,key:`svg-1`}],[`path`,{d:`M4 15l3 3l3 -3`,key:`svg-2`}],[`path`,{d:`M7 6v12`,key:`svg-3`}]]),S=s(`outline`,`trash`,`Trash`,[[`path`,{d:`M4 7l16 0`,key:`svg-0`}],[`path`,{d:`M10 11l0 6`,key:`svg-1`}],[`path`,{d:`M14 11l0 6`,key:`svg-2`}],[`path`,{d:`M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12`,key:`svg-3`}],[`path`,{d:`M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3`,key:`svg-4`}]]),C=e(t(),1),w=`w-full rounded-lg border border-[#303030] bg-[#141414] px-3 py-2 text-base text-white outline-none transition focus:border-[#A92626] focus-visible:ring-2 focus-visible:ring-[#A92626]/40 sm:text-sm`,T=`flex flex-col gap-1.5 text-xs text-[#999]`,E=`min-h-11 rounded-lg bg-[#8F0808] px-4 text-sm font-medium transition hover:bg-[#a30a0a] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[#D47272]`,D=`min-h-11 rounded-lg border border-[#303030] px-3 text-sm transition hover:border-[#A92626] hover:text-[#D47272] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[#A92626]`,O=`min-h-9 rounded-lg border border-[#303030] px-2.5 text-sm text-[#B3B3B3] transition hover:border-[#A92626] hover:text-[#D47272] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[#A92626] disabled:opacity-40`,k=i(),A=[{code:`th`,label:`ไทย`},{code:`en`,label:`English`}];function j({value:e,defaults:t,onChange:n,onSave:r,saving:i}){let[a,o]=(0,C.useState)(`th`),s=e[a];function c(t){n({...e,[a]:{...s,...t}})}function l(e,t){c({sections:s.sections.map((n,r)=>r===e?{...n,...t}:n)})}function u(e,t){let n=e+t;if(n<0||n>=s.sections.length)return;let r=[...s.sections],[i]=r.splice(e,1);r.splice(n,0,i),c({sections:r})}function d(){c({sections:[...s.sections,{heading:`หัวข้อที่ ${s.sections.length+1}`,body:``}]})}function f(e){c({sections:s.sections.filter((t,n)=>n!==e)})}function p(){n({...e,[a]:t[a]})}let m=s.title.trim()===``,h=s.lead.length>400;return(0,k.jsxs)(`div`,{className:`px-6 py-5`,children:[(0,k.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,k.jsx)(`div`,{role:`tablist`,"aria-label":`ภาษา`,className:`flex items-center gap-1 rounded-lg border border-[#242424] bg-[#141414] p-1`,children:A.map(e=>(0,k.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a===e.code,onClick:()=>o(e.code),className:`min-h-9 rounded-md px-4 text-sm transition ${a===e.code?`bg-[#242424] font-semibold text-[#D47272]`:`text-[#999] hover:text-white`}`,children:e.label},e.code))}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsxs)(`button`,{type:`button`,className:D,onClick:p,children:[`คืนค่าตั้งต้น (`,a.toUpperCase(),`)`]}),(0,k.jsx)(`button`,{type:`button`,className:E,onClick:r,disabled:i,children:i?`กำลังบันทึก…`:`บันทึกหน้าเกี่ยวกับเรา`})]})]}),(0,k.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-[minmax(0,1fr)_360px]`,children:[(0,k.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,k.jsxs)(`label`,{className:T,children:[`หัวข้อหลัก (H1)`,(0,k.jsx)(`input`,{classNamLine truncated
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{r as a,t as o}from"./messages-nFlHChGW.js";import{t as s}from"./createReactComponent-C-DRqPhY.js";import{t as c}from"./footer-icons-kTf1LTdH.js";import{n as l,t as u}from"./contact-link-BLAvkJkh.js";import{a as d}from"./seo-CukKNP_H.js";import{a as f,f as p,t as m,y as h}from"./cinemas-CTA3vCte.js";var g=s(`outline`,`arrow-down`,`ArrowDown`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M18 13l-6 6`,key:`svg-1`}],[`path`,{d:`M6 13l6 6`,key:`svg-2`}]]),_=s(`outline`,`arrow-up`,`ArrowUp`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M18 11l-6 -6`,key:`svg-1`}],[`path`,{d:`M6 11l6 -6`,key:`svg-2`}]]),v=s(`outline`,`grip-vertical`,`GripVertical`,[[`path`,{d:`M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-0`}],[`path`,{d:`M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-1`}],[`path`,{d:`M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-2`}],[`path`,{d:`M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-3`}],[`path`,{d:`M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-4`}],[`path`,{d:`M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`,key:`svg-5`}]]),y=s(`outline`,`photo-up`,`PhotoUp`,[[`path`,{d:`M15 8h.01`,key:`svg-0`}],[`path`,{d:`M12.5 21h-6.5a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v6.5`,key:`svg-1`}],[`path`,{d:`M3 16l5 -5c.928 -.893 2.072 -.893 3 0l3.5 3.5`,key:`svg-2`}],[`path`,{d:`M14 14l1 -1c.679 -.653 1.473 -.829 2.214 -.526`,key:`svg-3`}],[`path`,{d:`M19 22v-6`,key:`svg-4`}],[`path`,{d:`M22 19l-3 -3l-3 3`,key:`svg-5`}]]),b=s(`outline`,`plus`,`Plus`,[[`path`,{d:`M12 5l0 14`,key:`svg-0`}],[`path`,{d:`M5 12l14 0`,key:`svg-1`}]]),x=s(`outline`,`sort-ascending-letters`,`SortAscendingLetters`,[[`path`,{d:`M15 10v-5c0 -1.38 .62 -2 2 -2s2 .62 2 2v5m0 -3h-4`,key:`svg-0`}],[`path`,{d:`M19 21h-4l4 -7h-4`,key:`svg-1`}],[`path`,{d:`M4 15l3 3l3 -3`,key:`svg-2`}],[`path`,{d:`M7 6v12`,key:`svg-3`}]]),S=s(`outline`,`trash`,`Trash`,[[`path`,{d:`M4 7l16 0`,key:`svg-0`}],[`path`,{d:`M10 11l0 6`,key:`svg-1`}],[`path`,{d:`M14 11l0 6`,key:`svg-2`}],[`path`,{d:`M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12`,key:`svg-3`}],[`path`,{d:`M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3`,key:`svg-4`}]]),C=e(t(),1),w=`w-full rounded-lg border border-[#303030] bg-[#141414] px-3 py-2 text-base text-white outline-none transition focus:border-[#A92626] focus-visible:ring-2 focus-visible:ring-[#A92626]/40 sm:text-sm`,T=`flex flex-col gap-1.5 text-xs text-[#999]`,E=`min-h-11 rounded-lg bg-[#8F0808] px-4 text-sm font-medium transition hover:bg-[#a30a0a] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[#D47272]`,D=`min-h-11 rounded-lg border border-[#303030] px-3 text-sm transition hover:border-[#A92626] hover:text-[#D47272] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[#A92626]`,O=`min-h-9 rounded-lg border border-[#303030] px-2.5 text-sm text-[#B3B3B3] transition hover:border-[#A92626] hover:text-[#D47272] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[#A92626] disabled:opacity-40`,k=i(),A=[{code:`th`,label:`ไทย`},{code:`en`,label:`English`}];function j({value:e,defaults:t,onChange:n,onSave:r,saving:i}){let[a,o]=(0,C.useState)(`th`),s=e[a];function c(t){n({...e,[a]:{...s,...t}})}function l(e,t){c({sections:s.sections.map((n,r)=>r===e?{...n,...t}:n)})}function u(e,t){let n=e+t;if(n<0||n>=s.sections.length)return;let r=[...s.sections],[i]=r.splice(e,1);r.splice(n,0,i),c({sections:r})}function d(){c({sections:[...s.sections,{heading:`หัวข้อที่ ${s.sections.length+1}`,body:``}]})}function f(e){c({sections:s.sections.filter((t,n)=>n!==e)})}function p(){n({...e,[a]:t[a]})}let m=s.title.trim()===``,h=s.lead.length>400;return(0,k.jsxs)(`div`,{className:`px-6 py-5`,children:[(0,k.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,k.jsx)(`div`,{role:`tablist`,"aria-label":`ภาษา`,className:`flex items-center gap-1 rounded-lg border border-[#242424] bg-[#141414] p-1`,children:A.map(e=>(0,k.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":a===e.code,onClick:()=>o(e.code),className:`min-h-9 rounded-md px-4 text-sm transition ${a===e.code?`bg-[#242424] font-semibold text-[#D47272]`:`text-[#999] hover:text-white`}`,children:e.label},e.code))}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsxs)(`button`,{type:`button`,className:D,onClick:p,children:[`คืนค่าตั้งต้น (`,a.toUpperCase(),`)`]}),(0,k.jsx)(`button`,{type:`button`,className:E,onClick:r,disabled:i,children:i?`กำลังบันทึก…`:`บันทึกหน้าเกี่ยวกับเรา`})]})]}),(0,k.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-[minmax(0,1fr)_360px]`,children:[(0,k.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,k.jsxs)(`label`,{className:T,children:[`หัวข้อหลัก (H1)`,(0,k.jsx)(`input`,{classNamLine truncated
`),onChange:e=>A({...E,address_lines:e.target.value.split(`
`)})})]})]})}),(0,k.jsx)(M,{title:`คำอธิบายโรงหนัง`,description:`ข้อความที่แสดงใต้ชื่อโรง`,badge:E.description?`มีคำอธิบาย`:`ยังไม่มี`,children:(0,k.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,k.jsxs)(`label`,{className:Z,children:[`คำอธิบาย (TH)`,(0,k.jsx)(`textarea`,{className:`${X} h-20`,value:E.description,onChange:e=>A({...E,description:e.target.value})})]}),(0,k.jsxs)(`label`,{className:Z,children:[`คำอธิบาย (EN)`,(0,k.jsx)(`textarea`,{className:`${X} h-20`,value:E.description_en??``,onChange:e=>A({...E,description_en:e.target.value})})]})]})}),(0,k.jsxs)(`div`,{className:`sticky bottom-0 z-10 -mx-1 flex flex-wrap gap-2 rounded-xl border-t border-[#242424] bg-[#0D0D0D]/95 px-1 py-3 backdrop-blur`,children:[(0,k.jsx)(`button`,{type:`button`,className:$,onClick:()=>void O({cinemas:i.cinemas}),children:`บันทึกทั้งหมด`}),(0,k.jsx)(`button`,{type:`button`,className:Q,onClick:()=>{let e={...E,slug:`${E.slug}-copy-${Date.now().toString().slice(-4)}`,name:`${E.name} (สำเนา)`};N([...i.cinemas,e]),m(e.slug),D(`สร้างสำเนาแล้ว — กดบันทึกเพื่อยืนยัน`)},children:`ทำสำเนา`}),(0,k.jsx)(`button`,{type:`button`,className:Q,onClick:()=>{navigator.clipboard.writeText(h),D(`คัดลอก JSON แล้ว`)},children:`คัดลอก JSON`}),(0,k.jsx)(`button`,{type:`button`,className:`${Q} text-[#D47272]`,onClick:()=>{let e=i.cinemas.filter(e=>e.slug!==E.slug);N(e),m(e[0]?.slug??null)},children:`ลบโรงหนังนี้`})]}),(0,k.jsxs)(`details`,{className:`rounded-xl border border-[#242424] p-3`,children:[(0,k.jsx)(`summary`,{className:`cursor-pointer text-sm text-[#B3B3B3]`,children:`แก้ไขดิบเป็น JSON (คัดลอก/วางได้)`}),(0,k.jsx)(`textarea`,{className:`${X} mt-3 h-72 font-mono text-xs`,value:h,onChange:e=>g(e.target.value),spellCheck:!1}),(0,k.jsx)(`button`,{type:`button`,className:`${Q} mt-2`,onClick:()=>{try{A(JSON.parse(h)),D(`ใช้ JSON แล้ว — กดบันทึกเพื่อยืนยัน`)}catch{D(`JSON ไม่ถูกต้อง`)}},children:`ใช้ JSON นี้`})]}),(0,k.jsxs)(`details`,{className:`rounded-xl border border-[#242424] p-3`,children:[(0,k.jsx)(`summary`,{className:`cursor-pointer text-sm text-[#B3B3B3]`,children:`วาง JSON เพื่อเพิ่มโรงหนัง (ทับ slug ที่ซ้ำ)`}),(0,k.jsx)(`textarea`,{className:`${X} mt-3 h-40 font-mono text-xs`,value:_,onChange:e=>v(e.target.value),placeholder:`{"slug":"new-cinema","name":"NEW CINEMA","tags":[]}`,spellCheck:!1}),(0,k.jsx)(`button`,{type:`button`,className:`${Q} mt-2`,onClick:async()=>{let e=await fetch(`/api/admin/cinemas/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({raw:_})});if(!e.ok){D((await e.json().catch(()=>({}))).statusMessage??`นำเข้าไม่สำเร็จ`);return}let t=await e.json();a(t.store),v(``),D(`นำเข้า ${t.imported} รายการแล้ว`)},children:`นำเข้า / วางทับ`})]})]}):(0,k.jsx)(`p`,{className:`text-sm text-[#999]`,children:`เลือกโรงหนังหรือเพิ่มใหม่ก่อน`})})]}):null,t===`about`?(0,k.jsx)(j,{value:i.about,defaults:I,onChange:ee,onSave:()=>void O({about:i.about}),saving:w}):null,t===`forCinemas`?(0,k.jsx)(re,{value:i.forCinemas,defaults:oe,onChange:te,onSave:()=>void O({forCinemas:i.forCinemas}),saving:w,saveLabel:`บันทึกหน้าสำหรับคนทำโรงหนัง`}):null,t===`forFilmLovers`?(0,k.jsx)(re,{value:i.forFilmLovers,defaults:L,onChange:ne,onSave:()=>void O({forFilmLovers:i.forFilmLovers}),saving:w,saveLabel:`บันทึกหน้าสำหรับคนรักหนัง`}):null,t===`terms`?(0,k.jsxs)(`div`,{className:`px-6 py-5`,children:[(0,k.jsxs)(`p`,{className:`mb-3 text-sm text-[#999]`,children:[`แก้คำศัพท์ตามภาษา — key เป็นตำแหน่งข้อความในหน้าเว็บ (เช่น`,` `,(0,k.jsx)(`code`,{children:`hero.subtitle`}),`) เว้นว่างไว้แปลว่าใช้ค่าเดิม`]}),(0,k.jsxs)(`div`,{className:`mb-3 flex flex-wrap gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,className:$,onClick:()=>void O({site:i.site}),children:`บันทึกคำศัพท์`}),(0,k.jsx)(`button`,{type:`button`,className:Q,onClick:()=>F({...i.site,terms:[...i.site.terms,{key:`custom.term${i.site.terms.length+1}`,values:Object.fromEntries(z.map(e=>[e.code,``]))}]}),children:`+ เพิ่มคำศัพท์`}),f.map(e=>{let t=`venues.${e}`,n=i.site.terms.some(e=>e.key===t);r Line truncated
`),t=new Blob([`query,count,zero_result_count,click_count
+1 -1
View File
@@ -1 +1 @@
var e={name:`AlterFlixHub`,title:`AlterFlixHub — โรงหนังอิสระ อาร์ตเฮาส์ และกลุ่มคนฉายหนังในไทย`,description:`รวมโรงหนังอิสระและอาร์ตเฮาส์ในประเทศไทยไว้ที่เดียว พร้อมที่ตั้ง วิธีเดินทาง สิ่งอำนวยความสะดวก และปุ่มหาภาพยนตร์โรงใกล้ฉัน`,locale:`th_TH`,ogImage:`/og/alterflixhub-1200x630.png`,staticPages:[{path:`/`,priority:`1.0`,changeFrequency:`daily`},{path:`/for-film-lovers`,priority:`0.7`,changeFrequency:`monthly`},{path:`/for-cinemas`,priority:`0.7`,changeFrequency:`monthly`},{path:`/about`,priority:`0.5`,changeFrequency:`yearly`}]};function t(e,t){let n=t.startsWith(`/`)?t:`/${t}`;return`${e.replace(/\/+$/,``)}${n}`}function n(e){if(!e)return``;for(let t of e){let e=t.data;if(typeof e?.siteUrl==`string`&&e.siteUrl!==``)return e.siteUrl}return``}function r({origin:n,title:r,description:i,path:a,type:o=`website`,noIndex:s=!1}){let c=t(n,a),l=t(n,e.ogImage);return[{title:r},{name:`description`,content:i},{name:`robots`,content:s?`noindex, nofollow`:`index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1`},{tagName:`link`,rel:`canonical`,href:c},{property:`og:type`,content:o},{property:`og:site_name`,content:e.name},{property:`og:locale`,content:e.locale},{property:`og:title`,content:r},{property:`og:description`,content:i},{property:`og:url`,content:c},{property:`og:image`,content:l},{property:`og:image:width`,content:`1200`},{property:`og:image:height`,content:`630`},{property:`og:image:alt`,content:e.name},{name:`twitter:card`,content:`summary_large_image`},{name:`twitter:title`,content:r},{name:`twitter:description`,content:i},{name:`twitter:image`,content:l}]}function i(n){return[{"script:ld+json":{"@context":`https://schema.org`,"@graph":[{"@type":`WebSite`,"@id":`${n}/#website`,url:`${n}/`,name:e.name,description:e.description,inLanguage:`th-TH`,publisher:{"@id":`${n}/#organization`},potentialAction:{"@type":`SearchAction`,target:`${n}/?q={search_term_string}`,"query-input":`required name=search_term_string`}},{"@type":`Organization`,"@id":`${n}/#organization`,name:e.name,url:`${n}/`,logo:t(n,`/icon-512.png`)}]}}]}function a(e,n){return[{"script:ld+json":{"@context":`https://schema.org`,"@type":`BreadcrumbList`,itemListElement:n.map((n,r)=>({"@type":`ListItem`,position:r+1,name:n.name,item:t(e,n.path)}))}}]}function o(e){let n=e.image&&e.image.trim()!==``?e.image:null;return[{"script:ld+json":{"@context":`https://schema.org`,"@type":`MovieTheater`,name:e.name,description:e.description,url:t(e.origin,e.path),...n?{image:n.startsWith(`http`)?n:t(e.origin,n)}:{},...e.coordinates?{geo:{"@type":`GeoCoordinates`,latitude:e.coordinates.latitude,longitude:e.coordinates.longitude}}:{},address:{"@type":`PostalAddress`,addressCountry:`TH`,...e.locationLabel?{streetAddress:e.locationLabel}:{}},...e.mapUrl?{hasMap:e.mapUrl}:{}}}]}function s(n){return[{"script:ld+json":{"@context":`https://schema.org`,"@type":`Article`,headline:n.headline,description:n.description,inLanguage:`th-TH`,mainEntityOfPage:t(n.origin,n.path),author:{"@type":`Organization`,name:e.name},publisher:{"@type":`Organization`,name:e.name}}}]}export{r as a,n as i,a as n,i as o,o as r,e as s,s as t};
var e={name:`AlterFlixHub`,title:`AlterFlixHub — โรงหนังอิสระ อาร์ตเฮาส์ และกลุ่มคนฉายหนังในไทย`,description:`รวมโรงหนังอิสระและอาร์ตเฮาส์ในประเทศไทยไว้ที่เดียว พร้อมที่ตั้ง วิธีเดินทาง สิ่งอำนวยความสะดวก และปุ่มหาภาพยนตร์โรงใกล้ฉัน`,locale:`th_TH`,ogImage:`https://storage.hobbypj.com/hobbypj/alterflixhub/og/alterflixhub-1200x630.png`,staticPages:[{path:`/`,priority:`1.0`,changeFrequency:`daily`},{path:`/for-film-lovers`,priority:`0.7`,changeFrequency:`monthly`},{path:`/for-cinemas`,priority:`0.7`,changeFrequency:`monthly`},{path:`/about`,priority:`0.5`,changeFrequency:`yearly`}]};function t(e,t){let n=t.startsWith(`/`)?t:`/${t}`;return`${e.replace(/\/+$/,``)}${n}`}function n(e){if(!e)return``;for(let t of e){let e=t.data;if(typeof e?.siteUrl==`string`&&e.siteUrl!==``)return e.siteUrl}return``}function r({origin:n,title:r,description:i,path:a,type:o=`website`,noIndex:s=!1}){let c=t(n,a),l=t(n,e.ogImage);return[{title:r},{name:`description`,content:i},{name:`robots`,content:s?`noindex, nofollow`:`index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1`},{tagName:`link`,rel:`canonical`,href:c},{property:`og:type`,content:o},{property:`og:site_name`,content:e.name},{property:`og:locale`,content:e.locale},{property:`og:title`,content:r},{property:`og:description`,content:i},{property:`og:url`,content:c},{property:`og:image`,content:l},{property:`og:image:width`,content:`1200`},{property:`og:image:height`,content:`630`},{property:`og:image:alt`,content:e.name},{name:`twitter:card`,content:`summary_large_image`},{name:`twitter:title`,content:r},{name:`twitter:description`,content:i},{name:`twitter:image`,content:l}]}function i(n){return[{"script:ld+json":{"@context":`https://schema.org`,"@graph":[{"@type":`WebSite`,"@id":`${n}/#website`,url:`${n}/`,name:e.name,description:e.description,inLanguage:`th-TH`,publisher:{"@id":`${n}/#organization`},potentialAction:{"@type":`SearchAction`,target:`${n}/?q={search_term_string}`,"query-input":`required name=search_term_string`}},{"@type":`Organization`,"@id":`${n}/#organization`,name:e.name,url:`${n}/`,logo:t(n,`/icon-512.png`)}]}}]}function a(e,n){return[{"script:ld+json":{"@context":`https://schema.org`,"@type":`BreadcrumbList`,itemListElement:n.map((n,r)=>({"@type":`ListItem`,position:r+1,name:n.name,item:t(e,n.path)}))}}]}function o(e){let n=e.image&&e.image.trim()!==``?e.image:null;return[{"script:ld+json":{"@context":`https://schema.org`,"@type":`MovieTheater`,name:e.name,description:e.description,url:t(e.origin,e.path),...n?{image:n.startsWith(`http`)?n:t(e.origin,n)}:{},...e.coordinates?{geo:{"@type":`GeoCoordinates`,latitude:e.coordinates.latitude,longitude:e.coordinates.longitude}}:{},address:{"@type":`PostalAddress`,addressCountry:`TH`,...e.locationLabel?{streetAddress:e.locationLabel}:{}},...e.mapUrl?{hasMap:e.mapUrl}:{}}}]}function s(n){return[{"script:ld+json":{"@context":`https://schema.org`,"@type":`Article`,headline:n.headline,description:n.description,inLanguage:`th-TH`,mainEntityOfPage:t(n.origin,n.path),author:{"@type":`Organization`,name:e.name},publisher:{"@type":`Organization`,name:e.name}}}]}export{r as a,n as i,a as n,i as o,o as r,e as s,s as t};