PageSourceSearch

https://www.goglobal.to/assets/AdminPlatformAccessPage-Ds5gaJ3c.js

js goglobal.to collected 2026-09-24 13:22:26 UTC 2,574 bytes, 3 lines download raw bytes

1import{d as o,j as e}from"./react-vendor-BYeqKmV6.js";import{aE as c,aD as d,a1 as u,F as f,B as j}from"./index-C5_t1zCf.js";import{C as m,a as h,d as g,e as w,b as E}from"./card-CpuziIzR.js";import{L as N}from"./label-BjIbRJ8Q.js";import{S as x}from"./shield-check-Bk7cbA4h.js";import{L as v}from"./loader-circle-KzlnbA1r.js";import"./ui-vendor-FeF8SYpf.js";import"./data-vendor-JFafzwTy.js";function A(l){return Array.from(new Set(l.split(/[\n,]+/).map(a=>a.trim().toLowerCase()).filter(Boolean)))}function B(){const l=c.useUtils(),{data:a}=c.adminPlatformAccess.get.useQuery(void 0,{retry:!1}),r=c.adminPlatformAccess.update.useMutation({onSuccess:async t=>{await l.adminPlatformAccess.get.invalidate(),n(t.config.allowedEmails.join(`
2`)),d.success("Platform access settings saved")},onError:t=>{d.error(u(t))}}),[i,n]=o.useState("");o.useEffect(()=>{a&&n(a.allowedEmails.join(`
3`))},[a]);const s=o.useMemo(()=>A(i),[i]),p=()=>{r.mutate({allowedEmails:s})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Short Link Platform Access"}),e.jsx("p",{className:"mt-1 text-muted-foreground",children:"Control which email addresses can access the short link platform."})]}),e.jsx("div",{className:"grid gap-4 md:grid-cols-1",children:e.jsx(m,{children:e.jsx(h,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"rounded-lg bg-primary/10 p-2",children:e.jsx(x,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold",children:s.length}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Allowed Emails"})]})]})})})}),e.jsxs(m,{children:[e.jsxs(g,{children:[e.jsx(w,{children:"Allowed Email List"}),e.jsx(E,{children:"Only users with an email in this list can access the short link platform. Enter one email per line or separate with commas."})]}),e.jsxs(h,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(N,{children:"Email Whitelist"}),e.jsx(f,{value:i,onChange:t=>n(t.target.value),rows:10,placeholder:"[email protected]"})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:s.length>0?`${s.length} email${s.length===1?"":"s"} will be allowed`:"At least one email is required"})]})]}),e.jsxs(j,{onClick:p,disabled:r.isPending||s.length===0,className:"gap-2",children:[r.isPending?e.jsx(v,{className:"h-4 w-4 animate-spin"}):e.jsx(x,{className:"h-4 w-4"}),"Save Access Settings"]})]})}export{B as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.