mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-04 16:26:18 +00:00
13 lines
9.1 KiB
JavaScript
13 lines
9.1 KiB
JavaScript
![]() |
import{J as S,q as j,r as h,c as a,f as t,a as e,d as x,t as y,F as k,i as D,b as u,n as $,u as C,e as w,m as N,y as O,j as P,D as U,z as I,I as V,g as B,K as G,H as z,L as E,w as T,h as q,_ as M}from"./index-DrDyuimr.js";import{D as R}from"./DashboardClientAssignmentStore-DBxg-o3U.js";import{L as m}from"./localeText-BMwkcqAG.js";const W={class:"card rounded-0 border-0"},F={role:"button",class:"ms-auto text-white"},H={key:0,class:"bi bi-chevron-compact-down"},J={key:1,class:"bi bi-chevron-compact-up"},K={key:0,class:"card-body p-0"},Y={class:"list-group list-group-flush"},Q={key:0},X={class:"text-body"},Z={class:"text-muted"},ee={key:1},se={class:"text-body"},te={class:"text-muted"},le=["onClick"],ne=["onClick"],L=S({__name:"availablePeersGroup",props:["configuration","peers","clientAssignedPeers","availablePeerSearchString"],emits:["assign","unassign"],setup(r,{emit:v}){const i=r,b=v,d=R(),o=j(()=>i.clientAssignedPeers&&Object.keys(i.clientAssignedPeers).includes(i.configuration)?i.peers.filter(f=>!i.clientAssignedPeers[i.configuration].map(s=>s.id).includes(f.id)&&(!i.availablePeerSearchString||i.availablePeerSearchString&&(f.id.includes(i.availablePeerSearchString)||f.name.includes(i.availablePeerSearchString)))):i.peers),p=h(!1),c=h(!1);return(f,s)=>(t(),a("div",W,[e("div",{onClick:s[0]||(s[0]=n=>c.value=!c.value),role:"button",class:"card-header rounded-0 sticky-top z-5 bg-body-secondary border-0 border-bottom text-white d-flex"},[e("small",null,[e("samp",null,y(r.configuration),1)]),e("a",F,[c.value?(t(),a("i",H)):(t(),a("i",J))])]),c.value?x("",!0):(t(),a("div",K,[e("div",Y,[(t(!0),a(k,null,D(o.value,n=>(t(),a("div",{class:"list-group-item d-flex border-bottom list-group-item-action d-flex align-items-center gap-3",key:n.id},[p.value?(t(),a("div",ee,[e("small",se,[u(m,{t:"Are you sure to remove this peer?"})]),s[2]||(s[2]=e("br",null,null,-1)),e("small",te,[e("samp",null,y(n.id),1)])])):(t(),a("div",Q,[e("small",X,[e("samp",null,y(n.id),1)]),s[1]||(s[1]=e("br",null,null,-1)),e("small",Z,y(n.name?n.name:"Untitled Peer"),1)])),r.clientAssignedPeers?(t(),a("button",{key:2,onClick:l=>b("assign",n.id),class:$([{disabled:C(d).assigning},"btn bg-success-subtle text-success-emphasis ms-auto"])},s[3]||(s[3]=[e("i",{class:"bi bi-plus-circle-fill"},null,-1)]),10,le)):(t(),a("button",{key:3,onClick:l=>b("unassign",n.assignment_id),class:$([{disabled:C(d).unassigning},"btn bg-danger-subtle text-danger-emphasis ms-auto"]),"aria-label":"Delete Assignment"},s[4]||(s[4]=[e("i",{class:"bi bi-trash-fill"},null,-1)]),10,ne))]))),128))])]))]))}}),ae={key:0,class:"d-flex rounded-0 border-0 flex-column d-flex flex-column border-bottom pb-1"},ie={class:"d-flex flex-column p-3 gap-3"},oe={class:"d-flex align-items-center"},re={class:"mb-0"},de={class:"text-bg-primary badge ms-2"},ce={class:"text-bg-info badge ms-2"},ue={class:"rounded-3 availablePeers border h-100 overflow-scroll flex-grow-1 d-flex flex-column"},me={key:0,class:"text-muted m-auto p-3"},ge={key:0,style:{height:"500px"},class:"d-flex flex-column p-3"},ve={class:"availablePeers border h-100 card rounded-3"},be={class:"card-header sticky-top p-3"},fe={class:"mb-0 d-flex align-items-center"},he={class:"card-body p-0 overflow-scroll"},pe={key:0,class:"text-muted m-auto"},ye={class:"card-footer d-flex gap-2 p-3 align-items-center justify-content-end"},_e={key:1},xe=S({__name:"clientAssignedPeers",props:["client","clientAssignedPeers"],emits:["refresh"],setup(r,{emit:v}){const i=r,b=h(!1),d=R(),o=h(!1),p=v,c=async(n,l,g)=>{await d.assignClient(n,l,g,!1),p("refresh")},f=async n=>{await d.unassignClient(void 0,void 0,n),p("refresh")},s=h("");return(n,l)=>(t(),a("div",null,[b.value?(t(),a("div",_e,l[8]||(l[8]=[e("div",{class:"p-3 placeholder-glow border-bottom"},[e("h6",{class:"placeholder w-100 rounded-3"}),e("div",{class:"placeholder w-100 rounded-3",style:{height:"400px"}})],-1)]))):(t(),a("div",ae,[e("div",ie,[e("div",oe,[e("h6",re,[u(m,{t:"Assigned Peers"}),e("span",de,[w(y(Object.keys(r.clientAssignedPeers).length)+" ",1),u(m,{t:Object.keys(r.clientAssignedPeers).length>1?"Co
|
|||
|
|
|||
|
We received a request to reset the password for your account. You can reset your password by visiting the link below:
|
|||
|
|
|||
|
${c(n)}
|
|||
|
|
|||
|
This link will expire in 30 minutes for your security. If you didn’t request a password reset, you can safely ignore this email—your current password will remain unchanged.
|
|||
|
|
|||
|
If you need help, feel free to contact support.
|
|||
|
|
|||
|
Best regards,
|
|||
|
WGDashboard`};await I("/api/email/send",g,_=>{_.status?(d.value="Send email success.",i.value=!0):(d.value="Send email failed.",b.value=!1,i.value=!0)})}else d.value=`Please share this URL to your client to reset the password: ${c(n)}`,i.value=!0;else b.value=!1,d.value=l.message,i.value=!0}),o.value=!1};return(s,n)=>(t(),a("div",ke,[e("div",we,[e("h6",Pe,[u(m,{t:"Reset Password"})]),e("button",{class:$(["btn btn-sm bg-primary-subtle text-primary-emphasis rounded-3 ms-auto",{disabled:o.value}]),onClick:n[0]||(n[0]=l=>f())},[n[1]||(n[1]=e("i",{class:"bi bi-send me-2"},null,-1)),o.value?(t(),P(m,{key:1,t:"Sending..."})):(t(),P(m,{key:0,t:"Send Password Reset Link"}))],2)]),i.value?(t(),a("div",{key:0,class:$(["alert rounded-3 mb-0",[b.value?"alert-success":"alert-danger"]])},y(d.value),3)):x("",!0)]))}}),Ce={class:"p-4 border-bottom bg-body-tertiary z-0"},Se={class:"mb-3 backLink"},Ae={class:"text-muted"},De={class:"d-flex align-items-center"},Re={class:"text-muted"},Ie={class:"ms-auto"},Le={style:{flex:"1 0 0","overflow-y":"scroll"}},je={key:1,class:"d-flex w-100 h-100 text-muted"},Be={class:"m-auto text-center"},Ne=S({__name:"clientViewer",async setup(r){let v,i;const b=R(),d=G(),o=j(()=>b.getClientById(d.params.id)),p=h({}),c=async()=>{await B("/api/clients/assignedPeers",{ClientID:o.value.ClientID},f=>{p.value=f.data})};return o.value&&(z(()=>o.value.ClientID,async()=>{await c()}),[v,i]=E(()=>c()),await v,i()),(f,s)=>{const n=q("RouterLink");return o.value?(t(),a("div",{class:"text-body d-flex flex-column overflow-y-scroll h-100",key:o.value.ClientID},[e("div",Ce,[e("div",Se,[u(n,{to:"/clients",class:"text-body text-decoration-none"},{default:T(()=>s[1]||(s[1]=[e("i",{class:"bi bi-arrow-left me-2"},null,-1),w(" Back")])),_:1,__:[1]})]),e("small",Ae,[u(m,{t:"Email"})]),e("h1",null,y(o.value.Email),1),e("div",De,[e("small",Re,[u(m,{t:"Client ID"})]),e("small",Ie,[e("samp",null,y(o.value.ClientID),1)])])]),e("div",Le,[u(xe,{onRefresh:s[0]||(s[0]=l=>c()),clientAssignedPeers:p.value,client:o.value},null,8,["clientAssignedPeers","client"]),o.value.ClientGroup==="Local"?(t(),P($e,{key:0,client:o.value},null,8,["client"])):x("",!0)])])):(t(),a("div",je,[e("div",Be,[s[2]||(s[2]=e("h1",null,[e("i",{class:"bi bi-person-x"})],-1)),e("p",null,[u(m,{t:"Client does not exist"})])])]))}}}),Ge=M(Ne,[["__scopeId","data-v-d8c19c6a"]]);export{Ge as default};
|