mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-03 15:56:17 +00:00
2 lines
5.8 KiB
JavaScript
2 lines
5.8 KiB
JavaScript
import{B as C,q as L,o as B,c as g,a as e,t as y,b as d,F as D,i as N,j as v,w as V,h as I,L as E,f as r,D as O,r as f,I as j,m as x,v as z,g as w,J as R,k as G,y as M,u as b,G as T,n as $,d as S,_ as U}from"./index-B_FN5WmC.js";import{D as q}from"./DashboardClientAssignmentStore-B1hEb4Vg.js";import{L as p}from"./localeText-B3I6AP1L.js";const F={class:"card rounded-0 border-0"},J={class:"card-header d-flex align-items-center rounded-0"},P={class:"my-2"},H={class:"badge text-bg-primary ms-auto"},K={class:"card-body p-0"},Q={class:"list-group list-group-flush clientList"},W={class:"text-body"},X={class:"text-muted"},k=C({__name:"clientGroup",props:["groupName","clients","searchString"],setup(h){const l=h,i=L(()=>{const n=l.searchString.toLowerCase();return l.searchString?l.clients.filter(s=>s.ClientID&&s.ClientID.toLowerCase().includes(n)||s.Email&&s.Email.toLowerCase().includes(n)||s.Name&&s.Name.toLowerCase().includes(n)):l.clients});return E(),B(()=>{document.querySelector(".clientList .active")?.scrollIntoView()}),(n,s)=>{const a=I("RouterLink");return r(),g("div",F,[e("div",J,[e("h6",P,y(h.groupName),1),e("span",H,[d(p,{t:i.value.length+" Client"+(i.value.length>1?"s":"")},null,8,["t"])])]),e("div",K,[e("div",Q,[(r(!0),g(D,null,N(i.value,o=>(r(),v(a,{key:o.ClientID,id:"client_"+o.ClientID,"active-class":"active",to:{name:"Client Viewer",params:{id:o.ClientID}},class:"list-group-item d-flex flex-column border-bottom list-group-item-action client"},{default:V(()=>[e("small",W,y(o.Email),1),e("small",X,y(o.Name?o.Name:"No Name"),1)]),_:2},1032,["id","to"]))),128))])])])}}}),Y={class:"d-flex flex-column gap-2"},Z={class:"d-flex align-items-center"},ee={class:"mb-0"},te={class:"form-check form-switch ms-auto"},se={class:"form-check-label",for:"oidc_switch"},oe=["disabled"],ne=C({__name:"oidcSettings",props:["mode"],async setup(h){let l,i;const n=h,s=O(),a=f(!1),o=f(!1),_=async()=>{await w("/api/oidc/status",{mode:n.mode},t=>{a.value=t.data,o.value=!1})};[l,i]=j(()=>_()),await l,i();const c=async()=>{o.value=!0,await w("/api/oidc/toggle",{mode:n.mode},t=>{t.status||(a.value=!a.value,s.newMessage("Server",t.message,"danger")),o.value=!1})};return(t,u)=>(r(),g("div",Y,[e("div",Z,[e("h6",ee,[d(p,{t:"OpenID Connect (OIDC)"})]),e("div",te,[e("label",se,[d(p,{t:a.value?"Enabled":"Disabled"},null,8,["t"])]),x(e("input",{disabled:o.value,"onUpdate:modelValue":u[0]||(u[0]=m=>a.value=m),onChange:u[1]||(u[1]=m=>c()),class:"form-check-input",type:"checkbox",role:"switch",id:"oidc_switch"},null,40,oe),[[z,a.value]])])])]))}}),ae={class:"position-absolute w-100 h-100 top-0 start-0 z-1 rounded-3 d-flex p-2",style:{"background-color":"#00000070","z-index":"9999"}},le={class:"card m-auto rounded-3",style:{width:"700px"}},ie={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},ce={class:"mb-0"},re={class:"card-body px-4 d-flex gap-3 flex-column"},de={class:"d-flex align-items-center"},ue={class:"mb-0"},me={class:"form-check form-switch ms-auto"},_e={class:"form-check-label",for:"oidc_switch"},pe=["disabled"],he=C({__name:"clientSettings",emits:["close"],setup(h,{emit:l}){const i=l,n=O();f(!1);const s=R({enableClients:n.Configuration.Clients.enable}),a=f(!1),o=async()=>{a.value=!0,await w("/api/clients/toggleStatus",{},_=>{s.enableClients=_.data}),a.value=!1};return(_,c)=>(r(),g("div",ae,[e("div",le,[e("div",ie,[e("h4",ce,[d(p,{t:"Clients Settings"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:c[0]||(c[0]=t=>i("close"))})]),e("div",re,[e("div",de,[e("h6",ue,[d(p,{t:"Client Side App"})]),e("div",me,[e("label",_e,[d(p,{t:s.enableClients?"Enabled":"Disabled"},null,8,["t"])]),x(e("input",{disabled:_.oidcStatusLoading,"onUpdate:modelValue":c[1]||(c[1]=t=>s.enableClients=t),onChange:c[2]||(c[2]=t=>o()),class:"form-check-input",type:"checkbox",role:"switch",id:"oidc_switch"},null,40,pe),[[z,s.enableClients]])])]),d(ne,{mode:"Client"})])])]))}}),ge={class:"text-body w-100 h-100 pb-2 position-relative"},fe={class:"w-100 h-100 card rounded-3"},be={class:"border-bottom z-0"},ve={class:"d-flex text-body align-items-center sticky-top p-3 bg-body-tertiary rounded-top-3",style:{"border-top-right-radius":"0 !important"}},Ce=["placeholder"],ye={class:"row h-100 g-0"},we={class:"d-flex flex-column overflow-y-scroll",style:{flex:"1 0 0"}},xe=C({__name:"clients",async setup(h){let l,i;const n=q();[l,i]=j(()=>n.getClients()),await l,i(),n.getAllConfigurationsPeers();const s=f(""),a=E(),o=f(!1),_=L(()=>Object.fromEntries(Object.entries(n.clients).filter(([c,t])=>Object.keys(n.clients).filter(u=>u!=="Local").includes(c))));return(c,t)=>{const u=I("RouterView");return r(),g("div",ge,[e("div",fe,[d(G,{name:"zoom"},{default:V(()=>[o.value?(r(),v(he,{key:0,onClose:t[0]||(t[0]=m=>o.value=!1)})):S("",!0)]),_:1}),e("div",be,[e("div",ve,[t[4]||(t[4]=e("label",{for:"searchClient"},[e("i",{class:"bi bi-search me-2"})],-1)),x(e("input",{"onUpdate:modelValue":t[1]||(t[1]=m=>s.value=m),id:"searchClient",class:"form-control rounded-3 form-control-sm",placeholder:b(T)("Search Clients..."),type:"email",style:{width:"auto"}},null,8,Ce),[[M,s.value]]),e("button",{class:"btn btn-body ms-auto bg-body-secondary rounded-3 btn-sm",onClick:t[2]||(t[2]=m=>o.value=!o.value)},[t[3]||(t[3]=e("i",{class:"bi bi-gear-fill me-2"},null,-1)),d(p,{t:"Settings"})])])]),e("div",ye,[e("div",{class:$([{hide:b(a).params.id},"col-sm-4 border-end d-flex flex-column clientListContainer"])},[e("div",we,[Object.keys(b(n).clients).includes("Local")?(r(),v(k,{key:0,searchString:s.value,clients:b(n).clients.Local,groupName:"Local"},null,8,["searchString","clients"])):S("",!0),(r(!0),g(D,null,N(_.value,(m,A)=>(r(),v(k,{searchString:s.value,clients:m,groupName:A},null,8,["searchString","clients","groupName"]))),256))])],2),e("div",{class:$([{hide:!b(a).params.id},"col-sm-8 clientViewerContainer"])},[d(u)],2)])])])}}}),Le=U(xe,[["__scopeId","data-v-e441f3fe"]]);export{Le as default};
|