PageSourceSearch

https://cs2locker.com/_nuxt/DdLikiMH.js

js cs2locker.com collected 2026-10-05 18:47:06 UTC 4,683 bytes, 1 lines download raw bytes

1import{m as C,f as c,B as I,D as s,R as t,P as i,S as d,a8 as S,a9 as D,aa as M,L as x,W as f,Q as a,V as k}from"./S4n9--Ba.js";const P={class:"min-h-screen bg-background py-10 px-4 lg:px-8"},$={class:"max-w-4xl mx-auto space-y-8"},A={key:0,class:"bg-red-500/10 border border-red-500/20 p-4 rounded-lg text-red-500 text-sm"},N={key:1,class:"bg-green-500/10 border border-green-500/20 p-4 rounded-lg text-green-500 text-sm"},T={class:"bg-card border border-border rounded-xl p-5 space-y-3"},E={class:"flex gap-2"},R=["disabled"],V={key:0,class:"divide-y divide-border border border-border rounded-lg"},B=["src"],L={class:"min-w-0 flex-1"},q={class:"block truncate text-sm font-medium"},F={class:"block truncate text-xs text-muted-foreground"},K=["onClick"],O=["onClick"],U={key:1,class:"text-sm text-muted-foreground"},G={class:"bg-card border border-border rounded-xl overflow-hidden"},H={class:"border-b border-border px-5 py-3 font-semibold text-sm"},Q={key:0,class:"px-5 py-8 text-center text-sm text-muted-foreground"},W={key:1,class:"divide-y divide-border"},j=["src"],z={class:"min-w-0 flex-1"},J={class:"block truncate text-sm font-medium"},X={class:"block truncate text-xs text-muted-foreground"},Y=["onClick"],h="shop_access",te=C({__name:"shop-access",setup(Z){const u=c(""),g=c(!1),b=c([]),m=c([]),n=c(""),l=c("");async function v(){try{const o=await $fetch("/api/admin/permissions",{query:{permission:h}});m.value=o.permittedUsers}catch(o){n.value=o?.data?.statusMessage||"Could not load the list"}}async function p(){if(!(u.value.trim().length<2)){n.value="";try{const o=await $fetch("/api/admin/permissions",{query:{permission:h,search:u.value.trim()}});b.value=o.searchResults,g.value=!0}catch(o){n.value=o?.data?.statusMessage||"Search failed"}}}async function w(o){n.value="",l.value="";try{await $fetch("/api/admin/permissions",{method:"POST",body:{steamId:o,permission:h}}),l.value="Access given. They see the shop on their next page load.",await Promise.all([v(),p()])}catch(r){n.value=r?.data?.statusMessage||"Could not give access"}}async function _(o){n.value="",l.value="";try{await $fetch("/api/admin/permissions",{method:"DELETE",body:{steamId:o,permission:h}}),l.value="Access removed.",await Promise.all([v(),p()])}catch(r){n.value=r?.data?.statusMessage||"Could not remove access"}}return I(v),(o,r)=>(a(),s("div",P,[t("div",$,[r[2]||(r[2]=t("div",null,[t("h1",{class:"text-2xl font-bold"},"Shop access"),t("p",{class:"text-muted-foreground text-sm mt-1"}," The shop is open to admins and to the people listed here. Add someone to let them test buying, selling and swapping. ")],-1)),n.value?(a(),s("div",A,d(n.value),1)):i("",!0),l.value?(a(),s("div",N,d(l.value),1)):i("",!0),t("div",T,[r[1]||(r[1]=t("label",{class:"block text-sm font-medium"},"Find a user",-1)),t("div",E,[S(t("input",{"onUpdate:modelValue":r[0]||(r[0]=e=>u.value=e),type:"search",placeholder:"Steam name or SteamID64",class:"flex-1 h-10 rounded-lg border border-border bg-muted/30 px-3 text-sm",onKeyup:M(p,["enter"])},null,544),[[D,u.value]]),t("button",{class:"h-10 px-4 rounded-lg border border-border text-sm font-semibold hover:bg-accent",disabled:u.value.trim().length<2,onClick:p},"Search",8,R)]),b.value.length?(a(),s("ul",V,[(a(!0),s(x,null,f(b.value,e=>(a(),s("li",{key:e.steamId,class:"flex items-center gap-3 px-3 py-2.5"},[e.avatar?(a(),s("img",{key:0,src:e.avatar,alt:"",class:"h-8 w-8 rounded-full"},null,8,B)):i("",!0),t("span",L,[t("span",q,d(e.username||e.steamId),1),t("span",F,d(e.steamId),1)]),e.hasPermission?(a(),s("button",{key:1,class:"shrink-0 rounded-lg border border-border px-3 py-1.5 text-xs font-semibold hover:bg-accent",onClick:y=>_(e.steamId)},"Remove access",8,K)):(a(),s("button",{key:2,class:"shrink-0 rounded-lg bg-primary px-3 py-1.5 text-xs font-semibold text-primary-foreground hover:bg-primary/90",onClick:y=>w(e.steamId)},"Give access",8,O))]))),128))])):g.value?(a(),s("p",U,"No user found.")):i("",!0)]),t("div",G,[t("div",H,"Has access ("+d(m.value.length)+")",1),m.value.length?(a(),s("ul",W,[(a(!0),s(x,null,f(m.value,e=>(a(),s("li",{key:e.steamId,class:"flex items-center gap-3 px-5 py-3"},[e.avatar?(a(),s("img",{key:0,src:e.avatar,alt:"",class:"h-8 w-8 rounded-full"},null,8,j)):i("",!0),t("span",z,[t("span",J,d(e.username||e.steamId),1),t("span",X,[k(d(e.steamId)+" ",1),e.expiresAt?(a(),s(x,{key:0},[k(" · until "+d(new Date(e.expiresAt).toLocaleDateString()),1)],64)):i("",!0)])]),t("button",{class:"shrink-0 rounded-lg border border-border px-3 py-1.5 text-xs font-semibold hover:bg-accent",onClick:y=>_(e.steamId)},"Remove",8,Y)]))),128))])):(a(),s("p",Q,"Nobody yet. Add a tester above."))])])]))}});
1export{te 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.