PageSourceSearch

https://chat.lindy.ai/assets/llmPlaygroundSavedRunsView-BZdns3jf.js

js lindy.ai collected 2026-09-24 18:03:11 UTC 4,461 bytes, 1 lines download raw bytes

1import{r as l,j as e}from"./entry-BCe1jibU.js";import{e as R}from"./graphql-4Y3Cu4kt.js";import{b as A,c as n,A as C,a as v,d as F}from"./adminView-DkbsldBq.js";import{A as S}from"./adminLayout-OU-AekOj.js";import{u as I,r as M,e as E}from"./graphql-CbYyICyY.js";import{s as P,d as k}from"./llmPlaygroundData-CnWVJg6L.js";import{f as N}from"./index-Cy14VCe3.js";import"./pathPrefix-DU8I2oCO.js";import"./types-CjJu7saM.js";import"./auth-CgkXDIO7.js";import"./EvalCloneMarker-DeoTUGFR.js";import"./operations-Dn0xY-u2.js";import"./session-C75oaowB.js";import"./identity-X0DTFeA9.js";import"./Identity-QN8NXWkM.js";import"./billing-XWNTP5pu.js";import"./speechToText-BOPKEWM6.js";import"./types-CLw4uLQj.js";import"./shellCache-Br8NUPQk.js";import"./icons-B6i7AQrN.js";import"./index-pNUg2pyP.js";import"./index-tAHLmhMY.js";import"./index-CovN8vff.js";import"./index-CLpGrdKE.js";function L(){const[c,u]=l.useState(""),[x,p]=l.useState(null),[r,o]=l.useState(null),[i,h]=l.useState(!1),[f,j]=l.useState(null),s=I(P,{ownerFilter:x,first:50}),y=l.useMemo(()=>(s.data?.admin?.savedPlaygroundRuns?.edges??[]).flatMap(t=>t?.node?[t.node]:[]),[s.data]),g=()=>p(c.trim()||null),w=t=>{t.key==="Enter"&&g()},b=async()=>{if(r){h(!0),j(null);try{const t=await R(k,{id:r.id});if(!t.llmPlaygroundDeleteRun.data)throw new Error(t.llmPlaygroundDeleteRun.message??"Failed to delete run");s.setData(a=>{const m=a?.admin?.savedPlaygroundRuns;if(!a?.admin||!m)return a;const D=M(m.edges.flatMap(d=>d?.node?[d.node]:[]),r.id);return{...a,admin:{...a.admin,savedPlaygroundRuns:{...m,edges:D.map(d=>({node:d}))}}}}),o(null)}catch(t){j(E(t,"Failed to delete run"))}finally{h(!1)}}};return e.jsxs(S,{title:"Saved Playground Runs",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[e.jsx(A,{placeholder:"Filter by owner email or ID",value:c,onChange:t=>u(t.target.value),onKeyDown:w,className:"sm:max-w-xs","aria-label":"Filter by owner email or ID"}),e.jsx(n,{level:"outline",onClick:g,children:"Filter"}),x?e.jsx(n,{level:"outline",onClick:()=>{u(""),p(null)},children:"Clear"}):null]}),s.loading&&!s.data?e.jsx(C,{}):null,s.error&&!s.data?e.jsx(v,{message:s.error,onRetry:s.refetch}):null,f?e.jsx(v,{message:f}):null,s.data?e.jsx("div",{className:"overflow-x-auto rounded-lg border border-edge",children:e.jsxs("table",{className:"w-full min-w-[800px] text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-edge text-left text-slate-11",children:[e.jsx("th",{className:"px-4 py-2 font-medium",children:"Name"}),e.jsx("th",{className:"px-4 py-2 font-medium",children:"Owner"}),e.jsx("th",{className:"px-4 py-2 font-medium",children:"Revisions"}),e.jsx("th",{className:"px-4 py-2 font-medium",children:"Created"}),e.jsx("th",{className:"px-4 py-2 font-medium",children:"Updated"}),e.jsx("th",{className:"px-4 py-2 font-medium"})]})}),e.jsx("tbody",{children:y.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-slate-11",children:"No saved runs found"})}):y.map(t=>e.jsxs("tr",{className:"cursor-pointer border-b border-edge last:border-b-0 hover:bg-slate-2",children:[e.jsx("td",{className:"px-4 py-2",children:e.jsx("a",{href:`/admin/llm-playground?savedRunId=${encodeURIComponent(t.nodeId)}`,className:"text-indigo-500 hover:underline",children:t.name})}),e.jsx("td",{className:"px-4 py-2 font-mono text-xs text-slate-11",children:t.ownerId??"-"}),e.jsx("td",{className:"px-4 py-2",children:t.revisionCount}),e.jsx("td",{className:"px-4 py-2 text-slate-11",children:N(new Date(t.createdAt),{addSuffix:!0})}),e.jsx("td",{className:"px-4 py-2 text-slate-11",children:N(new Date(t.updatedAt),{addSuffix:!0})}),e.jsx("td",{className:"px-4 py-2",children:e.jsx(n,{level:"outline",size:"sm",onClick:()=>o(t),children:"Delete"})})]},t.id))})]})}):null]}),e.jsx(F,{open:r!==null,title:"Delete saved run",onClose:()=>!i&&o(null),children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-slate-11",children:"Are you sure you want to delete this saved run? This action cannot be undone."}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(n,{level:"outline",disabled:i,onClick:()=>o(null),children:"Cancel"}),e.jsx(n,{disabled:i,onClick:b,children:i?"Deleting...":"Delete"})]})]})})]})}function re(){return e.jsx(L,{})}export{L as LLMPlaygroundSavedRunsView,re as View};

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.