PageSourceSearch

https://ralphi.ai/build/assets/Index-TOt4BWsN.js

js ralphi.ai collected 2026-10-05 15:47:01 UTC 5,843 bytes, 1 lines download raw bytes

1import{r as S,b as v,c as l,o as c,d as r,u as i,h as $,w as d,a as t,g as w,f as C,v as O,F as k,i as V,t as m,l as j,e as B}from"./app-Dl-qXhxl.js";import{l as M}from"./lodash-D-6771SC.js";import{_ as U}from"./AdminLayout-Ds0LeWAW.js";import{_ as p}from"./SortableHeader-vmpsotvp.js";import{_ as x,r as F}from"./PencilSquareIcon-DLkd2Tci.js";import{_ as I}from"./Pagination-B0cCpqmW.js";import{r as T}from"./UsersIcon-CHw33XU4.js";import{r as E}from"./TrashIcon-BuA45sDP.js";/* empty css            */import"./ApplicationLogo-B59gZexS.js";const L={class:"flex justify-between items-center"},A={class:"py-12"},H={class:"max-w-7xl mx-auto sm:px-6 lg:px-8"},Y={class:"bg-white overflow-hidden shadow-sm sm:rounded-lg"},q={class:"p-6 text-gray-900"},G={class:"mb-6"},J={class:"flex flex-col sm:flex-row gap-4"},K={class:"flex-1"},P={class:"overflow-x-auto"},Q={class:"min-w-full divide-y divide-gray-200"},R={class:"bg-gray-50"},W={class:"bg-white divide-y divide-gray-200"},X={class:"px-6 py-4 whitespace-nowrap"},Z={class:"text-sm font-medium text-gray-900"},tt={class:"px-6 py-4 whitespace-nowrap"},et={class:"text-sm text-gray-900"},st={class:"px-6 py-4 whitespace-nowrap"},ot={class:"text-sm text-gray-500"},rt={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-900"},at={class:"px-6 py-4 whitespace-nowrap text-right"},it={class:"flex items-center justify-end gap-1"},nt={key:0},dt={key:0,class:"text-center py-12"},_t={__name:"Index",props:{tenants:Object,filters:Object},setup(n){var y,_,b;const u=n,o=S({search:((y=u.filters)==null?void 0:y.search)||"",sort_by:((_=u.filters)==null?void 0:_.sort_by)||"created_at",sort_direction:((b=u.filters)==null?void 0:b.sort_direction)||"desc"}),f=M.debounce(()=>{v.get(route("admin.tenants.index"),o,{preserveState:!0,replace:!0})},300),N=a=>{if(!a)return"";const e=new Date(a);if(isNaN(e.getTime()))return"";const s=e.toLocaleString("en-US",{month:"short"}),g=e.toLocaleString("en-US",{day:"2-digit"}),D=e.getFullYear();return`${s}, ${g} ${D}`},h=a=>{o.sort_by===a?o.sort_direction=o.sort_direction==="asc"?"desc":"asc":(o.sort_by=a,o.sort_direction="desc"),f()};function z(a,e){a.preventDefault(),confirm("Are you sure you want to delete this organization? This action cannot be undone.")&&v.delete(route("admin.tenants.destroy",e))}return(a,e)=>(c(),l(k,null,[r(i($),{title:"Organizations"}),r(U,null,{header:d(()=>[t("div",L,[e[3]||(e[3]=t("h2",{class:"font-semibold text-xl text-gray-800 leading-tight"}," Organizations ",-1)),r(i(j),{href:a.route("admin.tenants.create"),class:"inline-flex items-center px-4 py-2 bg-indigo-600 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-indigo-700 focus:bg-indigo-700 active:bg-indigo-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 transition ease-in-out duration-150"},{default:d(()=>[...e[2]||(e[2]=[B(" Create Organization ",-1)])]),_:1},8,["href"])])]),default:d(()=>[t("div",A,[t("div",H,[t("div",Y,[t("div",q,[e[8]||(e[8]=t("div",{class:"mb-6"},[t("h2",{class:"text-2xl font-bold text-gray-900"},"Organizations"),t("p",{class:"text-gray-600 mt-1"},"Manage all organizations in the system")],-1)),t("div",G,[t("div",J,[t("div",K,[C(t("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>o.search=s),type:"text",placeholder:"Search by name or ID...",class:"w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 rounded-md shadow-sm",onInput:e[1]||(e[1]=(...s)=>i(f)&&i(f)(...s))},null,544),[[O,o.search]])])])]),t("div",P,[t("table",Q,[t("thead",R,[t("tr",null,[r(p,{label:"ID",column:"id","sort-by":o.sort_by,"sort-direction":o.sort_direction,onSort:h},null,8,["sort-by","sort-direction"]),r(p,{label:"Name",column:"name","sort-by":o.sort_by,"sort-direction":o.sort_direction,onSort:h},null,8,["sort-by","sort-direction"]),e[4]||(e[4]=t("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"}," Users ",-1)),r(p,{label:"Created",column:"created_at","sort-by":o.sort_by,"sort-direction":o.sort_direction,onSort:h},null,8,["sort-by","sort-direction"]),e[5]||(e[5]=t("th",{scope:"col",class:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider"}," Actions ",-1))])]),t("tbody",W,[(c(!0),l(k,null,V(n.tenants.data,s=>(c(),l("tr",{key:s.id,class:"hover:bg-gray-50"},[t("td",X,[t("div",Z,m(s.id),1)]),t("td",tt,[t("div",et,m(s.name),1)]),t("td",st,[t("div",ot,m(s.users?s.users.length:0)+" users ",1)]),t("td",rt,m(N(s.created_at)),1),t("td",at,[t("div",it,[r(x,{label:"Edit",href:a.route("admin.tenants.edit",s.id),variant:"primary"},{default:d(()=>[r(i(F),{class:"h-4 w-4"})]),_:1},8,["href"]),r(x,{label:"Manage Users",href:a.route("admin.tenants.users.index",s.id),variant:"secondary"},{default:d(()=>[r(i(T),{class:"h-4 w-4"})]),_:1},8,["href"]),r(x,{label:"Delete",variant:"danger",onClick:g=>z(g,s.id)},{default:d(()=>[r(i(E),{class:"h-4 w-4"})]),_:1},8,["onClick"])])])]))),128)),n.tenants.data.length===0?(c(),l("tr",nt,[...e[6]||(e[6]=[t("td",{colspan:"5",class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-center"}
1," No organizations found. ",-1)])])):w("",!0)])])]),r(I,{data:n.tenants},null,8,["data"]),n.tenants.data&&n.tenants.data.length===0?(c(),l("div",dt,[...e[7]||(e[7]=[t("svg",{class:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"})],-1),t("h3",{class:"mt-2 text-sm font-medium text-gray-900"},"No organizations found",-1),t("p",{class:"mt-1 text-sm text-gray-500"},"No organizations match your search criteria.",-1)])])):w("",!0)])])])])]),_:1})],64))}};export{_t 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.