zenml-nightly 0.83.0.dev20250623__py3-none-any.whl → 0.83.1.dev20250624__py3-none-any.whl
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.
- zenml/VERSION +1 -1
- zenml/zen_server/dashboard/assets/{404-DmJUgorp.js → 404-B5eko6XL.js} +1 -1
- zenml/zen_server/dashboard/assets/{@reactflow-8OCk19Fi.js → @reactflow-B_iCtR7X.js} +1 -1
- zenml/zen_server/dashboard/assets/{AlertDialogDropdownItem-CZW4QyWn.js → AlertDialogDropdownItem-DsOmO1FH.js} +1 -1
- zenml/zen_server/dashboard/assets/{ButtonGroup-DFWWFGUE.js → ButtonGroup-4sPZDv70.js} +1 -1
- zenml/zen_server/dashboard/assets/{CodeSnippet-D2HkkAGr.js → CodeSnippet-Ctplhzdc.js} +1 -1
- zenml/zen_server/dashboard/assets/{CollapsibleCard-CnS09ljw.js → CollapsibleCard-CBKenz9f.js} +1 -1
- zenml/zen_server/dashboard/assets/{ComponentBadge-CDgdd0Ks.js → ComponentBadge-Cnecw3qz.js} +1 -1
- zenml/zen_server/dashboard/assets/{ComponentIcon-CbbOc7lb.js → ComponentIcon-CMiVW-O6.js} +1 -1
- zenml/zen_server/dashboard/assets/{DeleteAlertDialog-VIOMDLmx.js → DeleteAlertDialog-DEI0YDzP.js} +1 -1
- zenml/zen_server/dashboard/assets/{DialogItem-ClFCqxEp.js → DialogItem-CRCDpYU6.js} +1 -1
- zenml/zen_server/dashboard/assets/{Error-CQzjbDcN.js → Error-BG6f_WRd.js} +1 -1
- zenml/zen_server/dashboard/assets/{ExecutionStatus-CWreILP0.js → ExecutionStatus-BuhNAE9w.js} +1 -1
- zenml/zen_server/dashboard/assets/{Helpbox-CiKxG5_X.js → Helpbox-DtUG2Bf_.js} +1 -1
- zenml/zen_server/dashboard/assets/{Infobox-CGxFvqzi.js → Infobox-CSBRrM6r.js} +1 -1
- zenml/zen_server/dashboard/assets/{LeftSideMenu-DCsKdIjC.js → LeftSideMenu-DPsCCK3z.js} +1 -1
- zenml/zen_server/dashboard/assets/{NestedCollapsible-3M4llYtH.js → NestedCollapsible-CMuDIJlp.js} +1 -1
- zenml/zen_server/dashboard/assets/{NumberBox-C0mQktmV.js → NumberBox-DtCv7jh3.js} +1 -1
- zenml/zen_server/dashboard/assets/Pagination-CWnEpSpN.js +1 -0
- zenml/zen_server/dashboard/assets/{Partials-DSjkttlz.js → Partials-CfHD6OH5.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProCta-Dm5cWKpS.js → ProCta-CNyp04C8.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderIcon-DPwMR6nF.js → ProviderIcon-DHejyg7C.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderRadio-DEDNRgAb.js → ProviderRadio-tGtie8Gc.js} +1 -1
- zenml/zen_server/dashboard/assets/RunsBody-mYwMcWWj.js +1 -0
- zenml/zen_server/dashboard/assets/SearchField-BtUi6cYl.js +1 -0
- zenml/zen_server/dashboard/assets/{SecretTooltip-CZTRnaCV.js → SecretTooltip-B5u1UsQ9.js} +1 -1
- zenml/zen_server/dashboard/assets/{SetPassword-BjNGDC5e.js → SetPassword-BmbgL_ed.js} +1 -1
- zenml/zen_server/dashboard/assets/{SheetHeader-CASpN2Lz.js → SheetHeader-DkH7aG9K.js} +1 -1
- zenml/zen_server/dashboard/assets/StackComponentList-Bi8BKqCu.js +1 -0
- zenml/zen_server/dashboard/assets/StackList-Cvxapo0p.js +1 -0
- zenml/zen_server/dashboard/assets/{StackName-ojLC6xdl.js → StackName-CFSZL8ec.js} +1 -1
- zenml/zen_server/dashboard/assets/Tabs-D4dv48ry.js +1 -0
- zenml/zen_server/dashboard/assets/{Tick-BPrWnNlN.js → Tick-Qquvr4P3.js} +1 -1
- zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-CNfKDo2Q.js → UpdatePasswordSchemas-D_DCETSO.js} +1 -1
- zenml/zen_server/dashboard/assets/{UsageReason-Cb-mpV8M.js → UsageReason-DhiUV1bu.js} +1 -1
- zenml/zen_server/dashboard/assets/{Wizard-Dg8Pmn5A.js → Wizard-BHvY75u_.js} +1 -1
- zenml/zen_server/dashboard/assets/{WizardFooter-BcNDIvlQ.js → WizardFooter-FQm8y-jP.js} +1 -1
- zenml/zen_server/dashboard/assets/{all-pipeline-runs-query-DCdax7I5.js → all-pipeline-runs-query-DpKw9WL9.js} +1 -1
- zenml/zen_server/dashboard/assets/{bulk-delete-C_kpIB9A.js → bulk-delete-CzYA--cC.js} +1 -1
- zenml/zen_server/dashboard/assets/{configuration-form-B2hmKGnF.js → configuration-form-DSoMMiPE.js} +1 -1
- zenml/zen_server/dashboard/assets/{constants-1EZZxtay.js → constants-DTfsIqHy.js} +1 -1
- zenml/zen_server/dashboard/assets/{create-stack-TKmMtrkQ.js → create-stack-BpZrmKDu.js} +1 -1
- zenml/zen_server/dashboard/assets/{delete-run-CCR9md_s.js → delete-run-BkyDsKQc.js} +1 -1
- zenml/zen_server/dashboard/assets/elk-worker.min-BdOC9sib.js +6263 -0
- zenml/zen_server/dashboard/assets/expand-full-BPiXpch2.js +1 -0
- zenml/zen_server/dashboard/assets/{form-DFJkaFDX.js → form-BgtamtJm.js} +1 -1
- zenml/zen_server/dashboard/assets/{form-schemas-CrznJVzA.js → form-schemas-dyDkAxXP.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-BjUu1mP4.js → index-BBt0LDtR.js} +1 -1
- zenml/zen_server/dashboard/assets/index-BfNISy0X.css +1 -0
- zenml/zen_server/dashboard/assets/{index-BFqbGSck.js → index-BgEfQ3_G.js} +4 -4
- zenml/zen_server/dashboard/assets/{index-U992soPJ.js → index-eoDB_1XX.js} +1 -1
- zenml/zen_server/dashboard/assets/{layout-Do9YI4QX.js → layout-o1x87a3q.js} +1 -1
- zenml/zen_server/dashboard/assets/{login-mutation-D3tFP6Wm.js → login-mutation-C1hvP_cX.js} +1 -1
- zenml/zen_server/dashboard/assets/page-4xUZpMN0.js +31 -0
- zenml/zen_server/dashboard/assets/page-4zc4xPv2.js +2 -0
- zenml/zen_server/dashboard/assets/page-B0104V6C.js +1 -0
- zenml/zen_server/dashboard/assets/page-BNJsjvof.js +1 -0
- zenml/zen_server/dashboard/assets/{page-sJjNT9xA.js → page-BPQ66vR-.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CAJ8B0vb.js → page-BQgSZ2nH.js} +1 -1
- zenml/zen_server/dashboard/assets/page-BXl2ZX6J.js +1 -0
- zenml/zen_server/dashboard/assets/{page-CtiuMP_r.js → page-BxeZrG_t.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-Cal6XQ4U.js → page-C2A-2Cj_.js} +1 -1
- zenml/zen_server/dashboard/assets/page-C2i-C7jv.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DJIGaUQ9.js → page-C3JfJxuR.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-ChGcZI_6.js → page-CESEqC2L.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DCcuPZ8P.js → page-CF8cTZ7l.js} +1 -1
- zenml/zen_server/dashboard/assets/page-CKjsimVu.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DNjKHjnH.js → page-COLzBwff.js} +1 -1
- zenml/zen_server/dashboard/assets/page-COifg5fa.js +1 -0
- zenml/zen_server/dashboard/assets/{page-CnbIYE80.js → page-CQeJuA8T.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DKK6ulgy.js → page-CcjWEjre.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-9RjCitFH.js → page-CefGLeWy.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DUKbOhaD.js → page-CfxpV3j4.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-D9Hfx6GV.js → page-ClcUzawe.js} +1 -1
- zenml/zen_server/dashboard/assets/page-Ct_LB3zo.js +1 -0
- zenml/zen_server/dashboard/assets/page-D-ZWUMYY.js +1 -0
- zenml/zen_server/dashboard/assets/{page-CUaMMoPG.js → page-D-tJ_Y0a.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CdZCmszX.js → page-DHrvih9u.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DUK0Nd_1.js → page-DMhaHZDw.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CAUYrfui.js → page-DOCOmmKn.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-akLcPcKw.js → page-DcQmxKLp.js} +1 -1
- zenml/zen_server/dashboard/assets/page-Dh4GRWw5.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DwVPpCFg.js → page-DiHZK-1w.js} +1 -1
- zenml/zen_server/dashboard/assets/page-Dn7ZNapg.js +1 -0
- zenml/zen_server/dashboard/assets/page-Dy4vSQY7.js +1 -0
- zenml/zen_server/dashboard/assets/{page-CN7lkvXr.js → page-QrvWQwZb.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BrT0_zSJ.js → page-RF3Fup0q.js} +1 -1
- zenml/zen_server/dashboard/assets/page-WuvCrN47.js +1 -0
- zenml/zen_server/dashboard/assets/{page-Be3R2uYn.js → page-_WnHBI1F.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-C210HcBA.js → page-ghjVNgVE.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BCrKmYIZ.js → page-iDsDiDXw.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-ClvmVesa.js → page-rVhXI5ZO.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DEohTSz6.js → page-uxjMX8Iq.js} +1 -1
- zenml/zen_server/dashboard/assets/{persist-Dec_w7aB.js → persist-BsdEtCkd.js} +1 -1
- zenml/zen_server/dashboard/assets/{persist-DWMWVP-y.js → persist-CFPbMcJX.js} +1 -1
- zenml/zen_server/dashboard/assets/{resource-tyes-list-o2LXiMay.js → resource-tyes-list-79FqS3LY.js} +1 -1
- zenml/zen_server/dashboard/assets/{resource-type-tooltip-DwHrJstL.js → resource-type-tooltip-BL9ZTRKi.js} +1 -1
- zenml/zen_server/dashboard/assets/{service-connectors-DSEMwJ5A.js → service-connectors-Q8h7-_rG.js} +1 -1
- zenml/zen_server/dashboard/assets/{service-jxtvgks0.js → service-k-9Vsb30.js} +1 -1
- zenml/zen_server/dashboard/assets/{sharedSchema-BXzg0EZz.js → sharedSchema-C_HkejsG.js} +1 -1
- zenml/zen_server/dashboard/assets/{stack-detail-query-Cm0fsgo-.js → stack-detail-query-CNmVZ0Bo.js} +1 -1
- zenml/zen_server/dashboard/assets/{update-current-user-mutation-D5MjcQ6F.js → update-current-user-mutation-Ca-Lmwuj.js} +1 -1
- zenml/zen_server/dashboard/assets/{update-server-settings-mutation-CmnxdxiK.js → update-server-settings-mutation-Bwe3gUt4.js} +1 -1
- zenml/zen_server/dashboard/index.html +4 -4
- zenml/zen_stores/migrations/versions/0.83.1_release.py +23 -0
- {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250624.dist-info}/METADATA +5 -9
- {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250624.dist-info}/RECORD +110 -106
- zenml/zen_server/dashboard/assets/RunsBody-BRBn1e2O.js +0 -1
- zenml/zen_server/dashboard/assets/SearchField-DY6-UbRT.js +0 -1
- zenml/zen_server/dashboard/assets/StackComponentList-Be1pQt9m.js +0 -1
- zenml/zen_server/dashboard/assets/StackList-BdiR5DvR.js +0 -1
- zenml/zen_server/dashboard/assets/Tabs-DNSKblCM.js +0 -1
- zenml/zen_server/dashboard/assets/index-DuhuqTCI.css +0 -1
- zenml/zen_server/dashboard/assets/page-B0PsXWiT.js +0 -1
- zenml/zen_server/dashboard/assets/page-BcRI3-aR.js +0 -29
- zenml/zen_server/dashboard/assets/page-BgknnddT.js +0 -1
- zenml/zen_server/dashboard/assets/page-Bs3W2FDi.js +0 -1
- zenml/zen_server/dashboard/assets/page-C6KaiZ_W.js +0 -1
- zenml/zen_server/dashboard/assets/page-CHxVhF3x.js +0 -1
- zenml/zen_server/dashboard/assets/page-CktmtZ8Z.js +0 -1
- zenml/zen_server/dashboard/assets/page-CoXzjeEY.js +0 -1
- zenml/zen_server/dashboard/assets/page-D9iuB88h.js +0 -1
- zenml/zen_server/dashboard/assets/page-DYOucPtA.js +0 -1
- zenml/zen_server/dashboard/assets/page-DpqRelAy.js +0 -1
- zenml/zen_server/dashboard/assets/page-XURWnYZP.js +0 -1
- zenml/zen_server/dashboard/assets/page-abw-2oeW.js +0 -1
- zenml/zen_server/dashboard/assets/page-n9ejQ2V3.js +0 -2
- {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250624.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250624.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250624.dist-info}/entry_points.txt +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
import{j as o}from"./@radix-Cdvw4jJ8.js";import{C as r,S as m}from"./StackComponentList-Be1pQt9m.js";import{a as i}from"./@react-router-DeDfXbUF.js";import"./plus-Cl0_rCVF.js";import"./refresh-BcTM09NW.js";import"./SearchField-DY6-UbRT.js";import"./index-BFqbGSck.js";import"./@tanstack-5gTMR7G2.js";import"./@reactflow-8OCk19Fi.js";import"./chevron-right-double-Dgp_gEsp.js";import"./index-DWpiv-Ft.js";import"./DisplayDate-8RESqe5H.js";import"./SheetHeader-CASpN2Lz.js";import"./Tabs-DNSKblCM.js";import"./terminal-XFL_4QN-.js";import"./chevron-down-jbbQh82s.js";import"./transform-CeZdrxDZ.js";import"./NestedCollapsible-3M4llYtH.js";import"./type-guards-CNgPYg8l.js";import"./eye-CbVlAYty.js";import"./CollapsibleCard-CnS09ljw.js";import"./check-circle-C4tYvbtw.js";import"./CodeSnippet-D2HkkAGr.js";import"./all-pipeline-runs-query-DCdax7I5.js";import"./ExecutionStatus-CWreILP0.js";import"./help-Co6aedki.js";import"./index-BjUu1mP4.js";import"./stack-detail-query-Cm0fsgo-.js";import"./ComponentBadge-CDgdd0Ks.js";import"./ComponentIcon-CbbOc7lb.js";import"./layout-DBbfEFBe.js";import"./trash-DP6Tpp_E.js";import"./DeleteAlertDialog-VIOMDLmx.js";import"./zod-XdS2h1ws.js";import"./index.esm-DhJo3mA6.js";import"./Infobox-CGxFvqzi.js";import"./info-QkbQz4QU.js";import"./bulk-delete-C_kpIB9A.js";function M(){const{connectorId:t}=i();return o.jsx(r,{children:o.jsx(m,{fixedQueryParams:{connector_id:t},displayCreateComponent:!1})})}export{M as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as m,j as e}from"./@radix-Cdvw4jJ8.js";import{f as S,i as D,F as C,j as w,as as M,at as $,B as h,au as _,av as V,aw as J,a as P,I as k,C as g,az as U,aA as G,aB as A,A as K,k as Y,n as Z,aC as W,b2 as X,aD as ee,b3 as te,aF as se,ay as ne,D as ae,l as re,m as ce,p as ie,r as T,b as I,x as oe,g as F}from"./index-BFqbGSck.js";import{P as le,S as ue}from"./SearchField-DY6-UbRT.js";import{s as f,c as de,A as me,u as xe,a as R,b as he}from"./service-jxtvgks0.js";import{c as b,h as N,b as pe}from"./@tanstack-5gTMR7G2.js";import{t as fe}from"./zod-XdS2h1ws.js";import{u as je,F as ye,a as ve,C as v}from"./index.esm-DhJo3mA6.js";import{S as q}from"./trash-DP6Tpp_E.js";import{D as E,a as z}from"./DeleteAlertDialog-VIOMDLmx.js";import{c as ge,u as Ae}from"./bulk-delete-C_kpIB9A.js";import{S as Se}from"./Lock-CrIAdQo6.js";import{L as O}from"./@react-router-DeDfXbUF.js";import{A as De}from"./AlertDialogDropdownItem-CZW4QyWn.js";import"./@reactflow-8OCk19Fi.js";import"./chevron-right-double-Dgp_gEsp.js";import"./index-DWpiv-Ft.js";import"./CodeSnippet-D2HkkAGr.js";import"./Infobox-CGxFvqzi.js";import"./info-QkbQz4QU.js";import"./Tick-BPrWnNlN.js";import"./check-B9QMTa3f.js";async function Ce({body:t}){const s=D(w.serviceAccounts.all),n=await S(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const r=await n.json().then(a=>Array.isArray(a.detail)?a.detail[1]:a.detail).catch(()=>"Failed to create service account");throw new C({status:n.status,statusText:n.statusText,message:r})}return n.json()}function we(t){return b({...t,mutationFn:async s=>Ce({body:s})})}function B({isFallback:t}){const[s,n]=m.useState(!1),[r,a]=m.useState(""),i=N(),u=je({resolver:fe(de),defaultValues:{name:"",description:"",createDefault:!1}}),l=!!r&&u.watch("createDefault");function d(){return l?e.jsx(me,{value:r}):e.jsx(be,{isFallback:t,setApiKeyValue:a,setOpen:n})}return e.jsx(ye,{...u,children:e.jsxs(M,{open:s,onOpenChange:o=>{t&&!o&&i.invalidateQueries({queryKey:f.serviceAccountsKey()}),n(o),a(""),u.reset()},children:[e.jsx($,{asChild:!0,children:e.jsx(h,{className:"shrink-0",size:"sm",intent:"primary",children:"Add service account"})}),e.jsxs(_,{"data-success":l,className:"mx-auto overflow-x-auto transition-none data-[success=true]:max-w-[800px]",children:[e.jsx(V,{children:e.jsx(J,{children:"Add service account"})}),d()]})]})})}function be({setApiKeyValue:t,setOpen:s,isFallback:n}){const{watch:r,handleSubmit:a,control:i,formState:{isValid:u}}=ve(),{toast:l}=P(),d=N(),{mutate:o}=we({onError(c){A(c)&&l({status:"error",emphasis:"subtle",description:c.message,rounded:!0})},async onSuccess(c){if(l({description:"The service account has been added successfully.",status:"success",emphasis:"subtle",rounded:!0}),r("createDefault")){x(c.id);return}d.invalidateQueries({queryKey:f.serviceAccountsKey()}),s(!1)}}),{mutate:p}=xe({onSuccess(c){var y;n||d.invalidateQueries({queryKey:f.serviceAccountsKey()}),t(((y=c.body)==null?void 0:y.key)||"")},onError(c){A(c)&&l({status:"error",emphasis:"subtle",description:c.message,rounded:!0})}}),x=c=>{p({serviceAccountId:c,body:{name:"default",description:"Default api key"}})},H=c=>{o({name:c.name,description:c.description,active:!0})};return e.jsxs(e.Fragment,{children:[e.jsxs("form",{id:"create-secret-form",className:"space-y-5 p-7",onSubmit:a(H),children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{className:"font-inter text-sm text-left font-medium leading-5",children:"Name:"}),e.jsx(v,{name:"name",control:i,render:({field:c})=>e.jsx(k,{...c,className:"w-full",required:!0,placeholder:"Add name"})})]}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{className:"font-inter text-sm text-left font-medium leading-5",children:"Description:"}),e.jsx(v,{name:"description",control:i,render:({field:c})=>e.jsx(k,{...c,className:"w-full",placeholder:"Add description"})})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v,{control:i,name:"createDefault",render:({field:{onChange:c,value:y}})=>e.jsx(g,{checked:y,id:"default-key",onCheckedChange:L=>c(!!L)})}),e.jsx("label",{htmlFor:"default-key",children:"Create a default API Key"})]}),e.jsx("p",{className:"pl-[30px] text-text-xs text-theme-text-secondary",children:"This will include a default API Key for your service account."})]})]}),e.jsxs(U,{className:"gap-[10px]",children:[e.jsx(G,{asChild:!0,children:e.jsx(h,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(h,{intent:"primary",size:"sm",disabled:!u,type:"submit",form:"create-secret-form",children:"Add service account"})]})]})}async function Ne(t){const s=D(w.serviceAccounts.detail(t)),n=await S(s,{method:"DELETE",headers:{"Content-Type":"application/json"}});if(!n.ok){const r=await n.json().then(a=>Array.isArray(a.detail)?a.detail[1]:a.detail).catch(()=>`Failed to delete service account ${t}`);throw new C({status:n.status,statusText:n.statusText,message:r})}return n.json()}function ke(t){return b({...t,mutationFn:async s=>{await Ne(s)}})}const{ContextProvider:Te,useContext:j}=ge();function Q(){const{setRowSelection:t}=j(),{mutateAsync:s}=ke();async function n(r){await s(r)}return Ae({deleteFn:n,queryKeyToInvalidate:f.serviceAccountsKey(),setRowSelection:t})}function Fe(){const[t,s]=m.useState(!1),{selectedRowCount:n,selectedRowIDs:r}=j(),{bulkDelete:a}=Q();async function i(){await a(r),s(!1)}return e.jsxs(K,{open:t,onOpenChange:s,children:[e.jsx(Y,{asChild:!0,children:e.jsxs(h,{className:"rounded-sharp border-y-0 bg-white",size:"md",emphasis:"subtle",intent:"secondary",children:[e.jsx(q,{className:"h-5 w-5 shrink-0 gap-1 fill-neutral-400"}),"Delete"]})}),e.jsx(E,{title:`Delete Service Account${n>=2?"s":""}`,handleDelete:i,children:e.jsxs(z,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})]})}function Oe(){const{selectedRowCount:t}=j();return e.jsxs("div",{className:"flex items-center divide-x divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[e.jsx("div",{className:"bg-primary-25 px-2 py-1 font-semibold text-theme-text-brand",children:`${t} Service Account${t>1?"s":""} selected`}),e.jsx(Fe,{})]})}async function Pe({body:t,serviceAccountId:s}){const n=D(w.serviceAccounts.detail(s)),r=await S(n,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(r.status===404&&Z(),!r.ok){const a=await r.json().then(i=>Array.isArray(i.detail)?i.detail[1]:i.detail).catch(()=>`Failed to update service account ${s}`);throw new C({status:r.status,statusText:r.statusText,message:a})}return r.json()}function Ke(t){return b({...t,mutationFn:async({serviceAccountId:s,body:n})=>Pe({serviceAccountId:s,body:n})})}function Ie({isActive:t,serviceAccountId:s}){const{toast:n}=P(),r=N(),[a,i]=m.useState(!1),{mutate:u}=Ke({onError(o){A(o)&&n({status:"error",emphasis:"subtle",description:o.message,rounded:!0})},onSuccess(){r.invalidateQueries({queryKey:f.serviceAccountsKey()})}});function l(o){o?d(o):i(!0)}async function d(o){u({serviceAccountId:s,body:{active:o}})}return e.jsxs(e.Fragment,{children:[e.jsx(K,{open:a,onOpenChange:i,children:e.jsxs(W,{children:[e.jsx(X,{children:e.jsx(ee,{children:"Deactivate Service Account"})}),e.jsxs("div",{className:"p-5 text-text-md text-theme-text-secondary",children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"You won't be able to use any API keys of this service account to authenticate with the server anymore."})]}),e.jsxs(te,{className:"gap-[10px]",children:[e.jsx(se,{asChild:!0,children:e.jsx(h,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(h,{onClick:()=>d(!1).then(o=>i(!1)),intent:"primary",type:"button",children:"Deactivate"})]})]})}),e.jsx(ne,{checked:t,onCheckedChange:l})]})}function Re({serviceAccountId:t}){const[s,n]=m.useState(!1),[r,a]=m.useState(!1),{bulkDelete:i}=Q(),u=m.useRef(null),l=m.useRef(null);function d(){l.current=u.current}async function o(){await i([t]),p(!1)}function p(x){if(x===!1){n(!1),setTimeout(()=>{a(x)},200);return}a(x)}return e.jsxs(ae,{onOpenChange:n,open:s,children:[e.jsx(re,{ref:u,children:e.jsx(ce,{className:"h-5 w-5 fill-theme-text-secondary"})}),e.jsx(ie,{hidden:r,onCloseAutoFocus:x=>{l.current&&(l.current.focus(),l.current=null,x.preventDefault())},align:"end",sideOffset:7,children:e.jsx(De,{onSelect:d,open:r,onOpenChange:p,triggerChildren:"Delete",icon:e.jsx(q,{fill:"red"}),children:e.jsx(E,{title:"Delete Service Account",handleDelete:o,children:e.jsxs(z,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})})})]})}function qe(){return[{id:"select",meta:{width:"1%"},header:({table:t})=>e.jsx(g,{id:"check-all",checked:t.getIsAllRowsSelected(),onCheckedChange:s=>t.toggleAllRowsSelected(s==="indeterminate"?!0:s)}),cell:({row:t})=>e.jsx(g,{id:`check-${t.id}`,checked:t.getIsSelected(),onCheckedChange:t.getToggleSelectedHandler()})},{id:"service-account",header:"Service Account",accessorFn:t=>t.name,cell:({row:t})=>{var s;return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Se,{className:"h-5 w-5 flex-shrink-0 fill-primary-400"}),e.jsxs("div",{className:"group/copybutton flex flex-col",children:[e.jsx("div",{className:"flex flex-row items-center space-x-1",children:e.jsx("div",{className:"flex items-center space-x-1",children:e.jsx(O,{className:"text-text-md font-semibold text-theme-text-primary",to:T.settings.service_accounts.detail(t.original.id),children:t.original.name})})}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(O,{className:"flex items-center gap-1 text-text-sm text-theme-text-secondary",to:T.settings.service_accounts.detail(t.original.id),children:(s=t.original.metadata)==null?void 0:s.description})})]})]})}},{id:"active",header:"Active",accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.active},cell:({row:t})=>{var s;return e.jsx(Ie,{isActive:!!((s=t.original.body)!=null&&s.active),serviceAccountId:t.original.id})}},{id:"actions",meta:{width:"5%"},header:"",cell:({row:t})=>e.jsx("div",{className:"flex items-center justify-end",children:e.jsx(Re,{serviceAccountId:t.original.id})})}]}function Ee(){return e.jsxs(I,{className:"flex flex-col items-center justify-center space-y-4 p-9",children:[e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold text-theme-text-primary",children:"There are no service accounts yet."}),e.jsx("p",{className:"text-theme-text-secondary",children:"Create your first one now to automate your processes securely with ZenML."})]}),e.jsx(B,{isFallback:!0})]})}function ze(){const t=R(),{rowSelection:s,setRowSelection:n}=j(),r=m.useMemo(()=>qe(),[]),{data:a}=pe({...he.serviceAccountList({...t,sort_by:"desc:created",hydrate:!0})});return a&&a.items.length<1&&!t.name?e.jsx(Ee,{}):e.jsxs(e.Fragment,{children:[e.jsx(Be,{}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:a?e.jsx(oe,{getRowId:i=>i.id,rowSelection:s,onRowSelectionChange:n,columns:r,data:a.items}):e.jsx(F,{className:"h-[500px] w-full"})}),a?a.total_pages>1&&e.jsx(le,{searchParams:t,paginate:a}):e.jsx(F,{className:"h-[36px] w-[300px]"})]})]})}function Be(){const t=R(),{selectedRowCount:s}=j();return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s?e.jsx(Oe,{}):e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(ue,{searchParams:t})}),e.jsx(B,{isFallback:!1})]})}function ot(){return e.jsxs(I,{className:"space-y-4 p-5",children:[e.jsx(Qe,{}),e.jsx(Te,{children:e.jsx(ze,{})})]})}function Qe(){return e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Service Accounts"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Configure automated access for background tasks and integrations."}),e.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://docs.zenml.io/how-to/project-setup-and-management/connecting-to-zenml/connect-with-a-service-account",className:"link text-text-sm text-primary-400",children:"Learn More"})]})]})}export{ot as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{j as o}from"./@radix-Cdvw4jJ8.js";import{S as r}from"./Tabs-DNSKblCM.js";import{R as m}from"./RunsBody-BRBn1e2O.js";import{b as i}from"./ButtonGroup-DFWWFGUE.js";import{S as p}from"./StackList-BdiR5DvR.js";import{a as s}from"./@react-router-DeDfXbUF.js";import"./index-BFqbGSck.js";import"./@tanstack-5gTMR7G2.js";import"./@reactflow-8OCk19Fi.js";import"./terminal-XFL_4QN-.js";import"./chevron-down-jbbQh82s.js";import"./transform-CeZdrxDZ.js";import"./DisplayDate-8RESqe5H.js";import"./NestedCollapsible-3M4llYtH.js";import"./type-guards-CNgPYg8l.js";import"./eye-CbVlAYty.js";import"./CollapsibleCard-CnS09ljw.js";import"./check-circle-C4tYvbtw.js";import"./CodeSnippet-D2HkkAGr.js";import"./refresh-BcTM09NW.js";import"./SearchField-DY6-UbRT.js";import"./chevron-right-double-Dgp_gEsp.js";import"./index-DWpiv-Ft.js";import"./all-pipeline-runs-query-DCdax7I5.js";import"./ExecutionStatus-CWreILP0.js";import"./help-Co6aedki.js";import"./trash-DP6Tpp_E.js";import"./AlertDialogDropdownItem-CZW4QyWn.js";import"./DeleteAlertDialog-VIOMDLmx.js";import"./zod-XdS2h1ws.js";import"./index.esm-DhJo3mA6.js";import"./bulk-delete-C_kpIB9A.js";import"./delete-run-CCR9md_s.js";import"./plus-Cl0_rCVF.js";import"./index-BjUu1mP4.js";import"./stack-detail-query-Cm0fsgo-.js";import"./SheetHeader-CASpN2Lz.js";import"./components-Br2ezRib.js";import"./NumberBox-C0mQktmV.js";import"./ComponentBadge-CDgdd0Ks.js";import"./ComponentIcon-CbbOc7lb.js";import"./layout-DBbfEFBe.js";import"./Infobox-CGxFvqzi.js";import"./info-QkbQz4QU.js";import"./DialogItem-ClFCqxEp.js";function Z(){const{componentId:t}=s();return o.jsx("div",{className:"@container",children:o.jsx(r,{isPanel:!1,stacksTabContent:o.jsx(p,{fixedQueryParams:{component_id:t}}),runsTabContent:o.jsx(i,{children:o.jsx(m,{fixedQueryParams:{stack_component:t}})}),componentId:t})})}export{Z as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as f,j as s}from"./@radix-Cdvw4jJ8.js";import{R as g,u as b,a as y,b as v}from"./ButtonGroup-DFWWFGUE.js";import{y as N,E as P,r as c,P as S,z as i,C as p,T as k,q as C,s as R,t as T,v as u,w as x,G as w,B as E,x as _,g as h}from"./index-BFqbGSck.js";import{S as B}from"./pipeline-CSUlkd50.js";import{f as D,L as l,a as j}from"./@react-router-DeDfXbUF.js";import{S as A}from"./refresh-BcTM09NW.js";import{u as F}from"./all-pipeline-runs-query-DCdax7I5.js";import{S as I,P as z}from"./SearchField-DY6-UbRT.js";import{S as G}from"./terminal-XFL_4QN-.js";import{D as H}from"./DisplayDate-8RESqe5H.js";import{g as L,E as U}from"./ExecutionStatus-CWreILP0.js";import"./trash-DP6Tpp_E.js";import"./AlertDialogDropdownItem-CZW4QyWn.js";import"./DeleteAlertDialog-VIOMDLmx.js";import"./zod-XdS2h1ws.js";import"./index.esm-DhJo3mA6.js";import"./bulk-delete-C_kpIB9A.js";import"./@tanstack-5gTMR7G2.js";import"./delete-run-CCR9md_s.js";import"./@reactflow-8OCk19Fi.js";import"./chevron-right-double-Dgp_gEsp.js";import"./index-DWpiv-Ft.js";import"./check-circle-C4tYvbtw.js";import"./help-Co6aedki.js";function q(e){const{setBreadcrumbs:t}=N();f.useEffect(()=>{e&&t([P,{label:e,href:c.projects.pipelines.namespace(e)}])},[t,e])}function $({namespace:e}){return s.jsx(S,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(B,{className:"h-5 w-5 fill-neutral-400"}),s.jsx("h1",{className:"text-display-xs font-semibold",children:decodeURIComponent(e)})]})})}const d=1,O=i.object({page:i.coerce.number().min(d).optional().default(d).catch(d),name:i.string().optional(),operator:i.enum(["and","or"]).optional()});function J(){const[e]=D(),{page:t,name:a,operator:r}=O.parse({page:e.get("page")||void 0,name:e.get("name")||void 0});return{page:t,name:a,logical_operator:r}}function K(){return[{id:"select",meta:{width:"1%"},header:({table:e})=>s.jsx(p,{id:"check-all",checked:e.getIsAllRowsSelected(),onCheckedChange:t=>e.toggleAllRowsSelected(t==="indeterminate"?!0:t)}),cell:({row:e})=>s.jsx(p,{id:`check-${e.id}`,checked:e.getIsSelected(),onCheckedChange:e.getToggleSelectedHandler()})},{id:"run",header:"Run",accessorFn:e=>{var t;return{name:e.name,id:e.id,status:(t=e.body)==null?void 0:t.status}},cell:({getValue:e})=>{const{name:t,status:a,id:r}=e();return s.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[s.jsx(G,{className:`h-5 w-5 shrink-0 ${L(a)}`}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(l,{to:c.projects.runs.detail(r),className:"flex items-center gap-1",children:s.jsx("h2",{className:"text-text-md font-semibold",children:t})}),s.jsx(k,{children:s.jsxs(C,{children:[s.jsx(R,{className:"hover:text-theme-text-brand hover:underline",children:s.jsx(U,{status:a})}),s.jsx(T,{className:"z-20 capitalize",children:a})]})}),s.jsx(u,{copyText:t})]}),s.jsxs(l,{to:c.projects.runs.detail(r),className:"flex items-center gap-1",children:[s.jsx("p",{className:"text-text-xs text-theme-text-secondary",children:r.split("-")[0]}),s.jsx(u,{copyText:r})]})]})]})}},{id:"stack",header:"Stack",accessorFn:e=>{var t,a,r,n;return{name:(a=(t=e.body)==null?void 0:t.stack)==null?void 0:a.name,id:(n=(r=e.body)==null?void 0:r.stack)==null?void 0:n.id}},cell:({getValue:e})=>{const{name:t,id:a}=e();return!t||!a?null:s.jsx(l,{to:c.stacks.overview,children:s.jsx(x,{rounded:!1,className:"inline-block",color:"turquoise",emphasis:"subtle",children:t})})}},{id:"repository",header:"Repository",accessorFn:e=>{var t,a,r,n,o,m;return{name:(r=(a=(t=e.body)==null?void 0:t.code_reference)==null?void 0:a.body)==null?void 0:r.code_repository.name,id:(m=(o=(n=e.body)==null?void 0:n.code_reference)==null?void 0:o.body)==null?void 0:m.code_repository.id}},cell:({getValue:e})=>{const{name:t,id:a}=e();return!t||!a?null:s.jsx("div",{children:s.jsx(x,{rounded:!1,className:"inline-block",color:"grey",emphasis:"subtle",children:t})})}},{id:"created",header:"Created at",accessorFn:e=>{var t;return(t=e.body)==null?void 0:t.created},cell:({getValue:e})=>s.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:s.jsx(H,{dateString:e()})})},{id:"author",header:"Author",accessorFn:e=>{var t;return{author:(t=e.resources)==null?void 0:t.user}},cell:({getValue:e})=>{const{author:t}=e();return s.jsx(w,{username:t.name})}},{id:"admin_actions",header:"",meta:{width:"5%"},cell:({row:e})=>s.jsx(g,{id:e.original.id})}]}function M(){const{namespace:e}=j(),t=J(),a=K(),{selectedRowCount:r}=b(),{data:n,refetch:o}=F({params:{pipeline_name:decodeURIComponent(e),...t,sort_by:"desc:updated"}},{throwOnError:!0});return s.jsxs("div",{className:"flex flex-col gap-5 p-5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[r?s.jsx(y,{}):s.jsx(I,{searchParams:t}),s.jsxs(E,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>o(),children:[s.jsx(A,{className:"h-5 w-5 fill-theme-text-brand"}),"Refresh"]})]}),s.jsxs("div",{className:"flex flex-col items-center gap-5",children:[s.jsx("div",{className:"w-full",children:n?s.jsx(_,{columns:a,data:n.items}):s.jsx(h,{className:"h-[500px] w-full"})}),n?n.total_pages>1&&s.jsx(z,{searchParams:t,paginate:n}):s.jsx(h,{className:"h-[36px] w-[300px]"})]})]})}function ge(){const{namespace:e}=j();return q(e),s.jsx("div",{children:s.jsxs(v,{children:[s.jsx($,{namespace:e}),s.jsx(M,{})]})})}export{ge as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{j as t}from"./@radix-Cdvw4jJ8.js";import{C as o,S as r}from"./StackComponentList-Be1pQt9m.js";import"./plus-Cl0_rCVF.js";import"./refresh-BcTM09NW.js";import"./SearchField-DY6-UbRT.js";import"./index-BFqbGSck.js";import"./@tanstack-5gTMR7G2.js";import"./@react-router-DeDfXbUF.js";import"./@reactflow-8OCk19Fi.js";import"./chevron-right-double-Dgp_gEsp.js";import"./index-DWpiv-Ft.js";import"./DisplayDate-8RESqe5H.js";import"./SheetHeader-CASpN2Lz.js";import"./Tabs-DNSKblCM.js";import"./terminal-XFL_4QN-.js";import"./chevron-down-jbbQh82s.js";import"./transform-CeZdrxDZ.js";import"./NestedCollapsible-3M4llYtH.js";import"./type-guards-CNgPYg8l.js";import"./eye-CbVlAYty.js";import"./CollapsibleCard-CnS09ljw.js";import"./check-circle-C4tYvbtw.js";import"./CodeSnippet-D2HkkAGr.js";import"./all-pipeline-runs-query-DCdax7I5.js";import"./ExecutionStatus-CWreILP0.js";import"./help-Co6aedki.js";import"./index-BjUu1mP4.js";import"./stack-detail-query-Cm0fsgo-.js";import"./ComponentBadge-CDgdd0Ks.js";import"./ComponentIcon-CbbOc7lb.js";import"./layout-DBbfEFBe.js";import"./trash-DP6Tpp_E.js";import"./DeleteAlertDialog-VIOMDLmx.js";import"./zod-XdS2h1ws.js";import"./index.esm-DhJo3mA6.js";import"./Infobox-CGxFvqzi.js";import"./info-QkbQz4QU.js";import"./bulk-delete-C_kpIB9A.js";function K(){return t.jsx("div",{className:"pt-5",children:t.jsx(o,{children:t.jsx(r,{})})})}export{K as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as l,j as e}from"./@radix-Cdvw4jJ8.js";import{f as C,i as b,F as y,j as v,as as M,at as F,B as h,au as E,av as T,aw as P,ax as U,a as w,I as k,ay as O,az as I,aA as H,aB as R,S as D,z as u,aC as _,aD as z,aE as B,aF as Z,aG as q,D as V,l as G,m as L,p as K,G as Q,a3 as j,aH as J,e as $,g as f,x as W,b as X}from"./index-BFqbGSck.js";import{S as Y,P as ee}from"./SearchField-DY6-UbRT.js";import{C as se}from"./CodeSnippet-D2HkkAGr.js";import{c as N,h as A}from"./@tanstack-5gTMR7G2.js";import{u as ae}from"./index.esm-DhJo3mA6.js";import{D as te}from"./DisplayDate-8RESqe5H.js";import{A as re}from"./AlertDialogDropdownItem-CZW4QyWn.js";import{f as ne}from"./@react-router-DeDfXbUF.js";import"./@reactflow-8OCk19Fi.js";import"./chevron-right-double-Dgp_gEsp.js";import"./index-DWpiv-Ft.js";const ie=t=>l.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...t},l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 4C8.06703 4 6.50002 5.567 6.50002 7.5C6.50002 9.433 8.06703 11 10 11C11.933 11 13.5 9.433 13.5 7.5C13.5 5.567 11.933 4 10 4ZM4.50002 7.5C4.50002 4.46243 6.96246 2 10 2C13.0376 2 15.5 4.46243 15.5 7.5C15.5 10.5376 13.0376 13 10 13C6.96246 13 4.50002 10.5376 4.50002 7.5ZM19 14C19.5523 14 20 14.4477 20 15V17H22C22.5523 17 23 17.4477 23 18C23 18.5523 22.5523 19 22 19H20V21C20 21.5523 19.5523 22 19 22C18.4477 22 18 21.5523 18 21V19H16C15.4477 19 15 18.5523 15 18C15 17.4477 15.4477 17 16 17H18V15C18 14.4477 18.4477 14 19 14ZM7.32629 14.5C7.38335 14.5 7.44125 14.5 7.50003 14.5H12C12.5523 14.5 13 14.9477 13 15.5C13 16.0523 12.5523 16.5 12 16.5H7.50003C6.03171 16.5 5.51923 16.5109 5.12917 16.6292C4.17036 16.92 3.42005 17.6703 3.1292 18.6291C3.01088 19.0192 3.00002 19.5317 3.00002 21C3.00002 21.5523 2.55231 22 2.00002 22C1.44774 22 1.00002 21.5523 1.00002 21C1.00002 20.9412 1 20.8833 0.99998 20.8263C0.999526 19.599 0.999216 18.761 1.21532 18.0486C1.70007 16.4506 2.95059 15.2 4.54859 14.7153C5.261 14.4992 6.09902 14.4995 7.32629 14.5Z"}));async function le(t){const s=b(v.users.all),a=await C(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){const r=await a.json().then(n=>n.detail).catch(()=>"Failed to create User");throw new y({status:a.status,statusText:a.statusText,message:r})}return a.json()}function oe(t){return N({mutationFn:async s=>le(s),...t})}function ce(){const[t,s]=l.useState(!1),[a,r]=l.useState(null);return e.jsxs(M,{open:t,onOpenChange:n=>{s(n),r(null)},children:[e.jsx(F,{asChild:!0,children:e.jsx(h,{className:"shrink-0",intent:"primary",children:"Add Member"})}),e.jsxs(E,{className:"",children:[e.jsx(T,{children:e.jsx(P,{children:" Add a New Member"})}),a?e.jsx(me,{name:a.name,token:U(a)}):e.jsx(de,{setSuccessMember:r})]})]})}u.object({username:u.string(),isAdmin:u.boolean()});function de({setSuccessMember:t}){const{toast:s}=w(),a=A(),{mutate:r,isPending:n}=oe({onError(d){R(d)&&s({status:"error",emphasis:"subtle",icon:e.jsx(D,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:d.message,rounded:!0})},onSuccess(d){t(d),a.invalidateQueries({queryKey:["users"]})}}),c=l.useId(),o=l.useId(),{register:i,handleSubmit:x,watch:p,setValue:m}=ae();function S(d){r({is_admin:d.isAdmin,name:d.username})}return e.jsxs(e.Fragment,{children:[e.jsx("form",{id:"create-user-form",onSubmit:x(S),className:"space-y-5 p-7",children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{htmlFor:c,className:"text-text-sm",children:"Username"}),e.jsx(k,{...i("username"),id:c,className:"w-full"})]}),e.jsxs("div",{className:"flex gap-5",children:[e.jsx("label",{htmlFor:o,className:"text-text-md",children:"Add user as an Admin"}),e.jsx(O,{onCheckedChange:d=>m("isAdmin",!!d),...i("isAdmin",{value:!1}),id:o})]})]})}),e.jsxs(I,{className:"gap-[10px]",children:[e.jsx(H,{asChild:!0,children:e.jsx(h,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(h,{disabled:!p("username")||n,form:"create-user-form",size:"sm",children:"Generate Token"})]})]})}function me({token:t,name:s}){return e.jsxs("div",{className:"space-y-5 overflow-hidden p-7 text-center",children:[e.jsx(ie,{className:"m-auto mb-5 h-[110px] w-[110px] fill-success-500"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-lg font-semibold text-theme-text-primary",children:`The user ${s} was created successfully!`}),e.jsx("p",{className:"text-text-md text-theme-text-secondary",children:"Share the invitation link with the user to complete the registration."})]}),e.jsx(se,{className:"mx-auto",code:t})]})}const ue=t=>l.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...t},l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.9681 6.38231C3.73647 7.92199 3 9.87499 3 12C3 16.9706 7.02944 21 12 21C14.125 21 16.078 20.2635 17.6177 19.0319L4.9681 6.38231ZM6.38231 4.9681L19.0319 17.6177C20.2635 16.078 21 14.125 21 12C21 7.02944 16.9706 3 12 3C9.87499 3 7.92199 3.73647 6.38231 4.9681ZM1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12Z"}));async function he(t){const s=b(v.users.detail(t)),a=await C(s,{method:"DELETE",headers:{"Content-Type":"application/json"}});if(!a.ok){const r=await a.json().then(n=>n.detail).catch(()=>"Failed to delete User");throw new y({status:a.status,statusText:a.statusText,message:r})}return a.json()}function xe(t){return N({mutationFn:async s=>he(s),...t})}function pe({userId:t,name:s}){const{toast:a}=w(),r=A(),{isPending:n,mutate:c}=xe({onSuccess(){r.invalidateQueries({queryKey:["users"]})},onError:i=>{i instanceof Error&&a({status:"error",emphasis:"subtle",icon:e.jsx(D,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:i.message,rounded:!0})}});function o(){c(t)}return e.jsxs(_,{className:"p-0",children:[e.jsx(z,{className:"py-2 pl-5 pr-3 text-text-lg font-semibold",children:"Delete Member"}),e.jsx("div",{className:"border-y border-theme-border-moderate px-5 py-5",children:e.jsxs(B,{children:["Deleting ",e.jsx("strong",{children:s})," cannot be undone."]})}),e.jsxs("div",{className:"flex justify-end gap-3 px-5 py-3",children:[e.jsx(Z,{asChild:!0,children:e.jsx(h,{intent:"secondary",children:"Cancel"})}),e.jsx(q,{asChild:!0,children:e.jsx(h,{onClick:o,disabled:n,intent:"danger",children:"Delete"})})]})]})}function fe({userId:t,name:s}){const[a,r]=l.useState(!1),[n,c]=l.useState(!1),o=l.useRef(null),i=l.useRef(null);function x(){i.current=o.current}function p(m){if(m===!1){c(!1),setTimeout(()=>{r(m)},200);return}r(m)}return e.jsxs(V,{onOpenChange:c,open:n,children:[e.jsx(G,{ref:o,children:e.jsx(L,{className:"h-4 w-4 fill-theme-text-tertiary"})}),e.jsx(K,{hidden:a,onCloseAutoFocus:m=>{i.current&&(i.current.focus(),i.current=null,m.preventDefault())},align:"end",sideOffset:7,children:e.jsx(re,{onSelect:x,onOpenChange:p,triggerChildren:"Remove Member",icon:e.jsx(ue,{fill:"red"}),children:e.jsx(pe,{name:s,userId:t})})})]})}function ge({isAdmin:t}){return[{id:"name",accessorFn:s=>{var a;return{name:s.name,is_admin:!!((a=s.body)!=null&&a.is_admin)}},cell:({getValue:s})=>{const{name:a,is_admin:r}=s();return e.jsxs("div",{className:"flex",children:[e.jsx(Q,{username:a}),r&&e.jsx("div",{children:e.jsx(j,{className:"ml-2 capitalize",size:"xs",color:"purple",children:"Admin"})})]})},header:"User"},{accessorKey:"status",header:"Status",accessorFn:s=>{var a;return{status:(a=s.body)==null?void 0:a.active}},cell:({getValue:s})=>{const{status:a}=s();return e.jsx(j,{className:"capitalize",color:a?"green":"grey",children:a?"Active":"Inactive"})}},{id:"created",header:"Created",accessorFn:s=>{var a;return(a=s.body)==null?void 0:a.created},cell:({getValue:s})=>e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.jsx(te,{dateString:s()})})},...t?[{id:"actions",header:"",accessorFn:s=>({id:s.id,name:s.name}),meta:{width:"5%"},cell:({getValue:s})=>{const{id:a,name:r}=s();return e.jsx(fe,{name:r,userId:a})}}]:[]]}const g=1,je=u.object({page:u.coerce.number().min(g).optional().default(g).catch(g),name:u.string().optional(),operator:u.enum(["and","or"]).optional()});function Ce(){const[t]=ne(),{page:s,name:a,operator:r}=je.parse({page:t.get("page")||void 0,name:t.get("name")||void 0,operator:t.get("operator")||void 0});return{page:s,name:a,logical_operator:r}}function be(){var o,i;const t=Ce(),{data:s,isError:a}=J({params:{...t,sort_by:"desc:created"}},{throwOnError:!0}),{data:r,isPending:n,isError:c}=$();return a||c?null:n?e.jsx(f,{className:"h-[350px]"}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx(Y,{searchParams:t}),((o=r.body)==null?void 0:o.is_admin)&&e.jsx(ce,{})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:s?e.jsx(W,{columns:ge({isAdmin:(i=r.body)==null?void 0:i.is_admin}),data:s.items}):e.jsx(f,{className:"h-[250px] w-full"})}),s?s.total_pages>1&&e.jsx(ee,{searchParams:t,paginate:s}):e.jsx(f,{className:"h-[36px] w-[300px]"})]})]})}function Ue(){return e.jsxs(X,{className:"flex flex-col gap-4 p-5",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Members"}),e.jsx(be,{})]})}export{Ue as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as x,j as e}from"./@radix-Cdvw4jJ8.js";import{s as j,A as E,d as ae,u as re,b as C,a as B}from"./service-jxtvgks0.js";import{h as A,c as N,b as S}from"./@tanstack-5gTMR7G2.js";import{as as q,at as ie,B as f,au as _,av as z,aw as $,a as K,I as D,az as V,aA as H,aB as k,f as T,i as F,F as R,j as P,A as Q,k as oe,n as G,z as v,ay as L,T as ce,q as le,s as de,t as ue,g as b,D as me,l as xe,m as he,p as pe,an as fe,aC as ye,b2 as je,aD as ge,b3 as be,aF as Ae,C as I,b as U,x as ve,y as De,b7 as we,r as Ce,a3 as Ne}from"./index-BFqbGSck.js";import{P as Se,S as Ke}from"./SearchField-DY6-UbRT.js";import{t as Y}from"./zod-XdS2h1ws.js";import{u as J,C as w}from"./index.esm-DhJo3mA6.js";import{S as Z}from"./trash-DP6Tpp_E.js";import{c as ke,u as Te}from"./bulk-delete-C_kpIB9A.js";import{D as W,a as X}from"./DeleteAlertDialog-VIOMDLmx.js";import{S as ee}from"./key-icon-C07HKw8z.js";import{D as M}from"./DisplayDate-8RESqe5H.js";import{i as Fe,a as Re}from"./dates-Buh6SMo7.js";import{S as Pe}from"./refresh-BcTM09NW.js";import{A as Oe}from"./AlertDialogDropdownItem-CZW4QyWn.js";import{S as Ie}from"./info-QkbQz4QU.js";import{I as Me}from"./Infobox-CGxFvqzi.js";import{a as O}from"./@react-router-DeDfXbUF.js";import"./CodeSnippet-D2HkkAGr.js";import"./Tick-BPrWnNlN.js";import"./check-B9QMTa3f.js";import"./@reactflow-8OCk19Fi.js";import"./chevron-right-double-Dgp_gEsp.js";import"./index-DWpiv-Ft.js";function te({serviceAccountId:t,isFallback:s}){const n=A(),[i,a]=x.useState(!1),[r,o]=x.useState(""),u=!!r;function m(){return u?e.jsx(E,{value:r}):e.jsx(Ee,{isFallback:s,serviceAccountId:t,setApikeyValue:o})}return e.jsx(e.Fragment,{children:e.jsxs(q,{open:i,onOpenChange:l=>{s&&!l&&n.invalidateQueries({queryKey:j.apiKeysKey(t)}),a(l),o("")},children:[e.jsx(ie,{asChild:!0,children:e.jsx(f,{className:"shrink-0",intent:"primary",size:"sm",children:"Generate API Key"})}),e.jsxs(_,{"data-success":u,className:"mx-auto overflow-x-auto transition-none data-[success=true]:max-w-[800px]",children:[e.jsx(z,{children:e.jsx($,{children:u?"API Key Created Successfully":"Generate API Key"})}),m()]})]})})}function Ee({serviceAccountId:t,setApikeyValue:s,isFallback:n}){const{toast:i}=K(),a=A(),{handleSubmit:r,control:o,formState:{isValid:u},reset:m}=J({resolver:Y(ae),defaultValues:{name:"",description:""}}),{mutate:l}=re({onError(c){k(c)&&i({status:"error",emphasis:"subtle",description:c.message,rounded:!0})},onSuccess(c){var y;n||a.invalidateQueries({queryKey:j.apiKeysKey(t)}),s(((y=c.body)==null?void 0:y.key)||""),m()}});function d(c){l({serviceAccountId:t,body:{name:c.name,description:c.description}})}return e.jsxs(e.Fragment,{children:[e.jsxs("form",{id:"create-secret-form",className:"space-y-5 p-7",onSubmit:r(d),children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{className:"font-inter text-sm text-left font-medium leading-5",children:"Name:"}),e.jsx(w,{name:"name",control:o,render:({field:c})=>e.jsx(D,{...c,className:"w-full",required:!0,placeholder:"Add name"})})]}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{className:"font-inter text-sm text-left font-medium leading-5",children:"Description:"}),e.jsx(w,{name:"description",control:o,render:({field:c})=>e.jsx(D,{...c,className:"w-full",placeholder:"Add description"})})]})]}),e.jsxs(V,{className:"gap-[10px]",children:[e.jsx(H,{asChild:!0,children:e.jsx(f,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(f,{intent:"primary",disabled:!u,type:"submit",form:"create-secret-form",children:"Generate Key"})]})]})}async function Be(t,s){const n=F(P.serviceAccounts.apiKeys.detail(t,s)),i=await T(n,{method:"DELETE",headers:{"Content-Type":"application/json"}});if(!i.ok){const a=await i.json().then(r=>Array.isArray(r.detail)?r.detail[1]:r.detail).catch(()=>`Failed to delete api key ${s}`);throw new R({status:i.status,statusText:i.statusText,message:a})}return i.json()}function qe(t){return N({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n})=>{await Be(s,n)}})}const{ContextProvider:_e,useContext:g}=ke();function se(t){const{setRowSelection:s}=g(),{mutateAsync:n}=qe();async function i(a){await n({serviceAccountId:t,apiKeyId:a})}return Te({deleteFn:i,queryKeyToInvalidate:j.serviceAccountsKey(),setRowSelection:s})}function ze({serviceAccountId:t}){const[s,n]=x.useState(!1),{bulkDelete:i}=se(t),{selectedRowIDs:a,selectedRowCount:r}=g();async function o(){await i(a),n(!1)}return e.jsxs(Q,{open:s,onOpenChange:n,children:[e.jsx(oe,{asChild:!0,children:e.jsxs(f,{className:"rounded-sharp border-y-0 bg-white",size:"md",emphasis:"subtle",intent:"secondary",children:[e.jsx(Z,{className:"h-5 w-5 shrink-0 gap-1 fill-neutral-400"}),"Delete"]})}),e.jsx(W,{title:`Delete Api Key${r>=2?"s":""}`,handleDelete:o,children:e.jsxs(X,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})]})}function $e({serviceAccountId:t}){const{selectedRowCount:s}=g();return e.jsxs("div",{className:"flex items-center divide-x divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[e.jsx("div",{className:"bg-primary-25 px-2 py-1 font-semibold text-theme-text-brand",children:`${s} Api Key${s>1?"s":""} selected`}),e.jsx(ze,{serviceAccountId:t})]})}async function Ve({apiKeyId:t,body:s,serviceAccountId:n}){const i=F(P.serviceAccounts.apiKeys.rotate(n,t)),a=await T(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(a.status===404&&G(),!a.ok){const r=await a.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>`Failed to rotate key ${t}`);throw new R({status:a.status,statusText:a.statusText,message:r})}return a.json()}function He(t){return N({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n,body:i})=>Ve({serviceAccountId:s,apiKeyId:n,body:i})})}const Qe=v.object({enableRetention:v.boolean(),rotateMinutes:v.coerce.number().int().min(1).optional()}).refine(t=>!(t.enableRetention&&!t.rotateMinutes));function Ge({serviceAccountId:t,apiKeyId:s,open:n,setOpen:i}){const[a,r]=x.useState(""),o=!!a;function u(){return o?e.jsx(E,{value:a}):e.jsx(Le,{setApiKeyValue:r,apiKeyId:s,serviceAccountId:t})}return e.jsx(q,{open:n,onOpenChange:m=>{i(m),r("")},children:e.jsxs(_,{className:"mx-auto max-w-[800px] overflow-x-auto",children:[e.jsx(z,{children:e.jsx($,{children:"Rotate API Key"})}),u()]})})}function Le({apiKeyId:t,serviceAccountId:s,setApiKeyValue:n}){const{toast:i}=K(),a=A(),{control:r,watch:o,register:u,handleSubmit:m,formState:{errors:l,isValid:d}}=J({resolver:Y(Qe),defaultValues:{enableRetention:!1,rotateMinutes:void 0}});function c(p){const h={retain_period_minutes:p.rotateMinutes};y({serviceAccountId:s,apiKeyId:t,body:h})}const{mutate:y}=He({onError(p){k(p)&&i({status:"error",emphasis:"subtle",description:p.message,rounded:!0})},onSuccess(p){var h;i({description:"The API key has been rotated successfully.",status:"success",emphasis:"subtle",rounded:!0}),n(((h=p.body)==null?void 0:h.key)||""),a.invalidateQueries({queryKey:[...j.apiKeysKey(s)]})}});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-5 p-7",children:[e.jsx(Ue,{apiKeyId:t,serviceAccountId:s}),e.jsx(Ye,{}),e.jsxs("form",{onSubmit:m(c),id:"retention-form",children:[e.jsxs("div",{className:"flex items-center gap-1 rounded-t-md border bg-theme-surface-secondary p-1",children:[e.jsx(w,{control:r,name:"enableRetention",render:({field:{onChange:p,value:h}})=>e.jsx(L,{className:"data-[state=unchecked]:bg-neutral-200",checked:h,id:"enable-retention",onCheckedChange:ne=>p(!!ne)})}),"Include Retention Period",e.jsx(ce,{children:e.jsxs(le,{children:[e.jsx(de,{asChild:!0,children:e.jsxs("button",{type:"button",children:[e.jsx(Ie,{className:"h-4 w-4 shrink-0 fill-theme-text-tertiary"}),e.jsx("div",{className:"sr-only",children:"Info tooltip"})]})}),e.jsx(ue,{className:"z-50 flex max-w-[480px] bg-black",children:e.jsx("p",{className:"text-text-xs text-white",children:"To minimize disruption, you can set a retention period for your current key. Enter the duration(in minutes) you'd like the old key to remain active alongside the new one."})})]})})]}),e.jsxs("fieldset",{disabled:!o("enableRetention"),className:"space-y-5 rounded-b-md border-x border-b p-5 text-text-md text-theme-text-primary",children:[e.jsx("p",{className:"text-text-md text-theme-text-primary",children:"Keep the current key working for the next"}),e.jsxs("div",{children:[e.jsx("label",{className:"text-text-sm text-theme-text-primary",htmlFor:"retention-minutes",children:"Minutes"}),e.jsx(D,{id:"retention-minutes",...u("rotateMinutes"),disabled:!o("enableRetention"),placeholder:"0"}),l.rotateMinutes&&e.jsx("p",{className:"text-text-sm text-theme-text-error",children:l.rotateMinutes.message})]})]})]})]}),e.jsxs(V,{className:"gap-[10px]",children:[e.jsx(H,{asChild:!0,children:e.jsx(f,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(f,{intent:"primary",disabled:!d,size:"sm",form:"retention-form",children:"Rotate Key"})]})]})}function Ue({apiKeyId:t,serviceAccountId:s}){var r;const{data:n,isPending:i,isError:a}=S({...C.ApiKeysDetail(s,t),throwOnError:!0});return i?e.jsx(b,{className:"h-8 w-full"}):a?null:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ee,{className:"h-5 w-5 flex-shrink-0 fill-primary-400"}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("p",{children:n&&n.name}),e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:n&&((r=n.metadata)==null?void 0:r.description)})]})]})}function Ye(){return e.jsxs(Me,{children:[e.jsx("strong",{children:"Your current API Key will be deactivated."})," This means any processes or integrations using the old key will no longer function once the new key is generated."]})}function Je({serviceAccountId:t,apiKeyId:s}){const[n,i]=x.useState(!1),[a,r]=x.useState(!1),[o,u]=x.useState(!1),m=x.useRef(null),l=x.useRef(null),{bulkDelete:d}=se(t);function c(){l.current=m.current}function y(h){u(h),h||i(!1)}async function p(){await d([s]),y(!1)}return e.jsxs(e.Fragment,{children:[e.jsx(Ge,{setOpen:r,open:a,serviceAccountId:t,apiKeyId:s}),e.jsxs(me,{onOpenChange:i,open:n,children:[e.jsx(xe,{ref:m,children:e.jsx(he,{className:"h-5 w-5 fill-theme-text-secondary"})}),e.jsxs(pe,{hidden:o,onCloseAutoFocus:h=>{l.current&&(l.current.focus(),l.current=null,h.preventDefault())},align:"end",sideOffset:7,children:[e.jsx(fe,{className:"px-3",onClick:()=>r(!0),icon:e.jsx(Pe,{}),children:e.jsx("span",{children:"Rotate"})}),e.jsx(Oe,{onSelect:c,open:o,onOpenChange:y,triggerChildren:"Delete",icon:e.jsx(Z,{fill:"red"}),children:e.jsx(W,{title:"Delete API Key",handleDelete:p,children:e.jsxs(X,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})})]})]})]})}async function Ze({apiKeyId:t,body:s,serviceAccountId:n}){const i=F(P.serviceAccounts.apiKeys.detail(n,t)),a=await T(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(a.status===404&&G(),!a.ok){const r=await a.json().then(o=>Array.isArray(o.detail)?o.detail[0]:o.detail||"An error occurred").catch(()=>`Failed to update key ${t}`);throw new R({status:a.status,statusText:a.statusText,message:r})}return a.json()}function We(t){return N({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n,body:i})=>{await Ze({serviceAccountId:s,apiKeyId:n,body:i})}})}function Xe({isActive:t,serviceAccountId:s,apiKeyId:n}){const{toast:i}=K(),a=A(),[r,o]=x.useState(!1),{mutate:u}=We({onError(d){k(d)&&i({status:"error",emphasis:"subtle",description:d.message,rounded:!0})},onSuccess(){a.invalidateQueries({queryKey:j.apiKeysKey(s)})}});function m(d){d?l(d):o(!0)}async function l(d){u({serviceAccountId:s,apiKeyId:n,body:{active:d}})}return e.jsxs(e.Fragment,{children:[e.jsx(Q,{open:r,onOpenChange:o,children:e.jsxs(ye,{children:[e.jsx(je,{children:e.jsx(ge,{children:"Deactivate API Key"})}),e.jsxs("div",{className:"p-5 text-text-md text-theme-text-secondary",children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"You won't be able to use this API Key to authenticate with the server anymore."})]}),e.jsxs(be,{className:"gap-[10px]",children:[e.jsx(Ae,{asChild:!0,children:e.jsx(f,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(f,{onClick:()=>l(!1).then(d=>o(!1)),intent:"primary",type:"button",children:"Deactivate"})]})]})}),e.jsx(L,{checked:t,onCheckedChange:m})]})}function et(){return[{id:"select",meta:{width:"1%"},header:({table:t})=>e.jsx(I,{id:"check-all",checked:t.getIsAllRowsSelected(),onCheckedChange:s=>t.toggleAllRowsSelected(s==="indeterminate"?!0:s)}),cell:({row:t})=>e.jsx(I,{id:`check-${t.id}`,checked:t.getIsSelected(),onCheckedChange:t.getToggleSelectedHandler()})},{id:"name",header:"Name",accessorFn:t=>({name:t.name}),cell:({row:t})=>{var s;return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ee,{className:"h-5 w-5 flex-shrink-0 fill-primary-400"}),e.jsxs("div",{className:"group/copybutton flex flex-col",children:[e.jsx("div",{className:"flex flex-row items-center space-x-1",children:e.jsx("div",{className:"flex items-center space-x-1 text-text-md font-semibold text-theme-text-primary",children:t.original.name})}),e.jsx("div",{className:"flex items-center gap-1 text-text-sm text-theme-text-secondary",children:(s=t.original.metadata)==null?void 0:s.description})]})]})}},{id:"last-login",header:"Last Login",accessorFn:t=>{var s;return(s=t.metadata)==null?void 0:s.last_login},cell:({row:t})=>{var s,n;return(s=t.original.metadata)!=null&&s.last_login?e.jsx("p",{children:e.jsx(M,{short:!0,dateString:(n=t.original.metadata)==null?void 0:n.last_login})}):e.jsx("p",{children:"Never"})}},{id:"last-rotated",header:"Last Rotated",accessorFn:t=>{var s;return(s=t.metadata)==null?void 0:s.last_rotated},cell:({row:t})=>{var r;const s=(r=t.original.metadata)==null?void 0:r.last_rotated;if(!s)return e.jsx("p",{children:"Never"});const n=new Date(`${s}Z`),i=Fe(n),a=Re(n);return e.jsxs("div",{children:[e.jsx("p",{children:e.jsx(M,{short:!0,dateString:s})}),(i||a)&&e.jsx("p",{className:`${a?"text-theme-text-error":"text-theme-text-warning"} text-text-xs`,children:a?"More than 1 year old":"More than 6 months old"})]})}},{id:"active",header:"Active",accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.active},cell:({row:t})=>{var s,n;return e.jsx(Xe,{isActive:!!((s=t.original.body)!=null&&s.active),serviceAccountId:((n=t.original.body)==null?void 0:n.service_account.id)||"",apiKeyId:t.original.id})}},{id:"actions",header:"",meta:{width:"5%"},cell:({row:t})=>{var n;const s=(n=t.original.body)==null?void 0:n.service_account.id;return s?e.jsx("div",{className:"flex items-center justify-end",children:e.jsx(Je,{serviceAccountId:s,apiKeyId:t.original.id})}):null}}]}function tt(){const{serviceAccountId:t}=O();return e.jsxs(U,{className:"flex flex-col items-center justify-center space-y-4 p-9",children:[e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold text-theme-text-primary",children:"This service account doesn't have any API Keys yet"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Generate your first API Key to enable secure interactions with the ZenML Server."})]}),e.jsx(te,{isFallback:!0,serviceAccountId:t})]})}function st(){const{serviceAccountId:t}=O(),s=B(),{rowSelection:n,setRowSelection:i}=g(),a=x.useMemo(()=>et(),[]),{data:r}=S({...C.serviceAccountApiKeys(t,{...s,sort_by:"desc:created",hydrate:!0})});return r&&(r==null?void 0:r.items.length)<1&&!s.name?e.jsx(tt,{}):e.jsxs(e.Fragment,{children:[e.jsx(nt,{serviceAccountId:t}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:r?e.jsx(ve,{getRowId:o=>o.id,rowSelection:n,onRowSelectionChange:i,columns:a,data:r.items}):e.jsx(b,{className:"h-[500px] w-full"})}),r?r.total_pages>1&&e.jsx(Se,{searchParams:s,paginate:r}):e.jsx(b,{className:"h-[36px] w-[300px]"})]})]})}function nt({serviceAccountId:t}){const s=B(),{selectedRowCount:n}=g();return e.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2",children:[n?e.jsx($e,{serviceAccountId:t}):e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(Ke,{searchParams:s})}),e.jsx(te,{isFallback:!1,serviceAccountId:t})]})}function at(t){const{setBreadcrumbs:s}=De();x.useEffect(()=>{t&&s([...we,{label:t.name,href:Ce.settings.service_accounts.detail(t.id)}])},[s,t])}function Tt(){return e.jsxs(U,{className:"space-y-5 p-5",children:[e.jsxs("div",{children:[e.jsx(rt,{}),e.jsx("h1",{className:"my-5 text-text-lg font-semibold",children:"API Keys"})]}),e.jsx(_e,{children:e.jsx(st,{})})]})}function rt(){var i,a,r;const{serviceAccountId:t}=O(),s=S({...C.serviceAccountDetail(t),throwOnError:!0});if(at(s.data),s.isPending)return e.jsx(b,{className:"h-9 w-full"});if(s.isError)return null;const n=s.data;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-text-xl font-semibold",children:n.name}),e.jsx(Ne,{size:"sm",color:(i=n.body)!=null&&i.active?"light-purple":"light-grey",className:"text-text-xs font-semibold uppercase",children:(a=n.body)!=null&&a.active?"active":"inactive"})]}),e.jsx("p",{className:"text-text-md text-theme-text-secondary",children:(r=n.metadata)==null?void 0:r.description})]})}export{rt as APIKeyHeader,Tt as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as c,j as e}from"./@radix-Cdvw4jJ8.js";import{c as A,u as _}from"./bulk-delete-C_kpIB9A.js";import{q as E,c as O,b as I}from"./@tanstack-5gTMR7G2.js";import{i as C,j as w,o as F,f as B,n as L,F as y,A as q,k as z,B as P,D as $,l as M,m as G,p as H,C as g,r as p,T as U,q as K,s as Q,t as J,v as j,w as V,z as d,x as W,g as D}from"./index-BFqbGSck.js";import{S as X}from"./refresh-BcTM09NW.js";import{S as Y,P as Z}from"./SearchField-DY6-UbRT.js";import{S}from"./trash-DP6Tpp_E.js";import{D as v,a as T}from"./DeleteAlertDialog-VIOMDLmx.js";import{S as ee}from"./pipeline-CSUlkd50.js";import{S as te}from"./terminal-XFL_4QN-.js";import{g as se,E as ne,a as ae}from"./ExecutionStatus-CWreILP0.js";import{L as m,f as ie}from"./@react-router-DeDfXbUF.js";import{A as re}from"./AlertDialogDropdownItem-CZW4QyWn.js";import"./@reactflow-8OCk19Fi.js";import"./chevron-right-double-Dgp_gEsp.js";import"./index-DWpiv-Ft.js";import"./zod-XdS2h1ws.js";import"./index.esm-DhJo3mA6.js";import"./check-circle-C4tYvbtw.js";import"./help-Co6aedki.js";async function oe({params:t}){const n=C(w.pipelines.all+"?"+F(t)),s=await B(n,{method:"GET",headers:{"Content-Type":"application/json"}});if(s.status===404&&L(),!s.ok)throw new y({message:"Error while fetching pipelines",status:s.status,statusText:s.statusText});return s.json()}const x={all:["pipelines"],pipelineList:t=>E({queryKey:[...x.all,t],queryFn:async()=>oe({params:t})})};async function le({pipelineId:t}){const n=C(w.pipelines.detail(t)),s=await fetch(n,{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"}});if(!s.ok){const a=await s.json().then(i=>i.detail).catch(()=>`Failed to delete pipeline ${t}`);throw new y({status:s.status,statusText:s.statusText,message:a})}return s.json()}function ce(t){return O({mutationFn:le,...t})}const{ContextProvider:de,useContext:u}=A();function b(){const{setRowSelection:t}=u(),{mutateAsync:n}=ce();async function s(a){await n({pipelineId:a})}return _({deleteFn:s,queryKeyToInvalidate:x.all,setRowSelection:t})}function ue(){const[t,n]=c.useState(!1),{selectedRowCount:s,selectedRowIDs:a}=u(),{bulkDelete:i}=b();async function r(){await i(a),n(!1)}return e.jsxs(q,{open:t,onOpenChange:n,children:[e.jsx(z,{asChild:!0,children:e.jsxs(P,{className:"rounded-sharp border-y-0 bg-white",size:"md",emphasis:"subtle",intent:"secondary",children:[e.jsx(S,{className:"h-5 w-5 shrink-0 gap-1 fill-neutral-400"}),"Delete"]})}),e.jsx(v,{title:`Delete Pipeline${s>=2?"s":""}`,handleDelete:r,children:e.jsxs(T,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})]})}function pe(){const{selectedRowCount:t}=u();return e.jsxs("div",{className:"flex items-center divide-x divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[e.jsx("div",{className:"bg-primary-25 px-2 py-1 font-semibold text-theme-text-brand",children:`${t} Pipeline${t>1?"s":""} selected`}),e.jsx(ue,{})]})}function me({id:t}){const[n,s]=c.useState(!1),[a,i]=c.useState(!1),r=c.useRef(null),o=c.useRef(null),{bulkDelete:N}=b();async function R(){await N([t]),f(!1)}function k(){o.current=r.current}function f(l){if(l===!1){i(!1),setTimeout(()=>{s(l)},200);return}s(l)}return e.jsxs($,{onOpenChange:i,open:a,children:[e.jsx(M,{ref:r,children:e.jsx(G,{className:"h-4 w-4 fill-theme-text-tertiary"})}),e.jsx(H,{hidden:n,onCloseAutoFocus:l=>{o.current&&(o.current.focus(),o.current=null,l.preventDefault())},align:"end",sideOffset:7,children:e.jsx(re,{onSelect:k,open:n,onOpenChange:f,triggerChildren:"Delete",icon:e.jsx(S,{fill:"red"}),children:e.jsx(v,{title:"Delete Pipeline",handleDelete:R,children:e.jsxs(T,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})})})]})}function he(){return[{id:"select",meta:{width:"1%"},header:({table:t})=>e.jsx(g,{id:"check-all",checked:t.getIsAllRowsSelected(),onCheckedChange:n=>t.toggleAllRowsSelected(n==="indeterminate"?!0:n)}),cell:({row:t})=>e.jsx(g,{id:`check-${t.id}`,checked:t.getIsSelected(),onCheckedChange:t.getToggleSelectedHandler()})},{id:"name",header:"Pipeline",cell:({row:t})=>{var n,s,a;return e.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[e.jsx(ee,{className:`h-5 w-5 ${se((n=t.original.resources)==null?void 0:n.latest_run_status)}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(m,{to:p.projects.pipelines.namespace(encodeURIComponent(t.original.name)),className:"flex items-center gap-1",children:e.jsx("span",{className:"text-text-md font-semibold text-theme-text-primary",children:t.original.name})}),e.jsx(U,{children:e.jsxs(K,{children:[e.jsx(Q,{className:"hover:text-theme-text-brand hover:underline",children:e.jsx(ne,{status:(s=t.original.resources)==null?void 0:s.latest_run_status})}),e.jsx(J,{className:"z-20 capitalize",children:(a=t.original.resources)==null?void 0:a.latest_run_status})]})}),e.jsx(j,{copyText:t.original.name})]}),e.jsxs(m,{to:p.projects.pipelines.namespace(encodeURIComponent(t.original.name)),className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-text-xs text-theme-text-secondary",children:t.original.id.split("-")[0]}),e.jsx(j,{copyText:t.original.id})]})]})]})}},{id:"latest-run",header:"Latest Run",accessorFn:t=>{var n,s;return{status:(n=t.resources)==null?void 0:n.latest_run_status,runId:(s=t.resources)==null?void 0:s.latest_run_id}},cell:({getValue:t})=>{const{runId:n,status:s}=t();return!n||!s?e.jsx("div",{children:"No run"}):e.jsx(m,{to:p.projects.runs.detail(n),children:e.jsxs(V,{emphasis:"subtle",rounded:!1,className:"inline-flex items-center gap-0.5",color:ae(s),children:[e.jsx(te,{className:"h-3 w-3 fill-current"}),n==null?void 0:n.split("-")[0]]})})}},{id:"admin_actions",header:"",meta:{width:"5%"},cell:({row:t})=>e.jsx(me,{id:t.original.id})}]}const h=1,xe=d.object({page:d.coerce.number().min(h).optional().default(h).catch(h),name:d.string().optional(),operator:d.enum(["and","or"]).optional()});function fe(){const[t]=ie(),{page:n,name:s,operator:a}=xe.parse({page:t.get("page")||void 0,name:t.get("name")||void 0,operator:t.get("operator")||void 0});return{page:n,name:s,logical_operator:a}}function ge(){const t=fe(),{selectedRowCount:n,rowSelection:s,setRowSelection:a}=u(),{data:i,refetch:r}=I({...x.pipelineList({...t,sort_by:"desc:latest_run"}),throwOnError:!0});return e.jsxs("div",{className:"flex flex-col gap-5 pt-5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[n?e.jsx(pe,{}):e.jsx(Y,{searchParams:t}),e.jsx("div",{className:"flex justify-between",children:e.jsxs(P,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>r(),children:[e.jsx(X,{className:"h-5 w-5 fill-theme-text-brand"}),"Refresh"]})})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:i?e.jsx(W,{rowSelection:s,onRowSelectionChange:a,getRowId:o=>o.id,columns:he(),data:i.items}):e.jsx(D,{className:"h-[500px] w-full"})}),i?i.total_pages>1&&e.jsx(Z,{searchParams:t,paginate:i}):e.jsx(D,{className:"h-[36px] w-[300px]"})]})]})}function Le(){return e.jsx(de,{children:e.jsx(ge,{})})}export{Le as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as p,j as e}from"./@radix-Cdvw4jJ8.js";import{f as D,i as C,n as $,F as k,j as E,au as T,av as P,aw as F,I as j,az as O,aA as A,B as u,D as K,l as H,m as G,p as U,b1 as J,r as S,v,G as W,z as f,e as X,g as N,as as Y,at as Z,a as ee,aB as se,x as te,b as ae}from"./index-BFqbGSck.js";import{S as re,P as ne}from"./SearchField-DY6-UbRT.js";import{E as ie,S as le,s as ce,a as oe}from"./SecretTooltip-CZTRnaCV.js";import{c as V,h as q,b as me}from"./@tanstack-5gTMR7G2.js";import{S as de}from"./Lock-CrIAdQo6.js";import{D as ue}from"./DisplayDate-8RESqe5H.js";import{c as xe}from"./code-snippets-CqONne41.js";import{L as w,f as he}from"./@react-router-DeDfXbUF.js";import{S as I}from"./trash-DP6Tpp_E.js";import{D as b}from"./DialogItem-ClFCqxEp.js";import{S as pe}from"./eye-CbVlAYty.js";import{S as L}from"./plus-Cl0_rCVF.js";import{t as fe}from"./zod-XdS2h1ws.js";import{u as je,b as ge,C as g}from"./index.esm-DhJo3mA6.js";import"./@reactflow-8OCk19Fi.js";import"./chevron-right-double-Dgp_gEsp.js";import"./index-DWpiv-Ft.js";import"./CodeSnippet-D2HkkAGr.js";import"./info-QkbQz4QU.js";async function ye(t){const s=C(E.secrets.detail(t)),a=await D(s,{method:"DELETE",headers:{"Content-Type":"application/json"}});if(a.status===404&&$(),!a.ok)throw new k({message:"Error deleting secret",status:a.status,statusText:a.statusText});return a.json()}function Ne(t){return V({mutationFn:async s=>ye(s),...t})}function Se({secretId:t}){const s=q(),{mutate:a}=Ne({onSuccess(){s.invalidateQueries({queryKey:["secrets"]})}}),[r,n]=p.useState("");function o(){a(t)}function m(x){n(x.target.value)}return e.jsxs(T,{children:[e.jsx(P,{children:e.jsx(F,{children:"Delete secret"})}),e.jsxs("div",{className:"gap-5 p-5",children:[e.jsx("p",{className:"text-text-md text-theme-text-secondary",children:"Are you sure you want to delete this secret?"}),e.jsx("p",{className:"text-text-md text-theme-text-secondary",children:"This action cannot be undone."}),e.jsx("h3",{className:"font-inter text-sm mb-1 mt-4 text-left font-medium leading-5",children:"Please type DELETE to confirm"}),e.jsx(j,{name:"key",onChange:m,className:"w-full",required:!0,value:r})]}),e.jsxs(O,{className:"gap-[10px]",children:[e.jsx(A,{asChild:!0,children:e.jsx(u,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(u,{intent:"danger",type:"submit",form:"edit-secret-form",onClick:o,disabled:r!=="DELETE",children:"Delete"})]})]})}function ve({secretId:t}){const[s,a]=p.useState(!1),[r,n]=p.useState(!1),o=p.useRef(null),m=p.useRef(null);function x(){m.current=o.current}function h(d){if(d===!1){a(!1),setTimeout(()=>{n(d)},200);return}n(d)}return e.jsxs(K,{onOpenChange:a,open:s,children:[e.jsx(H,{ref:o,children:e.jsx(G,{className:"h-4 w-4 fill-theme-text-tertiary"})}),e.jsxs(U,{hidden:r,onCloseAutoFocus:d=>{m.current&&(m.current.focus(),m.current=null,d.preventDefault())},align:"end",sideOffset:7,children:[e.jsx(b,{onSelect:x,onOpenChange:h,triggerChildren:"Edit ",icon:e.jsx(J,{}),children:e.jsx(ie,{secretId:t,isSecretNameEditable:!0,dialogTitle:"Edit secret"})}),e.jsx(b,{onSelect:x,onOpenChange:h,triggerChildren:"Delete ",icon:e.jsx(I,{}),children:e.jsx(Se,{secretId:t})})]})]})}const we=[{id:"secret",header:"Secret",accessorFn:t=>t.name,cell:({getValue:t,row:s})=>{const a=xe(s.original.name);return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(de,{className:"h-5 w-5 flex-shrink-0 fill-primary-400"}),e.jsxs("div",{className:"group/copybutton flex flex-col",children:[e.jsxs("div",{className:"flex flex-row items-center space-x-1",children:[e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(w,{className:"text-text-md font-semibold text-theme-text-primary",to:S.settings.secrets.detail(s.original.id),children:s.original.name}),e.jsx(le,{code:a})]}),e.jsx(v,{copyText:t()})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{to:S.settings.secrets.detail(s.original.id),className:"flex items-center gap-1 text-text-sm text-theme-text-secondary",children:s.original.id.slice(0,8)}),e.jsx(v,{copyText:s.original.id})]})]})]})}},{id:"author",header:"Author",accessorFn:t=>{var s,a;return(a=(s=t.resources)==null?void 0:s.user)==null?void 0:a.name},cell:({getValue:t})=>{const s=t();return s?e.jsx(W,{username:s}):null}},{id:"created_at",header:"Created At",accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.created},cell:({getValue:t})=>e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.jsx(ue,{dateString:t()})})},{id:"admin_actions",header:"",accessorFn:t=>String(t.id),cell:({row:t,getValue:s})=>{var r,n,o;const a=s();return(o=(n=(r=t.original.resources)==null?void 0:r.user)==null?void 0:n.body)!=null&&o.is_admin?e.jsx(ve,{secretId:a}):e.jsx("p",{className:"text-sm text-theme-text-secondary",children:"No Actions"})}}],y=1,be=f.object({page:f.coerce.number().min(y).optional().default(y).catch(y),name:f.string().optional(),operator:f.enum(["and","or"]).optional()});function De(){const[t]=he(),{page:s,name:a,operator:r}=be.parse({page:t.get("page")||void 0,name:t.get("name")||void 0,operator:t.get("operator")||void 0});return{page:s,name:a,logical_operator:r}}async function Ce(t){const s=C(E.secrets.all),a=await D(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){const r=await a.json().then(n=>n.detail).catch(()=>"Failed to create Secret");throw new k({status:a.status,statusText:a.statusText,message:r})}return a.json()}function ke(t){return V({mutationFn:async s=>Ce(s),...t})}function Ee(){const[t,s]=p.useState(!1),a=X();if(a.isPending)return e.jsx(N,{className:"h-7 w-full"});if(a.isError)return e.jsx("div",{children:"Error loading user"});const r=a.data.id;return e.jsxs(Y,{open:t,onOpenChange:s,children:[e.jsx(Z,{asChild:!0,children:e.jsxs(u,{size:"md",className:"shrink-0",intent:"primary",children:[e.jsx(L,{className:"h-5 w-5 shrink-0 fill-white"}),e.jsx("span",{children:"New Secret"})]})}),e.jsxs(T,{className:"mx-auto w-[90vw] max-w-[744px]",children:[e.jsx(P,{children:e.jsx(F,{children:"Register New Secret"})}),e.jsx(Te,{userId:r,setOpen:s})]})]})}function Te({userId:t,setOpen:s}){const{handleSubmit:a,control:r,watch:n,setValue:o,formState:{isValid:m},reset:x}=je({resolver:fe(ce),defaultValues:{secretName:"",keysValues:[{key:"",value:""}]}}),{fields:h,append:d,remove:_}=ge({control:r,name:"keysValues"}),{toast:z}=ee(),R=q(),{mutate:M}=ke({onError(i){se(i)&&z({status:"error",emphasis:"subtle",description:i.message,rounded:!0})},onSuccess(){R.invalidateQueries({queryKey:["secrets"]}),s(!1),x()}}),Q=i=>{M({user:t,name:i.secretName,values:i.keysValues.reduce((l,c)=>(c.key&&c.value&&(l[c.key]=c.value),l),{})})},B=i=>{Q(i)};return e.jsxs(e.Fragment,{children:[e.jsx("form",{id:"create-secret-form",className:"gap-5 p-5",onSubmit:a(B),children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("label",{className:"font-inter text-sm text-left font-medium leading-5",children:["Secret Name",e.jsx("span",{className:"ml-1 text-theme-text-error",children:"*"})]}),e.jsx(g,{name:"secretName",control:r,render:({field:i})=>e.jsx(j,{...i,className:"mb-3 w-full",required:!0})})]}),e.jsxs("div",{className:"mt-10",children:[e.jsx("div",{children:e.jsx("h1",{className:"font-inter text-lg text-left font-semibold",children:"Keys"})}),e.jsxs("div",{className:"mt-5 flex flex-row",children:[e.jsx("div",{className:"flex-grow",children:e.jsx("label",{className:"font-inter text-sm text-left font-medium",children:"Key"})}),e.jsx("div",{className:"flex-grow pr-12",children:e.jsx("label",{className:"font-inter text-sm text-left font-medium",children:"Value"})})]})]}),h.map((i,l)=>e.jsxs("div",{className:"flex flex-row items-center space-x-1",children:[e.jsx("div",{className:"relative flex-grow",children:e.jsx(g,{name:`keysValues.${l}.key`,control:r,render:({field:c})=>e.jsx(j,{...c,className:"mb-2 w-full",required:!0,placeholder:"key"})})}),e.jsx("div",{className:"relative flex-grow",children:e.jsxs("div",{className:"relative",children:[e.jsx(g,{name:`keysValues.${l}.value`,control:r,render:({field:c})=>e.jsx(j,{...c,className:"mb-2 w-full pr-10",required:!0,placeholder:"•••••••••",type:n(`keysValues.${l}.showPassword`)?"text":"password"})}),e.jsx("button",{type:"button",onClick:()=>{const c=n(`keysValues.${l}.showPassword`);o(`keysValues.${l}.showPassword`,!c)},className:"absolute inset-y-1 right-0 flex items-center pb-1 pr-3",children:e.jsx(pe,{className:"h-4 w-4 flex-shrink-0"})})]})}),e.jsxs("div",{className:"flex items-center",children:[l===h.length-1&&e.jsx(u,{intent:"primary",emphasis:"subtle",onClick:()=>d({key:"",value:""}),className:"mb-2 flex h-7 w-7 items-center justify-center",children:e.jsx(L,{className:"flex-shrink-0 fill-primary-600"})}),l!==h.length-1&&e.jsx(u,{intent:"secondary",emphasis:"minimal",onClick:()=>_(l),className:"mb-2 h-7 w-7 items-center justify-center",children:e.jsx(I,{className:"flex-shrink-0 fill-theme-text-secondary"})})]})]},i.id))]})}),e.jsxs(O,{className:"gap-[10px]",children:[e.jsx(A,{asChild:!0,children:e.jsx(u,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(u,{intent:"primary",disabled:!m,type:"submit",form:"create-secret-form",children:"Register Secret"})]})]})}function Pe(){const t=De(),{data:s}=me({...oe.secretList({...t,sort_by:"desc:created"}),throwOnError:!0});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx(re,{searchParams:t}),e.jsx(Ee,{})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:s?e.jsx(te,{columns:we,data:s.items}):e.jsx(N,{className:"h-[250px] w-full"})}),s?s.total_pages>1&&e.jsx(ne,{searchParams:t,paginate:s}):e.jsx(N,{className:"h-[36px] w-[300px]"})]})]})}function Xe(){return e.jsxs(ae,{className:"space-y-4 p-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Secrets"}),e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:["Configure and manage your pipeline secrets and configurations."," ",e.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://docs.zenml.io/how-to/interact-with-secrets",className:"link text-primary-400",children:"Learn More"})]})]}),e.jsx(Pe,{})]})}export{Xe as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as i,j as e}from"./@radix-Cdvw4jJ8.js";import{g as o,B as n,r as c,bh as d}from"./index-BFqbGSck.js";import{S as h}from"./StackList-BdiR5DvR.js";import{p as m,c as j}from"./persist-Dec_w7aB.js";import{p as l,c as k}from"./persist-DWMWVP-y.js";import{I as p}from"./Infobox-CGxFvqzi.js";import{s as u}from"./index-BjUu1mP4.js";import{b as f}from"./@tanstack-5gTMR7G2.js";import{L as x}from"./@react-router-DeDfXbUF.js";import"./@reactflow-8OCk19Fi.js";import"./plus-Cl0_rCVF.js";import"./refresh-BcTM09NW.js";import"./SearchField-DY6-UbRT.js";import"./chevron-right-double-Dgp_gEsp.js";import"./index-DWpiv-Ft.js";import"./DisplayDate-8RESqe5H.js";import"./CodeSnippet-D2HkkAGr.js";import"./CollapsibleCard-CnS09ljw.js";import"./chevron-down-jbbQh82s.js";import"./check-circle-C4tYvbtw.js";import"./SheetHeader-CASpN2Lz.js";import"./components-Br2ezRib.js";import"./NumberBox-C0mQktmV.js";import"./ComponentBadge-CDgdd0Ks.js";import"./ComponentIcon-CbbOc7lb.js";import"./layout-DBbfEFBe.js";import"./transform-CeZdrxDZ.js";import"./trash-DP6Tpp_E.js";import"./DialogItem-ClFCqxEp.js";import"./AlertDialogDropdownItem-CZW4QyWn.js";import"./sharedSchema-BXzg0EZz.js";import"./index.es-C1gfATPn.js";import"./info-QkbQz4QU.js";import"./stack-detail-query-Cm0fsgo-.js";function w({setHasResumeableStack:a}){const{success:t,data:s}=m(),r=f({...u.stackDeploymentStack({provider:(s==null?void 0:s.provider)||"aws",stack_name:(s==null?void 0:s.stackName)||"",date_start:s==null?void 0:s.timestamp}),enabled:t,throwOnError:!0});return i.useEffect(()=>{r.data&&(j(),a(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(o,{className:"h-[70px] w-full"}):e.jsx(p,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(n,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(x,{to:c.stacks.create.newInfra,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function b({setHasResumeableTerraform:a}){const{success:t,data:s}=l(),r=f({...u.stackDeploymentStack({provider:(s==null?void 0:s.provider)||"aws",stack_name:(s==null?void 0:s.stackName)||"",date_start:s==null?void 0:s.timestamp}),enabled:t,throwOnError:!0});return i.useEffect(()=>{r.data&&(k(),a(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(o,{className:"h-[70px] w-full"}):e.jsx(p,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Terraform Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(n,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(x,{to:c.stacks.create.terraform,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function v(){const[a,t]=i.useState(m().success),[s,r]=i.useState(l().success);return!a&&!s?null:e.jsxs("div",{className:"space-y-5",children:[a&&e.jsx(w,{setHasResumeableStack:t}),s&&e.jsx(b,{setHasResumeableTerraform:r})]})}function re(){const{setTourState:a,tourState:{tourActive:t}}=d();return i.useEffect(()=>{t&&a(s=>({...s,run:!0,stepIndex:s.stepIndex}))},[t]),e.jsxs("div",{className:"space-y-5 py-5",children:[e.jsx(v,{}),e.jsx(h,{})]})}export{re as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{j as e,r as j}from"./@radix-Cdvw4jJ8.js";import{B as i,r as u,f as D,i as S,F as b,j as T,aO as x,A as g,k,z as c,D as R,l as A,m as P,p as B,an as E,C as h,v as p,G as L,aP as F,g as f,x as _,b as I}from"./index-BFqbGSck.js";import{S as M,P as z}from"./SearchField-DY6-UbRT.js";import{c as O,b as C}from"./@tanstack-5gTMR7G2.js";import{S as H}from"./refresh-BcTM09NW.js";import{S as $}from"./plus-Cl0_rCVF.js";import{L as m,f as G}from"./@react-router-DeDfXbUF.js";import{c as Q,u as K}from"./bulk-delete-C_kpIB9A.js";import{S as y}from"./trash-DP6Tpp_E.js";import{D as U,a as q}from"./DeleteAlertDialog-VIOMDLmx.js";import{C as J,R as V}from"./resource-type-tooltip-DwHrJstL.js";import{e as W,R as X,E as Y}from"./service-connectors-DSEMwJ5A.js";import"./@reactflow-8OCk19Fi.js";import"./chevron-right-double-Dgp_gEsp.js";import"./index-DWpiv-Ft.js";import"./zod-XdS2h1ws.js";import"./index.esm-DhJo3mA6.js";import"./type-guards-CNgPYg8l.js";function Z(){return e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Service Connectors"}),e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:["Configure and manage your service connectors."," ",e.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://docs.zenml.io/how-to/infrastructure-deployment/auth-management",className:"link text-text-sm text-primary-400",children:"Learn More"})]})]})}function ee(){return e.jsx(i,{size:"md",asChild:!0,children:e.jsxs(m,{to:u.settings.connectors.create,children:[e.jsx($,{className:"h-5 w-5 shrink-0 fill-white"}),e.jsx("span",{children:"New Connector"})]})})}async function te({connectorId:t}){const s=S(T.serviceConnectors.detail(t)),n=await D(s,{method:"DELETE"});if(!n.ok){const r=await n.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>`Error while deleting connector ${t}`);throw new b({status:n.status,statusText:n.statusText,message:r})}return n.json()}function se(t){return O({...t,mutationFn:async({connectorId:s})=>te({connectorId:s})})}const{ContextProvider:ne,useContext:l}=Q();function w(){const{setRowSelection:t}=l(),{mutateAsync:s}=se();async function n(r){await s({connectorId:r})}return K({deleteFn:n,queryKeyToInvalidate:[...x.connectors],setRowSelection:t})}function v({deleteHandler:t}){return e.jsx(U,{title:"Delete Connectors",handleDelete:t,children:e.jsxs(q,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})}function re({deleteHandler:t,open:s,setOpen:n}){return e.jsx(g,{open:s,onOpenChange:n,children:e.jsx(v,{deleteHandler:t})})}function oe(){const{selectedRowCount:t,selectedRowIDs:s}=l(),{bulkDelete:n}=w();async function r(){await n(s)}const o=t>1?"s":"",a=`${t} Service connector${o} selected`;return e.jsxs("div",{className:"flex h-7 items-center divide-x divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[e.jsx("div",{className:"bg-primary-25 px-2 py-1 font-semibold text-theme-text-brand",children:a}),e.jsxs(g,{children:[e.jsx(k,{asChild:!0,children:e.jsxs(i,{className:"rounded-sharp border-y-0 bg-white",size:"md",emphasis:"subtle",intent:"secondary",children:[e.jsx(y,{className:"h-5 w-5 shrink-0 gap-1 fill-neutral-400"}),"Delete"]})}),e.jsx(v,{deleteHandler:r})]})]})}function ae({queryParams:t}){const{selectedRowCount:s}=l();return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s>0?e.jsx(oe,{}):e.jsx(M,{searchParams:t}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ce,{queryParams:t}),e.jsx(ee,{})]})]})})}function ce({queryParams:t}){const{refetch:s}=C(x.serviceConnectorList(t));return e.jsxs(i,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>s(),children:[e.jsx(H,{className:"h-5 w-5 fill-theme-text-brand"}),"Refresh"]})}const d=1,ie=c.object({page:c.coerce.number().min(d).optional().default(d).catch(d),name:c.string().optional(),operator:c.enum(["and","or"]).optional()});function le(){const[t]=G(),{page:s,name:n,operator:r}=ie.parse({page:t.get("page")||void 0,name:t.get("name")||void 0,sortBy:t.get("sort_by")||void 0});return{page:s,name:n,logical_operator:r}}function de({id:t}){const[s,n]=j.useState(!1),{bulkDelete:r}=w();async function o(){await r([t]),n(!1)}return e.jsxs(e.Fragment,{children:[e.jsx(re,{deleteHandler:o,open:s,setOpen:n}),e.jsxs(R,{children:[e.jsx(A,{asChild:!0,children:e.jsx(i,{intent:"secondary",emphasis:"minimal",className:"flex aspect-square items-center justify-center p-0",children:e.jsx(P,{className:"h-4 w-4 shrink-0 fill-theme-text-tertiary"})})}),e.jsx(B,{align:"end",sideOffset:7,children:e.jsxs(E,{onSelect:()=>n(!0),className:"cursor-pointer space-x-2",children:[e.jsx(y,{className:"h-3 w-3 fill-neutral-400"}),e.jsx("p",{children:"Delete"})]})})]})]})}function ue(){return j.useMemo(()=>[{id:"select",meta:{width:"1%"},header:({table:t})=>e.jsx(h,{id:"check-all",checked:t.getIsAllRowsSelected(),onCheckedChange:s=>t.toggleAllRowsSelected(s==="indeterminate"?!0:s)}),cell:({row:t})=>e.jsx(h,{id:`check-${t.id}`,checked:t.getIsSelected(),onCheckedChange:t.getToggleSelectedHandler()})},{id:"name",header:"Service Connector",accessorKey:"name",cell:({row:t})=>{var o;const s=t.original.id,n=t.original.name,r=(o=t.original.body)==null?void 0:o.connector_type;return e.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[!!r&&typeof r!="string"&&e.jsx(J,{connectorType:r}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(m,{to:u.settings.connectors.detail.configuration(s),className:"block max-w-[200px] truncate text-text-md font-semibold",children:n}),e.jsx(p,{copyText:n})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(m,{to:u.settings.connectors.detail.configuration(s),children:s.split("-")[0]}),e.jsx(p,{copyText:s})]})]})]})}},{id:"resource_types",header(){return e.jsx("p",{className:"whitespace-nowrap",children:"Resource Types"})},cell:({row:t})=>{const s=W(t.original);return e.jsx("div",{className:"flex items-center gap-0.5",children:s.map((n,r)=>e.jsx(V,{resourceType:n},r))})}},{id:"resource-name",header(){return e.jsx("p",{className:"whitespace-nowrap",children:"Resource Name"})},cell:({row:t})=>e.jsx("div",{className:"max-w-[100px]",children:e.jsx(X,{connector:t.original})})},{id:"user",header:"Author",accessorFn:t=>{var s,n;return(n=(s=t.resources)==null?void 0:s.user)==null?void 0:n.name},cell:({row:t})=>{var n;const s=(n=t.original.resources)==null?void 0:n.user;return s?e.jsx(L,{className:"max-w-[200px] truncate",username:F(s)}):null}},{id:"expires",header(){return e.jsx("p",{className:"whitespace-nowrap",children:"Expires in"})},accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.expires_at},cell:({row:t})=>{var n;const s=(n=t.original.body)==null?void 0:n.expires_at;return s?e.jsx(Y,{expires:s}):e.jsx("p",{children:"Never"})}},{id:"admin_actions",header:"",cell:({row:t})=>e.jsx(de,{id:t.original.id})}],[])}function me({queryParams:t}){const{rowSelection:s,setRowSelection:n}=l(),r=C({...x.serviceConnectorList(t)}),o=ue();if(r.isPending)return e.jsxs("div",{className:"space-y-5",children:[e.jsx(f,{className:"h-[300px] w-full"}),e.jsx(f,{className:"mx-auto h-[36px] w-[300px]"})]});if(r.isError)return null;const a=r.data;return e.jsx("section",{className:"flex flex-col gap-5",children:e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:e.jsx(_,{columns:o,data:a.items,rowSelection:s,getRowId:N=>N.id,onRowSelectionChange:n})}),a.total_pages>1&&e.jsx(z,{searchParams:t,paginate:a})]})})}function xe(){const s={...le(),sort_by:"desc:updated"};return e.jsxs(e.Fragment,{children:[e.jsx(ae,{queryParams:s}),e.jsx(me,{queryParams:s})]})}function Be(){return e.jsxs(I,{className:"space-y-4 p-5",children:[e.jsx(Z,{}),e.jsx(ne,{children:e.jsx(xe,{})})]})}export{Be as default};
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{r as v,j as s}from"./@radix-Cdvw4jJ8.js";import{o as q,f as B,i as V,F as Z,j as G,as as J,au as Y,av as K,aw as Q,B as D,ab as X,a$ as ee,r as te,a as re,d as ne,g as oe,h as se,b0 as ae,aB as ie,b as _}from"./index-BFqbGSck.js";import{c as ce}from"./@tanstack-5gTMR7G2.js";import{S as ue}from"./clock-B_mTG8PH.js";import{C as I}from"./CodeSnippet-D2HkkAGr.js";import{I as le}from"./Infobox-CGxFvqzi.js";import{T as pe}from"./Tick-BPrWnNlN.js";import{E as me}from"./react-error-boundary.esm-7_MuhCay.js";import{L as de}from"./@react-router-DeDfXbUF.js";import"./@reactflow-8OCk19Fi.js";import"./info-QkbQz4QU.js";import"./check-B9QMTa3f.js";async function fe({params:t}){const n=q(t).toString(),o=V(G.apiToken+(n?`?${n}`:"")),r=await B(o,{credentials:"include",headers:{"Content-Type":"application/json"}});if(!r.ok){const e=await r.json().then(a=>Array.isArray(a.detail)?a.detail[1]:a.detail).catch(()=>"Error while creating API Token");throw new Z({status:r.status,statusText:r.statusText,message:e})}return r.json()}function he(t){return ce({mutationFn:async n=>fe(n),...t})}class x extends Error{}x.prototype.name="InvalidTokenError";function ye(t){return decodeURIComponent(atob(t).replace(/(.)/g,(n,o)=>{let r=o.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function ve(t){let n=t.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return ye(n)}catch{return atob(n)}}function Te(t,n){if(typeof t!="string")throw new x("Invalid token specified: must be a string");n||(n={});const o=n.header===!0?0:1,r=t.split(".")[o];if(typeof r!="string")throw new x(`Invalid token specified: missing part #${o+1}`);let e;try{e=ve(r)}catch(a){throw new x(`Invalid token specified: invalid base64 for part #${o+1} (${a.message})`)}try{return JSON.parse(e)}catch(a){throw new x(`Invalid token specified: invalid json for part #${o+1} (${a.message})`)}}var b={exports:{}},S,N;function xe(){if(N)return S;N=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return S=t,S}var j,E;function ge(){if(E)return j;E=1;var t=xe();function n(){}function o(){}return o.resetWarningCache=n,j=function(){function r(i,c,l,d,h,p){if(p!==t){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function e(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:e,element:r,elementType:r,instanceOf:e,node:r,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:o,resetWarningCache:n};return a.PropTypes=a,a},j}var A;function be(){return A||(A=1,b.exports=ge()()),b.exports}var u=be();function R(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Se(t,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function M(t,n,o){return n&&Se(t.prototype,n),t}function $(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&w(t,n)}function g(t){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},g(t)}function w(t,n){return w=Object.setPrototypeOf||function(r,e){return r.__proto__=e,r},w(t,n)}function je(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function we(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pe(t,n){return n&&(typeof n=="object"||typeof n=="function")?n:we(t)}function z(t){var n=je();return function(){var r=g(t),e;if(n){var a=g(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return Pe(this,e)}}function ke(t){return De(t)||Ce(t)||Oe(t)||_e()}function De(t){if(Array.isArray(t))return P(t)}function Ce(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Oe(t,n){if(t){if(typeof t=="string")return P(t,n);var o=Object.prototype.toString.call(t).slice(8,-1);if(o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set")return Array.from(t);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return P(t,n)}}function P(t,n){(n==null||n>t.length)&&(n=t.length);for(var o=0,r=new Array(n);o<n;o++)r[o]=t[o];return r}function _e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,o=String(t);if(n===0)return o;var r=o.match(/(.*?)([0-9]+)(.*)/),e=r?r[1]:"",a=r?r[3]:"",i=r?r[2]:o,c=i.length>=n?i:(ke(Array(n)).map(function(){return"0"}).join("")+i).slice(n*-1);return"".concat(e).concat(c).concat(a)}var U={daysInHours:!1,zeroPadTime:2};function Ie(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.now,r=o===void 0?Date.now:o,e=n.precision,a=e===void 0?0:e,i=n.controlled,c=n.offsetTime,l=c===void 0?0:c,d=n.overtime,h;typeof t=="string"?h=new Date(t).getTime():t instanceof Date?h=t.getTime():h=t,i||(h+=l);var p=i?h:h-r(),f=Math.min(20,Math.max(0,a)),m=Math.round(parseFloat(((d?p:Math.max(0,p))/1e3).toFixed(f))*1e3),y=Math.abs(m)/1e3;return{total:m,days:Math.floor(y/(3600*24)),hours:Math.floor(y/3600%24),minutes:Math.floor(y/60%60),seconds:Math.floor(y%60),milliseconds:Number((y%1*1e3).toFixed()),completed:m<=0}}function Ne(t,n){var o=t.days,r=t.hours,e=t.minutes,a=t.seconds,i=Object.assign(Object.assign({},U),n),c=i.daysInHours,l=i.zeroPadTime,d=i.zeroPadDays,h=d===void 0?l:d,p=Math.min(2,l),f=c?T(r+o*24,l):T(r,p);return{days:c?"":T(o,h),hours:f,minutes:T(e,p),seconds:T(a,p)}}var F=function(t){$(o,t);var n=z(o);function o(){var r;return R(this,o),r=n.apply(this,arguments),r.state={count:r.props.count||3},r.startCountdown=function(){r.interval=window.setInterval(function(){var e=r.state.count-1;e===0?(r.stopCountdown(),r.props.onComplete&&r.props.onComplete()):r.setState(function(a){return{count:a.count-1}})},1e3)},r.stopCountdown=function(){clearInterval(r.interval)},r.addTime=function(e){r.stopCountdown(),r.setState(function(a){return{count:a.count+e}},r.startCountdown)},r}return M(o,[{key:"componentDidMount",value:function(){this.startCountdown()}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"render",value:function(){return this.props.children?v.cloneElement(this.props.children,{count:this.state.count}):null}}]),o}(v.Component);F.propTypes={count:u.number,children:u.element,onComplete:u.func};var C=function(t){$(o,t);var n=z(o);function o(r){var e;if(R(this,o),e=n.call(this,r),e.mounted=!1,e.initialTimestamp=e.calcOffsetStartTimestamp(),e.offsetStartTimestamp=e.props.autoStart?0:e.initialTimestamp,e.offsetTime=0,e.legacyMode=!1,e.legacyCountdownRef=null,e.tick=function(){var i=e.calcTimeDelta(),c=i.completed&&!e.props.overtime?void 0:e.props.onTick;e.setTimeDeltaState(i,void 0,c)},e.setLegacyCountdownRef=function(i){e.legacyCountdownRef=i},e.start=function(){if(!e.isStarted()){var i=e.offsetStartTimestamp;e.offsetStartTimestamp=0,e.offsetTime+=i?e.calcOffsetStartTimestamp()-i:0;var c=e.calcTimeDelta();e.setTimeDeltaState(c,"STARTED",e.props.onStart),!e.props.controlled&&(!c.completed||e.props.overtime)&&(e.clearTimer(),e.interval=window.setInterval(e.tick,e.props.intervalDelay))}},e.pause=function(){e.isPaused()||(e.clearTimer(),e.offsetStartTimestamp=e.calcOffsetStartTimestamp(),e.setTimeDeltaState(e.state.timeDelta,"PAUSED",e.props.onPause))},e.stop=function(){e.isStopped()||(e.clearTimer(),e.offsetStartTimestamp=e.calcOffsetStartTimestamp(),e.offsetTime=e.offsetStartTimestamp-e.initialTimestamp,e.setTimeDeltaState(e.calcTimeDelta(),"STOPPED",e.props.onStop))},e.isStarted=function(){return e.isStatus("STARTED")},e.isPaused=function(){return e.isStatus("PAUSED")},e.isStopped=function(){return e.isStatus("STOPPED")},e.isCompleted=function(){return e.isStatus("COMPLETED")},r.date){var a=e.calcTimeDelta();e.state={timeDelta:a,status:a.completed?"COMPLETED":"STOPPED"}}else e.legacyMode=!0;return e}return M(o,[{key:"componentDidMount",value:function(){this.legacyMode||(this.mounted=!0,this.props.onMount&&this.props.onMount(this.calcTimeDelta()),this.props.autoStart&&this.start())}},{key:"componentDidUpdate",value:function(e){this.legacyMode||this.props.date!==e.date&&(this.initialTimestamp=this.calcOffsetStartTimestamp(),this.offsetStartTimestamp=this.initialTimestamp,this.offsetTime=0,this.setTimeDeltaState(this.calcTimeDelta()))}},{key:"componentWillUnmount",value:function(){this.legacyMode||(this.mounted=!1,this.clearTimer())}},{key:"calcTimeDelta",value:function(){var e=this.props,a=e.date,i=e.now,c=e.precision,l=e.controlled,d=e.overtime;return Ie(a,{now:i,precision:c,controlled:l,offsetTime:this.offsetTime,overtime:d})}},{key:"calcOffsetStartTimestamp",value:function(){return Date.now()}},{key:"addTime",value:function(e){this.legacyCountdownRef.addTime(e)}},{key:"clearTimer",value:function(){window.clearInterval(this.interval)}},{key:"isStatus",value:function(e){return this.state.status===e}},{key:"setTimeDeltaState",value:function(e,a,i){var c=this;if(this.mounted){var l=e.completed&&!this.state.timeDelta.completed,d=e.completed&&a==="STARTED";l&&!this.props.overtime&&this.clearTimer();var h=function(){i&&i(c.state.timeDelta),c.props.onComplete&&(l||d)&&c.props.onComplete(e,d)};return this.setState(function(p){var f=a||p.status;return e.completed&&!c.props.overtime?f="COMPLETED":!a&&f==="COMPLETED"&&(f="STOPPED"),{timeDelta:e,status:f}},h)}}},{key:"getApi",value:function(){return this.api=this.api||{start:this.start,pause:this.pause,stop:this.stop,isStarted:this.isStarted,isPaused:this.isPaused,isStopped:this.isStopped,isCompleted:this.isCompleted}}},{key:"getRenderProps",value:function(){var e=this.props,a=e.daysInHours,i=e.zeroPadTime,c=e.zeroPadDays,l=this.state.timeDelta;return Object.assign(Object.assign({},l),{api:this.getApi(),props:this.props,formatted:Ne(l,{daysInHours:a,zeroPadTime:i,zeroPadDays:c})})}},{key:"render",value:function(){if(this.legacyMode){var e=this.props,a=e.count,i=e.children,c=e.onComplete;return v.createElement(F,{ref:this.setLegacyCountdownRef,count:a,onComplete:c},i)}var l=this.props,d=l.className,h=l.overtime,p=l.children,f=l.renderer,m=this.getRenderProps();if(f)return f(m);if(p&&this.state.timeDelta.completed&&!h)return v.cloneElement(p,{countdown:m});var y=m.formatted,O=y.days,H=y.hours,L=y.minutes,W=y.seconds;return v.createElement("span",{className:d},m.total<0?"-":"",O,O?":":"",H,":",L,":",W)}}]),o}(v.Component);C.defaultProps=Object.assign(Object.assign({},U),{controlled:!1,intervalDelay:1e3,precision:0,autoStart:!0});C.propTypes={date:u.oneOfType([u.instanceOf(Date),u.string,u.number]),daysInHours:u.bool,zeroPadTime:u.number,zeroPadDays:u.number,controlled:u.bool,intervalDelay:u.number,precision:u.number,autoStart:u.bool,overtime:u.bool,className:u.string,children:u.element,renderer:u.func,now:u.func,onMount:u.func,onStart:u.func,onPause:u.func,onStop:u.func,onTick:u.func,onComplete:u.func};function Ee({token:t,open:n,setOpen:o}){return s.jsx(J,{open:n,onOpenChange:o,children:s.jsxs(Y,{className:"max-w-[700px]",children:[s.jsx(K,{children:s.jsx(Q,{children:"API Token Created Successfully"})}),s.jsxs("div",{className:"space-y-3 overflow-hidden px-7 py-5",children:[s.jsx(Ae,{}),s.jsx(Re,{}),s.jsx(Me,{token:t}),s.jsx(me,{fallbackRender:()=>null,children:s.jsx(ze,{token:t})}),s.jsx("div",{role:"separator","aria-hidden":"true",className:"h-[1px] bg-theme-border-moderate"}),s.jsx(Ue,{token:t}),s.jsx(Fe,{}),s.jsx("div",{role:"separator","aria-hidden":"true",className:"h-[1px] bg-theme-border-moderate"}),s.jsx(He,{})]})]})})}function Ae(){return s.jsxs("section",{children:[s.jsx("p",{className:"font-semibold",children:"Here is your new API Token"}),s.jsx("p",{className:"text-theme-text-secondary",children:"This token provides temporary access to your ZenML Server"})]})}function Re(){return s.jsx(le,{children:"Important: This token expires in 1 hour and cannot be retrieved later. Please, copy it now."})}function Me({token:t}){const[n,o]=v.useState(!1);function r(e){navigator.clipboard&&(navigator.clipboard.writeText(e),o(!0),setTimeout(()=>{o(!1)},2e3))}return s.jsxs("section",{className:"flex items-center gap-5 py-5",children:[s.jsx("code",{className:"block overflow-x-auto whitespace-nowrap font-sans text-display-xs",children:t}),n?s.jsxs("div",{className:"flex h-7 items-center",children:[s.jsx(pe,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary"}),s.jsx("p",{className:"sr-only",children:"copied successfully"})]}):s.jsxs(D,{onClick:()=>r(t),size:"md",intent:"secondary",className:"flex items-center gap-1",emphasis:"subtle",children:[s.jsx(X,{className:"size-4 shrink-0 fill-inherit"}),"Copy"]})]})}const $e=({days:t,hours:n,minutes:o,seconds:r,completed:e})=>{if(e)return s.jsx("span",{className:"font-semibold text-theme-text-error",children:"Expired"});const a=c=>String(c).padStart(2,"0"),i=[];return t>0&&i.push(`${t}`),(t>0||n>0)&&i.push(`${a(n)}`),(t>0||n>0||o>0)&&i.push(`${a(o)}`),i.push(`${a(r)}`),s.jsx("span",{className:"font-semibold",children:i.join(":")})};function ze({token:t}){if(!t)return null;const n=Te(t);return n.exp?s.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3 rounded-sm border border-theme-border-moderate bg-theme-surface-tertiary py-1 text-center",children:[s.jsx(ue,{className:"size-5 shrink-0 fill-theme-text-secondary"}),s.jsxs("div",{children:["Expires in:"," ",s.jsx(C,{daysInHours:!0,renderer:$e,zeroPadTime:2,date:new Date(n.exp*1e3)})]})]}):null}function Ue({token:t}){const n=`${window.location.origin}/api/v1/current-user`;return s.jsxs("section",{className:"space-y-1",children:[s.jsx("div",{className:"font-semibold",children:"Using your API Token"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-theme-text-secondary",children:"To use the API token to run queries against the Server API, you can run the following commands:"}),s.jsx(I,{code:Le(t,n)}),s.jsx(I,{code:We(t,n)})]})]})}function Fe(){const t=`${window.location.origin}/docs`;return s.jsxs("section",{className:"space-y-2",children:[s.jsx("p",{className:"font-semibold",children:"API Documentation"}),s.jsx("p",{className:"text-theme-text-secondary",children:"Access our OpenAPI dashboard for comprehensive documentation on all available REST API endpoints:"}),s.jsx(D,{asChild:!0,size:"md",intent:"secondary",className:"flex w-fit items-center gap-1",emphasis:"subtle",children:s.jsxs("a",{target:"_blank",rel:"noopener noreferrer",href:t,children:[s.jsx("span",{children:"Open the documentation"}),s.jsx(ee,{className:"size-5 shrink-0 fill-inherit"})]})})]})}function He(){return s.jsxs("p",{children:["For long-term programmatic access, consider"," ",s.jsx(de,{className:"link text-theme-text-brand",to:te.settings.service_accounts.overview,children:"setting up a service account instead."})]})}function Le(t,n){return`curl -H "Authorization: Bearer ${t}" "${encodeURI(n)}"`}function We(t,n){return`wget -qO- --header="Authorization: Bearer ${t}" "${encodeURI(n)}"`}const k=v.forwardRef(({className:t,onClick:n,...o},r)=>{const{toast:e}=re(),[a,i]=v.useState(""),[c,l]=v.useState(!1),d=ne(),{mutate:h,isPending:p}=he({onError:m=>{ie(m)&&e({title:"Error",emphasis:"subtle",rounded:!0,status:"error",description:m.message}),console.log(m)},onSuccess:m=>{i(m),l(!0)}});function f(m){l(m),m||i("")}return d.isPending?s.jsx(oe,{className:"h-7 w-10"}):d.isError?null:s.jsxs(s.Fragment,{children:[s.jsxs(D,{disabled:p||ae(d.data.auth_scheme||"other"),ref:r,...o,onClick:()=>h({params:{token_type:"generic"}}),className:se(t),children:[p&&s.jsx("div",{role:"alert","aria-busy":"true",className:"full h-[20px] w-[20px] animate-spin rounded-rounded border-2 border-theme-text-negative border-b-theme-text-brand"}),"Create new token"]}),s.jsx(Ee,{open:c,setOpen:f,token:a})]})});k.displayName="CreateTokenButton";function rt(){return s.jsxs(_,{className:"flex flex-col gap-5 p-5",children:[s.jsx("h1",{className:"text-text-xl font-semibold",children:"API Tokens"}),s.jsx("div",{className:"flex items-center justify-end",children:s.jsx(k,{size:"sm"})}),s.jsxs(_,{className:"flex w-full flex-col items-center justify-center space-y-5 p-9 text-center",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("h2",{className:"text-display-xs font-semibold",children:"Create a new API Token"}),s.jsx("p",{className:"text-text-xl text-theme-text-secondary",children:"Generate a temporary access key for quick, secure automation tasks in your Tenant. An API Token is temporary (max. 1 hour) and won't be stored anywhere."})]}),s.jsx(k,{size:"md"})]})]})}export{rt as default};
|
{zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250624.dist-info}/LICENSE
RENAMED
File without changes
|
{zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250624.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|