PageSourceSearch

https://henoun.de/assets/index-9b6642bf.js

js henoun.de collected 2026-10-04 08:09:22 UTC 6,553 bytes, 4 lines download raw bytes

1import{r as o,j as e,p as x,J as h,H as p,u,C as b,D as f,E as w,m as g,G as j,N,M as y}from"../index.js";import{S as v}from"./index-44bf2282.js";/* empty css                 */import{A as c}from"./admin-80960fc6.js";function k({workspace:t,users:r}){var l;const s=o.useRef(null),i=async()=>{var a;if(!window.confirm(`Are you sure you want to delete ${t.name}?
2After you do this it will be unavailable in this instance of AnythingLLM.
3
4This action is irreversible.`))return!1;(a=s==null?void 0:s.current)==null||a.remove(),await c.deleteWorkspace(t.id)};return e.jsx(e.Fragment,{children:e.jsxs("tr",{ref:s,className:"bg-transparent text-white text-opacity-80 text-xs font-medium border-b border-white/10 h-10",children:[e.jsx("th",{scope:"row",className:"px-6 whitespace-nowrap",children:t.name}),e.jsx("td",{className:"px-6 flex items-center",children:e.jsxs("a",{href:x.workspace.chat(t.slug),target:"_blank",rel:"noreferrer",className:"text-white flex items-center hover:underline",children:[e.jsx(h,{className:"mr-2 w-4 h-4"})," ",t.slug]})}),e.jsx("td",{className:"px-6",children:e.jsx("a",{href:x.workspace.settings.members(t.slug),className:"text-white flex items-center underline",children:(l=t.userIds)==null?void 0:l.length})}),e.jsx("td",{className:"px-6",children:t.createdAt}),e.jsx("td",{className:"px-6 flex items-center gap-x-6 h-full mt-1",children:e.jsx("button",{onClick:i,className:"text-xs font-medium text-white/80 light:text-black/80 hover:light:text-red-500 hover:text-red-300 rounded-lg px-2 py-1 hover:bg-white hover:light:bg-red-50 hover:bg-opacity-10",children:e.jsx(p,{className:"h-5 w-5"})})})]})})}function C({closeModal:t}){const[r,s]=o.useState(null),{t:i}=u(),l=async a=>{s(null),a.preventDefault();const n=new FormData(a.target),{workspace:d,error:m}=await c.newWorkspace(n.get("name"));d&&window.location.reload(),s(m)};return e.jsx("div",{className:"fixed inset-0 z-50 overflow-auto bg-black bg-opacity-50 flex items-center justify-center",children:e.jsxs("div",{className:"relative w-full max-w-2xl bg-theme-bg-secondary rounded-lg shadow border-2 border-theme-modal-border",children:[e.jsxs("div",{className:"relative p-6 border-b rounded-t border-theme-modal-border",children:[e.jsx("div",{className:"w-full flex gap-x-2 items-center",children:e.jsx("h3",{className:"text-xl font-semibold text-white overflow-hidden overflow-ellipsis whitespace-nowrap",children:"Create new workspace"})}),e.jsx("button",{onClick:t,type:"button",className:"absolute top-4 right-4 transition-all duration-300 bg-transparent rounded-lg text-sm p-1 inline-flex items-center hover:bg-theme-modal-border hover:border-theme-modal-border hover:border-opacity-50 border-transparent border",children:e.jsx(b,{size:24,weight:"bold",className:"text-white"})})]}),e.jsx("div",{className:"p-6",children:e.jsxs("form",{onSubmit:l,children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"name",className:"block mb-2 text-sm font-medium text-white",children:i("common.workspaces-name")}),e.jsx("input",{name:"name",type:"text",className:"border-none bg-theme-settings-input-bg w-full text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"My workspace",minLength:4,required:!0,autoComplete:"off"})]}),r&&e.jsxs("p",{className:"text-red-400 text-sm",children:["Error: ",r]}),e.jsx("p",{className:"text-white text-opacity-60 text-xs md:text-sm",children:"After creating this workspace only admins will be able to see it. You can add users after it has been created."})]}),e.jsxs("div",{className:"flex justify-between items-center mt-6 pt-6 border-t border-theme-modal-border",children:[e.jsx("button",{onClick:t,type:"button",className:"transition-all duration-300 text-white hover:bg-zinc-700 px-4 py-2 rounded-lg text-sm",children:"Cancel"}),e.jsx("button",{type:"submit",className:"transition-all duration-300 bg-white text-black hover:opacity-60 px-4 py-2 rounded-lg text-sm",children:"Create workspace"})]})]})})]})})}function D(){const{isOpen:t,openModal:r,closeModal:s}=f();return e.jsxs("div",{className:"w-screen h-screen overflow-hidden bg-theme-bg
4-container flex",children:[e.jsx(w,{}),e.jsxs("div",{style:{height:g?"100%":"calc(100% - 32px)"},className:"relative md:ml-[2px] md:mr-[16px] md:my-[16px] md:rounded-[16px] bg-theme-bg-secondary w-full h-full overflow-y-scroll p-4 md:p-0",children:[e.jsxs("div",{className:"flex flex-col w-full px-1 md:pl-6 md:pr-[50px] md:py-6 py-16",children:[e.jsxs("div",{className:"w-full flex flex-col gap-y-1 pb-6 border-white/10 border-b-2",children:[e.jsx("div",{className:"items-center flex gap-x-4",children:e.jsx("p",{className:"text-lg leading-6 font-bold text-theme-text-primary",children:"Instance Workspaces"})}),e.jsx("p",{className:"text-xs leading-[18px] font-base text-theme-text-secondary",children:"These are all the workspaces that exist on this instance. Removing a workspace will delete all of its associated chats and settings."})]}),e.jsx("div",{className:"w-full justify-end flex",children:e.jsxs(j,{onClick:r,className:"mt-3 mr-0 mb-4 md:-mb-14 z-10",children:[e.jsx(N,{className:"h-4 w-4",weight:"bold"})," New Workspace"]})}),e.jsx("div",{className:"overflow-x-auto",children:e.jsx(W,{})})]}),e.jsx(y,{isOpen:t,children:e.jsx(C,{closeModal:s})})]})]})}function W(){const[t,r]=o.useState(!0),[s,i]=o.useState([]),[l,a]=o.useState([]);return o.useEffect(()=>{async function n(){const d=await c.users(),m=await c.workspaces();i(d),a(m),r(!1)}n()},[]),t?e.jsx(v,{height:"80vh",width:"100%",highlightColor:"var(--theme-bg-primary)",baseColor:"var(--theme-bg-secondary)",count:1,className:"w-full p-4 rounded-b-2xl rounded-tr-2xl rounded-tl-sm mt-6",containerClassName:"flex w-full"}):e.jsxs("table",{className:"w-full text-xs text-left rounded-lg mt-6 min-w-[640px] border-spacing-0",children:[e.jsx("thead",{className:"text-theme-text-secondary text-xs leading-[18px] font-bold uppercase border-white/10 border-b",children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:"px-6 py-3 rounded-tl-lg",children:"Name"}),e.jsx("th",{scope:"col",className:"px-6 py-3",children:"Link"}),e.jsx("th",{scope:"col",className:"px-6 py-3",children:"Users"}),e.jsx("th",{scope:"col",className:"px-6 py-3",children:"Created On"}),e.jsx("th",{scope:"col",className:"px-6 py-3 rounded-tr-lg",children:" "})]})}),e.jsx("tbody",{children:l.map(n=>e.jsx(k,{workspace:n,users:s},n.id))})]})}export{D 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.