@kaitranntt/ccs 5.13.0-dev.2 → 5.13.0-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION +1 -1
- package/dist/ui/assets/{accounts-BqgbKJ_T.js → accounts-rbj9VREc.js} +1 -1
- package/dist/ui/assets/analytics-zAUBxVOb.js +64 -0
- package/dist/ui/assets/api-WEkECgad.js +1 -0
- package/dist/ui/assets/{cliproxy-jQ6copQ7.js → cliproxy-BuniU2Em.js} +1 -1
- package/dist/ui/assets/dropdown-menu-BtxX1kEU.js +1 -0
- package/dist/ui/assets/{health-CWKKFk6T.js → health-Bh3x7Rdd.js} +1 -1
- package/dist/ui/assets/icons-vQ1Fu1vW.js +1 -0
- package/dist/ui/assets/index-CfmYxSZU.js +10 -0
- package/dist/ui/assets/index-swR-Qynx.css +1 -0
- package/dist/ui/assets/{radix-ui-DAH8Vq_G.js → radix-ui-4P1Sa1Vh.js} +1 -1
- package/dist/ui/assets/{settings-D7tDThbI.js → settings-DooB0EE9.js} +1 -1
- package/dist/ui/assets/shared-CxNt_aVs.js +1 -0
- package/dist/ui/assets/{table-DHr1Oba_.js → table-CwKT3lvs.js} +1 -1
- package/dist/ui/assets/{tanstack-DAI1tKxf.js → tanstack-DcowkQHo.js} +1 -1
- package/dist/ui/index.html +5 -5
- package/dist/web-server/usage-routes.d.ts.map +1 -1
- package/dist/web-server/usage-routes.js +246 -14
- package/dist/web-server/usage-routes.js.map +1 -1
- package/dist/web-server/usage-types.d.ts +49 -0
- package/dist/web-server/usage-types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/analytics-kvupQ2oO.js +0 -64
- package/dist/ui/assets/api-BDi9b5BG.js +0 -1
- package/dist/ui/assets/dropdown-menu-DpmTYmUM.js +0 -1
- package/dist/ui/assets/icons-Pr4HmEFP.js +0 -1
- package/dist/ui/assets/index-BnrVxA3p.css +0 -1
- package/dist/ui/assets/index-JNyH4mtq.js +0 -10
- package/dist/ui/assets/shared-BsRfvJUd.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,K as M,L,M as I,N as k,Q as K,U as R,V as z,W as F}from"./radix-ui-4P1Sa1Vh.js";import{r as m}from"./react-vendor-CjrBBxxX.js";import{u as $,B as p,I as E,c as u,k as A,D as H,l as _,m as q,n as V,o as Q,T as U,p as B,q as C,r as w,s as J,L as Y,C as G,e as W,f as X,t as Z,a as ee,v as y,w as se,x as te}from"./index-CfmYxSZU.js";import{d as ae,f as D,g as ne,u as ie,a as re,b as le}from"./tanstack-DcowkQHo.js";import{T as oe,a as de,b as T,c as ce,d as me,e as ue}from"./table-CwKT3lvs.js";import{D as xe,a as ge,b as fe,c as S,d as he}from"./dropdown-menu-BtxX1kEU.js";import{E as je,x as pe,y as ve,z as Ne,I as be,L as P,X as Ce,J as we,k as ye}from"./icons-vQ1Fu1vW.js";import"./form-utils-DKkU3nz7.js";function De({data:s,onEditSettings:t}){const i=$(),d=ae({data:s,columns:[{accessorKey:"name",header:"Name",size:200},{accessorKey:"settingsPath",header:"Settings Path"},{accessorKey:"configured",header:"Status",size:100,cell:({row:n})=>e.jsx("span",{className:n.original.configured?"text-green-600":"text-yellow-600",children:n.original.configured?"[OK]":"[!]"})},{id:"actions",header:"Actions",size:100,cell:({row:n})=>e.jsxs(xe,{children:[e.jsx(ge,{asChild:!0,children:e.jsx(p,{variant:"ghost",size:"sm",children:e.jsx(je,{className:"w-4 h-4"})})}),e.jsxs(fe,{align:"end",className:"bg-white dark:bg-zinc-950 border shadow-md",children:[t&&e.jsxs(S,{onClick:()=>t(n.original),children:[e.jsx(pe,{className:"w-4 h-4 mr-2"}),"Edit"]}),e.jsx(he,{}),e.jsxs(S,{className:"text-red-600 focus:text-red-600 focus:bg-red-100/50",onClick:()=>i.mutate(n.original.name),children:[e.jsx(ve,{className:"w-4 h-4 mr-2"}),"Delete"]})]})]})}],getCoreRowModel:ne()});return s.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No profiles found. Create one to get started."}):e.jsx("div",{className:"border rounded-md",children:e.jsxs(oe,{children:[e.jsx(de,{children:d.getHeaderGroups().map(n=>e.jsx(T,{children:n.headers.map(r=>{const l=r.id==="actions",f=r.id==="configured",h=r.id==="name";return e.jsx(ce,{className:l?"w-[50px]":f?"w-[100px]":h?"w-[200px]":"w-auto",children:r.isPlaceholder?null:D(r.column.columnDef.header,r.getContext())},r.id)})},n.id))}),e.jsx(me,{children:d.getRowModel().rows.map(n=>e.jsx(T,{children:n.getVisibleCells().map(r=>e.jsx(ue,{children:D(r.column.columnDef.cell,r.getContext())},r.id))},n.id))})]})})}function Te({label:s,...t}){const[i,o]=m.useState(!1);return e.jsxs("div",{className:"space-y-1",children:[s&&e.jsx("label",{className:"text-sm font-medium",children:s}),e.jsxs("div",{className:"relative",children:[e.jsx(E,{type:i?"text":"password",className:"pr-10 font-mono",...t}),e.jsx(p,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3",onClick:()=>o(!i),tabIndex:-1,children:i?e.jsx(Ne,{className:"w-4 h-4"}):e.jsx(be,{className:"w-4 h-4"})})]})]})}function Se({...s}){return e.jsx(M,{"data-slot":"alert-dialog",...s})}function Pe({...s}){return e.jsx(z,{"data-slot":"alert-dialog-portal",...s})}function Ee({className:s,...t}){return e.jsx(F,{"data-slot":"alert-dialog-overlay",className:u("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",s),...t})}function Ae({className:s,...t}){return e.jsxs(Pe,{children:[e.jsx(Ee,{}),e.jsx(L,{"data-slot":"alert-dialog-content",className:u("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",s),...t})]})}function Oe({className:s,...t}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:u("flex flex-col gap-2 text-center sm:text-left",s),...t})}function Me({className:s,...t}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:u("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",s),...t})}function Le({className:s,...t}){return e.jsx(I,{"data-slot":"alert-dialog-title",className:u("text-lg font-semibold",s),...t})}function Ie({className:s,...t}){return e.jsx(k,{"data-slot":"alert-dialog-description",className:u("text-muted-foreground text-sm",s),...t})}function ke({className:s,...t}){return e.jsx(R,{className:u(A(),s),...t})}function Ke({className:s,...t}){return e.jsx(K,{className:u(A({variant:"outline"}),s),...t})}function Re({open:s,onConfirm:t,onCancel:i,title:o,description:d,confirmText:n="Confirm",variant:r="default"}){return e.jsx(Se,{open:s,onOpenChange:l=>!l&&i(),children:e.jsxs(Ae,{children:[e.jsxs(Oe,{children:[e.jsx(Le,{children:o}),e.jsx(Ie,{children:d})]}),e.jsxs(Me,{children:[e.jsx(Ke,{onClick:i,children:"Cancel"}),e.jsx(ke,{onClick:t,className:r==="destructive"?"bg-red-600 hover:bg-red-700":"",children:n})]})]})})}function ze({profileName:s,onClose:t}){const[i,o]=m.useState({}),[d,n]=m.useState(!1),r=ie(),{data:l,isLoading:f,refetch:h}=re({queryKey:["settings",s],queryFn:()=>fetch(`/api/settings/${s}/raw`).then(a=>a.json())}),j=m.useMemo(()=>{const a=l?.settings;if(a)return{...a,env:{...a.env,...i}}},[l?.settings,i]),g=le({mutationFn:async()=>{const a={...l?.settings,env:{...l?.settings?.env,...i}},c=await fetch(`/api/settings/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:a,expectedMtime:l?.mtime})});if(c.status===409)throw new Error("CONFLICT");if(!c.ok)throw new Error("Failed to save");return c.json()},onSuccess:()=>{r.invalidateQueries({queryKey:["settings",s]}),r.invalidateQueries({queryKey:["profiles"]}),y.success("Settings saved"),t()},onError:a=>{a.message==="CONFLICT"?n(!0):y.error(a.message)}}),N=()=>{g.mutate()},v=async a=>{n(!1),a?(await h(),g.mutate()):t()},b=(a,c)=>{o(x=>({...x,[a]:c}))},O=a=>[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/^API_KEY$/,/^AUTH_TOKEN$/,/_SECRET$/,/^SECRET$/].some(x=>x.test(a));return e.jsxs(e.Fragment,{children:[e.jsxs(q,{children:[e.jsxs(V,{children:["Edit Profile: ",s]}),e.jsx(Q,{children:"Configure environment variables and settings for this profile."})]}),f?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(P,{className:"w-8 h-8 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ml-3 text-muted-foreground",children:"Loading settings..."})]}):e.jsxs("div",{className:"flex flex-col h-[60vh]",children:[e.jsxs(U,{defaultValue:"env",className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs(B,{className:"w-full justify-start border-b rounded-none p-0 h-auto bg-transparent",children:[e.jsx(C,{value:"env",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2",children:"Environment"}),e.jsx(C,{value:"general",className:"rounded-none border-b-2 border-transparent data-[state=active]:border-primary data-[state=active]:bg-transparent px-4 py-2",children:"General"})]}),e.jsx(w,{value:"env",className:"flex-1 overflow-hidden p-4 pt-4 m-0",children:e.jsx(J,{className:"h-full pr-4",children:j?.env&&Object.keys(j.env).length>0?e.jsx("div",{className:"space-y-6",children:Object.entries(j.env).map(([a,c])=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(Y,{className:"text-sm font-medium text-foreground",children:a}),O(a)?e.jsx(Te,{value:c,onChange:x=>b(a,x.target.value),className:"font-mono text-sm"}):e.jsx(E,{value:c,onChange:x=>b(a,x.target.value),className:"font-mono text-sm"})]},a))}):e.jsxs("div",{className:"py-12 text-center text-muted-foreground bg-muted/30 rounded-lg border border-dashed",children:[e.jsx("p",{children:"No environment variables configured."}),e.jsx("p",{className:"text-xs mt-1",children:"Add variables in your settings.json file."})]})})}),e.jsx(w,{value:"general",className:"p-4 m-0",children:e.jsxs(G,{children:[e.jsxs(W,{children:[e.jsx(X,{className:"text-base",children:"Profile Information"}),e.jsx(Z,{children:"Details about this configuration file."})]}),e.jsx(ee,{className:"space-y-4",children:l&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-sm",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Path"}),e.jsx("code",{className:"col-span-2 bg-muted p-1 rounded text-xs break-all",children:l.path})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 text-sm",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Last Modified"}),e.jsx("span",{className:"col-span-2",children:new Date(l.mtime).toLocaleString()})]})]})})]})})]}),e.jsxs("div",{className:"pt-4 mt-auto border-t flex justify-end gap-2",children:[e.jsxs(p,{type:"button",variant:"outline",onClick:t,children:[e.jsx(Ce,{className:"w-4 h-4 mr-2"})," Cancel"]}),e.jsx(p,{onClick:N,disabled:g.isPending,children:g.isPending?e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"w-4 h-4 mr-2 animate-spin"})," Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"w-4 h-4 mr-2"})," Save Changes"]})})]})]}),e.jsx(Re,{open:d,title:"File Modified Externally",description:"This settings file was modified by another process. Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>v(!0),onCancel:()=>v(!1)})]})}function Fe({open:s,onClose:t,profileName:i}){const o=m.useCallback(d=>{d||t()},[t]);return e.jsx(H,{open:s,onOpenChange:o,children:e.jsx(_,{className:"sm:max-w-3xl max-h-[80vh] overflow-y-auto",children:s&&i&&e.jsx(ze,{profileName:i,onClose:t},`${i}-${s}`)})})}function Je(){const[s,t]=m.useState(!1),[i,o]=m.useState(null),[d,n]=m.useState(!1),[r,l]=m.useState(null),{data:f,isLoading:h}=se(),j=v=>{l(v.name),n(!0)},g=()=>{t(!1),o(null)},N=()=>{n(!1),l(null)};return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"API Profiles"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage custom API profiles for Claude CLI"})]}),e.jsxs(p,{onClick:()=>t(!0),children:[e.jsx(ye,{className:"w-4 h-4 mr-2"}),"Create Profile"]})]}),h?e.jsx("div",{className:"text-muted-foreground",children:"Loading profiles..."}):e.jsx(De,{data:f?.profiles||[],onEditSettings:j}),e.jsx(te,{open:s,onClose:g,profile:i}),e.jsx(Fe,{open:d,onClose:N,profileName:r})]})}export{Je as ApiPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-DAH8Vq_G.js";import{r as l}from"./react-vendor-CjrBBxxX.js";import{r as f,t as h,s as $,B as d,D as G,h as U,i as H,j as W,k as X,C as v,a as N,L,I as K}from"./index-JNyH4mtq.js";import{D as Y,a as J,b as Z,c as R}from"./dropdown-menu-DpmTYmUM.js";import{a as _,u as b,b as C,d as he,f as V,g as pe}from"./tanstack-DAI1tKxf.js";import{T as ge,a as fe,b as z,c as je,d as ve,e as Ne}from"./table-DHr1Oba_.js";import{w as y,E as ye,s as ee,x as se,a as E,T as te,h as w,i as ae,y as T,R as re,X as we,k as be,z as O,G as Ce}from"./icons-Pr4HmEFP.js";import"./form-utils-DKkU3nz7.js";function Ae(){return _({queryKey:["cliproxy"],queryFn:()=>f.cliproxy.list()})}function P(){return _({queryKey:["cliproxy-auth"],queryFn:()=>f.cliproxy.auth()})}function ke(){const s=b();return C({mutationFn:r=>f.cliproxy.create(r),onSuccess:()=>{s.invalidateQueries({queryKey:["cliproxy"]}),h.success("Variant created successfully")},onError:r=>{h.error(r.message)}})}function Se(){const s=b();return C({mutationFn:r=>f.cliproxy.delete(r),onSuccess:()=>{s.invalidateQueries({queryKey:["cliproxy"]}),h.success("Variant deleted successfully")},onError:r=>{h.error(r.message)}})}function De(){const s=b();return C({mutationFn:({provider:r,accountId:n})=>f.cliproxy.accounts.setDefault(r,n),onSuccess:()=>{s.invalidateQueries({queryKey:["cliproxy-accounts"]}),s.invalidateQueries({queryKey:["cliproxy-auth"]}),h.success("Default account updated")},onError:r=>{h.error(r.message)}})}function Te(){const s=b();return C({mutationFn:({provider:r,accountId:n})=>f.cliproxy.accounts.remove(r,n),onSuccess:()=>{s.invalidateQueries({queryKey:["cliproxy-accounts"]}),s.invalidateQueries({queryKey:["cliproxy-auth"]}),h.success("Account removed")},onError:r=>{h.error(r.message)}})}const Re={gemini:"Google Gemini",codex:"OpenAI Codex",agy:"Antigravity",qwen:"Alibaba Qwen",iflow:"iFlow"};function Pe({data:s}){const r=Se(),i=he({data:s,columns:[{accessorKey:"name",header:"Name",cell:({row:a})=>e.jsx("span",{className:"font-medium",children:a.original.name})},{accessorKey:"provider",header:"Provider",cell:({row:a})=>Re[a.original.provider]||a.original.provider},{accessorKey:"account",header:"Account",cell:({row:a})=>{const c=a.original.account;return c?e.jsxs($,{variant:"secondary",className:"text-xs font-normal",children:[e.jsx(y,{className:"w-3 h-3 mr-1 opacity-70"}),c]}):e.jsx("span",{className:"text-muted-foreground text-xs italic",children:"default"})}},{accessorKey:"settings",header:"Settings Path",cell:({row:a})=>e.jsx("code",{className:"text-[10px] bg-muted px-1.5 py-0.5 rounded text-muted-foreground",children:a.original.settings||`config.cliproxy.${a.original.name}`})},{id:"actions",header:"Actions",cell:({row:a})=>e.jsx("div",{className:"flex justify-end",children:e.jsxs(Y,{children:[e.jsx(J,{asChild:!0,children:e.jsxs(d,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(ye,{className:"w-4 h-4"})]})}),e.jsx(Z,{align:"end",className:"bg-white dark:bg-zinc-950",children:e.jsxs(R,{className:"text-red-600 focus:text-red-600 focus:bg-red-50 dark:focus:bg-red-950/30",onClick:()=>r.mutate(a.original.name),children:[e.jsx(ee,{className:"w-4 h-4 mr-2"}),"Delete"]})})]})})}],getCoreRowModel:pe()});return s.length===0?e.jsxs("div",{className:"text-center py-12 border rounded-lg bg-muted/5 border-dashed",children:[e.jsx("div",{className:"text-muted-foreground text-sm",children:"No CLIProxy variants found."}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Create one to use OAuth-based providers with specific account configurations."})]}):e.jsx("div",{className:"border rounded-md overflow-hidden bg-card",children:e.jsxs(ge,{children:[e.jsx(fe,{className:"bg-muted/50",children:i.getHeaderGroups().map(a=>e.jsx(z,{children:a.headers.map(c=>e.jsx(je,{children:c.isPlaceholder?null:V(c.column.columnDef.header,c.getContext())},c.id))},a.id))}),e.jsx(ve,{children:i.getRowModel().rows.map(a=>e.jsx(z,{children:a.getVisibleCells().map(c=>e.jsx(Ne,{children:V(c.column.columnDef.cell,c.getContext())},c.id))},a.id))})]})})}const B=[{id:"gemini",name:"Google Gemini",description:"Gemini Pro/Flash models"},{id:"codex",name:"OpenAI Codex",description:"GPT-4 and codex models"},{id:"agy",name:"Antigravity",description:"Antigravity AI models"},{id:"qwen",name:"Alibaba Qwen",description:"Qwen Code models"},{id:"iflow",name:"iFlow",description:"iFlow AI models"}];function qe({open:s,onClose:r}){const[n,i]=l.useState("provider"),[a,c]=l.useState(""),[o,u]=l.useState(null),[m,p]=l.useState(""),[x,j]=l.useState(""),[ne,A]=l.useState(!1),[k,q]=l.useState(!1),{data:M,refetch:ie}=P(),S=ke(),g=M?.authStatus.find(t=>t.provider===a)?.accounts||[];l.useEffect(()=>{if(!s){const t=setTimeout(()=>{i("provider"),c(""),u(null),p(""),j(""),A(!1)},0);return()=>clearTimeout(t)}},[s]),l.useEffect(()=>{if(n==="auth"&&g.length>0){const t=setTimeout(()=>{g.length===1?(u(g[0]),i("variant")):i("account")},0);return()=>clearTimeout(t)}},[n,g]);const ce=async t=>{await navigator.clipboard.writeText(t),A(!0),setTimeout(()=>A(!1),2e3)},le=async()=>{q(!0),await ie(),q(!1)},de=t=>{c(t);const D=M?.authStatus.find(xe=>xe.provider===t)?.accounts||[];D.length===0?i("auth"):D.length===1?(u(D[0]),i("variant")):i("account")},oe=t=>{u(t),i("variant")},me=async()=>{if(!(!m||!a))try{await S.mutateAsync({name:m,provider:a,model:x||void 0,account:o?.id}),i("success")}catch(t){console.error("Failed to create variant:",t)}},I=`ccs ${a} --auth --add`,Q=["provider","auth","variant","success"],ue=(t=>t==="account"?1:Q.indexOf(t))(n);return e.jsx(G,{open:s,onOpenChange:r,children:e.jsxs(U,{className:"sm:max-w-lg",children:[e.jsxs(H,{children:[e.jsxs(W,{className:"flex items-center gap-2",children:[e.jsx(se,{className:"w-5 h-5 text-primary"}),"Quick Setup Wizard"]}),e.jsxs(X,{children:[n==="provider"&&"Select a provider to get started",n==="auth"&&"Authenticate with your provider",n==="account"&&"Select which account to use",n==="variant"&&"Create your custom variant",n==="success"&&"Setup complete!"]})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[n==="provider"&&e.jsx("div",{className:"grid gap-2",children:B.map(t=>e.jsxs("button",{onClick:()=>de(t.id),className:"flex items-center justify-between p-3 border rounded-lg hover:bg-muted/50 transition-colors text-left",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:t.name}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t.description})]}),e.jsx(E,{className:"w-4 h-4 text-muted-foreground"})]},t.id))}),n==="auth"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{children:e.jsxs(N,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(te,{className:"w-4 h-4"}),"Run this command in your terminal:"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 px-3 py-2 bg-muted rounded-md font-mono text-sm",children:I}),e.jsx(d,{variant:"outline",size:"icon",onClick:()=>ce(I),children:ne?e.jsx(w,{className:"w-4 h-4 text-green-500"}):e.jsx(ae,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["This will open your browser to authenticate with"," ",B.find(t=>t.id===a)?.name]})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(d,{variant:"ghost",onClick:()=>i("provider"),children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsxs(d,{onClick:le,disabled:k,children:[e.jsx(re,{className:`w-4 h-4 mr-2 ${k?"animate-spin":""}`}),k?"Checking...":"I ran the command"]})]})]}),n==="account"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"grid gap-2",children:g.map(t=>e.jsxs("button",{onClick:()=>oe(t),className:"flex items-center justify-between p-3 border rounded-lg hover:bg-muted/50 transition-colors text-left",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(y,{className:"w-5 h-5 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:t.email||t.id}),t.isDefault&&e.jsx("div",{className:"text-xs text-muted-foreground",children:"Default account"})]})]}),e.jsx(E,{className:"w-4 h-4 text-muted-foreground"})]},t.id))}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs(d,{variant:"ghost",onClick:()=>i("auth"),children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Add different account"]})})]}),n==="variant"&&e.jsxs("div",{className:"space-y-4",children:[o&&e.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted/50 rounded-md text-sm",children:[e.jsx(y,{className:"w-4 h-4"}),e.jsxs("span",{children:["Using: ",o.email||o.id]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(L,{htmlFor:"variant-name",children:"Variant Name *"}),e.jsx(K,{id:"variant-name",value:m,onChange:t=>p(t.target.value),placeholder:"e.g., my-gemini, g3, flash"}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Use this name to invoke: ccs ",m||"<name>",' "prompt"']})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(L,{htmlFor:"model-name",children:"Model (optional)"}),e.jsx(K,{id:"model-name",value:x,onChange:t=>j(t.target.value),placeholder:"e.g., gemini-2.5-pro"})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2",children:[e.jsxs(d,{variant:"ghost",onClick:()=>g.length>1?i("account"):i("auth"),children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsx(d,{onClick:me,disabled:!m||S.isPending,children:S.isPending?"Creating...":"Create Variant"})]})]}),n==="success"&&e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"w-16 h-16 bg-green-100 dark:bg-green-900/30 rounded-full flex items-center justify-center",children:e.jsx(w,{className:"w-8 h-8 text-green-600 dark:text-green-400"})})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-lg",children:"Variant Created!"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Your custom variant is ready to use"})]}),e.jsx(v,{children:e.jsxs(N,{className:"p-4 space-y-2",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Usage:"}),e.jsxs("code",{className:"block px-3 py-2 bg-muted rounded-md font-mono text-sm",children:["ccs ",m,' "your prompt here"']})]})}),e.jsx(d,{onClick:r,className:"w-full",children:"Done"})]})]}),e.jsx("div",{className:"flex justify-center gap-1 pt-2",children:Q.map((t,F)=>e.jsx("div",{className:`w-2 h-2 rounded-full transition-colors ${ue>=F?"bg-primary":"bg-muted"}`},t))})]})})}function Me({open:s,onClose:r,provider:n,displayName:i}){const[a,c]=l.useState(!1),[o,u]=l.useState(!1),{refetch:m}=P(),p=`ccs ${n} --auth --add`,x=async()=>{await navigator.clipboard.writeText(p),c(!0),setTimeout(()=>c(!1),2e3)},j=async()=>{u(!0),await m(),u(!1),r()};return e.jsx(G,{open:s,onOpenChange:r,children:e.jsxs(U,{className:"sm:max-w-md",children:[e.jsxs(H,{children:[e.jsxs(W,{children:["Add ",i," Account"]}),e.jsx(X,{children:"Run the command below in your terminal to authenticate a new account"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsx(v,{children:e.jsxs(N,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(te,{className:"w-4 h-4"}),"Run this command:"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 px-3 py-2 bg-muted rounded-md font-mono text-sm",children:p}),e.jsx(d,{variant:"outline",size:"icon",onClick:x,children:a?e.jsx(w,{className:"w-4 h-4 text-green-500"}):e.jsx(ae,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["This will open your browser to authenticate with ",i]})]})}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(d,{variant:"ghost",onClick:r,children:"Cancel"}),e.jsxs(d,{onClick:j,disabled:o,children:[e.jsx(re,{className:`w-4 h-4 mr-2 ${o?"animate-spin":""}`}),o?"Checking...":"I ran the command"]})]})]})]})})}function Ie({account:s,onSetDefault:r,onRemove:n,isRemoving:i}){return e.jsxs(Y,{children:[e.jsx(J,{asChild:!0,children:e.jsxs("button",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-full border transition-colors hover:bg-muted/80 ${s.isDefault?"border-primary/30 bg-primary/10 text-primary font-medium":"border-muted bg-muted/40"}`,children:[e.jsx(y,{className:"w-3 h-3"}),e.jsx("span",{className:"max-w-[200px] truncate",children:s.email||s.id}),s.isDefault&&e.jsx(O,{className:"w-3 h-3 fill-current"}),e.jsx(Ce,{className:"w-3 h-3 opacity-50"})]})}),e.jsxs(Z,{align:"start",className:"w-56",children:[e.jsxs("div",{className:"px-2 py-1.5 text-xs text-muted-foreground bg-muted/30 -mx-1 -mt-1 mb-1 border-b",children:[e.jsx("div",{className:"font-medium text-foreground mb-0.5 truncate",children:s.email||s.id}),s.lastUsedAt&&e.jsxs("div",{children:["Last used: ",new Date(s.lastUsedAt).toLocaleDateString()]})]}),!s.isDefault&&e.jsxs(R,{onClick:r,children:[e.jsx(O,{className:"w-4 h-4 mr-2"}),"Set as default"]}),e.jsxs(R,{className:"text-red-600 focus:text-red-600 focus:bg-red-50 dark:focus:bg-red-950/30",onClick:n,disabled:i,children:[e.jsx(ee,{className:"w-4 h-4 mr-2"}),i?"Removing...":"Remove account"]})]})]})}function Qe({status:s,setDefaultMutation:r,removeMutation:n,onAddAccount:i}){const a=s.accounts||[];return e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between p-4 border-b last:border-0 hover:bg-muted/5 transition-colors gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4 min-w-[180px]",children:[e.jsx("div",{className:`flex items-center justify-center w-8 h-8 rounded-full ${s.authenticated?"bg-green-500/10 text-green-600 dark:text-green-400":"bg-muted text-muted-foreground"}`,children:s.authenticated?e.jsx(w,{className:"w-5 h-5"}):e.jsx(we,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"font-medium flex items-center gap-2",children:[s.displayName,a.length>0&&e.jsx($,{variant:"secondary",className:"text-[10px] h-5 px-1.5 font-normal",children:a.length})]}),e.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:s.provider})]})]}),e.jsx("div",{className:"flex-1 flex items-center gap-2 flex-wrap",children:s.authenticated&&a.length>0?a.map(c=>e.jsx(Ie,{account:c,onSetDefault:()=>r.mutate({provider:s.provider,accountId:c.id}),onRemove:()=>n.mutate({provider:s.provider,accountId:c.id}),isRemoving:n.isPending},c.id)):e.jsx("div",{className:"text-sm text-muted-foreground italic",children:s.authenticated?"Authenticated (No specific accounts tracked)":"Not authenticated"})}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(d,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:i,children:[e.jsx(be,{className:"w-3 h-3"}),"Add Account"]})})]})}function Ue(){const[s,r]=l.useState(!1),[n,i]=l.useState(null),{data:a,isLoading:c}=Ae(),{data:o,isLoading:u}=P(),m=De(),p=Te();return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-8",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"CLIProxy"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage OAuth-based provider variants and multi-account configurations"})]}),e.jsxs(d,{onClick:()=>r(!0),children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Quick Setup"]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:"Built-in Providers"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage authentication status and accounts for built-in providers."})]}),e.jsx(v,{className:"py-0 gap-0",children:e.jsx(N,{className:"p-0",children:u?e.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading authentication status..."}):e.jsx("div",{className:"flex flex-col",children:o?.authStatus.map(x=>e.jsx(Qe,{status:x,setDefaultMutation:m,removeMutation:p,onAddAccount:()=>i({provider:x.provider,displayName:x.displayName})},x.provider))})})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:"Custom Variants"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Create custom aliases for providers with specific accounts."})]})}),c?e.jsx("div",{className:"text-muted-foreground",children:"Loading variants..."}):e.jsx(Pe,{data:a?.variants||[]})]}),e.jsx(qe,{open:s,onClose:()=>r(!1)}),e.jsx(Me,{open:n!==null,onClose:()=>i(null),provider:n?.provider||"",displayName:n?.displayName||""})]})}export{Ue as CliproxyPage};
|
|
1
|
+
import{j as e}from"./radix-ui-4P1Sa1Vh.js";import{r as l}from"./react-vendor-CjrBBxxX.js";import{y as f,v as h,d as $,B as d,D as G,l as U,m as H,n as W,o as X,C as v,a as N,L,I as K}from"./index-CfmYxSZU.js";import{D as Y,a as J,b as Z,c as R}from"./dropdown-menu-BtxX1kEU.js";import{a as _,u as b,b as C,d as he,f as O,g as pe}from"./tanstack-DcowkQHo.js";import{T as ge,a as fe,b as V,c as je,d as ve,e as Ne}from"./table-CwKT3lvs.js";import{N as y,E as ye,y as ee,s as se,a as E,T as te,h as w,i as ae,O as T,R as re,X as we,k as be,Q as z,u as Ce}from"./icons-vQ1Fu1vW.js";import"./form-utils-DKkU3nz7.js";function Ae(){return _({queryKey:["cliproxy"],queryFn:()=>f.cliproxy.list()})}function P(){return _({queryKey:["cliproxy-auth"],queryFn:()=>f.cliproxy.auth()})}function ke(){const s=b();return C({mutationFn:r=>f.cliproxy.create(r),onSuccess:()=>{s.invalidateQueries({queryKey:["cliproxy"]}),h.success("Variant created successfully")},onError:r=>{h.error(r.message)}})}function Se(){const s=b();return C({mutationFn:r=>f.cliproxy.delete(r),onSuccess:()=>{s.invalidateQueries({queryKey:["cliproxy"]}),h.success("Variant deleted successfully")},onError:r=>{h.error(r.message)}})}function De(){const s=b();return C({mutationFn:({provider:r,accountId:n})=>f.cliproxy.accounts.setDefault(r,n),onSuccess:()=>{s.invalidateQueries({queryKey:["cliproxy-accounts"]}),s.invalidateQueries({queryKey:["cliproxy-auth"]}),h.success("Default account updated")},onError:r=>{h.error(r.message)}})}function Te(){const s=b();return C({mutationFn:({provider:r,accountId:n})=>f.cliproxy.accounts.remove(r,n),onSuccess:()=>{s.invalidateQueries({queryKey:["cliproxy-accounts"]}),s.invalidateQueries({queryKey:["cliproxy-auth"]}),h.success("Account removed")},onError:r=>{h.error(r.message)}})}const Re={gemini:"Google Gemini",codex:"OpenAI Codex",agy:"Antigravity",qwen:"Alibaba Qwen",iflow:"iFlow"};function Pe({data:s}){const r=Se(),i=he({data:s,columns:[{accessorKey:"name",header:"Name",cell:({row:a})=>e.jsx("span",{className:"font-medium",children:a.original.name})},{accessorKey:"provider",header:"Provider",cell:({row:a})=>Re[a.original.provider]||a.original.provider},{accessorKey:"account",header:"Account",cell:({row:a})=>{const c=a.original.account;return c?e.jsxs($,{variant:"secondary",className:"text-xs font-normal",children:[e.jsx(y,{className:"w-3 h-3 mr-1 opacity-70"}),c]}):e.jsx("span",{className:"text-muted-foreground text-xs italic",children:"default"})}},{accessorKey:"settings",header:"Settings Path",cell:({row:a})=>e.jsx("code",{className:"text-[10px] bg-muted px-1.5 py-0.5 rounded text-muted-foreground",children:a.original.settings||`config.cliproxy.${a.original.name}`})},{id:"actions",header:"Actions",cell:({row:a})=>e.jsx("div",{className:"flex justify-end",children:e.jsxs(Y,{children:[e.jsx(J,{asChild:!0,children:e.jsxs(d,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(ye,{className:"w-4 h-4"})]})}),e.jsx(Z,{align:"end",className:"bg-white dark:bg-zinc-950",children:e.jsxs(R,{className:"text-red-600 focus:text-red-600 focus:bg-red-50 dark:focus:bg-red-950/30",onClick:()=>r.mutate(a.original.name),children:[e.jsx(ee,{className:"w-4 h-4 mr-2"}),"Delete"]})})]})})}],getCoreRowModel:pe()});return s.length===0?e.jsxs("div",{className:"text-center py-12 border rounded-lg bg-muted/5 border-dashed",children:[e.jsx("div",{className:"text-muted-foreground text-sm",children:"No CLIProxy variants found."}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Create one to use OAuth-based providers with specific account configurations."})]}):e.jsx("div",{className:"border rounded-md overflow-hidden bg-card",children:e.jsxs(ge,{children:[e.jsx(fe,{className:"bg-muted/50",children:i.getHeaderGroups().map(a=>e.jsx(V,{children:a.headers.map(c=>e.jsx(je,{children:c.isPlaceholder?null:O(c.column.columnDef.header,c.getContext())},c.id))},a.id))}),e.jsx(ve,{children:i.getRowModel().rows.map(a=>e.jsx(V,{children:a.getVisibleCells().map(c=>e.jsx(Ne,{children:O(c.column.columnDef.cell,c.getContext())},c.id))},a.id))})]})})}const B=[{id:"gemini",name:"Google Gemini",description:"Gemini Pro/Flash models"},{id:"codex",name:"OpenAI Codex",description:"GPT-4 and codex models"},{id:"agy",name:"Antigravity",description:"Antigravity AI models"},{id:"qwen",name:"Alibaba Qwen",description:"Qwen Code models"},{id:"iflow",name:"iFlow",description:"iFlow AI models"}];function qe({open:s,onClose:r}){const[n,i]=l.useState("provider"),[a,c]=l.useState(""),[o,u]=l.useState(null),[m,p]=l.useState(""),[x,j]=l.useState(""),[ne,A]=l.useState(!1),[k,q]=l.useState(!1),{data:M,refetch:ie}=P(),S=ke(),g=M?.authStatus.find(t=>t.provider===a)?.accounts||[];l.useEffect(()=>{if(!s){const t=setTimeout(()=>{i("provider"),c(""),u(null),p(""),j(""),A(!1)},0);return()=>clearTimeout(t)}},[s]),l.useEffect(()=>{if(n==="auth"&&g.length>0){const t=setTimeout(()=>{g.length===1?(u(g[0]),i("variant")):i("account")},0);return()=>clearTimeout(t)}},[n,g]);const ce=async t=>{await navigator.clipboard.writeText(t),A(!0),setTimeout(()=>A(!1),2e3)},le=async()=>{q(!0),await ie(),q(!1)},de=t=>{c(t);const D=M?.authStatus.find(xe=>xe.provider===t)?.accounts||[];D.length===0?i("auth"):D.length===1?(u(D[0]),i("variant")):i("account")},oe=t=>{u(t),i("variant")},me=async()=>{if(!(!m||!a))try{await S.mutateAsync({name:m,provider:a,model:x||void 0,account:o?.id}),i("success")}catch(t){console.error("Failed to create variant:",t)}},Q=`ccs ${a} --auth --add`,I=["provider","auth","variant","success"],ue=(t=>t==="account"?1:I.indexOf(t))(n);return e.jsx(G,{open:s,onOpenChange:r,children:e.jsxs(U,{className:"sm:max-w-lg",children:[e.jsxs(H,{children:[e.jsxs(W,{className:"flex items-center gap-2",children:[e.jsx(se,{className:"w-5 h-5 text-primary"}),"Quick Setup Wizard"]}),e.jsxs(X,{children:[n==="provider"&&"Select a provider to get started",n==="auth"&&"Authenticate with your provider",n==="account"&&"Select which account to use",n==="variant"&&"Create your custom variant",n==="success"&&"Setup complete!"]})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[n==="provider"&&e.jsx("div",{className:"grid gap-2",children:B.map(t=>e.jsxs("button",{onClick:()=>de(t.id),className:"flex items-center justify-between p-3 border rounded-lg hover:bg-muted/50 transition-colors text-left",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:t.name}),e.jsx("div",{className:"text-xs text-muted-foreground",children:t.description})]}),e.jsx(E,{className:"w-4 h-4 text-muted-foreground"})]},t.id))}),n==="auth"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{children:e.jsxs(N,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(te,{className:"w-4 h-4"}),"Run this command in your terminal:"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 px-3 py-2 bg-muted rounded-md font-mono text-sm",children:Q}),e.jsx(d,{variant:"outline",size:"icon",onClick:()=>ce(Q),children:ne?e.jsx(w,{className:"w-4 h-4 text-green-500"}):e.jsx(ae,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["This will open your browser to authenticate with"," ",B.find(t=>t.id===a)?.name]})]})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(d,{variant:"ghost",onClick:()=>i("provider"),children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsxs(d,{onClick:le,disabled:k,children:[e.jsx(re,{className:`w-4 h-4 mr-2 ${k?"animate-spin":""}`}),k?"Checking...":"I ran the command"]})]})]}),n==="account"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"grid gap-2",children:g.map(t=>e.jsxs("button",{onClick:()=>oe(t),className:"flex items-center justify-between p-3 border rounded-lg hover:bg-muted/50 transition-colors text-left",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(y,{className:"w-5 h-5 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:t.email||t.id}),t.isDefault&&e.jsx("div",{className:"text-xs text-muted-foreground",children:"Default account"})]})]}),e.jsx(E,{className:"w-4 h-4 text-muted-foreground"})]},t.id))}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs(d,{variant:"ghost",onClick:()=>i("auth"),children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Add different account"]})})]}),n==="variant"&&e.jsxs("div",{className:"space-y-4",children:[o&&e.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted/50 rounded-md text-sm",children:[e.jsx(y,{className:"w-4 h-4"}),e.jsxs("span",{children:["Using: ",o.email||o.id]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(L,{htmlFor:"variant-name",children:"Variant Name *"}),e.jsx(K,{id:"variant-name",value:m,onChange:t=>p(t.target.value),placeholder:"e.g., my-gemini, g3, flash"}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Use this name to invoke: ccs ",m||"<name>",' "prompt"']})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(L,{htmlFor:"model-name",children:"Model (optional)"}),e.jsx(K,{id:"model-name",value:x,onChange:t=>j(t.target.value),placeholder:"e.g., gemini-2.5-pro"})]}),e.jsxs("div",{className:"flex items-center justify-between pt-2",children:[e.jsxs(d,{variant:"ghost",onClick:()=>g.length>1?i("account"):i("auth"),children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsx(d,{onClick:me,disabled:!m||S.isPending,children:S.isPending?"Creating...":"Create Variant"})]})]}),n==="success"&&e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx("div",{className:"w-16 h-16 bg-green-100 dark:bg-green-900/30 rounded-full flex items-center justify-center",children:e.jsx(w,{className:"w-8 h-8 text-green-600 dark:text-green-400"})})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold text-lg",children:"Variant Created!"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Your custom variant is ready to use"})]}),e.jsx(v,{children:e.jsxs(N,{className:"p-4 space-y-2",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"Usage:"}),e.jsxs("code",{className:"block px-3 py-2 bg-muted rounded-md font-mono text-sm",children:["ccs ",m,' "your prompt here"']})]})}),e.jsx(d,{onClick:r,className:"w-full",children:"Done"})]})]}),e.jsx("div",{className:"flex justify-center gap-1 pt-2",children:I.map((t,F)=>e.jsx("div",{className:`w-2 h-2 rounded-full transition-colors ${ue>=F?"bg-primary":"bg-muted"}`},t))})]})})}function Me({open:s,onClose:r,provider:n,displayName:i}){const[a,c]=l.useState(!1),[o,u]=l.useState(!1),{refetch:m}=P(),p=`ccs ${n} --auth --add`,x=async()=>{await navigator.clipboard.writeText(p),c(!0),setTimeout(()=>c(!1),2e3)},j=async()=>{u(!0),await m(),u(!1),r()};return e.jsx(G,{open:s,onOpenChange:r,children:e.jsxs(U,{className:"sm:max-w-md",children:[e.jsxs(H,{children:[e.jsxs(W,{children:["Add ",i," Account"]}),e.jsx(X,{children:"Run the command below in your terminal to authenticate a new account"})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsx(v,{children:e.jsxs(N,{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(te,{className:"w-4 h-4"}),"Run this command:"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 px-3 py-2 bg-muted rounded-md font-mono text-sm",children:p}),e.jsx(d,{variant:"outline",size:"icon",onClick:x,children:a?e.jsx(w,{className:"w-4 h-4 text-green-500"}):e.jsx(ae,{className:"w-4 h-4"})})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["This will open your browser to authenticate with ",i]})]})}),e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(d,{variant:"ghost",onClick:r,children:"Cancel"}),e.jsxs(d,{onClick:j,disabled:o,children:[e.jsx(re,{className:`w-4 h-4 mr-2 ${o?"animate-spin":""}`}),o?"Checking...":"I ran the command"]})]})]})]})})}function Qe({account:s,onSetDefault:r,onRemove:n,isRemoving:i}){return e.jsxs(Y,{children:[e.jsx(J,{asChild:!0,children:e.jsxs("button",{className:`inline-flex items-center gap-1.5 px-2.5 py-1 text-xs rounded-full border transition-colors hover:bg-muted/80 ${s.isDefault?"border-primary/30 bg-primary/10 text-primary font-medium":"border-muted bg-muted/40"}`,children:[e.jsx(y,{className:"w-3 h-3"}),e.jsx("span",{className:"max-w-[200px] truncate",children:s.email||s.id}),s.isDefault&&e.jsx(z,{className:"w-3 h-3 fill-current"}),e.jsx(Ce,{className:"w-3 h-3 opacity-50"})]})}),e.jsxs(Z,{align:"start",className:"w-56",children:[e.jsxs("div",{className:"px-2 py-1.5 text-xs text-muted-foreground bg-muted/30 -mx-1 -mt-1 mb-1 border-b",children:[e.jsx("div",{className:"font-medium text-foreground mb-0.5 truncate",children:s.email||s.id}),s.lastUsedAt&&e.jsxs("div",{children:["Last used: ",new Date(s.lastUsedAt).toLocaleDateString()]})]}),!s.isDefault&&e.jsxs(R,{onClick:r,children:[e.jsx(z,{className:"w-4 h-4 mr-2"}),"Set as default"]}),e.jsxs(R,{className:"text-red-600 focus:text-red-600 focus:bg-red-50 dark:focus:bg-red-950/30",onClick:n,disabled:i,children:[e.jsx(ee,{className:"w-4 h-4 mr-2"}),i?"Removing...":"Remove account"]})]})]})}function Ie({status:s,setDefaultMutation:r,removeMutation:n,onAddAccount:i}){const a=s.accounts||[];return e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between p-4 border-b last:border-0 hover:bg-muted/5 transition-colors gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4 min-w-[180px]",children:[e.jsx("div",{className:`flex items-center justify-center w-8 h-8 rounded-full ${s.authenticated?"bg-green-500/10 text-green-600 dark:text-green-400":"bg-muted text-muted-foreground"}`,children:s.authenticated?e.jsx(w,{className:"w-5 h-5"}):e.jsx(we,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"font-medium flex items-center gap-2",children:[s.displayName,a.length>0&&e.jsx($,{variant:"secondary",className:"text-[10px] h-5 px-1.5 font-normal",children:a.length})]}),e.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:s.provider})]})]}),e.jsx("div",{className:"flex-1 flex items-center gap-2 flex-wrap",children:s.authenticated&&a.length>0?a.map(c=>e.jsx(Qe,{account:c,onSetDefault:()=>r.mutate({provider:s.provider,accountId:c.id}),onRemove:()=>n.mutate({provider:s.provider,accountId:c.id}),isRemoving:n.isPending},c.id)):e.jsx("div",{className:"text-sm text-muted-foreground italic",children:s.authenticated?"Authenticated (No specific accounts tracked)":"Not authenticated"})}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(d,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:i,children:[e.jsx(be,{className:"w-3 h-3"}),"Add Account"]})})]})}function Ue(){const[s,r]=l.useState(!1),[n,i]=l.useState(null),{data:a,isLoading:c}=Ae(),{data:o,isLoading:u}=P(),m=De(),p=Te();return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-8",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"CLIProxy"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage OAuth-based provider variants and multi-account configurations"})]}),e.jsxs(d,{onClick:()=>r(!0),children:[e.jsx(se,{className:"w-4 h-4 mr-2"}),"Quick Setup"]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:"Built-in Providers"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage authentication status and accounts for built-in providers."})]}),e.jsx(v,{className:"py-0 gap-0",children:e.jsx(N,{className:"p-0",children:u?e.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading authentication status..."}):e.jsx("div",{className:"flex flex-col",children:o?.authStatus.map(x=>e.jsx(Ie,{status:x,setDefaultMutation:m,removeMutation:p,onAddAccount:()=>i({provider:x.provider,displayName:x.displayName})},x.provider))})})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:"Custom Variants"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Create custom aliases for providers with specific accounts."})]})}),c?e.jsx("div",{className:"text-muted-foreground",children:"Loading variants..."}):e.jsx(Pe,{data:a?.variants||[]})]}),e.jsx(qe,{open:s,onClose:()=>r(!1)}),e.jsx(Me,{open:n!==null,onClose:()=>i(null),provider:n?.provider||"",displayName:n?.displayName||""})]})}export{Ue as CliproxyPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,X as d,Y as s,Z as i,_ as u,$ as c,a0 as m}from"./radix-ui-4P1Sa1Vh.js";import"./react-vendor-CjrBBxxX.js";import{c as n}from"./index-CfmYxSZU.js";function v({...t}){return e.jsx(d,{"data-slot":"dropdown-menu",...t})}function g({...t}){return e.jsx(s,{"data-slot":"dropdown-menu-trigger",...t})}function x({className:t,sideOffset:a=4,...o}){return e.jsx(i,{children:e.jsx(u,{"data-slot":"dropdown-menu-content",sideOffset:a,className:n("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md bg-white dark:bg-zinc-950",t),...o})})}function w({className:t,inset:a,variant:o="default",...r}){return e.jsx(c,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":o,className:n("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-current relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r})}function b({className:t,...a}){return e.jsx(m,{"data-slot":"dropdown-menu-separator",className:n("bg-border -mx-1 my-1 h-px",t),...a})}export{v as D,g as a,x as b,w as c,b as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-DAH8Vq_G.js";import{c as l,t as p,B as g,v as w,w as y,x as k,s as z,S as h}from"./index-JNyH4mtq.js";import{a as R,u as M,b as W}from"./tanstack-DAI1tKxf.js";import{r as j}from"./react-vendor-CjrBBxxX.js";import{J as v,a as E,T as C,i as S,Z as O,d as P,U as $,S as T,N as I,G as H,O as F,R as A}from"./icons-Pr4HmEFP.js";import"./form-utils-DKkU3nz7.js";const B={sm:{dimension:80,strokeWidth:6,fontSize:"text-lg",labelSize:"text-[10px]"},md:{dimension:120,strokeWidth:8,fontSize:"text-3xl",labelSize:"text-xs"},lg:{dimension:160,strokeWidth:10,fontSize:"text-4xl",labelSize:"text-sm"}},D={ok:{stroke:"#22C55E",glow:"rgba(34, 197, 94, 0.4)"},warning:{stroke:"#EAB308",glow:"rgba(234, 179, 8, 0.4)"},error:{stroke:"#EF4444",glow:"rgba(239, 68, 68, 0.4)"}};function G({passed:s,total:t,status:a,size:o="md"}){const n=B[o],d=D[a],i=t>0?Math.round(s/t*100):0,r=(n.dimension-n.strokeWidth)/2,c=2*Math.PI*r,f=c-i/100*c,x=n.dimension/2;return e.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[e.jsxs("svg",{width:n.dimension,height:n.dimension,className:"transform -rotate-90",style:{filter:`drop-shadow(0 0 8px ${d.glow})`},children:[e.jsx("circle",{cx:x,cy:x,r,fill:"none",stroke:"currentColor",strokeWidth:n.strokeWidth,className:"text-muted/30"}),e.jsx("circle",{cx:x,cy:x,r,fill:"none",stroke:d.stroke,strokeWidth:n.strokeWidth,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:f,className:"transition-all duration-1000 ease-out"}),i>0&&e.jsx("circle",{cx:x+r*Math.cos(i/100*2*Math.PI-Math.PI/2),cy:x+r*Math.sin(i/100*2*Math.PI-Math.PI/2),r:n.strokeWidth/2,fill:d.stroke,className:"animate-pulse",style:{filter:`drop-shadow(0 0 4px ${d.glow})`}})]}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsx("span",{className:l("font-mono font-bold tracking-tight",n.fontSize),children:i}),e.jsx("span",{className:l("font-mono uppercase tracking-widest text-muted-foreground",n.labelSize),children:"health"})]})]})}function b({label:s,value:t,color:a,bgColor:o}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full animate-pulse",o)}),e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:s}),e.jsx("span",{className:l("font-mono font-bold text-sm",a),children:t})]})}function L({total:s,passed:t,warnings:a,errors:o,info:n}){const d=t/s*100,i=a/s*100,r=o/s*100,c=n/s*100;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"h-2 rounded-full overflow-hidden bg-muted/50 flex",children:[r>0&&e.jsx("div",{className:"h-full bg-red-500 transition-all duration-500",style:{width:`${r}%`}}),i>0&&e.jsx("div",{className:"h-full bg-yellow-500 transition-all duration-500",style:{width:`${i}%`}}),c>0&&e.jsx("div",{className:"h-full bg-blue-500 transition-all duration-500",style:{width:`${c}%`}}),d>0&&e.jsx("div",{className:"h-full bg-green-500 transition-all duration-500",style:{width:`${d}%`}})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Checks"}),e.jsx("span",{className:"font-mono font-bold text-lg",children:s})]}),e.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[e.jsx(b,{label:"OK",value:t,color:"text-green-500",bgColor:"bg-green-500"}),e.jsx(b,{label:"WARN",value:a,color:"text-yellow-500",bgColor:"bg-yellow-500"}),e.jsx(b,{label:"ERR",value:o,color:"text-red-500",bgColor:"bg-red-500"}),e.jsx(b,{label:"INFO",value:n,color:"text-blue-500",bgColor:"bg-blue-500"})]})]})]})}function q(){return R({queryKey:["health"],queryFn:async()=>(await fetch("/api/health")).json(),refetchInterval:3e4})}function K(){const s=M();return W({mutationFn:async t=>{const a=await fetch(`/api/health/fix/${t}`,{method:"POST"}),o=await a.json();if(!a.ok)throw new Error(o.message);return o},onSuccess:t=>{s.invalidateQueries({queryKey:["health"]}),p.success(t.message)},onError:t=>{p.error(t.message)}})}const Q={ok:{dot:"bg-green-500",label:"OK",labelColor:"text-green-500"},warning:{dot:"bg-yellow-500",label:"WARN",labelColor:"text-yellow-500"},error:{dot:"bg-red-500",label:"ERR",labelColor:"text-red-500"},info:{dot:"bg-blue-500",label:"INFO",labelColor:"text-blue-500"}};function U({check:s}){const t=K(),a=Q[s.status],[o,n]=j.useState(!1),d=s.details||s.fix,i=r=>{navigator.clipboard.writeText(r),p.success("Copied to clipboard")};return d?e.jsx(w,{open:o,onOpenChange:n,children:e.jsxs("div",{className:l("group rounded-lg border transition-all duration-150",o?"border-border bg-muted/30":"border-transparent hover:border-border/50 hover:bg-muted/50"),children:[e.jsx(y,{asChild:!0,children:e.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2 text-left",children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",a.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",a.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",a.labelColor),children:["[",a.label,"]"]}),e.jsx(E,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",o&&"rotate-90")})]})}),e.jsx(k,{children:e.jsxs("div",{className:"px-3 pb-3 pt-1 space-y-2 ml-7",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.message}),s.details&&e.jsx("pre",{className:"text-xs font-mono text-muted-foreground bg-background/50 rounded p-2 overflow-x-auto border border-border/50",children:s.details}),s.fix&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-2 bg-background/50 rounded px-2 py-1.5 border border-border/50",children:[e.jsx(C,{className:"w-3 h-3 text-muted-foreground shrink-0"}),e.jsx("code",{className:"text-xs font-mono flex-1 truncate",children:s.fix}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>s.fix&&i(s.fix),className:"h-5 w-5 p-0",children:e.jsx(S,{className:"w-3 h-3"})})]}),s.fixable&&s.status!=="ok"&&e.jsxs(g,{size:"sm",onClick:()=>t.mutate(s.id),disabled:t.isPending,className:"h-7 px-3 text-xs",children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),"Apply Fix"]})]})]})})]})}):e.jsxs("div",{className:l("group flex items-center gap-3 px-3 py-2 rounded-lg","hover:bg-muted/50 transition-colors duration-150","border border-transparent hover:border-border/50"),children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",a.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",a.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",a.labelColor),children:["[",a.label,"]"]}),s.fixable&&s.status!=="ok"&&e.jsxs(g,{size:"sm",variant:"ghost",onClick:()=>t.mutate(s.id),disabled:t.isPending,className:"h-6 px-2 text-xs opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),"Fix"]})]})}const Z={Monitor:I,Settings:T,Users:$,Shield:P,Zap:O};function J({group:s,defaultOpen:t=!0}){const[a,o]=j.useState(t),n=Z[s.icon]||I,d=s.checks.filter(m=>m.status==="ok").length,i=s.checks.length,r=s.checks.some(m=>m.status==="error"),c=s.checks.some(m=>m.status==="warning"),f=Math.round(d/i*100),x=r?"text-red-500":c?"text-yellow-500":"text-green-500",u=r?"bg-red-500":c?"bg-yellow-500":"bg-green-500";return e.jsx(w,{open:a,onOpenChange:o,children:e.jsxs("div",{className:l("rounded-lg border transition-all duration-200",r?"border-red-500/30":c?"border-yellow-500/30":"border-border"),children:[e.jsx(y,{asChild:!0,children:e.jsxs("button",{className:l("w-full flex items-center gap-3 p-3 text-left rounded-lg","hover:bg-muted/50 transition-colors duration-150",a&&"rounded-b-none border-b border-border/50"),children:[e.jsx("div",{className:l("p-1.5 rounded-md",r?"bg-red-500/10 text-red-500":c?"bg-yellow-500/10 text-yellow-500":"bg-muted text-muted-foreground"),children:e.jsx(n,{className:"w-4 h-4"})}),e.jsx("span",{className:"flex-1 text-sm font-semibold",children:s.name}),!a&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("div",{className:"w-16 h-1.5 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:l("h-full transition-all duration-500",u),style:{width:`${f}%`}})})}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",x),children:[d,"/",i]}),e.jsx(H,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",a&&"rotate-180")})]})}),e.jsx(k,{children:e.jsx("div",{className:"p-2 space-y-0.5",children:s.checks.map(m=>e.jsx(U,{check:m},m.id))})})]})})}function V(s){return s.errors>0?"error":s.warnings>0?"warning":"ok"}function X(s){const t=Math.floor((Date.now()-s)/1e3);if(t<5)return"just now";if(t<60)return`${t}s ago`;const a=Math.floor(t/60);return a<60?`${a}m ago`:`${Math.floor(a/60)}h ago`}function Y(s){return[...s].sort((t,a)=>{const o=t.checks.filter(r=>r.status==="error").length,n=a.checks.filter(r=>r.status==="error").length,d=t.checks.filter(r=>r.status==="warning").length,i=a.checks.filter(r=>r.status==="warning").length;return o!==n?n-o:i-d})}function _(){return e.jsxs("div",{className:"font-mono text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"$"}),e.jsx("span",{children:"ccs doctor"})]})}function ee(){return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsx("div",{className:"rounded-xl border bg-gradient-to-br from-background to-muted/20 p-6",children:e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx(h,{className:"w-[120px] h-[120px] rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(h,{className:"h-5 w-48"}),e.jsx(h,{className:"h-8 w-64"}),e.jsx(h,{className:"h-4 w-32"})]})]})}),e.jsx(h,{className:"h-16 w-full rounded-lg"}),e.jsx("div",{className:"space-y-3",children:[1,2,3,4].map(s=>e.jsx(h,{className:"h-20 rounded-lg"},s))})]})}function le(){const{data:s,isLoading:t,refetch:a,dataUpdatedAt:o}=q(),n=o,[d,i]=j.useState(0);j.useEffect(()=>{const u=setInterval(()=>i(m=>m+1),1e3);return()=>clearInterval(u)},[]);const r=()=>{navigator.clipboard.writeText("ccs doctor"),p.success("Copied to clipboard")},c=()=>{a(),p.info("Refreshing health checks...")};if(t&&!s)return e.jsx(ee,{});const f=s?V(s.summary):"ok",x=s?.groups?Y(s.groups):[];return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsxs("div",{className:l("relative overflow-hidden rounded-xl border p-6","bg-gradient-to-br from-background via-background to-muted/30"),children:[e.jsx("div",{className:"absolute inset-0 opacity-[0.02] pointer-events-none",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 2px, currentColor 2px, currentColor 3px)"}}),e.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),e.jsxs("div",{className:"relative flex flex-col md:flex-row items-start md:items-center gap-6",children:[s&&e.jsx("div",{className:"shrink-0",children:e.jsx(G,{passed:s.summary.passed,total:s.summary.total-s.summary.info,status:f,size:"md"})}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(_,{}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("h1",{className:"text-2xl font-bold font-mono tracking-tight",children:"System Health"}),s?.version&&e.jsxs(z,{variant:"outline",className:"font-mono text-xs bg-muted/50",children:["build ",s.version]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(F,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"Last scan:"}),e.jsx("span",{className:"font-mono",children:n?X(n):"--"}),e.jsx("span",{className:"text-muted-foreground",children:"|"}),e.jsx("span",{className:"text-muted-foreground",children:"Auto-refresh:"}),e.jsx("span",{className:"font-mono text-green-500",children:"30s"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs(g,{variant:"outline",size:"sm",onClick:r,className:"gap-2 font-mono text-xs",children:[e.jsx(C,{className:"w-3 h-3"}),"ccs doctor",e.jsx(S,{className:"w-3 h-3 opacity-50"})]}),e.jsxs(g,{variant:"outline",size:"sm",onClick:c,disabled:t,className:"gap-2",children:[e.jsx(A,{className:l("w-4 h-4",t&&"animate-spin")}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"}),e.jsx("kbd",{className:"hidden md:inline-flex h-5 items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:"R"})]})]})]})]}),s&&e.jsx("div",{className:"rounded-lg border bg-card p-4",children:e.jsx(L,{total:s.summary.total,passed:s.summary.passed,warnings:s.summary.warnings,errors:s.summary.errors,info:s.summary.info})}),x.length>0&&e.jsx("div",{className:"space-y-3",children:x.map((u,m)=>e.jsx(J,{group:u,defaultOpen:m<2||u.checks.some(N=>N.status==="error"||N.status==="warning")},u.id))}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground border-t pt-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{children:["Version ",e.jsx("span",{className:"font-mono",children:s?.version??"--"})]}),e.jsxs("span",{children:["Platform"," ",e.jsx("span",{className:"font-mono",children:typeof navigator<"u"?navigator.platform:"linux"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),e.jsx("span",{children:"Live monitoring active"})]})]})]})}export{le as HealthPage};
|
|
1
|
+
import{j as e}from"./radix-ui-4P1Sa1Vh.js";import{c as l,v as p,B as g,z as w,A as y,E as k,d as z,S as h}from"./index-CfmYxSZU.js";import{a as R,u as E,b as M}from"./tanstack-DcowkQHo.js";import{r as j}from"./react-vendor-CjrBBxxX.js";import{Y as v,a as W,T as C,i as S,Z as P,d as O,U as $,S as T,_ as I,u as H,$ as F,R as A}from"./icons-vQ1Fu1vW.js";import"./form-utils-DKkU3nz7.js";const B={sm:{dimension:80,strokeWidth:6,fontSize:"text-lg",labelSize:"text-[10px]"},md:{dimension:120,strokeWidth:8,fontSize:"text-3xl",labelSize:"text-xs"},lg:{dimension:160,strokeWidth:10,fontSize:"text-4xl",labelSize:"text-sm"}},D={ok:{stroke:"#22C55E",glow:"rgba(34, 197, 94, 0.4)"},warning:{stroke:"#EAB308",glow:"rgba(234, 179, 8, 0.4)"},error:{stroke:"#EF4444",glow:"rgba(239, 68, 68, 0.4)"}};function L({passed:s,total:t,status:a,size:o="md"}){const n=B[o],d=D[a],i=t>0?Math.round(s/t*100):0,r=(n.dimension-n.strokeWidth)/2,c=2*Math.PI*r,f=c-i/100*c,x=n.dimension/2;return e.jsxs("div",{className:"relative inline-flex items-center justify-center",children:[e.jsxs("svg",{width:n.dimension,height:n.dimension,className:"transform -rotate-90",style:{filter:`drop-shadow(0 0 8px ${d.glow})`},children:[e.jsx("circle",{cx:x,cy:x,r,fill:"none",stroke:"currentColor",strokeWidth:n.strokeWidth,className:"text-muted/30"}),e.jsx("circle",{cx:x,cy:x,r,fill:"none",stroke:d.stroke,strokeWidth:n.strokeWidth,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:f,className:"transition-all duration-1000 ease-out"}),i>0&&e.jsx("circle",{cx:x+r*Math.cos(i/100*2*Math.PI-Math.PI/2),cy:x+r*Math.sin(i/100*2*Math.PI-Math.PI/2),r:n.strokeWidth/2,fill:d.stroke,className:"animate-pulse",style:{filter:`drop-shadow(0 0 4px ${d.glow})`}})]}),e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[e.jsx("span",{className:l("font-mono font-bold tracking-tight",n.fontSize),children:i}),e.jsx("span",{className:l("font-mono uppercase tracking-widest text-muted-foreground",n.labelSize),children:"health"})]})]})}function b({label:s,value:t,color:a,bgColor:o}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full animate-pulse",o)}),e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:s}),e.jsx("span",{className:l("font-mono font-bold text-sm",a),children:t})]})}function q({total:s,passed:t,warnings:a,errors:o,info:n}){const d=t/s*100,i=a/s*100,r=o/s*100,c=n/s*100;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"h-2 rounded-full overflow-hidden bg-muted/50 flex",children:[r>0&&e.jsx("div",{className:"h-full bg-red-500 transition-all duration-500",style:{width:`${r}%`}}),i>0&&e.jsx("div",{className:"h-full bg-yellow-500 transition-all duration-500",style:{width:`${i}%`}}),c>0&&e.jsx("div",{className:"h-full bg-blue-500 transition-all duration-500",style:{width:`${c}%`}}),d>0&&e.jsx("div",{className:"h-full bg-green-500 transition-all duration-500",style:{width:`${d}%`}})]}),e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Checks"}),e.jsx("span",{className:"font-mono font-bold text-lg",children:s})]}),e.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[e.jsx(b,{label:"OK",value:t,color:"text-green-500",bgColor:"bg-green-500"}),e.jsx(b,{label:"WARN",value:a,color:"text-yellow-500",bgColor:"bg-yellow-500"}),e.jsx(b,{label:"ERR",value:o,color:"text-red-500",bgColor:"bg-red-500"}),e.jsx(b,{label:"INFO",value:n,color:"text-blue-500",bgColor:"bg-blue-500"})]})]})]})}function G(){return R({queryKey:["health"],queryFn:async()=>(await fetch("/api/health")).json(),refetchInterval:3e4})}function K(){const s=E();return M({mutationFn:async t=>{const a=await fetch(`/api/health/fix/${t}`,{method:"POST"}),o=await a.json();if(!a.ok)throw new Error(o.message);return o},onSuccess:t=>{s.invalidateQueries({queryKey:["health"]}),p.success(t.message)},onError:t=>{p.error(t.message)}})}const Q={ok:{dot:"bg-green-500",label:"OK",labelColor:"text-green-500"},warning:{dot:"bg-yellow-500",label:"WARN",labelColor:"text-yellow-500"},error:{dot:"bg-red-500",label:"ERR",labelColor:"text-red-500"},info:{dot:"bg-blue-500",label:"INFO",labelColor:"text-blue-500"}};function U({check:s}){const t=K(),a=Q[s.status],[o,n]=j.useState(!1),d=s.details||s.fix,i=r=>{navigator.clipboard.writeText(r),p.success("Copied to clipboard")};return d?e.jsx(w,{open:o,onOpenChange:n,children:e.jsxs("div",{className:l("group rounded-lg border transition-all duration-150",o?"border-border bg-muted/30":"border-transparent hover:border-border/50 hover:bg-muted/50"),children:[e.jsx(y,{asChild:!0,children:e.jsxs("button",{className:"w-full flex items-center gap-3 px-3 py-2 text-left",children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",a.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",a.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",a.labelColor),children:["[",a.label,"]"]}),e.jsx(W,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",o&&"rotate-90")})]})}),e.jsx(k,{children:e.jsxs("div",{className:"px-3 pb-3 pt-1 space-y-2 ml-7",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.message}),s.details&&e.jsx("pre",{className:"text-xs font-mono text-muted-foreground bg-background/50 rounded p-2 overflow-x-auto border border-border/50",children:s.details}),s.fix&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-2 bg-background/50 rounded px-2 py-1.5 border border-border/50",children:[e.jsx(C,{className:"w-3 h-3 text-muted-foreground shrink-0"}),e.jsx("code",{className:"text-xs font-mono flex-1 truncate",children:s.fix}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>s.fix&&i(s.fix),className:"h-5 w-5 p-0",children:e.jsx(S,{className:"w-3 h-3"})})]}),s.fixable&&s.status!=="ok"&&e.jsxs(g,{size:"sm",onClick:()=>t.mutate(s.id),disabled:t.isPending,className:"h-7 px-3 text-xs",children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),"Apply Fix"]})]})]})})]})}):e.jsxs("div",{className:l("group flex items-center gap-3 px-3 py-2 rounded-lg","hover:bg-muted/50 transition-colors duration-150","border border-transparent hover:border-border/50"),children:[e.jsxs("div",{className:"relative flex items-center justify-center w-4 h-4",children:[e.jsx("div",{className:l("w-2 h-2 rounded-full",a.dot)}),s.status!=="ok"&&e.jsx("div",{className:l("absolute w-2 h-2 rounded-full animate-ping opacity-75",a.dot)})]}),e.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:s.name}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",a.labelColor),children:["[",a.label,"]"]}),s.fixable&&s.status!=="ok"&&e.jsxs(g,{size:"sm",variant:"ghost",onClick:()=>t.mutate(s.id),disabled:t.isPending,className:"h-6 px-2 text-xs opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),"Fix"]})]})}const Z={Monitor:I,Settings:T,Users:$,Shield:O,Zap:P};function V({group:s,defaultOpen:t=!0}){const[a,o]=j.useState(t),n=Z[s.icon]||I,d=s.checks.filter(m=>m.status==="ok").length,i=s.checks.length,r=s.checks.some(m=>m.status==="error"),c=s.checks.some(m=>m.status==="warning"),f=Math.round(d/i*100),x=r?"text-red-500":c?"text-yellow-500":"text-green-500",u=r?"bg-red-500":c?"bg-yellow-500":"bg-green-500";return e.jsx(w,{open:a,onOpenChange:o,children:e.jsxs("div",{className:l("rounded-lg border transition-all duration-200",r?"border-red-500/30":c?"border-yellow-500/30":"border-border"),children:[e.jsx(y,{asChild:!0,children:e.jsxs("button",{className:l("w-full flex items-center gap-3 p-3 text-left rounded-lg","hover:bg-muted/50 transition-colors duration-150",a&&"rounded-b-none border-b border-border/50"),children:[e.jsx("div",{className:l("p-1.5 rounded-md",r?"bg-red-500/10 text-red-500":c?"bg-yellow-500/10 text-yellow-500":"bg-muted text-muted-foreground"),children:e.jsx(n,{className:"w-4 h-4"})}),e.jsx("span",{className:"flex-1 text-sm font-semibold",children:s.name}),!a&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("div",{className:"w-16 h-1.5 rounded-full bg-muted overflow-hidden",children:e.jsx("div",{className:l("h-full transition-all duration-500",u),style:{width:`${f}%`}})})}),e.jsxs("span",{className:l("font-mono text-xs font-semibold",x),children:[d,"/",i]}),e.jsx(H,{className:l("w-4 h-4 text-muted-foreground transition-transform duration-200",a&&"rotate-180")})]})}),e.jsx(k,{children:e.jsx("div",{className:"p-2 space-y-0.5",children:s.checks.map(m=>e.jsx(U,{check:m},m.id))})})]})})}function Y(s){return s.errors>0?"error":s.warnings>0?"warning":"ok"}function _(s){const t=Math.floor((Date.now()-s)/1e3);if(t<5)return"just now";if(t<60)return`${t}s ago`;const a=Math.floor(t/60);return a<60?`${a}m ago`:`${Math.floor(a/60)}h ago`}function J(s){return[...s].sort((t,a)=>{const o=t.checks.filter(r=>r.status==="error").length,n=a.checks.filter(r=>r.status==="error").length,d=t.checks.filter(r=>r.status==="warning").length,i=a.checks.filter(r=>r.status==="warning").length;return o!==n?n-o:i-d})}function X(){return e.jsxs("div",{className:"font-mono text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx("span",{className:"text-green-500",children:"$"}),e.jsx("span",{children:"ccs doctor"})]})}function ee(){return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsx("div",{className:"rounded-xl border bg-gradient-to-br from-background to-muted/20 p-6",children:e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx(h,{className:"w-[120px] h-[120px] rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(h,{className:"h-5 w-48"}),e.jsx(h,{className:"h-8 w-64"}),e.jsx(h,{className:"h-4 w-32"})]})]})}),e.jsx(h,{className:"h-16 w-full rounded-lg"}),e.jsx("div",{className:"space-y-3",children:[1,2,3,4].map(s=>e.jsx(h,{className:"h-20 rounded-lg"},s))})]})}function le(){const{data:s,isLoading:t,refetch:a,dataUpdatedAt:o}=G(),n=o,[d,i]=j.useState(0);j.useEffect(()=>{const u=setInterval(()=>i(m=>m+1),1e3);return()=>clearInterval(u)},[]);const r=()=>{navigator.clipboard.writeText("ccs doctor"),p.success("Copied to clipboard")},c=()=>{a(),p.info("Refreshing health checks...")};if(t&&!s)return e.jsx(ee,{});const f=s?Y(s.summary):"ok",x=s?.groups?J(s.groups):[];return e.jsxs("div",{className:"p-6 max-w-6xl mx-auto space-y-6",children:[e.jsxs("div",{className:l("relative overflow-hidden rounded-xl border p-6","bg-gradient-to-br from-background via-background to-muted/30"),children:[e.jsx("div",{className:"absolute inset-0 opacity-[0.02] pointer-events-none",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 2px, currentColor 2px, currentColor 3px)"}}),e.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:e.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),e.jsxs("div",{className:"relative flex flex-col md:flex-row items-start md:items-center gap-6",children:[s&&e.jsx("div",{className:"shrink-0",children:e.jsx(L,{passed:s.summary.passed,total:s.summary.total-s.summary.info,status:f,size:"md"})}),e.jsxs("div",{className:"flex-1 space-y-3",children:[e.jsx(X,{}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("h1",{className:"text-2xl font-bold font-mono tracking-tight",children:"System Health"}),s?.version&&e.jsxs(z,{variant:"outline",className:"font-mono text-xs bg-muted/50",children:["build ",s.version]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx(F,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-muted-foreground",children:"Last scan:"}),e.jsx("span",{className:"font-mono",children:n?_(n):"--"}),e.jsx("span",{className:"text-muted-foreground",children:"|"}),e.jsx("span",{className:"text-muted-foreground",children:"Auto-refresh:"}),e.jsx("span",{className:"font-mono text-green-500",children:"30s"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs(g,{variant:"outline",size:"sm",onClick:r,className:"gap-2 font-mono text-xs",children:[e.jsx(C,{className:"w-3 h-3"}),"ccs doctor",e.jsx(S,{className:"w-3 h-3 opacity-50"})]}),e.jsxs(g,{variant:"outline",size:"sm",onClick:c,disabled:t,className:"gap-2",children:[e.jsx(A,{className:l("w-4 h-4",t&&"animate-spin")}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"}),e.jsx("kbd",{className:"hidden md:inline-flex h-5 items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground",children:"R"})]})]})]})]}),s&&e.jsx("div",{className:"rounded-lg border bg-card p-4",children:e.jsx(q,{total:s.summary.total,passed:s.summary.passed,warnings:s.summary.warnings,errors:s.summary.errors,info:s.summary.info})}),x.length>0&&e.jsx("div",{className:"space-y-3",children:x.map((u,m)=>e.jsx(V,{group:u,defaultOpen:m<2||u.checks.some(N=>N.status==="error"||N.status==="warning")},u.id))}),e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground border-t pt-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{children:["Version ",e.jsx("span",{className:"font-mono",children:s?.version??"--"})]}),e.jsxs("span",{children:["Platform"," ",e.jsx("span",{className:"font-mono",children:typeof navigator<"u"?navigator.platform:"linux"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),e.jsx("span",{children:"Live monitoring active"})]})]})]})}export{le as HealthPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as h}from"./react-vendor-CjrBBxxX.js";const M=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,o,c)=>c?c.toUpperCase():o.toLowerCase()),d=t=>{const a=_(t);return a.charAt(0).toUpperCase()+a.slice(1)},r=(...t)=>t.filter((a,o,c)=>!!a&&a.trim()!==""&&c.indexOf(a)===o).join(" ").trim(),v=t=>{for(const a in t)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};var m={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const x=h.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:o=2,absoluteStrokeWidth:c,className:n="",children:s,iconNode:k,...y},p)=>h.createElement("svg",{ref:p,...m,width:a,height:a,stroke:t,strokeWidth:c?Number(o)*24/Number(a):o,className:r("lucide",n),...!s&&!v(y)&&{"aria-hidden":"true"},...y},[...k.map(([i,l])=>h.createElement(i,l)),...Array.isArray(s)?s:[s]]));const e=(t,a)=>{const o=h.forwardRef(({className:c,...n},s)=>h.createElement(x,{ref:s,iconNode:a,className:r(`lucide-${M(d(t))}`,`lucide-${t}`,c),...n}));return o.displayName=d(t),o};const u=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],w1=e("activity",u);const f=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],g1=e("arrow-down-right",f);const w=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],$1=e("arrow-left",w);const g=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],N1=e("arrow-right",g);const $=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],z1=e("arrow-up-right",$);const N=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],C1=e("book-open",N);const z=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],b1=e("bot",z);const C=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],A1=e("calendar",C);const b=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],j1=e("chart-column",b);const A=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],q1=e("chart-pie",A);const j=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],H1=e("check",j);const q=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],L1=e("chevron-down",q);const H=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],V1=e("chevron-right",H);const L=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],S1=e("circle-alert",L);const V=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],E1=e("circle-check",V);const S=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],R1=e("circle-x",S);const E=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],P1=e("clock",E);const R=[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]],O1=e("construction",R);const P=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],U1=e("copy",P);const O=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],B1=e("cpu",O);const U=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],D1=e("database",U);const B=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],T1=e("dollar-sign",B);const D=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],W1=e("ellipsis",D);const T=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],F1=e("eye-off",T);const W=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],I1=e("eye",W);const F=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],K1=e("file-text",F);const I=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Z1=e("folder-open",I);const K=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],G1=e("gauge",K);const Z=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],J1=e("house",Z);const G=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Q1=e("key",G);const J=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],X1=e("loader-circle",J);const Q=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Y1=e("monitor",Q);const X=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],e0=e("moon",X);const Y=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],a0=e("panel-left",Y);const e1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],t0=e("plus",e1);const a1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],o0=e("refresh-cw",a1);const t1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],c0=e("save",t1);const o1=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],s0=e("settings",o1);const c1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],h0=e("shield",c1);const s1=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],n0=e("sparkles",s1);const h1=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],y0=e("square-pen",h1);const n1=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],d0=e("star",n1);const y1=[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]],r0=e("stethoscope",y1);const d1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],k0=e("sun",d1);const r1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],p0=e("terminal",r1);const k1=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],i0=e("trash-2",k1);const p1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],l0=e("trending-up",p1);const i1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],M0=e("triangle-alert",i1);const l1=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],_0=e("user",l1);const M1=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],v0=e("users",M1);const _1=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],m0=e("wifi-off",_1);const v1=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],x0=e("wifi",v1);const m1=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],u0=e("wrench",m1);const x1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],f0=e("x",x1);const u1=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],w0=e("zap",u1);export{B1 as $,w1 as A,C1 as B,j1 as C,T1 as D,W1 as E,Z1 as F,G1 as G,J1 as H,I1 as I,c0 as J,Q1 as K,X1 as L,e0 as M,_0 as N,$1 as O,a0 as P,d0 as Q,o0 as R,s0 as S,p0 as T,v0 as U,O1 as V,m0 as W,f0 as X,u0 as Y,w0 as Z,Y1 as _,V1 as a,b1 as a0,k0 as b,x0 as c,h0 as d,R1 as e,S1 as f,E1 as g,H1 as h,U1 as i,M0 as j,t0 as k,r0 as l,N1 as m,A1 as n,K1 as o,D1 as p,g1 as q,z1 as r,n0 as s,P1 as t,L1 as u,l0 as v,q1 as w,y0 as x,i0 as y,F1 as z};
|