Files
WGDashboard/src/static/dist/WGDashboardAdmin/assets/clients-BTLjFrK8.js

2 lines
6.1 KiB
JavaScript
Raw Normal View History

2025-09-07 17:04:35 +08:00
import{B as C,q as L,o as B,c as g,a as e,t as y,b as r,F as D,i as N,j as v,w as V,h as I,K as E,f as u,D as O,r as b,L as j,m as x,v as z,e as G,g as w,H as R,k as M,y as T,u as f,G as U,n as $,d as S,_ as q}from"./index-CqpVtsXc.js";import{D as F}from"./DashboardClientAssignmentStore-3mOqJKOK.js";import{L as m}from"./localeText-DKJsmANp.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"},k=C({__name:"clientGroup",props:["groupName","clients","searchString"],setup(h){const l=h,d=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 u(),g("div",H,[e("div",K,[e("h6",P,y(h.groupName),1),e("span",W,[r(m,{t:d.value.length+" Clients"},null,8,["t"])])]),e("div",J,[e("div",Q,[(u(!0),g(D,null,N(d.value,o=>(u(),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",X,y(o.Email),1),e("small",Y,y(o.Name?o.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"},ne=["disabled"],ae={class:"alert alert-dark rounded-3 mb-0"},le=C({__name:"oidcSettings",props:["mode"],async setup(h){let l,d;const n=h,s=O(),a=b(!1),o=b(!1),p=async()=>{await w("/api/oidc/status",{mode:n.mode},t=>{a.value=t.data,o.value=!1})};[l,d]=j(()=>p()),await l,d();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,i)=>(u(),g("div",Z,[e("div",ee,[e("h6",te,[r(m,{t:"OpenID Connect (OIDC)"})]),e("div",se,[e("label",oe,[r(m,{t:a.value?"Enabled":"Disabled"},null,8,["t"])]),x(e("input",{disabled:o.value,"onUpdate:modelValue":i[0]||(i[0]=_=>a.value=_),onChange:i[1]||(i[1]=_=>c()),class:"form-check-input",type:"checkbox",role:"switch",id:"oidc_switch"},null,40,ne),[[z,a.value]])])]),e("div",null,[e("div",ae,[r(m,{t:"Due to security reason, in order to edit OIDC configuration, you will need to edit "}),i[2]||(i[2]=e("code",null,"wg-dashboard-oidc-providers.json",-1)),i[3]||(i[3]=G()),r(m,{t:"directly, then restart WGDashboard to apply the latest settings."})])])]))}}),ie={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 d-flex gap-3 flex-column"},me={class:"d-flex align-items-center"},_e={class:"mb-0"},pe={class:"form-check form-switch ms-auto"},he={class:"form-check-label",for:"oidc_switch"},ge=["disabled"],be=C({__name:"clientSettings",emits:["close"],setup(h,{emit:l}){const d=l,n=O();b(!1);const s=R({enableClients:n.Configuration.Clients.enable}),a=b(!1),o=async()=>{a.value=!0,await w("/api/clients/toggleStatus",{},p=>{s.enableClients=p.data}),a.value=!1};return(p,c)=>(u(),g("div",ie,[e("div",re,[e("div",ce,[e("h4",de,[r(m,{t:"Clients Settings"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:c[0]||(c[0]=t=>d("close"))})]),e("div",ue,[e("div",me,[e("h6",_e,[r(m,{t:"Client Side App"})]),e("div",pe,[e("label",he,[r(m,{t:s.enableClients?"Enabled":"Disabled"},null,8,["t"])]),x(e("input",{disabled:p.oidcStatusLoading,"onUpdate:modelValue":c[1]||(c[1]=t=>s.enableClients=t),onChange:c[2]||