PageSourceSearch

https://moviecool.asia/_nuxt/DwwIBG7g.js

js moviecool.asia collected 2026-10-03 17:57:37 UTC 3,627 bytes, 3 lines download raw bytes

1import{D as s,E as b,Ht as w,J as S,On as l,_ as n,b as U,ct as C,k,mt as x,qt as u,un as B,vn as p}from"./IKVlQCqm.js";import{t as d}from"./0p9REYoh.js";import{t as D}from"./B6d-cI7N2.js";import{t as M}from"./DJX3E4Rx.js";import{t as $}from"./BQoOBjNj.js";import{t as F}from"./CIhpkm062.js";import{t as P}from"./DanHkgse2.js";import{i as j,r as I}from"./DqSY_8uN2.js";import{t as L}from"./C1n7BvLM.js";var K={class:"page !pt-0"},R={class:"space-y-4"},q={class:"buttons"},G=["srcdoc"],H="mailer",z=k({__name:"mailer",setup(Q){$({layout:"backend",middleware:["auth"]});const o=S("DIALOGS"),N=S("BACKEND_NAV");N.value=H;const E={"error_response.pug":{user_name:"王小明",type:"film",tid:"abc12345",item_title:"範例電影標題",report:"演員名字打錯了",reply:"感謝回報,已經修正囉!"},"notify.pug":{subject:"[MovieCool] 系統通知信",body:`王小明 您好,
2
3這是一封系統自動發出的信件。`}},V={template:"",settings:"{}"},O=I({template:j().trim().min(1,"請選擇範本")}),t=p(JSON.parse(JSON.stringify(V))),_=p([]),f=p(""),r=p(""),c=p(!1);w(()=>t.value.template,a=>{const e=a&&E[a]||{};t.value.settings=JSON.stringify(e,null,4)});async function T(a){try{const e=JSON.parse(t.value.settings||"{}"),i=await d("/api/mailer",{method:"POST",body:{template:t.value.template,...e}});f.value=i.html}catch(e){const i=e instanceof SyntaxError?"測試資料 JSON 格式錯誤,請檢查後再試":"預覽失敗,請稍後再試";o.value.alert(i)}}function h(){o.value.alert("請確認必填資料均有正確填寫",()=>setTimeout(()=>scrollTop(),100))}async function A(){if(!t.value.template)return o.value.alert("請先選擇範本");if(!r.value)return o.value.alert("請輸入收件信箱");o.value.confirm(`確定要寄出這封測試信到 ${r.value} 嗎?`,async()=>{c.value=!0;try{const a=JSON.parse(t.value.settings||"{}");await d("/api/mailer/send",{method:"POST",body:{template:t.value.template,to:r.value,...a}}),o.value.inform("測試信已送出")}catch(a){const e=a instanceof SyntaxError?"測試資料 JSON 格式錯誤,請檢查後再試":"寄送失敗,請稍後再試";o.value.alert(e)}finally{c.value=!1}})}return C(async()=>{const a=await d("/api/mailer");_.value=a.map(e=>({label:e,value:e}))}),(a,e)=>{const i=L,v=D,y=F,g=M,J=P;return x(),U("div",K,[e[5]||(e[5]=n("div",{class:"backend_title"},[n("div",{class:"relative"},[n("h1",null,"Mailer 範本預覽"),n("div",{class:"comment"},"選擇範本、填入測試資料,預覽或寄送測試信")])],-1)),s(J,{state:l(t),schema:l(O),onSubmit:T,onError:h},{default:u(()=>[s(y,{class:"ring-0"},{default:u(()=>[n("div",R,[s(i,{modelValue:l(t).template,"onUpdate:modelValue":e[0]||(e[0]=m=>l(t).template=m),name:"template",label:"範本檔名",items:l(_)},null,8,["modelValue","items"]),s(v,{modelValue:l(t).settings,"onUpdate:modelValue":e[1]||(e[1]=m=>l(t).settings=m),name:"settings",label:"測試資料(JSON)",rows:"10",type:"textarea"},null,8,["modelValue"]),s(v,{modelValue:l(r),"onUpdate:modelValue":e[2]||(e[2]=m=>B(r)?r.value=m:null),name:"test_email",label:"收件信箱(寄測試信用)",type:"email",placeholder:"請輸入收件信箱"},null,8,["modelValue"])])]),_:1}),n("div",q,[s(g,{type:"submit"},{default:u(()=>e[3]||(e[3]=[b("預覽",-1)])),_:1,__:[3]}),s(g,{type:"button",color:"neutral",variant:"outline",loading:l(c),onClick:A},{default:u(()=>e[4]||(e[4]=[b("寄送測試信",-1)])),_:1,__:[4]},8,["loading"])])]),_:1},8,["state","schema"]),s(y,{class:"mt-6 ring-0"},{default:u(()=>[n("iframe",{srcdoc:l(f),style:{width:"100%",height:"90vh"}},null,8,G)]),_:1})])}}}),oe=z;export{oe 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.