2025-08-28 17:58:02 +08:00
|
|
|
import{B as b,q as k,o as B,c as p,a as e,t as y,b as d,F as L,i as D,j as v,w as N,h as V,K as I,f as c,D as O,r as h,L as j,m as E,v as G,e as R,g as w,H as M,k as T,y as A,u as g,G as q,n as x,d as $,_ as F}from"./index-Bf1cwdNU.js";import{D as U}from"./DashboardClientAssignmentStore-C5sYwudF.js";import{L as m}from"./localeText-D6yQa3r-.js";const H={class:"card rounded-0 border-0"},K={class:"card-header d-flex align-items-center rounded-0"},P={class:"my-2"},W={class:"badge text-bg-primary ms-auto"},J={class:"card-body p-0"},Q={class:"list-group list-group-flush clientList"},X={class:"text-body"},Y={class:"text-muted"},S=b({__name:"clientGroup",props:["groupName","clients","searchString"],setup(_){const i=_,r=k(()=>{const o=i.searchString.toLowerCase();return i.searchString?i.clients.filter(a=>a.ClientID&&a.ClientID.toLowerCase().includes(o)||a.Email&&a.Email.toLowerCase().includes(o)||a.Name&&a.Name.toLowerCase().includes(o)):i.clients});return I(),B(()=>{document.querySelector(".clientList .active")?.scrollIntoView()}),(o,a)=>{const n=V("RouterLink");return c(),p("div",H,[e("div",K,[e("h6",P,y(_.groupName),1),e("span",W,[d(m,{t:r.value.length+" Clients"},null,8,["t"])])]),e("div",J,[e("div",Q,[(c(!0),p(L,null,D(r.value,t=>(c(),v(n,{key:t.ClientID,id:"client_"+t.ClientID,"active-class":"active",to:{name:"Client Viewer",params:{id:t.ClientID}},class:"list-group-item d-flex flex-column border-bottom list-group-item-action client"},{default:N(()=>[e("small",X,y(t.Email),1),e("small",Y,y(t.Name?t.Name:"No Name"),1)]),_:2},1032,["id","to"]))),128))])])])}}}),Z={class:"d-flex flex-column gap-2"},ee={class:"d-flex align-items-center"},te={class:"mb-0"},se={class:"form-check form-switch ms-auto"},oe={class:"form-check-label",for:"oidc_switch"},ae=["disabled"],ne={class:"alert alert-dark rounded-3 mb-0"},ie=b({__name:"oidcSettings",props:["mode"],async setup(_){let i,r;const o=_,a=O(),n=h(!1),t=h(!1),C=async()=>{await w("/api/oidc/status",{mode:o.mode},s=>{n.value=s.data,t.value=!1})};[i,r]=j(()=>C()),await i,r();const f=async()=>{t.value=!0,await w("/api/oidc/toggle",{mode:o.mode},s=>{s.status||(n.value=!n.value,a.newMessage("Server",s.message,"danger")),t.value=!1})};return(s,l)=>(c(),p("div",Z,[e("div",ee,[e("h6",te,[d(m,{t:"OpenID Connect (OIDC)"})]),e("div",se,[e("label",oe,[d(m,{t:n.value?"Enabled":"Disabled"},null,8,["t"])]),E(e("input",{disabled:t.value,"onUpdate:modelValue":l[0]||(l[0]=u=>n.value=u),onChange:l[1]||(l[1]=u=>f()),class:"form-check-input",type:"checkbox",role:"switch",id:"oidc_switch"},null,40,ae),[[G,n.value]])])]),e("div",null,[e("div",ne,[d(m,{t:"Due to security reason, in order to edit OIDC configuration, you will need to edit "}),l[2]||(l[2]=e("code",null,"wg-dashboard-oidc-providers.json",-1)),l[3]||(l[3]=R()),d(m,{t:"directly, then restart WGDashboard to apply the latest settings."})])])]))}}),le={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"}},re={class:"card m-auto rounded-3",style:{width:"700px"}},ce={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},de={class:"mb-0"},ue={class:"card-body px-4"},me={class:"py-2"},_e=b({__name:"clientSettings",emits:["close"],setup(_,{emit:i}){const r=i,o=O();return h(!1),M({allow_local_sign_up:o.Configuration.Clients.allow_local_sign_up}),(a,n)=>(c(),p("div",le,[e("div",re,[e("div",ce,[e("h4",de,[d(m,{t:"Clients Settings"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:n[0]||(n[0]=t=>r("close"))})]),e("div",ue,[e("div",me,[d(ie,{mode:"Client"})])])])]))}}),pe={class:"text-body w-100 h-100 pb-2 position-relative"},ge={class:"w-100 h-100 card rounded-3"},he={class:"border-bottom z-0"},fe={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"}},ve=["placeholder"],be={class:"row h-100 g-0"},Ce={class:"d-flex flex-column overflow-y-scroll",style:{flex:"1 0 0"}},ye=b({__name:"clients",async setup(_){let i,r;const o=U();[i,r]=j(()=>o.getClients()),a
|