mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-07-16 18:16:59 +00:00
2 lines
9.9 KiB
JavaScript
2 lines
9.9 KiB
JavaScript
|
import{_ as E,r as v,N as V,H as T,a as i,c,b as e,t as B,e as x,n as w,z as P,g as I,D as H,E as U,j as k,d as r,m as _,x as $,v as L,w as M,G as R,q as j,i as g,S as A}from"./index-SSUbX4pf.js";import{d as D}from"./dayjs.min-DLM-rQy6.js";import{V as W}from"./vue-datepicker-tIqIpQlD.js";import{L as h}from"./localeText-Bv7TXms4.js";const O={class:"card rounded-0 border-start-0 border-bottom-0 bg-body-secondary",style:{height:"400px",overflow:"scroll"}},q={class:"card-body"},J={key:0,class:"alert alert-danger rounded-3"},z={class:"font-monospace"},G=["innerText"],F={__name:"peerShareWithEmailBodyPreview",props:["body","selectedPeer"],async setup(s){let t,f;const m=s,b=v(""),p=v(!1),n=v(""),l=async()=>{m.body&&(p.value=!1,b.value="",await P("/api/email/previewBody",{Body:m.body,ConfigurationName:m.selectedPeer.configuration.Name,Peer:m.selectedPeer.id},o=>{o.status?b.value=o.data:n.value=o.message,p.value=!o.status}))};[t,f]=V(()=>l()),await t,f();let d;return T(()=>m.body,async()=>{d===void 0?d=setTimeout(async()=>{await l()},500):(clearTimeout(d),d=setTimeout(async()=>{await l()},500))}),(o,S)=>(i(),c("div",O,[e("div",q,[p.value&&s.body?(i(),c("div",J,[S[0]||(S[0]=e("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),e("span",z,B(n.value),1)])):x("",!0),s.body?(i(),c("div",{key:1,class:w({"opacity-50":p.value}),innerText:b.value},null,10,G)):x("",!0)])]))}},K=E(F,[["__scopeId","data-v-8cfb4d4d"]]),Q={key:0},X={class:"mb-3"},Z={class:"position-relative"},ee=["disabled","placeholder"],te={class:"position-relative"},se=["placeholder","disabled"],ae={class:"row g-0"},oe=["disabled","placeholder"],ie={key:0,class:"col-6"},le={class:"card border-top-0 rounded-top-0 rounded-bottom-3 bg-body-tertiary",style:{border:"var(--bs-border-width) solid var(--bs-border-color)"}},re={class:"card-body d-flex flex-column gap-2"},ne={class:"form-check form-switch ms-auto"},de={class:"form-check-label",for:"livePreview"},ce={class:"form-check form-switch"},ue={class:"form-check-label",for:"includeAttachment"},me=["disabled"],pe={key:0},he={key:1},be={key:1},fe={__name:"peerShareWithEmail",props:["dataCopy","selectedPeer"],emits:["fullscreen"],async setup(s,{emit:t}){let f,m;const b=s,p=v(!1);[f,m]=V(()=>I("/api/email/ready",{},y=>{p.value=y.status})),await f,m();const n=H(),l=U({Receiver:"",Body:n.Configuration.Email.email_template,Subject:"",IncludeAttachment:!1,ConfigurationName:b.selectedPeer.configuration.Name,Peer:b.selectedPeer.id}),d=v(!1),o=v(!1),S=async()=>{o.value=!0,await P("/api/email/send",l,y=>{y.status?n.newMessage("Server","Email sent successfully!","success"):n.newMessage("Server",`Email sent failed! Reason: ${y.message}`,"danger"),o.value=!1})},C=y=>R(y),N=t;return T(d,()=>{N("fullscreen",d.value)}),(y,a)=>{const Y=k("RouterLink");return p.value?(i(),c("div",Q,[e("h6",X,[r(h,{t:"Share with Email"})]),e("form",{class:"d-flex gap-3 flex-column",onSubmit:a[5]||(a[5]=u=>{u.preventDefault(),S()})},[e("div",null,[e("div",Z,[a[6]||(a[6]=e("i",{class:"bi bi-person-circle",style:{position:"absolute",top:"0.4rem",left:"0.75rem"}},null,-1)),_(e("input",{type:"email",class:"form-control rounded-top-3 rounded-bottom-0",style:{"padding-left":"calc( 0.75rem + 24px )"},"onUpdate:modelValue":a[0]||(a[0]=u=>l.Receiver=u),disabled:o.value,placeholder:C("Send to who?"),required:"",id:"email_receiver","aria-describedby":"emailHelp"},null,8,ee),[[$,l.Receiver]])]),e("div",te,[a[7]||(a[7]=e("i",{class:"bi bi-hash",style:{position:"absolute",top:"0.4rem",left:"0.75rem"}},null,-1)),_(e("input",{type:"text",class:"form-control rounded-0 border-top-0 border-bottom-0",style:{"padding-left":"calc( 0.75rem + 24px )"},placeholder:C("Subject"),disabled:o.value,"onUpdate:modelValue":a[1]||(a[1]=u=>l.Subject=u),id:"email_subject","aria-describedby":"emailHelp"},null,8,se),[[$,l.Subject]])]),e("div",ae,[e("div",{class:w([d.value?"col-6":"col-12"])},[_(e("textarea",{class:"form-control rounded-top-0 rounded-bottom-0 font-monospace border-bottom-0","onUpdate:modelValue":a[2]||(a[2]=u=>l.Body=u),disabled:o.value,placeholder:C("Body"),style:{height:"400
|