zenml-nightly 0.80.2.dev20250415__py3-none-any.whl → 0.81.0.dev20250417__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/cli/utils.py +13 -11
- zenml/config/compiler.py +1 -0
- zenml/config/global_config.py +1 -1
- zenml/config/pipeline_configurations.py +1 -0
- zenml/config/pipeline_run_configuration.py +1 -0
- zenml/constants.py +4 -1
- zenml/integrations/gcp/orchestrators/vertex_orchestrator.py +47 -5
- zenml/integrations/gcp/vertex_custom_job_parameters.py +15 -1
- zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator.py +0 -1
- zenml/integrations/kubernetes/orchestrators/kubernetes_orchestrator_entrypoint.py +0 -1
- zenml/integrations/kubernetes/step_operators/kubernetes_step_operator.py +0 -3
- zenml/logging/step_logging.py +41 -21
- zenml/login/credentials_store.py +31 -0
- zenml/models/v2/base/base.py +8 -4
- zenml/models/v2/base/filter.py +1 -1
- zenml/models/v2/core/pipeline_run.py +19 -0
- zenml/orchestrators/step_launcher.py +2 -3
- zenml/orchestrators/step_runner.py +2 -2
- zenml/orchestrators/utils.py +2 -5
- zenml/pipelines/pipeline_context.py +1 -0
- zenml/pipelines/pipeline_decorator.py +4 -0
- zenml/pipelines/pipeline_definition.py +83 -22
- zenml/pipelines/run_utils.py +4 -0
- zenml/steps/utils.py +1 -1
- zenml/zen_server/auth.py +44 -64
- zenml/zen_server/dashboard/assets/{404-CYPi9d8E.js → 404-o3nB5iwI.js} +1 -1
- zenml/zen_server/dashboard/assets/{AlertDialogDropdownItem-Dn8bgaXG.js → AlertDialogDropdownItem-C_qWs-4u.js} +1 -1
- zenml/zen_server/dashboard/assets/{CodeSnippet-CSINAl3I.js → CodeSnippet-nRnOvbOJ.js} +1 -1
- zenml/zen_server/dashboard/assets/{CollapsibleCard-CQOb53t9.js → CollapsibleCard-9sSz7n1R.js} +1 -1
- zenml/zen_server/dashboard/assets/{Commands-CPleXvse.js → Commands-BwBzFj-5.js} +1 -1
- zenml/zen_server/dashboard/assets/{ComponentBadge-CIFj0W7T.js → ComponentBadge-CMx2DbsV.js} +1 -1
- zenml/zen_server/dashboard/assets/{ComponentIcon-D3JHFhJU.js → ComponentIcon-CSxdApv8.js} +1 -1
- zenml/zen_server/dashboard/assets/{CsvVizualization-Cklc1Vb5.js → CsvVizualization-lxB2iyEh.js} +1 -1
- zenml/zen_server/dashboard/assets/{DeleteAlertDialog-Bzq-uSd7.js → DeleteAlertDialog-Bp0o-UXZ.js} +1 -1
- zenml/zen_server/dashboard/assets/{DialogItem-zjMgCmCl.js → DialogItem-DHw2ihTx.js} +1 -1
- zenml/zen_server/dashboard/assets/{Error-kdeNHm_o.js → Error-DRhVeVHQ.js} +1 -1
- zenml/zen_server/dashboard/assets/{ExecutionStatus-UE6Rbmtk.js → ExecutionStatus-HnZXi9bW.js} +1 -1
- zenml/zen_server/dashboard/assets/{Helpbox-CeM-FPQl.js → Helpbox-Dsr3ZYcL.js} +1 -1
- zenml/zen_server/dashboard/assets/{Infobox-CD0fDbYF.js → Infobox-C4Op55B8.js} +1 -1
- zenml/zen_server/dashboard/assets/{InlineAvatar-CrHWwlf4.js → InlineAvatar-CrAwe7Pl.js} +1 -1
- zenml/zen_server/dashboard/assets/{NestedCollapsible-DfTTGG8u.js → NestedCollapsible-Ce1bmT8N.js} +1 -1
- zenml/zen_server/dashboard/assets/{Partials-DggkUpWp.js → Partials-DjTM0Oe-.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProBadge-BCdprj69.js → ProBadge-CDEqgzh8.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProCta-szzPO0Y7.js → ProCta-BYSSivgY.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderIcon-MdqWDO6-.js → ProviderIcon-B8W7AGNk.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderRadio-B4CB4vzP.js → ProviderRadio-BWFJPEY2.js} +1 -1
- zenml/zen_server/dashboard/assets/{RunSelector-Bhb83FyB.js → RunSelector-DoL_gMHJ.js} +1 -1
- zenml/zen_server/dashboard/assets/{RunsBody-Csn2VEOE.js → RunsBody-B6mBjv-_.js} +1 -1
- zenml/zen_server/dashboard/assets/{SearchField-Cce00eQL.js → SearchField-DHl5flXv.js} +1 -1
- zenml/zen_server/dashboard/assets/{SecretTooltip-DaDLBVj-.js → SecretTooltip-CCn9HfEh.js} +1 -1
- zenml/zen_server/dashboard/assets/{SetPassword-tX6fom1Y.js → SetPassword-BDFVwnNB.js} +1 -1
- zenml/zen_server/dashboard/assets/{StackList-CQt1xGRh.js → StackList-dhdUtky3.js} +1 -1
- zenml/zen_server/dashboard/assets/{Tabs-CCQyIqRb.js → Tabs-BuZG8ft1.js} +1 -1
- zenml/zen_server/dashboard/assets/{Tick-D63_jhf1.js → Tick-C4gtED35.js} +1 -1
- zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-CbbvoGYV.js → UpdatePasswordSchemas-3gg2tC-H.js} +1 -1
- zenml/zen_server/dashboard/assets/{UsageReason-C2cNrUeS.js → UsageReason-DOMAzO02.js} +1 -1
- zenml/zen_server/dashboard/assets/{Wizard-BVkN2a2x.js → Wizard-BSH_lIfi.js} +1 -1
- zenml/zen_server/dashboard/assets/{WizardFooter-Bk7gIKiS.js → WizardFooter-CnM-50jL.js} +1 -1
- zenml/zen_server/dashboard/assets/{all-pipeline-runs-query-BLclwQSi.js → all-pipeline-runs-query-D9XfZpmV.js} +1 -1
- zenml/zen_server/dashboard/assets/{configuration-form-CjrAp0GS.js → configuration-form-Ci_QlfZC.js} +1 -1
- zenml/zen_server/dashboard/assets/{create-stack-Bd2JdQer.js → create-stack-CoQ5SEJL.js} +1 -1
- zenml/zen_server/dashboard/assets/{delete-run-Cwpxu1-d.js → delete-run-B5xUZwdP.js} +1 -1
- zenml/zen_server/dashboard/assets/{flavor-select-c0w-6o9w.js → flavor-select-DOLAl-S4.js} +1 -1
- zenml/zen_server/dashboard/assets/{form-schemas-B5Ax1SZf.js → form-schemas-BaEJ1z87.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-BW-KaQ2p.js → index-BoWZ9rXk.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-CjdtNrfJ.js → index-e8udi7QT.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-Be2jLIYM.js → index-hsSXyS3H.js} +2 -2
- zenml/zen_server/dashboard/assets/{index-d_40qKeY.js → index-ojAuWXMf.js} +1 -1
- zenml/zen_server/dashboard/assets/{login-mutation-DOajKct8.js → login-mutation-CwraNa5G.js} +1 -1
- zenml/zen_server/dashboard/assets/{not-found-DolTp0dr.js → not-found-BuK1QrF2.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-C4zMMcaH.js → page-0AIX3VK8.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BkPPfNfG.js → page-3lW9eIer.js} +1 -1
- zenml/zen_server/dashboard/assets/page-9PzQok8O.js +1 -0
- zenml/zen_server/dashboard/assets/{page-bS5tHLDW.js → page-B5clbTo4.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BRfeowe0.js → page-BEibNYiA.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CmzmFF4S.js → page-BOE2XBFy.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DmOcZO8U.js → page-BQVPbNps.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-D3m9-YWJ.js → page-BbygQpf-.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CKVbEdX2.js → page-Bki79xdd.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-Dv3qtvm8.js → page-BnKwJnOb.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-ir7Scz2Y.js → page-C-6XUKSp.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-48DMcIQw.js → page-C30HZCTR.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BmTf1Lf1.js → page-C7buw8xJ.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CwAbTnvK.js → page-CBGeo-7W.js} +2 -2
- zenml/zen_server/dashboard/assets/{page-BEAx6ZvH.js → page-CIDo1Ajk.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CaTJVICi.js → page-CZgeF_wQ.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DCpZju6a.js → page-CgJcperk.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-gRfUvR0E.js → page-CjRoKEQs.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DWOAh8Pp.js → page-Co-FJ5ds.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-D-MjLTXS.js → page-Cu8vuohQ.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-mtwS5oci.js → page-Czj8fu8q.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-hNHJPQtK.js → page-D0QcEBi1.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CPRymOIS.js → page-DHDeVaMO.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-B32kCGPe.js → page-DKY_U5Sz.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BiAjLLww.js → page-DLVtrRa5.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DEUeF3mO.js → page-DQHU5o_C.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BbRtQC2E.js → page-DbEn9V9E.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DezabeEO.js → page-DpY1koQY.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-P81CcE2L.js → page-DrS4WOup.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BuZC8z6N.js → page-DwIlrsF0.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DnY59jOg.js → page-HIAPXq4w.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BgUR_5z3.js → page-Jw2QAdxa.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DivlNKt9.js → page-KRP_w5zH.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-a1c6o4vv.js → page-_Zt6UwiG.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BBNrvxC1.js → page-hVng6ANV.js} +1 -1
- zenml/zen_server/dashboard/assets/{persist-BUqILw7G.js → persist-DLvsEXh0.js} +1 -1
- zenml/zen_server/dashboard/assets/{persist-BbdfLc0W.js → persist-xOAq24Bm.js} +1 -1
- zenml/zen_server/dashboard/assets/{service-CV2zjc-p.js → service-MHyqhRgp.js} +1 -1
- zenml/zen_server/dashboard/assets/{sharedSchema-DpGc9kQg.js → sharedSchema-CQA5lnlU.js} +1 -1
- zenml/zen_server/dashboard/assets/{stack-detail-query-BpzLZjvw.js → stack-detail-query-C1GoxBeK.js} +1 -1
- zenml/zen_server/dashboard/assets/{update-server-settings-mutation-Dv6qHtK9.js → update-server-settings-mutation-DduehrZn.js} +1 -1
- zenml/zen_server/dashboard/index.html +2 -2
- zenml/zen_server/download_utils.py +26 -29
- zenml/zen_server/jwt.py +0 -14
- zenml/zen_server/routers/auth_endpoints.py +5 -36
- zenml/zen_server/routers/pipeline_deployments_endpoints.py +63 -26
- zenml/zen_server/routers/runs_endpoints.py +57 -0
- zenml/zen_server/template_execution/utils.py +1 -1
- zenml/zen_stores/migrations/versions/0.81.0_release.py +23 -0
- zenml/zen_stores/rest_zen_store.py +16 -13
- zenml/zen_stores/schemas/pipeline_run_schemas.py +1 -0
- zenml/zen_stores/sql_zen_store.py +18 -0
- {zenml_nightly-0.80.2.dev20250415.dist-info → zenml_nightly-0.81.0.dev20250417.dist-info}/METADATA +3 -2
- {zenml_nightly-0.80.2.dev20250415.dist-info → zenml_nightly-0.81.0.dev20250417.dist-info}/RECORD +128 -127
- zenml/zen_server/dashboard/assets/page-BAjhc2bs.js +0 -1
- {zenml_nightly-0.80.2.dev20250415.dist-info → zenml_nightly-0.81.0.dev20250417.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.80.2.dev20250415.dist-info → zenml_nightly-0.81.0.dev20250417.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.80.2.dev20250415.dist-info → zenml_nightly-0.81.0.dev20250417.dist-info}/entry_points.txt +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
import{r as l,j as e}from"./@radix-C7hRs6Kx.js";import{b as p,u as D,a as v,S,E as C}from"./SecretTooltip-
|
1
|
+
import{r as l,j as e}from"./@radix-C7hRs6Kx.js";import{b as p,u as D,a as v,S,E as C}from"./SecretTooltip-CCn9HfEh.js";import{a as f,c as N}from"./@tanstack-CSxjHCME.js";import{au as b,aL as w,av as k,I as j,aM as E,ax as T,h,at as K,aN as A,D as V,w as O,x as L,y as B,S as z,ak as F,al as I,N as Q,n as R,B as q,K as M}from"./index-hsSXyS3H.js";import{S as P}from"./key-icon-DO4DPJHZ.js";import{S as H}from"./trash-BWSZ7NRK.js";import{A as _}from"./AlertDialogDropdownItem-C_qWs-4u.js";import{b as $}from"./@react-router-BGgzhn5D.js";import"./plus-COjQg3AG.js";import"./zod-C0xYeTvL.js";import"./index.esm-D7jFlf5N.js";import"./CodeSnippet-nRnOvbOJ.js";import"./@reactflow-CQi1Z1Wq.js";function U({secretId:s,keyName:r}){const{data:t,isLoading:a,isError:u}=f({...p.secretDetail(s)}),i=N(),{mutate:c}=D({onError(d){K(d)&&A({status:"error",emphasis:"subtle",description:d.message,rounded:!0})},onSuccess(){i.invalidateQueries({queryKey:["secrets"]}),i.invalidateQueries({queryKey:["secretDetail",s]})}}),[n,m]=l.useState(""),x=()=>{var d;if(t){const g={...(d=t.body)==null?void 0:d.values};delete g[r];const y={name:t.name,scope:"workspace",values:g};c({id:s,body:y})}};function o(d){m(d.target.value)}return a?e.jsx("div",{children:"Loading..."}):u?e.jsx("div",{children:"Error loading secret details"}):e.jsxs(b,{children:[e.jsx(w,{children:e.jsx(k,{children:"Delete Key"})}),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 key?"}),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:o,className:"w-full",required:!0,value:n})]}),e.jsxs(E,{className:"gap-[10px]",children:[e.jsx(T,{asChild:!0,children:e.jsx(h,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(h,{intent:"danger",type:"button",onClick:x,disabled:n!=="DELETE",children:"Delete"})]})]})}function G({secretId:s,keyName:r}){const[t,a]=l.useState(!1),[u,i]=l.useState(!1),c=l.useRef(null),n=l.useRef(null);function m(){n.current=c.current}function x(o){if(o===!1){a(!1),setTimeout(()=>{i(o)},200);return}i(o)}return e.jsxs(V,{onOpenChange:a,open:t,children:[e.jsx(O,{ref:c,children:e.jsx(L,{className:"h-4 w-4 fill-theme-text-tertiary"})}),e.jsx(B,{hidden:u,onCloseAutoFocus:o=>{n.current&&(n.current.focus(),n.current=null,o.preventDefault())},align:"end",sideOffset:7,children:e.jsx(_,{onSelect:m,onOpenChange:x,triggerChildren:"Delete ",icon:e.jsx(H,{}),children:e.jsx(U,{secretId:s,keyName:r})})})]})}const J=({value:s})=>{const[r,t]=l.useState(!1),a=typeof s=="string"?s:"",u="•".repeat(a.length);return e.jsxs("div",{className:"flex items-center gap-2 space-x-2",children:[e.jsx(S,{onClick:()=>t(!r),className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{children:r?a:u})]})};function W(s,r){return[{id:"key",header:"Key",accessorKey:"key",cell:({row:t})=>{const a=`from zenml.client import Client
|
2
2
|
secret = Client().get_secret("${r}")
|
3
3
|
|
4
4
|
# 'secret.secret_values' will contain a dictionary with all key-value pairs within your secret.
|
@@ -1 +1 @@
|
|
1
|
-
import{r as x,j as e}from"./@radix-C7hRs6Kx.js";import{ak as I,al as ne,h as y,am as E,an as _,ao as q,f as v,I as K,ar as z,as as B,at as D,j as C,o as S,F as k,p as T,t as Q,v as ae,C as re,s as V,z as N,aq as $,T as ie,G as oe,H as ce,a2 as le,J as de,S as b,D as ue,w as me,x as xe,y as he,ah as pe,au as ye,aL as fe,av as je,aM as ge,ax as Ae,B as H,N as be,n as ve,U as De}from"./index-Be2jLIYM.js";import{c as j,b as P,a as F}from"./@tanstack-CSxjHCME.js";import{s as g,A as G,d as Ne,u as Ke,b as O,a as L}from"./service-CV2zjc-p.js";import{P as we,S as Ce}from"./SearchField-Cce00eQL.js";import{t as U}from"./zod-C0xYeTvL.js";import{u as J,C as w}from"./index.esm-D7jFlf5N.js";import{S as Y}from"./trash-BWSZ7NRK.js";import{D as Z,a as W}from"./DeleteAlertDialog-Bzq-uSd7.js";import{S as X}from"./key-icon-DO4DPJHZ.js";import{D as M}from"./DisplayDate-CYVBBSgr.js";import{i as Se,a as ke}from"./dates-3pMLCNrD.js";import{S as Te}from"./refresh-CM5T3QeU.js";import{A as Pe}from"./AlertDialogDropdownItem-Dn8bgaXG.js";import{I as Fe}from"./Infobox-CD0fDbYF.js";import{b as R}from"./@react-router-BGgzhn5D.js";import"./@reactflow-CQi1Z1Wq.js";import"./CodeSnippet-CSINAl3I.js";import"./Tick-D63_jhf1.js";import"./check-DK77doTf.js";import"./chevron-right-double-uNWbJT-C.js";import"./index-DR30v9MZ.js";function ee({serviceAccountId:t,isFallback:s}){const n=j(),[a,r]=x.useState(!1),[i,o]=x.useState(""),l=!!i;function m(){return l?e.jsx(G,{value:i}):e.jsx(Oe,{isFallback:s,serviceAccountId:t,setApikeyValue:o})}return e.jsx(e.Fragment,{children:e.jsxs(I,{open:a,onOpenChange:c=>{s&&!c&&n.invalidateQueries({queryKey:g.apiKeysKey(t)}),r(c),o("")},children:[e.jsx(ne,{asChild:!0,children:e.jsx(y,{className:"shrink-0",intent:"primary",size:"sm",children:"Generate API Key"})}),e.jsxs(E,{"data-success":l,className:"mx-auto overflow-x-auto transition-none data-[success=true]:max-w-[800px]",children:[e.jsx(_,{children:e.jsx(q,{children:l?"API Key Created Successfully":"Generate API Key"})}),m()]})]})})}function Oe({serviceAccountId:t,setApikeyValue:s,isFallback:n}){const{toast:a}=v(),r=j(),{handleSubmit:i,control:o,formState:{isValid:l},reset:m}=J({resolver:U(Ne),defaultValues:{name:"",description:""}}),{mutate:c}=Ke({onError(u){D(u)&&a({status:"error",emphasis:"subtle",description:u.message,rounded:!0})},onSuccess(u){var f;n||r.invalidateQueries({queryKey:g.apiKeysKey(t)}),s(((f=u.body)==null?void 0:f.key)||""),m()}});function d(u){c({serviceAccountId:t,body:{name:u.name,description:u.description}})}return e.jsxs(e.Fragment,{children:[e.jsxs("form",{id:"create-secret-form",className:"space-y-5 p-7",onSubmit:i(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:u})=>e.jsx(K,{...u,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:u})=>e.jsx(K,{...u,className:"w-full",placeholder:"Add description"})})]})]}),e.jsxs(z,{className:"gap-[10px]",children:[e.jsx(B,{asChild:!0,children:e.jsx(y,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(y,{intent:"primary",disabled:!l,type:"submit",form:"create-secret-form",children:"Generate Key"})]})]})}async function Re(t,s){const n=S(T.serviceAccounts.apiKeys.detail(t,s)),a=await C(n,{method:"DELETE",headers:{"Content-Type":"application/json"}});if(!a.ok){const r=await a.json().then(i=>Array.isArray(i.detail)?i.detail[1]:i.detail).catch(()=>`Failed to delete api key ${s}`);throw new k({status:a.status,statusText:a.statusText,message:r})}return a.json()}function Me(t){return P({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n})=>{await Re(s,n)}})}const te=x.createContext(null);function Ie({children:t}){const[s,n]=x.useState([]),a=j(),{toast:r}=v(),i=Me(),o=async(l,m)=>{try{const c=l.map(d=>i.mutateAsync({apiKeyId:d,serviceAccountId:m}));await Promise.all(c),r({description:"Deleted successfully.",status:"success",emphasis:"subtle",rounded:!0}),await a.invalidateQueries({queryKey:g.apiKeysKey(m)}),n([])}catch(c){D(c)&&r({status:"error",emphasis:"subtle",description:c.message,rounded:!0})}};return e.jsx(te.Provider,{value:{selectedApiKeys:s,setSelectedApiKeys:n,bulkDeleteApiKeys:o},children:t})}function A(){const t=x.useContext(te);if(!t)throw new Error("useServiceAccountSelectorContext must be used within a ServiceAccountsSelectorProvider");return t}function Ee({serviceAccountId:t}){const[s,n]=x.useState(!1),{bulkDeleteApiKeys:a,selectedApiKeys:r}=A();async function i(){await a(r,t),n(!1)}return e.jsxs(Q,{open:s,onOpenChange:n,children:[e.jsx(ae,{asChild:!0,children:e.jsxs(y,{className:"rounded-sharp border-none 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(Z,{title:`Delete Api Key${r.length>=2?"s":""}`,handleDelete:i,children:e.jsxs(W,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})]})}function _e({serviceAccountId:t}){const{selectedApiKeys:s}=A();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==null?void 0:s.length} Api Key${(s==null?void 0:s.length)>1?"s":""} selected`}),e.jsx(Ee,{serviceAccountId:t})]})}const qe=({id:t})=>{const{selectedApiKeys:s,setSelectedApiKeys:n}=A(),a=(r,i)=>{n(o=>r?[...o,i]:o.filter(l=>l!==i))};return e.jsx(re,{id:t,onCheckedChange:r=>a(r,t),checked:s.includes(t),className:"h-3 w-3"})};async function ze({apiKeyId:t,body:s,serviceAccountId:n}){const a=S(T.serviceAccounts.apiKeys.rotate(n,t)),r=await C(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(r.status===404&&V(),!r.ok){const i=await r.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>`Failed to rotate key ${t}`);throw new k({status:r.status,statusText:r.statusText,message:i})}return r.json()}function Be(t){return P({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n,body:a})=>ze({serviceAccountId:s,apiKeyId:n,body:a})})}const Qe=N.object({enableRetention:N.boolean(),rotateMinutes:N.coerce.number().int().min(1).optional()}).refine(t=>!(t.enableRetention&&!t.rotateMinutes));function Ve({serviceAccountId:t,apiKeyId:s,open:n,setOpen:a}){const[r,i]=x.useState(""),o=!!r;function l(){return o?e.jsx(G,{value:r}):e.jsx($e,{setApiKeyValue:i,apiKeyId:s,serviceAccountId:t})}return e.jsx(I,{open:n,onOpenChange:m=>{a(m),i("")},children:e.jsxs(E,{className:"mx-auto max-w-[800px] overflow-x-auto",children:[e.jsx(_,{children:e.jsx(q,{children:"Rotate API Key"})}),l()]})})}function $e({apiKeyId:t,serviceAccountId:s,setApiKeyValue:n}){const{toast:a}=v(),r=j(),{control:i,watch:o,register:l,handleSubmit:m,formState:{errors:c,isValid:d}}=J({resolver:U(Qe),defaultValues:{enableRetention:!1,rotateMinutes:void 0}});function u(p){const h={retain_period_minutes:p.rotateMinutes};f({serviceAccountId:s,apiKeyId:t,body:h})}const{mutate:f}=Be({onError(p){D(p)&&a({status:"error",emphasis:"subtle",description:p.message,rounded:!0})},onSuccess(p){var h;a({description:"The API key has been rotated successfully.",status:"success",emphasis:"subtle",rounded:!0}),n(((h=p.body)==null?void 0:h.key)||""),r.invalidateQueries({queryKey:[...g.apiKeysKey(s)]})}});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-5 p-7",children:[e.jsx(He,{apiKeyId:t,serviceAccountId:s}),e.jsx(Ge,{}),e.jsxs("form",{onSubmit:m(u),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:i,name:"enableRetention",render:({field:{onChange:p,value:h}})=>e.jsx($,{className:"data-[state=unchecked]:bg-neutral-200",checked:h,id:"enable-retention",onCheckedChange:se=>p(!!se)})}),"Include Retention Period",e.jsx(ie,{children:e.jsxs(oe,{children:[e.jsx(ce,{asChild:!0,children:e.jsxs("button",{type:"button",children:[e.jsx(le,{className:"h-4 w-4 shrink-0 fill-theme-text-tertiary"}),e.jsx("div",{className:"sr-only",children:"Info tooltip"})]})}),e.jsx(de,{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(K,{id:"retention-minutes",...l("rotateMinutes"),disabled:!o("enableRetention"),placeholder:"0"}),c.rotateMinutes&&e.jsx("p",{className:"text-text-sm text-theme-text-error",children:c.rotateMinutes.message})]})]})]})]}),e.jsxs(z,{className:"gap-[10px]",children:[e.jsx(B,{asChild:!0,children:e.jsx(y,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(y,{intent:"primary",disabled:!d,size:"sm",form:"retention-form",children:"Rotate Key"})]})]})}function He({apiKeyId:t,serviceAccountId:s}){var i;const{data:n,isPending:a,isError:r}=F({...O.ApiKeysDetail(s,t),throwOnError:!0});return a?e.jsx(b,{className:"h-8 w-full"}):r?null:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(X,{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&&((i=n.metadata)==null?void 0:i.description)})]})]})}function Ge(){return e.jsxs(Fe,{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 Le({serviceAccountId:t,apiKeyId:s}){const[n,a]=x.useState(!1),[r,i]=x.useState(!1),[o,l]=x.useState(!1),m=x.useRef(null),c=x.useRef(null),{bulkDeleteApiKeys:d}=A();function u(){c.current=m.current}function f(h){l(h),h||a(!1)}async function p(){await d([s],t),f(!1)}return e.jsxs(e.Fragment,{children:[e.jsx(Ve,{setOpen:i,open:r,serviceAccountId:t,apiKeyId:s}),e.jsxs(ue,{onOpenChange:a,open:n,children:[e.jsx(me,{ref:m,children:e.jsx(xe,{className:"h-5 w-5 fill-theme-text-secondary"})}),e.jsxs(he,{hidden:o,onCloseAutoFocus:h=>{c.current&&(c.current.focus(),c.current=null,h.preventDefault())},align:"end",sideOffset:7,children:[e.jsx(pe,{className:"px-3",onClick:()=>i(!0),icon:e.jsx(Te,{}),children:e.jsx("span",{children:"Rotate"})}),e.jsx(Pe,{onSelect:u,open:o,onOpenChange:f,triggerChildren:"Delete",icon:e.jsx(Y,{fill:"red"}),children:e.jsx(Z,{title:"Delete API Key",handleDelete:p,children:e.jsxs(W,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})})]})]})]})}async function Ue({apiKeyId:t,body:s,serviceAccountId:n}){const a=S(T.serviceAccounts.apiKeys.detail(n,t)),r=await C(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(r.status===404&&V(),!r.ok){const i=await r.json().then(o=>Array.isArray(o.detail)?o.detail[0]:o.detail||"An error occurred").catch(()=>`Failed to update key ${t}`);throw new k({status:r.status,statusText:r.statusText,message:i})}return r.json()}function Je(t){return P({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n,body:a})=>{await Ue({serviceAccountId:s,apiKeyId:n,body:a})}})}function Ye({isActive:t,serviceAccountId:s,apiKeyId:n}){const{toast:a}=v(),r=j(),[i,o]=x.useState(!1),{mutate:l}=Je({onError(d){D(d)&&a({status:"error",emphasis:"subtle",description:d.message,rounded:!0})},onSuccess(){r.invalidateQueries({queryKey:g.apiKeysKey(s)})}});function m(d){d?c(d):o(!0)}async function c(d){l({serviceAccountId:s,apiKeyId:n,body:{active:d}})}return e.jsxs(e.Fragment,{children:[e.jsx(Q,{open:i,onOpenChange:o,children:e.jsxs(ye,{children:[e.jsx(fe,{children:e.jsx(je,{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(ge,{className:"gap-[10px]",children:[e.jsx(Ae,{asChild:!0,children:e.jsx(y,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(y,{onClick:()=>c(!1).then(d=>o(!1)),intent:"primary",type:"button",children:"Deactivate"})]})]})}),e.jsx($,{checked:t,onCheckedChange:m})]})}function Ze(){return[{id:"check",header:"",meta:{width:"1%"},accessorFn:t=>{var s;return String((s=t.body)==null?void 0:s.service_account.id)},cell:({row:t})=>e.jsx(qe,{id:t.original.id})},{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(X,{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 i;const s=(i=t.original.metadata)==null?void 0:i.last_rotated;if(!s)return e.jsx("p",{children:"Never"});const n=new Date(`${s}Z`),a=Se(n),r=ke(n);return e.jsxs("div",{children:[e.jsx("p",{children:e.jsx(M,{short:!0,dateString:s})}),(a||r)&&e.jsx("p",{className:`${r?"text-theme-text-error":"text-theme-text-warning"} text-text-xs`,children:r?"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(Ye,{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(Le,{serviceAccountId:s,apiKeyId:t.original.id})}):null}}]}function We(){const{serviceAccountId:t}=R();return e.jsxs(H,{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(ee,{isFallback:!0,serviceAccountId:t})]})}function Xe(){const{serviceAccountId:t}=R(),s=L(),n=x.useMemo(()=>Ze(),[]),{data:a}=F({...O.serviceAccountApiKeys(t,{...s,sort_by:"desc:created",hydrate:!0})});return a&&(a==null?void 0:a.items.length)<1&&!s.name?e.jsx(We,{}):e.jsxs(Ie,{children:[e.jsx(et,{serviceAccountId:t}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:a?e.jsx(be,{columns:n,data:a.items}):e.jsx(b,{className:"h-[500px] w-full"})}),a?a.total_pages>1&&e.jsx(we,{searchParams:s,paginate:a}):e.jsx(b,{className:"h-[36px] w-[300px]"})]})]})}function et({serviceAccountId:t}){const s=L(),{selectedApiKeys:n}=A();return e.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2",children:[n.length?e.jsx(_e,{serviceAccountId:t}):e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(Ce,{searchParams:s})}),e.jsx(ee,{isFallback:!1,serviceAccountId:t})]})}function Nt(){return e.jsxs(H,{className:"space-y-5 p-5",children:[e.jsxs("div",{children:[e.jsx(tt,{}),e.jsx("h1",{className:"my-5 text-text-lg font-semibold",children:"API Keys"})]}),e.jsx(Xe,{})]})}function tt(){var r,i,o;const{setCurrentBreadcrumbData:t}=ve(),{serviceAccountId:s}=R(),n=F({...O.serviceAccountDetail(s),throwOnError:!0});if(x.useEffect(()=>{n.data&&t({segment:"service_account_detail",data:n.data})},[n.data,t]),n.isPending)return e.jsx(b,{className:"h-9 w-full"});if(n.isError)return null;const a=n.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:a.name}),e.jsx(De,{size:"sm",color:(r=a.body)!=null&&r.active?"light-purple":"light-grey",className:"text-text-xs font-semibold uppercase",children:(i=a.body)!=null&&i.active?"active":"inactive"})]}),e.jsx("p",{className:"text-text-md text-theme-text-secondary ",children:(o=a.metadata)==null?void 0:o.description})]})}export{tt as APIKeyHeader,Nt as default};
|
1
|
+
import{r as x,j as e}from"./@radix-C7hRs6Kx.js";import{ak as I,al as ne,h as y,am as E,an as _,ao as q,f as v,I as K,ar as z,as as B,at as D,j as C,o as S,F as k,p as T,t as Q,v as ae,C as re,s as V,z as N,aq as $,T as ie,G as oe,H as ce,a2 as le,J as de,S as b,D as ue,w as me,x as xe,y as he,ah as pe,au as ye,aL as fe,av as je,aM as ge,ax as Ae,B as H,N as be,n as ve,U as De}from"./index-hsSXyS3H.js";import{c as j,b as P,a as F}from"./@tanstack-CSxjHCME.js";import{s as g,A as G,d as Ne,u as Ke,b as O,a as L}from"./service-MHyqhRgp.js";import{P as we,S as Ce}from"./SearchField-DHl5flXv.js";import{t as U}from"./zod-C0xYeTvL.js";import{u as J,C as w}from"./index.esm-D7jFlf5N.js";import{S as Y}from"./trash-BWSZ7NRK.js";import{D as Z,a as W}from"./DeleteAlertDialog-Bp0o-UXZ.js";import{S as X}from"./key-icon-DO4DPJHZ.js";import{D as M}from"./DisplayDate-CYVBBSgr.js";import{i as Se,a as ke}from"./dates-3pMLCNrD.js";import{S as Te}from"./refresh-CM5T3QeU.js";import{A as Pe}from"./AlertDialogDropdownItem-C_qWs-4u.js";import{I as Fe}from"./Infobox-C4Op55B8.js";import{b as R}from"./@react-router-BGgzhn5D.js";import"./@reactflow-CQi1Z1Wq.js";import"./CodeSnippet-nRnOvbOJ.js";import"./Tick-C4gtED35.js";import"./check-DK77doTf.js";import"./chevron-right-double-uNWbJT-C.js";import"./index-DR30v9MZ.js";function ee({serviceAccountId:t,isFallback:s}){const n=j(),[a,r]=x.useState(!1),[i,o]=x.useState(""),l=!!i;function m(){return l?e.jsx(G,{value:i}):e.jsx(Oe,{isFallback:s,serviceAccountId:t,setApikeyValue:o})}return e.jsx(e.Fragment,{children:e.jsxs(I,{open:a,onOpenChange:c=>{s&&!c&&n.invalidateQueries({queryKey:g.apiKeysKey(t)}),r(c),o("")},children:[e.jsx(ne,{asChild:!0,children:e.jsx(y,{className:"shrink-0",intent:"primary",size:"sm",children:"Generate API Key"})}),e.jsxs(E,{"data-success":l,className:"mx-auto overflow-x-auto transition-none data-[success=true]:max-w-[800px]",children:[e.jsx(_,{children:e.jsx(q,{children:l?"API Key Created Successfully":"Generate API Key"})}),m()]})]})})}function Oe({serviceAccountId:t,setApikeyValue:s,isFallback:n}){const{toast:a}=v(),r=j(),{handleSubmit:i,control:o,formState:{isValid:l},reset:m}=J({resolver:U(Ne),defaultValues:{name:"",description:""}}),{mutate:c}=Ke({onError(u){D(u)&&a({status:"error",emphasis:"subtle",description:u.message,rounded:!0})},onSuccess(u){var f;n||r.invalidateQueries({queryKey:g.apiKeysKey(t)}),s(((f=u.body)==null?void 0:f.key)||""),m()}});function d(u){c({serviceAccountId:t,body:{name:u.name,description:u.description}})}return e.jsxs(e.Fragment,{children:[e.jsxs("form",{id:"create-secret-form",className:"space-y-5 p-7",onSubmit:i(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:u})=>e.jsx(K,{...u,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:u})=>e.jsx(K,{...u,className:"w-full",placeholder:"Add description"})})]})]}),e.jsxs(z,{className:"gap-[10px]",children:[e.jsx(B,{asChild:!0,children:e.jsx(y,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(y,{intent:"primary",disabled:!l,type:"submit",form:"create-secret-form",children:"Generate Key"})]})]})}async function Re(t,s){const n=S(T.serviceAccounts.apiKeys.detail(t,s)),a=await C(n,{method:"DELETE",headers:{"Content-Type":"application/json"}});if(!a.ok){const r=await a.json().then(i=>Array.isArray(i.detail)?i.detail[1]:i.detail).catch(()=>`Failed to delete api key ${s}`);throw new k({status:a.status,statusText:a.statusText,message:r})}return a.json()}function Me(t){return P({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n})=>{await Re(s,n)}})}const te=x.createContext(null);function Ie({children:t}){const[s,n]=x.useState([]),a=j(),{toast:r}=v(),i=Me(),o=async(l,m)=>{try{const c=l.map(d=>i.mutateAsync({apiKeyId:d,serviceAccountId:m}));await Promise.all(c),r({description:"Deleted successfully.",status:"success",emphasis:"subtle",rounded:!0}),await a.invalidateQueries({queryKey:g.apiKeysKey(m)}),n([])}catch(c){D(c)&&r({status:"error",emphasis:"subtle",description:c.message,rounded:!0})}};return e.jsx(te.Provider,{value:{selectedApiKeys:s,setSelectedApiKeys:n,bulkDeleteApiKeys:o},children:t})}function A(){const t=x.useContext(te);if(!t)throw new Error("useServiceAccountSelectorContext must be used within a ServiceAccountsSelectorProvider");return t}function Ee({serviceAccountId:t}){const[s,n]=x.useState(!1),{bulkDeleteApiKeys:a,selectedApiKeys:r}=A();async function i(){await a(r,t),n(!1)}return e.jsxs(Q,{open:s,onOpenChange:n,children:[e.jsx(ae,{asChild:!0,children:e.jsxs(y,{className:"rounded-sharp border-none 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(Z,{title:`Delete Api Key${r.length>=2?"s":""}`,handleDelete:i,children:e.jsxs(W,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})]})}function _e({serviceAccountId:t}){const{selectedApiKeys:s}=A();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==null?void 0:s.length} Api Key${(s==null?void 0:s.length)>1?"s":""} selected`}),e.jsx(Ee,{serviceAccountId:t})]})}const qe=({id:t})=>{const{selectedApiKeys:s,setSelectedApiKeys:n}=A(),a=(r,i)=>{n(o=>r?[...o,i]:o.filter(l=>l!==i))};return e.jsx(re,{id:t,onCheckedChange:r=>a(r,t),checked:s.includes(t),className:"h-3 w-3"})};async function ze({apiKeyId:t,body:s,serviceAccountId:n}){const a=S(T.serviceAccounts.apiKeys.rotate(n,t)),r=await C(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(r.status===404&&V(),!r.ok){const i=await r.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>`Failed to rotate key ${t}`);throw new k({status:r.status,statusText:r.statusText,message:i})}return r.json()}function Be(t){return P({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n,body:a})=>ze({serviceAccountId:s,apiKeyId:n,body:a})})}const Qe=N.object({enableRetention:N.boolean(),rotateMinutes:N.coerce.number().int().min(1).optional()}).refine(t=>!(t.enableRetention&&!t.rotateMinutes));function Ve({serviceAccountId:t,apiKeyId:s,open:n,setOpen:a}){const[r,i]=x.useState(""),o=!!r;function l(){return o?e.jsx(G,{value:r}):e.jsx($e,{setApiKeyValue:i,apiKeyId:s,serviceAccountId:t})}return e.jsx(I,{open:n,onOpenChange:m=>{a(m),i("")},children:e.jsxs(E,{className:"mx-auto max-w-[800px] overflow-x-auto",children:[e.jsx(_,{children:e.jsx(q,{children:"Rotate API Key"})}),l()]})})}function $e({apiKeyId:t,serviceAccountId:s,setApiKeyValue:n}){const{toast:a}=v(),r=j(),{control:i,watch:o,register:l,handleSubmit:m,formState:{errors:c,isValid:d}}=J({resolver:U(Qe),defaultValues:{enableRetention:!1,rotateMinutes:void 0}});function u(p){const h={retain_period_minutes:p.rotateMinutes};f({serviceAccountId:s,apiKeyId:t,body:h})}const{mutate:f}=Be({onError(p){D(p)&&a({status:"error",emphasis:"subtle",description:p.message,rounded:!0})},onSuccess(p){var h;a({description:"The API key has been rotated successfully.",status:"success",emphasis:"subtle",rounded:!0}),n(((h=p.body)==null?void 0:h.key)||""),r.invalidateQueries({queryKey:[...g.apiKeysKey(s)]})}});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-5 p-7",children:[e.jsx(He,{apiKeyId:t,serviceAccountId:s}),e.jsx(Ge,{}),e.jsxs("form",{onSubmit:m(u),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:i,name:"enableRetention",render:({field:{onChange:p,value:h}})=>e.jsx($,{className:"data-[state=unchecked]:bg-neutral-200",checked:h,id:"enable-retention",onCheckedChange:se=>p(!!se)})}),"Include Retention Period",e.jsx(ie,{children:e.jsxs(oe,{children:[e.jsx(ce,{asChild:!0,children:e.jsxs("button",{type:"button",children:[e.jsx(le,{className:"h-4 w-4 shrink-0 fill-theme-text-tertiary"}),e.jsx("div",{className:"sr-only",children:"Info tooltip"})]})}),e.jsx(de,{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(K,{id:"retention-minutes",...l("rotateMinutes"),disabled:!o("enableRetention"),placeholder:"0"}),c.rotateMinutes&&e.jsx("p",{className:"text-text-sm text-theme-text-error",children:c.rotateMinutes.message})]})]})]})]}),e.jsxs(z,{className:"gap-[10px]",children:[e.jsx(B,{asChild:!0,children:e.jsx(y,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(y,{intent:"primary",disabled:!d,size:"sm",form:"retention-form",children:"Rotate Key"})]})]})}function He({apiKeyId:t,serviceAccountId:s}){var i;const{data:n,isPending:a,isError:r}=F({...O.ApiKeysDetail(s,t),throwOnError:!0});return a?e.jsx(b,{className:"h-8 w-full"}):r?null:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(X,{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&&((i=n.metadata)==null?void 0:i.description)})]})]})}function Ge(){return e.jsxs(Fe,{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 Le({serviceAccountId:t,apiKeyId:s}){const[n,a]=x.useState(!1),[r,i]=x.useState(!1),[o,l]=x.useState(!1),m=x.useRef(null),c=x.useRef(null),{bulkDeleteApiKeys:d}=A();function u(){c.current=m.current}function f(h){l(h),h||a(!1)}async function p(){await d([s],t),f(!1)}return e.jsxs(e.Fragment,{children:[e.jsx(Ve,{setOpen:i,open:r,serviceAccountId:t,apiKeyId:s}),e.jsxs(ue,{onOpenChange:a,open:n,children:[e.jsx(me,{ref:m,children:e.jsx(xe,{className:"h-5 w-5 fill-theme-text-secondary"})}),e.jsxs(he,{hidden:o,onCloseAutoFocus:h=>{c.current&&(c.current.focus(),c.current=null,h.preventDefault())},align:"end",sideOffset:7,children:[e.jsx(pe,{className:"px-3",onClick:()=>i(!0),icon:e.jsx(Te,{}),children:e.jsx("span",{children:"Rotate"})}),e.jsx(Pe,{onSelect:u,open:o,onOpenChange:f,triggerChildren:"Delete",icon:e.jsx(Y,{fill:"red"}),children:e.jsx(Z,{title:"Delete API Key",handleDelete:p,children:e.jsxs(W,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})})]})]})]})}async function Ue({apiKeyId:t,body:s,serviceAccountId:n}){const a=S(T.serviceAccounts.apiKeys.detail(n,t)),r=await C(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(r.status===404&&V(),!r.ok){const i=await r.json().then(o=>Array.isArray(o.detail)?o.detail[0]:o.detail||"An error occurred").catch(()=>`Failed to update key ${t}`);throw new k({status:r.status,statusText:r.statusText,message:i})}return r.json()}function Je(t){return P({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n,body:a})=>{await Ue({serviceAccountId:s,apiKeyId:n,body:a})}})}function Ye({isActive:t,serviceAccountId:s,apiKeyId:n}){const{toast:a}=v(),r=j(),[i,o]=x.useState(!1),{mutate:l}=Je({onError(d){D(d)&&a({status:"error",emphasis:"subtle",description:d.message,rounded:!0})},onSuccess(){r.invalidateQueries({queryKey:g.apiKeysKey(s)})}});function m(d){d?c(d):o(!0)}async function c(d){l({serviceAccountId:s,apiKeyId:n,body:{active:d}})}return e.jsxs(e.Fragment,{children:[e.jsx(Q,{open:i,onOpenChange:o,children:e.jsxs(ye,{children:[e.jsx(fe,{children:e.jsx(je,{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(ge,{className:"gap-[10px]",children:[e.jsx(Ae,{asChild:!0,children:e.jsx(y,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(y,{onClick:()=>c(!1).then(d=>o(!1)),intent:"primary",type:"button",children:"Deactivate"})]})]})}),e.jsx($,{checked:t,onCheckedChange:m})]})}function Ze(){return[{id:"check",header:"",meta:{width:"1%"},accessorFn:t=>{var s;return String((s=t.body)==null?void 0:s.service_account.id)},cell:({row:t})=>e.jsx(qe,{id:t.original.id})},{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(X,{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 i;const s=(i=t.original.metadata)==null?void 0:i.last_rotated;if(!s)return e.jsx("p",{children:"Never"});const n=new Date(`${s}Z`),a=Se(n),r=ke(n);return e.jsxs("div",{children:[e.jsx("p",{children:e.jsx(M,{short:!0,dateString:s})}),(a||r)&&e.jsx("p",{className:`${r?"text-theme-text-error":"text-theme-text-warning"} text-text-xs`,children:r?"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(Ye,{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(Le,{serviceAccountId:s,apiKeyId:t.original.id})}):null}}]}function We(){const{serviceAccountId:t}=R();return e.jsxs(H,{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(ee,{isFallback:!0,serviceAccountId:t})]})}function Xe(){const{serviceAccountId:t}=R(),s=L(),n=x.useMemo(()=>Ze(),[]),{data:a}=F({...O.serviceAccountApiKeys(t,{...s,sort_by:"desc:created",hydrate:!0})});return a&&(a==null?void 0:a.items.length)<1&&!s.name?e.jsx(We,{}):e.jsxs(Ie,{children:[e.jsx(et,{serviceAccountId:t}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:a?e.jsx(be,{columns:n,data:a.items}):e.jsx(b,{className:"h-[500px] w-full"})}),a?a.total_pages>1&&e.jsx(we,{searchParams:s,paginate:a}):e.jsx(b,{className:"h-[36px] w-[300px]"})]})]})}function et({serviceAccountId:t}){const s=L(),{selectedApiKeys:n}=A();return e.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2",children:[n.length?e.jsx(_e,{serviceAccountId:t}):e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(Ce,{searchParams:s})}),e.jsx(ee,{isFallback:!1,serviceAccountId:t})]})}function Nt(){return e.jsxs(H,{className:"space-y-5 p-5",children:[e.jsxs("div",{children:[e.jsx(tt,{}),e.jsx("h1",{className:"my-5 text-text-lg font-semibold",children:"API Keys"})]}),e.jsx(Xe,{})]})}function tt(){var r,i,o;const{setCurrentBreadcrumbData:t}=ve(),{serviceAccountId:s}=R(),n=F({...O.serviceAccountDetail(s),throwOnError:!0});if(x.useEffect(()=>{n.data&&t({segment:"service_account_detail",data:n.data})},[n.data,t]),n.isPending)return e.jsx(b,{className:"h-9 w-full"});if(n.isError)return null;const a=n.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:a.name}),e.jsx(De,{size:"sm",color:(r=a.body)!=null&&r.active?"light-purple":"light-grey",className:"text-text-xs font-semibold uppercase",children:(i=a.body)!=null&&i.active?"active":"inactive"})]}),e.jsx("p",{className:"text-text-md text-theme-text-secondary ",children:(o=a.metadata)==null?void 0:o.description})]})}export{tt as APIKeyHeader,Nt as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as i,j as e}from"./@radix-C7hRs6Kx.js";import{z as o,f as y,j as g,k as N,c as b,l as v,S,I as u,h as p,m as w,r as k,n as F}from"./index-
|
1
|
+
import{r as i,j as e}from"./@radix-C7hRs6Kx.js";import{z as o,f as y,j as g,k as N,c as b,l as v,S,I as u,h as p,m as w,r as k,n as F}from"./index-hsSXyS3H.js";import{T as C,P}from"./ProCta-BYSSivgY.js";import{t as U}from"./zod-C0xYeTvL.js";import{b as E}from"./@tanstack-CSxjHCME.js";import{u as M}from"./index.esm-D7jFlf5N.js";import{S as L}from"./check-circle-mvyzYvIW.js";import{L as z}from"./@react-router-BGgzhn5D.js";import"./@reactflow-CQi1Z1Wq.js";import"./check-DK77doTf.js";const h=i.createContext(null);function B({children:s}){const[t,a]=i.useState(!1);return e.jsx(h.Provider,{value:{setSubmitSuccess:a,submitSuccess:t},children:s})}function f(){const s=i.useContext(h);if(s===null)throw new Error("useUpgradeContext must be used within an UpgradeProvider");return s}const T=o.object({name:o.string().min(1),company:o.string().min(1),email:o.string().email()});function I(){const{setSubmitSuccess:s}=f(),{toast:t}=y(),a=M({resolver:U(T),defaultValues:{company:"",email:"",name:""}}),n=E({mutationFn:Z,onSuccess:()=>s(!0),onError:r=>{t({emphasis:"subtle",status:"error",rounded:!0,description:r.message})}});async function c(r,l,m){n.mutate({...r,userId:l,isDebug:m})}return{form:a,submitFormMutation:n,handleSubmitForm:c}}async function Z({company:s,email:t,isDebug:a,name:n,userId:c}){return g(N,{method:"POST",credentials:"omit",headers:{"Content-Type":"application/json"},body:JSON.stringify([{debug:a,event:"Upgrade initiated",type:"track",user_id:c,properties:{company:s,email:t,name:n}}])})}function _(){return e.jsxs("div",{className:"space-y-5",children:[e.jsx(D,{}),e.jsx(R,{})]})}function D(){return e.jsxs("div",{className:"flex flex-col items-center space-y-0.5",children:[e.jsx("h1",{className:"text-center text-display-xs font-semibold",children:"Upgrade to ZenML Pro on your own VPC"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Direct self-deployment, no sales calls"})]})}function R(){const s=b(),t=v(),{form:a,handleSubmitForm:n,submitFormMutation:c}=I(),{register:r,handleSubmit:l,formState:{isValid:m,isSubmitting:d}}=a,{isPending:x}=c;return s.isPending||t.isPending?e.jsx(S,{className:"h-[250px] w-full"}):s.isError||t.isError?e.jsx("p",{children:"Something went wrong...."}):e.jsxs("div",{className:"space-y-5",children:[e.jsxs("form",{onSubmit:l(j=>n(j,t.data.id,!!s.data.debug)),className:"space-y-5",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{htmlFor:"name",className:"text-text-sm",children:"Your Name"}),e.jsx(u,{...r("name"),id:"name",className:"w-full"})]}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{htmlFor:"company",className:"text-text-sm",children:"Company"}),e.jsx(u,{...r("company"),id:"company",className:"w-full"})]}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{htmlFor:"email",className:"text-text-sm",children:"Email address"}),e.jsx(u,{...r("email"),id:"email",className:"w-full"})]}),e.jsxs(p,{size:"md",className:"w-full justify-center",disabled:d||x||!m,type:"submit",children:[(x||d)&&e.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"}),"Continue"]})]}),e.jsxs("p",{className:"text-center text-text-xs text-theme-text-secondary",children:["By submitting the form you accept our"," ",e.jsx("a",{className:"link",href:"https://www.zenml.io/cloud-terms-and-privacy",target:"_blank",rel:"noopener noreferrer",children:"terms of use"})," ","and"," ",e.jsx("a",{href:"https://www.zenml.io/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"link",children:"privacy policy"}),"."]})]})}function V(){return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-display-xs font-semibold",children:"As easy as following the steps"}),e.jsx("p",{className:"text-theme-text-secondary",children:"From sign-up to deployment in minutes"})]}),e.jsx(Y,{})]})}const W=["Fill out your details","Receive comprehensive ZenML Pro documentation","Deploy ZenML Pro and upgrade your tenant","Get a free 14-day trial license"];function Y(){return e.jsx("ol",{className:"space-y-3",children:W.map((s,t)=>e.jsxs("li",{className:"flex items-center space-x-1",children:[e.jsx(q,{children:t+1}),e.jsx("span",{children:s})]},t))})}function q({className:s,...t}){return e.jsx("div",{...t,className:w("flex h-4 w-4 shrink-0 items-center justify-center rounded-rounded bg-warning-400 text-text-xs text-theme-text-negative")})}function G(){return e.jsxs("section",{className:"flex w-full flex-col-reverse items-center justify-end gap-5 lg:flex-row lg:gap-[100px] xl:pl-[200px] 2xl:pl-[300px]",children:[e.jsx(V,{}),e.jsx(_,{})]})}const H="/assets/upgrade-form-CwRHBuXB.webp",O=["Comprehensive documentation to get started","Your 14-day trial license key","Step-by-step deployment instructions"];function A(){return e.jsxs("section",{className:"flex h-full w-full flex-col items-center justify-center space-y-5",children:[e.jsx(L,{className:"h-[120px] w-[120px] fill-theme-text-success"}),e.jsxs("div",{className:"space-y-7",children:[e.jsxs("div",{className:"max-w-[500px] space-y-2 text-center",children:[e.jsx("h1",{className:"text-display-xs font-semibold",children:"You're on your way to ZenML Pro!"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Thank you for choosing to upgrade to ZenML Pro. We've received your request and you'll receive an email with:"}),e.jsx("ul",{className:"mx-auto w-fit space-y-3",children:O.map((s,t)=>e.jsxs("li",{className:"flex items-center gap-1",children:[e.jsx(C,{}),e.jsx("span",{children:s})]},t))}),e.jsxs("p",{className:"text-theme-text-secondary",children:["Meanwhile, you can ask your questions in our"," ",e.jsx("a",{className:"link",href:"https://zenml.io/slack",target:"_blank",rel:"noopener noreferrer",children:"Slack channel"})," ","or"," ",e.jsx("a",{className:"link",href:"https://docs.zenml.io",target:"_blank",rel:"noopener noreferrer",children:"check our documentation."})]})]}),e.jsx(p,{size:"md",className:"mx-auto",children:e.jsx(z,{to:k.home,children:"Go to Dashboard"})})]})]})}function J(){const{submitSuccess:s}=f();return e.jsxs(P,{className:"relative min-h-[620px]",children:[e.jsx("img",{src:H,className:"absolute hidden -translate-x-3/4 -rotate-[5deg] scale-75 xl:block 2xl:-translate-x-[60%]"}),s===!1&&e.jsx(G,{}),s===!0&&e.jsx(A,{})]})}function ce(){const{setCurrentBreadcrumbData:s}=F();return i.useEffect(()=>{s({segment:"upgrade",data:null})},[]),e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx("div",{className:"layout-container",children:e.jsx(B,{children:e.jsx(J,{})})})})}export{ce as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as l,j as e}from"./@radix-C7hRs6Kx.js";import{u as d,S as h,a as j,b as y}from"./form-schemas-
|
1
|
+
import{r as l,j as e}from"./@radix-C7hRs6Kx.js";import{u as d,S as h,a as j,b as y}from"./form-schemas-BaEJ1z87.js";import{E as w}from"./EmptyState-M1jafpg6.js";import{A,I as U,P as b,U as P,S as g}from"./UsageReason-DOMAzO02.js";import{d as _}from"./@react-router-BGgzhn5D.js";import{j as F,o as C,F as E,p as N,e as k,f as H,i as I}from"./index-hsSXyS3H.js";import{b as M}from"./@tanstack-CSxjHCME.js";import{u as D}from"./login-mutation-CwraNa5G.js";import{S as R}from"./SetPassword-BDFVwnNB.js";import"./check-circle-mvyzYvIW.js";import"./UpdatePasswordSchemas-3gg2tC-H.js";import"./zod-C0xYeTvL.js";import"./index.esm-D7jFlf5N.js";import"./gcp-CHNvgEss.js";import"./kubernetes-D6OUjwSK.js";import"./rocket-Cf-B-XOR.js";import"./@reactflow-CQi1Z1Wq.js";import"./PasswordChecker-lYTOtNom.js";const S=l.createContext(null);function T({children:t,initialUser:r}){const[a,s]=l.useState(r||{});return e.jsx(S.Provider,{value:{newUser:a,setNewUser:s},children:t})}function p(){const t=l.useContext(S);if(t===null)throw new Error("useActivationContext must be used within an ActivationProvider");return t}function L(){const{setSurveyStep:t}=d(),{setNewUser:r,newUser:a}=p();function s({fullName:n,getUpdates:o,email:u}){r(c=>({...c,...u?{email:u}:{email:null},full_name:n,email_opted_in:o})),t(c=>c+1)}return e.jsx(A,{email:a.email,fullName:a.full_name,submitHandler:s})}async function z({userId:t,body:r}){const a=C(N.users.activate(t)),s=await F(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!s.ok){const n=await s.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>"Failed to update activate user");throw new E({status:s.status,statusText:s.statusText,message:n})}return s.json()}function J(t){return M({mutationFn:async r=>z(r),...t})}function O({userId:t,setUsername:r}){const{newUser:a}=p(),{setAuthState:s}=k(),{setSurveyStep:n}=d(),{mutate:o}=D({onSuccess:()=>{s("true"),n(i=>i+1)}}),{toast:u}=H(),{mutate:c}=J({onSuccess:async i=>{r(i.name),o({username:i.name,password:a.password??void 0})},onError:i=>{i instanceof Error&&u({status:"error",emphasis:"subtle",icon:e.jsx(I,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:i.message,rounded:!0})}});function m({other:i,providers:f,otherVal:x}){const v={infra_providers:i?[...f,x]:f,finished_onboarding_survey:!0};c({userId:t,body:{...a,user_metadata:{...a.user_metadata,...v}}})}return e.jsx(U,{submitHandler:m})}function W(){const{setSurveyStep:t}=d(),{setNewUser:r}=p();function a({newPassword:s}){r(n=>({...n,password:s})),t(n=>n+1)}return e.jsx(R,{submitHandler:a})}function Y(){const{setSurveyStep:t}=d(),{setNewUser:r}=p();function a({primaryUse:s}){const n={primary_use:s};r(o=>({...o,user_metadata:{...o.user_metadata,...n}})),t(o=>o+1)}return e.jsx(b,{submitHandler:a})}function Z(){const{setSurveyStep:t}=d(),{setNewUser:r}=p();function a({usageReason:s,comparison_tools:n,otherTool:o,otherToolVal:u}){const c={usage_reason:s,...!!n&&{comparing_tools:o&&u?[...n,u]:n}};r(m=>({...m,user_metadata:{...m.user_metadata,...c}})),t(m=>m+1)}return e.jsx(P,{submitHandler:a})}function q(){const{surveyStep:t}=d(),[r]=_(),[a,s]=l.useState(""),n=r.get("user"),o=r.get("token");return!n||!o?e.jsx(w,{children:e.jsx("p",{children:"Invalid activation link."})}):e.jsx(e.Fragment,{children:e.jsxs(T,{initialUser:{activation_token:o},children:[e.jsx(h,{stepAmount:6}),t===1&&e.jsx(L,{}),t===2&&e.jsx(W,{}),t===3&&e.jsx(Y,{}),t===4&&e.jsx(Z,{}),t===5&&e.jsx(O,{setUsername:s,userId:n}),t===6&&e.jsx(g,{}),t===7&&e.jsx(j,{subHeader:"Your created your ZenML account",username:a})]})})}function pt(){return e.jsx("div",{children:e.jsx(y,{children:e.jsx(q,{})})})}export{pt as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{j as e,r as j}from"./@radix-C7hRs6Kx.js";import{W as f,E as g,z as o,M as b,r as c,T as y,G as N,H as v,J as P,K as p,L as u,h as R,N as S,S as x,n as T}from"./index-
|
1
|
+
import{j as e,r as j}from"./@radix-C7hRs6Kx.js";import{W as f,E as g,z as o,M as b,r as c,T as y,G as N,H as v,J as P,K as p,L as u,h as R,N as S,S as x,n as T}from"./index-hsSXyS3H.js";import{d as k,L as l,b as h}from"./@react-router-BGgzhn5D.js";import{S as C}from"./refresh-CM5T3QeU.js";import{u as _}from"./all-pipeline-runs-query-D9XfZpmV.js";import{S as E,P as w}from"./SearchField-DHl5flXv.js";import{D}from"./DisplayDate-CYVBBSgr.js";import{g as F,E as A}from"./ExecutionStatus-HnZXi9bW.js";import{I as B}from"./InlineAvatar-CrAwe7Pl.js";import{a as I,b as z,u as L,c as G,R as H}from"./RunSelector-DoL_gMHJ.js";import"./@tanstack-CSxjHCME.js";import"./@reactflow-CQi1Z1Wq.js";import"./chevron-right-double-uNWbJT-C.js";import"./index-DR30v9MZ.js";import"./check-circle-mvyzYvIW.js";import"./trash-BWSZ7NRK.js";import"./DeleteAlertDialog-Bp0o-UXZ.js";import"./zod-C0xYeTvL.js";import"./index.esm-D7jFlf5N.js";import"./AlertDialogDropdownItem-C_qWs-4u.js";import"./delete-run-B5xUZwdP.js";function U({namespace:s}){return e.jsx(f,{children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(g,{className:"h-5 w-5 fill-neutral-400"}),e.jsx("h1",{className:"text-display-xs font-semibold",children:decodeURIComponent(s)})]})})}const d=1,q=o.object({page:o.coerce.number().min(d).optional().default(d).catch(d),name:o.string().optional(),operator:o.enum(["and","or"]).optional()});function J(){const[s]=k(),{page:a,name:t,operator:r}=q.parse({page:s.get("page")||void 0,name:s.get("name")||void 0});return{page:a,name:t,logical_operator:r}}function K(){return[{id:"check",header:"",meta:{width:"1%"},accessorFn:s=>({id:s.id}),cell:({getValue:s})=>{const{id:a}=s();return e.jsx(I,{id:a})}},{id:"run",header:"Run",accessorFn:s=>{var a;return{name:s.name,id:s.id,status:(a=s.body)==null?void 0:a.status}},cell:({getValue:s})=>{const{name:a,status:t,id:r}=s();return e.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[e.jsx(b,{className:`h-5 w-5 shrink-0 ${F(t)}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(l,{to:c.runs.detail(r),className:"flex items-center gap-1",children:e.jsx("h2",{className:"text-text-md font-semibold",children:a})}),e.jsx(y,{children:e.jsxs(N,{children:[e.jsx(v,{className:"hover:text-theme-text-brand hover:underline",children:e.jsx(A,{status:t})}),e.jsx(P,{className:"z-20 capitalize",children:t})]})}),e.jsx(p,{copyText:a})]}),e.jsxs(l,{to:c.runs.detail(r),className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-text-xs text-theme-text-secondary",children:r.split("-")[0]}),e.jsx(p,{copyText:r})]})]})]})}},{id:"stack",header:"Stack",accessorFn:s=>{var a,t,r,n;return{name:(t=(a=s.body)==null?void 0:a.stack)==null?void 0:t.name,id:(n=(r=s.body)==null?void 0:r.stack)==null?void 0:n.id}},cell:({getValue:s})=>{const{name:a,id:t}=s();return!a||!t?null:e.jsx(l,{to:c.stacks.overview,children:e.jsx(u,{rounded:!1,className:"inline-block",color:"turquoise",emphasis:"subtle",children:a})})}},{id:"repository",header:"Repository",accessorFn:s=>{var a,t,r,n,i,m;return{name:(r=(t=(a=s.body)==null?void 0:a.code_reference)==null?void 0:t.body)==null?void 0:r.code_repository.name,id:(m=(i=(n=s.body)==null?void 0:n.code_reference)==null?void 0:i.body)==null?void 0:m.code_repository.id}},cell:({getValue:s})=>{const{name:a,id:t}=s();return!a||!t?null:e.jsx("div",{children:e.jsx(u,{rounded:!1,className:"inline-block",color:"grey",emphasis:"subtle",children:a})})}},{id:"created",header:"Created at",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(D,{dateString:s()})})},{id:"author",header:"Author",accessorFn:s=>{var a;return{author:(a=s.body)==null?void 0:a.user}},cell:({getValue:s})=>{const{author:a}=s();return e.jsx(B,{username:a.name})}},{id:"admin_actions",header:"",meta:{width:"5%"},cell:({row:s})=>e.jsx(z,{id:s.original.id})}]}function M(){const{namespace:s}=h(),a=J(),t=K(),{selectedRuns:r}=L(),{data:n,refetch:i}=_({params:{pipeline_name:decodeURIComponent(s),...a,sort_by:"desc:updated"}},{throwOnError:!0});return e.jsxs("div",{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[r.length?e.jsx(G,{}):e.jsx(E,{searchParams:a}),e.jsxs(R,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>i(),children:[e.jsx(C,{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:n?e.jsx(S,{columns:t,data:n.items}):e.jsx(x,{className:"h-[500px] w-full"})}),n?n.total_pages>1&&e.jsx(w,{searchParams:a,paginate:n}):e.jsx(x,{className:"h-[36px] w-[300px]"})]})]})}function ue(){const{namespace:s}=h(),{setCurrentBreadcrumbData:a}=T();return j.useEffect(()=>{s&&a({segment:"pipeline_detail",data:{name:s}})},[s]),e.jsx("div",{children:e.jsxs(H,{children:[e.jsx(U,{namespace:s}),e.jsx(M,{})]})})}export{ue as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as o,j as e}from"./@radix-C7hRs6Kx.js";import{o as j,p as C,q as M,j as y,s as T,F as b,ak as F,al as E,h,am as P,an as U,ao as k,ap as O,f as v,I,aq as R,ar as _,as as q,at as H,i as D,z as m,au as z,av as Z,aw as B,ax as K,ay as Q,D as V,w as L,x as G,y as J,az as $,U as w,l as W,S as f,N as X,B as Y}from"./index-
|
1
|
+
import{r as o,j as e}from"./@radix-C7hRs6Kx.js";import{o as j,p as C,q as M,j as y,s as T,F as b,ak as F,al as E,h,am as P,an as U,ao as k,ap as O,f as v,I,aq as R,ar as _,as as q,at as H,i as D,z as m,au as z,av as Z,aw as B,ax as K,ay as Q,D as V,w as L,x as G,y as J,az as $,U as w,l as W,S as f,N as X,B as Y}from"./index-hsSXyS3H.js";import{S as ee,P as se}from"./SearchField-DHl5flXv.js";import{a as te,b as N,c as A}from"./@tanstack-CSxjHCME.js";import{C as ae}from"./CodeSnippet-nRnOvbOJ.js";import{u as re}from"./index.esm-D7jFlf5N.js";import{D as ne}from"./DisplayDate-CYVBBSgr.js";import{I as ie}from"./InlineAvatar-CrAwe7Pl.js";import{A as oe}from"./AlertDialogDropdownItem-C_qWs-4u.js";import{d as le}from"./@react-router-BGgzhn5D.js";import"./@reactflow-CQi1Z1Wq.js";import"./chevron-right-double-uNWbJT-C.js";import"./index-DR30v9MZ.js";function ce({params:a}){return["users",a]}async function de({params:a}){const s=j(C.users.all+"?"+M(a)),t=await y(s,{method:"GET",headers:{"Content-Type":"application/json"}});if(t.status===404&&T(),!t.ok)throw new b({message:"Error while fetching users",status:t.status,statusText:t.statusText});return t.json()}function ue(a,s){return te({queryKey:ce(a),queryFn:()=>de(a),...s})}const me=a=>o.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...a},o.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 he(a){const s=j(C.users.all),t=await y(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!t.ok){const r=await t.json().then(n=>n.detail).catch(()=>"Failed to create User");throw new b({status:t.status,statusText:t.statusText,message:r})}return t.json()}function xe(a){return N({mutationFn:async s=>he(s),...a})}function pe(){const[a,s]=o.useState(!1),[t,r]=o.useState(null);return e.jsxs(F,{open:a,onOpenChange:n=>{s(n),r(null)},children:[e.jsx(E,{asChild:!0,children:e.jsx(h,{className:"shrink-0",intent:"primary",children:"Add Member"})}),e.jsxs(P,{className:"",children:[e.jsx(U,{children:e.jsx(k,{children:" Add a New Member"})}),t?e.jsx(ge,{name:t.name,token:O(t)}):e.jsx(fe,{setSuccessMember:r})]})]})}m.object({username:m.string(),isAdmin:m.boolean()});function fe({setSuccessMember:a}){const{toast:s}=v(),t=A(),{mutate:r,isPending:n}=xe({onError(d){H(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){a(d),t.invalidateQueries({queryKey:["users"]})}}),c=o.useId(),l=o.useId(),{register:i,handleSubmit:x,watch:p,setValue:u}=re();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(I,{...i("username"),id:c,className:"w-full"})]}),e.jsxs("div",{className:"flex gap-5",children:[e.jsx("label",{htmlFor:l,className:"text-text-md",children:"Add user as an Admin"}),e.jsx(R,{onCheckedChange:d=>u("isAdmin",!!d),...i("isAdmin",{value:!1}),id:l})]})]})}),e.jsxs(_,{className:"gap-[10px]",children:[e.jsx(q,{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 ge({token:a,name:s}){return e.jsxs("div",{className:"space-y-5 overflow-hidden p-7 text-center",children:[e.jsx(me,{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(ae,{className:"mx-auto",code:a})]})}const je=a=>o.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...a},o.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 Ce(a){const s=j(C.users.detail(a)),t=await y(s,{method:"DELETE",headers:{"Content-Type":"application/json"}});if(!t.ok){const r=await t.json().then(n=>n.detail).catch(()=>"Failed to delete User");throw new b({status:t.status,statusText:t.statusText,message:r})}return t.json()}function ye(a){return N({mutationFn:async s=>Ce(s),...a})}function be({userId:a,name:s}){const{toast:t}=v(),r=A(),{isPending:n,mutate:c}=ye({onSuccess(){r.invalidateQueries({queryKey:["users"]})},onError:i=>{i instanceof Error&&t({status:"error",emphasis:"subtle",icon:e.jsx(D,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:i.message,rounded:!0})}});function l(){c(a)}return e.jsxs(z,{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(K,{asChild:!0,children:e.jsx(h,{intent:"secondary",children:"Cancel"})}),e.jsx(Q,{asChild:!0,children:e.jsx(h,{onClick:l,disabled:n,intent:"danger",children:"Delete"})})]})]})}function we({userId:a,name:s}){const[t,r]=o.useState(!1),[n,c]=o.useState(!1),l=o.useRef(null),i=o.useRef(null);function x(){i.current=l.current}function p(u){if(u===!1){c(!1),setTimeout(()=>{r(u)},200);return}r(u)}return e.jsxs(V,{onOpenChange:c,open:n,children:[e.jsx(L,{ref:l,children:e.jsx(G,{className:"h-4 w-4 fill-theme-text-tertiary"})}),e.jsx(J,{hidden:t,onCloseAutoFocus:u=>{i.current&&(i.current.focus(),i.current=null,u.preventDefault())},align:"end",sideOffset:7,children:e.jsx(oe,{onSelect:x,onOpenChange:p,triggerChildren:"Remove Member",icon:e.jsx(je,{fill:"red"}),children:e.jsx(be,{name:s,userId:a})})})]})}function ve({isAdmin:a}){return[{id:"name",accessorFn:s=>{var t;return{name:s.name,is_admin:!!((t=s.body)!=null&&t.is_admin)}},cell:({getValue:s})=>{const{name:t,is_admin:r}=s();return e.jsxs("div",{className:"flex",children:[e.jsx(ie,{username:t}),r&&e.jsx("div",{children:e.jsx(w,{className:"ml-2 capitalize",size:"xs",color:"purple",children:"Admin"})})]})},header:"User"},{accessorKey:"status",header:"Status",accessorFn:s=>{var t;return{status:(t=s.body)==null?void 0:t.active}},cell:({getValue:s})=>{const{status:t}=s();return e.jsx(w,{className:"capitalize",color:t?"green":"grey",children:t?"Active":"Inactive"})}},{id:"created",header:"Created",accessorFn:s=>{var t;return(t=s.body)==null?void 0:t.created},cell:({getValue:s})=>e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.jsx(ne,{dateString:s()})})},...a?[{id:"actions",header:"",accessorFn:s=>({id:s.id,name:$(s)}),meta:{width:"5%"},cell:({getValue:s})=>{const{id:t,name:r}=s();return e.jsx(we,{name:r,userId:t})}}]:[]]}const g=1,De=m.object({page:m.coerce.number().min(g).optional().default(g).catch(g),name:m.string().optional(),operator:m.enum(["and","or"]).optional()});function Ne(){const[a]=le(),{page:s,name:t,operator:r}=De.parse({page:a.get("page")||void 0,name:a.get("name")||void 0,operator:a.get("operator")||void 0});return{page:s,name:t,logical_operator:r}}function Ae(){var l,i;const a=Ne(),{data:s,isError:t}=ue({params:{...a,sort_by:"desc:created"}},{throwOnError:!0}),{data:r,isPending:n,isError:c}=W();return t||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(ee,{searchParams:a}),((l=r.body)==null?void 0:l.is_admin)&&e.jsx(pe,{})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:s?e.jsx(X,{columns:ve({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(se,{searchParams:a,paginate:s}):e.jsx(f,{className:"h-[36px] w-[300px]"})]})]})}function He(){return e.jsxs(Y,{className:"flex flex-col gap-4 p-5",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Members"}),e.jsx(Ae,{})]})}export{He as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as o,j as e}from"./@radix-C7hRs6Kx.js";import{S as N}from"./file-text-BdxZdjP_.js";import{h as p,M as b,X as y,bf as j,c as h,S as d,ai as g,bg as w,U as S,l as k,az as L,m as v,a8 as z,aH as M,aa as C,ab as R,B as _,bc as f,r as E,aS as D}from"./index-Be2jLIYM.js";import{S as I}from"./package-D1Mhqeh8.js";import{S as H}from"./help-DyMolRxD.js";import{S as P}from"./plus-COjQg3AG.js";import{C as l}from"./CodeSnippet-CSINAl3I.js";import{H as u}from"./Helpbox-CeM-FPQl.js";import{S as V}from"./chevron-down-A-rmltmI.js";import{T as Z}from"./Tick-D63_jhf1.js";import{S as O}from"./chevron-right-double-uNWbJT-C.js";import{g as B}from"./login-command-CkqxPtV3.js";import{L as T}from"./@react-router-BGgzhn5D.js";import"./@tanstack-CSxjHCME.js";import"./@reactflow-CQi1Z1Wq.js";import"./check-DK77doTf.js";const A=s=>o.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...s},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.75873 3H17.2413C18.0463 2.99999 18.7107 2.99998 19.2519 3.04419C19.8139 3.09012 20.3307 3.18868 20.816 3.43597C21.5686 3.81947 22.1806 4.43139 22.5641 5.18404C22.8027 5.65238 22.9028 6.14994 22.9508 6.68931C23.0043 6.8527 23.0136 7.02505 22.9819 7.18959C23 7.63971 23 8.16035 23 8.75868V15.2413C23 16.0463 23 16.7106 22.9558 17.2518C22.9099 17.8139 22.8113 18.3306 22.5641 18.816C22.1806 19.5686 21.5686 20.1805 20.816 20.564C20.3307 20.8113 19.8139 20.9099 19.2519 20.9558C18.7107 21 18.0463 21 17.2413 21H6.7587C5.95374 21 5.28939 21 4.7482 20.9558C4.1861 20.9099 3.6694 20.8113 3.18406 20.564C2.43141 20.1805 1.81949 19.5686 1.436 18.816C1.18871 18.3306 1.09014 17.8139 1.04422 17.2518C1 16.7106 1.00001 16.0463 1.00002 15.2413V8.7587C1.00001 8.16037 1.00001 7.63972 1.01816 7.1896C0.986405 7.02505 0.995778 6.85269 1.04924 6.6893C1.09723 6.14993 1.19737 5.65238 1.436 5.18404C1.81949 4.43139 2.43141 3.81947 3.18406 3.43597C3.6694 3.18868 4.1861 3.09012 4.7482 3.04419C5.28939 2.99998 5.95376 2.99999 6.75873 3ZM3.00002 8.92066V15.2C3.00002 16.0566 3.0008 16.6389 3.03758 17.089C3.0734 17.5274 3.13832 17.7516 3.21801 17.908C3.40976 18.2843 3.71572 18.5903 4.09204 18.782C4.24844 18.8617 4.47265 18.9266 4.91106 18.9624C5.36115 18.9992 5.94345 19 6.80002 19H17.2C18.0566 19 18.6389 18.9992 19.089 18.9624C19.5274 18.9266 19.7516 18.8617 19.908 18.782C20.2843 18.5903 20.5903 18.2843 20.782 17.908C20.8617 17.7516 20.9267 17.5274 20.9625 17.089C20.9992 16.6389 21 16.0566 21 15.2V8.92066L14.4086 13.5347C14.3698 13.5618 14.3313 13.5888 14.2932 13.6156C13.7486 13.998 13.2703 14.3338 12.7256 14.4696C12.2492 14.5884 11.7509 14.5884 11.2744 14.4696C10.7297 14.3338 10.2515 13.998 9.70683 13.6156C9.66872 13.5888 9.63029 13.5618 9.59148 13.5347L3.00002 8.92066ZM20.9173 6.53728L13.2616 11.8962C12.5327 12.4065 12.3783 12.495 12.2419 12.529C12.0831 12.5686 11.917 12.5686 11.7582 12.529C11.6218 12.495 11.4673 12.4065 10.7384 11.8962L3.08279 6.53728C3.11852 6.33012 3.165 6.19607 3.21801 6.09202C3.40976 5.7157 3.71572 5.40973 4.09204 5.21799C4.24844 5.1383 4.47265 5.07337 4.91106 5.03755C5.36115 5.00078 5.94345 5 6.80002 5H17.2C18.0566 5 18.6389 5.00078 19.089 5.03755C19.5274 5.07337 19.7516 5.1383 19.908 5.21799C20.2843 5.40973 20.5903 5.7157 20.782 6.09202C20.8351 6.19607 20.8815 6.33012 20.9173 6.53728Z"})),q=s=>o.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...s},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.75873 1H14.2413C15.0463 0.999988 15.7107 0.999977 16.2519 1.04419C16.814 1.09012 17.3307 1.18868 17.816 1.43597C18.5686 1.81947 19.1806 2.43139 19.5641 3.18404C19.8113 3.66937 19.9099 4.18608 19.9558 4.74817C20.0001 5.28936 20 5.95372 20 6.75868V10.0176C20.0673 10.0212 20.1323 10.0254 20.1951 10.0306C20.5904 10.0629 20.9836 10.1342 21.362 10.327C21.9265 10.6146 22.3854 11.0735 22.673 11.638C22.8658 12.0164 22.9372 12.4096 22.9695 12.805C23.0001 13.1795 23 13.6343 23 14.1614V16.9463C23 17.3849 23.0001 17.7634 22.9787 18.0767C22.9562 18.4065 22.9067 18.7364 22.7717 19.0623C22.4672 19.7974 21.8832 20.3814 21.1481 20.6859C20.8222 20.8209 20.4922 20.8704 20.1624 20.8929C20.1101 20.8965 20.056 20.8995 20 20.902V22C20 22.3723 19.7932 22.7138 19.4633 22.8862C19.1333 23.0587 18.7349 23.0336 18.4292 22.8211L16.2528 21.3079C15.9176 21.0749 15.8497 21.0324 15.7857 21.0034C15.7118 20.9699 15.6341 20.9455 15.5544 20.9308C15.4852 20.9181 15.4052 20.9143 14.9969 20.9143H13.1615C12.6343 20.9143 12.1796 20.9143 11.805 20.8837C11.4097 20.8514 11.0164 20.7801 10.6381 20.5873C10.0736 20.2997 9.61463 19.8407 9.32701 19.2763C9.13422 18.8979 9.0629 18.5047 9.0306 18.1093C9.01405 17.9068 9.00646 17.6808 9.00297 17.4326L7.61004 18.843C7.41849 19.037 7.23062 19.2272 7.06596 19.3669C6.91972 19.4909 6.61021 19.7413 6.17978 19.7771C5.69995 19.8169 5.23016 19.624 4.9168 19.2585C4.63567 18.9306 4.59142 18.5349 4.57452 18.3439C4.5555 18.1289 4.55554 17.8615 4.55558 17.5889L4.55559 16.0111C4.53636 15.9951 4.49179 15.9682 4.4203 15.9578C2.67169 15.7016 1.2984 14.3283 1.04226 12.5797C0.999782 12.2897 0.999881 11.9625 1.00001 11.5208C1.00002 11.4958 1.00003 11.4703 1.00003 11.4444L1.00003 6.7587C1.00002 5.95373 1.00001 5.28937 1.04422 4.74818C1.09015 4.18608 1.18871 3.66937 1.436 3.18404C1.8195 2.43139 2.43142 1.81947 3.18407 1.43597C3.6694 1.18868 4.18611 1.09012 4.7482 1.04419C5.2894 0.999977 5.95376 0.999988 6.75873 1ZM11 14.9994C11 14.9998 11 15.0003 11 15.0007V16.7143C11 17.2908 11.0008 17.6631 11.024 17.9465C11.0462 18.2181 11.0838 18.3188 11.109 18.3683C11.2049 18.5564 11.3579 18.7094 11.546 18.8053C11.5955 18.8305 11.6962 18.8682 11.9679 18.8904C12.2512 18.9135 12.6235 18.9143 13.2 18.9143H14.9969C15.0181 18.9143 15.0391 18.9143 15.06 18.9143C15.3707 18.914 15.6448 18.9138 15.9169 18.964C16.1561 19.0081 16.3892 19.0811 16.6108 19.1815C16.8628 19.2956 17.0878 19.4523 17.3428 19.6298C17.3598 19.6417 17.3771 19.6537 17.3945 19.6658L18 20.0868V19.9143C18 19.362 18.4477 18.9143 19 18.9143C19.4797 18.9143 19.7893 18.9137 20.0263 18.8976C20.2543 18.882 20.3411 18.8554 20.3827 18.8382C20.6277 18.7367 20.8224 18.542 20.9239 18.297C20.9411 18.2554 20.9678 18.1685 20.9833 17.9405C20.9995 17.7035 21 17.3939 21 16.9143V14.2C21 13.6234 20.9993 13.2512 20.9761 12.9678C20.9539 12.6962 20.9162 12.5955 20.891 12.546C20.7952 12.3578 20.6422 12.2049 20.454 12.109C20.4046 12.0838 20.3039 12.0461 20.0322 12.0239C19.7489 12.0008 19.3766 12 18.8 12H13.2C12.6235 12 12.2512 12.0008 11.9679 12.0239C11.6962 12.0461 11.5955 12.0838 11.546 12.109C11.3579 12.2049 11.2049 12.3578 11.109 12.546C11.0838 12.5955 11.0462 12.6962 11.024 12.9678C11.0008 13.2512 11 13.6234 11 14.2V14.9994ZM9.00003 14.5894L6.55559 17.0644V15.9916C6.55559 14.8142 5.59832 14.109 4.71017 13.9789C3.83586 13.8508 3.14921 13.1642 3.02115 12.2899C3.00269 12.1639 3.00003 11.9959 3.00003 11.4444V6.8C3.00003 5.94342 3.00081 5.36113 3.03758 4.91104C3.0734 4.47262 3.13833 4.24842 3.21802 4.09202C3.40976 3.7157 3.71572 3.40973 4.09205 3.21799C4.24845 3.1383 4.47265 3.07337 4.91107 3.03755C5.36116 3.00078 5.94345 3 6.80003 3H14.2C15.0566 3 15.6389 3.00078 16.089 3.03755C16.5274 3.07337 16.7516 3.1383 16.908 3.21799C17.2843 3.40973 17.5903 3.7157 17.782 4.09202C17.8617 4.24842 17.9267 4.47262 17.9625 4.91104C17.9993 5.36113 18 5.94342 18 6.8V10L13.1615 10C12.6343 9.99998 12.1796 9.99997 11.805 10.0306C11.4097 10.0629 11.0164 10.1342 10.6381 10.327C10.0736 10.6146 9.61463 11.0735 9.32701 11.638C9.13422 12.0164 9.0629 12.4096 9.0306 12.805C9 13.1795 9.00001 13.6343 9.00003 14.1615L9.00003 14.5894Z"}));function U(){const s=[{text:"Send us a message",href:"mailto:cloud@zenml.io",icon:e.jsx(A,{className:"h-5 w-5 fill-neutral-500"})},{text:"Join our Slack Community",href:"https://zenml.io/slack",icon:e.jsx(q,{className:"h-5 w-5 fill-neutral-500"})}];return e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-lg font-semibold",children:"Support"}),e.jsx("ul",{className:"space-y-1",children:s.map((t,n)=>e.jsx("li",{children:e.jsx(p,{size:"md",className:"w-fit px-2 text-theme-text-secondary",intent:"secondary",emphasis:"minimal",asChild:!0,children:e.jsxs("a",{target:"_blank",rel:"noopener noreferrer",className:"flex gap-1",href:t.href,children:[t.icon,e.jsx("div",{children:t.text})]})})},n))})]})}function F(){const s=[{text:"Browse our docs",href:"https://docs.zenml.io",icon:e.jsx(N,{className:"h-5 w-5 fill-neutral-500"})},{text:"Discover projects",href:"https://github.com/zenml-io/zenml-projects",icon:e.jsx(I,{className:"h-5 w-5 fill-neutral-500"})},{text:"Navigate our examples",href:"https://github.com/zenml-io/zenml/tree/main/examples/",icon:e.jsx(b,{className:"h-5 w-5 fill-neutral-500"})},{text:"Read our blog",href:"https://zenml.io/blog",icon:e.jsx(y,{className:"h-5 w-5 fill-neutral-500"})}];return e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"mb-0.5 text-text-lg font-semibold",children:"Resources"}),e.jsx("ul",{className:"space-y-1",children:s.map((t,n)=>e.jsx("li",{children:e.jsx(p,{size:"md",className:"w-fit px-2 text-theme-text-secondary",intent:"secondary",emphasis:"minimal",asChild:!0,children:e.jsxs("a",{rel:"noopener noreferrer",target:"_blank",className:"flex gap-1",href:t.href,children:[t.icon,e.jsx("div",{children:t.text})]})})},n))})]})}function $(){const s=j(),t=h();if(s.isPending||t.isPending)return e.jsx(d,{className:"h-[32px] w-[150px]"});if(s.isError||t.isError)return null;const n=g(t.data.deployment_type||"other"),r=w(s.data,n),a=r.itemsDone,i=r.totalItems;return e.jsxs(S,{rounded:!1,color:"light-purple",className:"text-text-sm font-semibold",children:[a,"/",i," steps completed"]})}function J(){return e.jsxs("div",{className:"space-between flex flex-col flex-wrap items-center gap-1 space-x-5 overflow-x-hidden lg:flex-row",children:[e.jsxs("div",{className:"flex-1 space-y-1 overflow-x-hidden",children:[e.jsxs("h2",{className:"truncate text-display-xs font-semibold",children:["Welcome to ZenML",e.jsx(K,{})]}),e.jsx("p",{className:"truncate text-display-xs text-theme-text-secondary",children:"You can start by following your quick setup."})]}),e.jsx($,{})]})}function K(){const s=k();if(s.isError)return null;if(s.isPending)return e.jsx(d,{className:"h-6 w-[70px]"});const t=L(s.data);return e.jsx(e.Fragment,{children:t?`, ${t}`:""})}function W({className:s,...t}){return e.jsx("div",{className:v("flex h-[28px] w-[28px] shrink-0 items-center justify-center rounded-rounded border-2 border-warning-300 bg-warning-50",s),...t,children:e.jsx(O,{className:"h-3 w-3 fill-warning-300"})})}function m({completed:s,title:t,children:n,hasDownstream:r,active:a=!1}){const[i,c]=o.useState(a);return o.useEffect(()=>{c(a)},[a]),e.jsxs(z,{disabled:!(r||a||s),open:i,onOpenChange:c,children:[e.jsx("div",{className:"flex w-full flex-col gap-3 bg-theme-surface-primary px-5 py-3",children:e.jsxs("div",{className:"flex w-full justify-between gap-2",children:[s?e.jsx(Z,{className:"shrink-0"}):r?e.jsx(W,{}):e.jsx(M,{className:"shrink-0"}),e.jsx(C,{className:"w-full",children:e.jsx(X,{active:a,skipped:r,title:t,completed:s})}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(C,{children:e.jsx(V,{className:` ${i?"":"-rotate-90"} h-5 w-5 shrink-0 rounded-md fill-neutral-500`})})})]})}),n&&e.jsx(R,{className:"border-t border-theme-border-moderate",children:e.jsxs("div",{className:"flex w-full items-center gap-2 bg-theme-surface-primary p-5",children:[e.jsx("div",{className:"w-[28px] shrink-0"}),e.jsx("div",{className:"w-full min-w-0 flex-1",children:n})]})})]})}function X({completed:s,title:t,skipped:n,active:r}){return e.jsx("div",{className:"flex w-full items-center justify-between gap-2",children:e.jsx("div",{className:"flex w-full items-center",children:e.jsx("div",{className:v("text-text-xl",{"text-theme-text-tertiary line-through decoration-theme-text-tertiary":s||n,"font-semibold":r,"text-theme-text-secondary":!r&&!s}),children:t})})})}function Y({completed:s,hasDownstreamStep:t,active:n}){const{data:r}=h({throwOnError:!0});return e.jsx(m,{active:n,hasDownstream:t,completed:s,title:"Install and log in to ZenML (5 min)",children:e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Install ZenML"}),e.jsx(l,{code:`pip install "zenml==${r?r.version:e.jsx(d,{className:"w-7"})}"`})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Log in to your ZenML Server"}),e.jsx(l,{code:B((r==null?void 0:r.deployment_type)||"other")})]}),e.jsx(u,{link:"https://docs.zenml.io/user-guides/production-guide/deploying-zenml#connecting-to-a-deployed-zenml"})]})})}function G({active:s,completed:t,hasDownstreamStep:n}){return e.jsx(m,{active:s,hasDownstream:n,completed:t,title:"Run a pipeline (2 min)",children:e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Download the quickstart example to your local machine"}),e.jsx(l,{code:"git clone --depth 1 https://github.com/zenml-io/zenml.git && cd zenml/examples/quickstart"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Initialize ZenML in the current directory"}),e.jsx(l,{code:"zenml init"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Install the remaining requirements apart from ZenML"}),e.jsx(l,{code:"pip install -r requirements.txt"})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:["Run the training pipeline.",e.jsx("br",{}),"Once it is running, your dashboard will show all the details of the associated run, models, and artifacts."]}),e.jsx(l,{code:"python run.py"})]}),e.jsxs(_,{className:"flex w-full flex-wrap items-center justify-between gap-y-1 p-2",children:[e.jsxs("div",{className:"flex items-center gap-[10px]",children:[e.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-sm bg-teal-25",children:e.jsx(H,{className:"h-5 w-5 fill-teal-400"})}),e.jsx("p",{children:"Do you need help?"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("a",{target:"_blank",rel:"noopener noreferrer",className:f({intent:"secondary",emphasis:"subtle",size:"md"}),href:"https://github.com/zenml-io/zenml/blob/main/examples/quickstart/README.md",children:"Open the Readme"}),e.jsx("a",{target:"_blank",rel:"noopener noreferrer",className:f({intent:"primary",emphasis:"subtle",size:"md"}),href:"https://docs.zenml.io/user-guides/starter-guide/create-an-ml-pipeline",children:"Browse our docs"})]})]})]})})}function Q({completed:s,active:t,hasDownstreamStep:n}){const r=E.stacks.create.index+"?"+new URLSearchParams({origin:"onboarding"}).toString();return e.jsxs(m,{hasDownstream:n,completed:s,title:"Connect to a remote stack (5 min)",active:t,children:[e.jsxs("p",{className:"mb-3",children:["A stack configures how a pipeline is executed"," ",e.jsx(se,{href:"https://docs.zenml.io/user-guides/production-guide/understand-stacks"})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Connect your Cloud to deploy your ZenML pipelines in a remote stack."}),e.jsx(p,{className:"w-fit",size:"md",asChild:!0,children:e.jsxs(T,{className:"flex",to:r,children:[e.jsx(P,{className:"h-5 w-5 shrink-0 fill-white"}),"Register a remote stack"]})})]}),e.jsx(u,{link:"https://docs.zenml.io/user-guides/production-guide/understand-stacks"})]})]})}function ee({active:s,completed:t,hasDownstreamStep:n}){return e.jsx(m,{hasDownstream:n,completed:t,title:"Run a pipeline in a remote stack (3 min)",active:s,children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Set the new stack"}),e.jsx(l,{wrap:!0,codeClasses:"whitespace-pre-wrap",code:"zenml stack set REMOTE_STACK"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Run the pipeline"}),e.jsx(l,{wrap:!0,codeClasses:"whitespace-pre-wrap",code:"python run.py"})]}),e.jsx("div",{children:e.jsx(u,{link:"https://docs.zenml.io/user-guides/production-guide/understand-stacks"})})]})})}function se({href:s}){return e.jsx("a",{href:s,rel:"noopener noreferrer",target:"_blank",className:"link text-text-sm font-semibold text-theme-text-brand",children:"Learn more"})}function te(){const s=j({refetchInterval:5e3}),t=h();if(s.isPending||t.isPending)return e.jsx(d,{className:"h-[200px] w-full"});if(s.isError||t.isError)return null;const n=g(t.data.deployment_type||"other"),{getItem:r}=w(s.data,n),a=r("device_verified"),i=r("pipeline_run"),c=r("stack_with_remote_orchestrator_created"),x=r("pipeline_run_with_remote_orchestrator");return e.jsxs("ul",{className:"space-y-5",children:[!n&&e.jsx("li",{children:e.jsx(Y,{active:a.isActive,completed:a.isCompleted,hasDownstreamStep:a.hasDownStreamStep})}),e.jsx("li",{children:e.jsx(G,{active:i.isActive,completed:i.isCompleted,hasDownstreamStep:i.hasDownStreamStep})}),e.jsx("li",{children:e.jsx(Q,{active:c.isActive,completed:c.isCompleted,hasDownstreamStep:c.hasDownStreamStep})}),e.jsx("li",{children:e.jsx(ee,{active:x.isActive,completed:x.isCompleted,hasDownstreamStep:x.hasDownStreamStep})})]})}function ge(){const{setTourState:s,tourState:{tourActive:t}}=D();return o.useEffect(()=>{t&&s(n=>({...n,run:!0,stepIndex:n.stepIndex}))},[t]),e.jsxs("div",{className:"layout-container grid grid-cols-4 gap-5 py-5",children:[e.jsxs("div",{className:"col-span-4 space-y-5 lg:col-span-3",children:[e.jsx(J,{}),e.jsx(te,{})]}),e.jsxs("div",{className:"col-span-4 space-y-5 lg:col-span-1",children:[e.jsx(U,{}),e.jsx(F,{})]})]})}export{ge as default};
|
1
|
+
import{r as c,j as e}from"./@radix-C7hRs6Kx.js";import{S as N}from"./file-text-BdxZdjP_.js";import{h as p,M as b,X as y,bf as j,c as h,S as d,ai as g,bg as w,U as S,l as k,az as L,m as v,a8 as z,aH as _,aa as C,ab as M,B as R,bc as f,r as E,aS as D}from"./index-hsSXyS3H.js";import{S as I}from"./package-D1Mhqeh8.js";import{S as H}from"./help-DyMolRxD.js";import{S as P}from"./plus-COjQg3AG.js";import{C as l}from"./CodeSnippet-nRnOvbOJ.js";import{H as u}from"./Helpbox-Dsr3ZYcL.js";import{S as V}from"./chevron-down-A-rmltmI.js";import{T as Z}from"./Tick-C4gtED35.js";import{S as O}from"./chevron-right-double-uNWbJT-C.js";import{g as B}from"./login-command-CkqxPtV3.js";import{L as T}from"./@react-router-BGgzhn5D.js";import"./@tanstack-CSxjHCME.js";import"./@reactflow-CQi1Z1Wq.js";import"./check-DK77doTf.js";const A=s=>c.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...s},c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.75873 3H17.2413C18.0463 2.99999 18.7107 2.99998 19.2519 3.04419C19.8139 3.09012 20.3307 3.18868 20.816 3.43597C21.5686 3.81947 22.1806 4.43139 22.5641 5.18404C22.8027 5.65238 22.9028 6.14994 22.9508 6.68931C23.0043 6.8527 23.0136 7.02505 22.9819 7.18959C23 7.63971 23 8.16035 23 8.75868V15.2413C23 16.0463 23 16.7106 22.9558 17.2518C22.9099 17.8139 22.8113 18.3306 22.5641 18.816C22.1806 19.5686 21.5686 20.1805 20.816 20.564C20.3307 20.8113 19.8139 20.9099 19.2519 20.9558C18.7107 21 18.0463 21 17.2413 21H6.7587C5.95374 21 5.28939 21 4.7482 20.9558C4.1861 20.9099 3.6694 20.8113 3.18406 20.564C2.43141 20.1805 1.81949 19.5686 1.436 18.816C1.18871 18.3306 1.09014 17.8139 1.04422 17.2518C1 16.7106 1.00001 16.0463 1.00002 15.2413V8.7587C1.00001 8.16037 1.00001 7.63972 1.01816 7.1896C0.986405 7.02505 0.995778 6.85269 1.04924 6.6893C1.09723 6.14993 1.19737 5.65238 1.436 5.18404C1.81949 4.43139 2.43141 3.81947 3.18406 3.43597C3.6694 3.18868 4.1861 3.09012 4.7482 3.04419C5.28939 2.99998 5.95376 2.99999 6.75873 3ZM3.00002 8.92066V15.2C3.00002 16.0566 3.0008 16.6389 3.03758 17.089C3.0734 17.5274 3.13832 17.7516 3.21801 17.908C3.40976 18.2843 3.71572 18.5903 4.09204 18.782C4.24844 18.8617 4.47265 18.9266 4.91106 18.9624C5.36115 18.9992 5.94345 19 6.80002 19H17.2C18.0566 19 18.6389 18.9992 19.089 18.9624C19.5274 18.9266 19.7516 18.8617 19.908 18.782C20.2843 18.5903 20.5903 18.2843 20.782 17.908C20.8617 17.7516 20.9267 17.5274 20.9625 17.089C20.9992 16.6389 21 16.0566 21 15.2V8.92066L14.4086 13.5347C14.3698 13.5618 14.3313 13.5888 14.2932 13.6156C13.7486 13.998 13.2703 14.3338 12.7256 14.4696C12.2492 14.5884 11.7509 14.5884 11.2744 14.4696C10.7297 14.3338 10.2515 13.998 9.70683 13.6156C9.66872 13.5888 9.63029 13.5618 9.59148 13.5347L3.00002 8.92066ZM20.9173 6.53728L13.2616 11.8962C12.5327 12.4065 12.3783 12.495 12.2419 12.529C12.0831 12.5686 11.917 12.5686 11.7582 12.529C11.6218 12.495 11.4673 12.4065 10.7384 11.8962L3.08279 6.53728C3.11852 6.33012 3.165 6.19607 3.21801 6.09202C3.40976 5.7157 3.71572 5.40973 4.09204 5.21799C4.24844 5.1383 4.47265 5.07337 4.91106 5.03755C5.36115 5.00078 5.94345 5 6.80002 5H17.2C18.0566 5 18.6389 5.00078 19.089 5.03755C19.5274 5.07337 19.7516 5.1383 19.908 5.21799C20.2843 5.40973 20.5903 5.7157 20.782 6.09202C20.8351 6.19607 20.8815 6.33012 20.9173 6.53728Z"})),q=s=>c.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...s},c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.75873 1H14.2413C15.0463 0.999988 15.7107 0.999977 16.2519 1.04419C16.814 1.09012 17.3307 1.18868 17.816 1.43597C18.5686 1.81947 19.1806 2.43139 19.5641 3.18404C19.8113 3.66937 19.9099 4.18608 19.9558 4.74817C20.0001 5.28936 20 5.95372 20 6.75868V10.0176C20.0673 10.0212 20.1323 10.0254 20.1951 10.0306C20.5904 10.0629 20.9836 10.1342 21.362 10.327C21.9265 10.6146 22.3854 11.0735 22.673 11.638C22.8658 12.0164 22.9372 12.4096 22.9695 12.805C23.0001 13.1795 23 13.6343 23 14.1614V16.9463C23 17.3849 23.0001 17.7634 22.9787 18.0767C22.9562 18.4065 22.9067 18.7364 22.7717 19.0623C22.4672 19.7974 21.8832 20.3814 21.1481 20.6859C20.8222 20.8209 20.4922 20.8704 20.1624 20.8929C20.1101 20.8965 20.056 20.8995 20 20.902V22C20 22.3723 19.7932 22.7138 19.4633 22.8862C19.1333 23.0587 18.7349 23.0336 18.4292 22.8211L16.2528 21.3079C15.9176 21.0749 15.8497 21.0324 15.7857 21.0034C15.7118 20.9699 15.6341 20.9455 15.5544 20.9308C15.4852 20.9181 15.4052 20.9143 14.9969 20.9143H13.1615C12.6343 20.9143 12.1796 20.9143 11.805 20.8837C11.4097 20.8514 11.0164 20.7801 10.6381 20.5873C10.0736 20.2997 9.61463 19.8407 9.32701 19.2763C9.13422 18.8979 9.0629 18.5047 9.0306 18.1093C9.01405 17.9068 9.00646 17.6808 9.00297 17.4326L7.61004 18.843C7.41849 19.037 7.23062 19.2272 7.06596 19.3669C6.91972 19.4909 6.61021 19.7413 6.17978 19.7771C5.69995 19.8169 5.23016 19.624 4.9168 19.2585C4.63567 18.9306 4.59142 18.5349 4.57452 18.3439C4.5555 18.1289 4.55554 17.8615 4.55558 17.5889L4.55559 16.0111C4.53636 15.9951 4.49179 15.9682 4.4203 15.9578C2.67169 15.7016 1.2984 14.3283 1.04226 12.5797C0.999782 12.2897 0.999881 11.9625 1.00001 11.5208C1.00002 11.4958 1.00003 11.4703 1.00003 11.4444L1.00003 6.7587C1.00002 5.95373 1.00001 5.28937 1.04422 4.74818C1.09015 4.18608 1.18871 3.66937 1.436 3.18404C1.8195 2.43139 2.43142 1.81947 3.18407 1.43597C3.6694 1.18868 4.18611 1.09012 4.7482 1.04419C5.2894 0.999977 5.95376 0.999988 6.75873 1ZM11 14.9994C11 14.9998 11 15.0003 11 15.0007V16.7143C11 17.2908 11.0008 17.6631 11.024 17.9465C11.0462 18.2181 11.0838 18.3188 11.109 18.3683C11.2049 18.5564 11.3579 18.7094 11.546 18.8053C11.5955 18.8305 11.6962 18.8682 11.9679 18.8904C12.2512 18.9135 12.6235 18.9143 13.2 18.9143H14.9969C15.0181 18.9143 15.0391 18.9143 15.06 18.9143C15.3707 18.914 15.6448 18.9138 15.9169 18.964C16.1561 19.0081 16.3892 19.0811 16.6108 19.1815C16.8628 19.2956 17.0878 19.4523 17.3428 19.6298C17.3598 19.6417 17.3771 19.6537 17.3945 19.6658L18 20.0868V19.9143C18 19.362 18.4477 18.9143 19 18.9143C19.4797 18.9143 19.7893 18.9137 20.0263 18.8976C20.2543 18.882 20.3411 18.8554 20.3827 18.8382C20.6277 18.7367 20.8224 18.542 20.9239 18.297C20.9411 18.2554 20.9678 18.1685 20.9833 17.9405C20.9995 17.7035 21 17.3939 21 16.9143V14.2C21 13.6234 20.9993 13.2512 20.9761 12.9678C20.9539 12.6962 20.9162 12.5955 20.891 12.546C20.7952 12.3578 20.6422 12.2049 20.454 12.109C20.4046 12.0838 20.3039 12.0461 20.0322 12.0239C19.7489 12.0008 19.3766 12 18.8 12H13.2C12.6235 12 12.2512 12.0008 11.9679 12.0239C11.6962 12.0461 11.5955 12.0838 11.546 12.109C11.3579 12.2049 11.2049 12.3578 11.109 12.546C11.0838 12.5955 11.0462 12.6962 11.024 12.9678C11.0008 13.2512 11 13.6234 11 14.2V14.9994ZM9.00003 14.5894L6.55559 17.0644V15.9916C6.55559 14.8142 5.59832 14.109 4.71017 13.9789C3.83586 13.8508 3.14921 13.1642 3.02115 12.2899C3.00269 12.1639 3.00003 11.9959 3.00003 11.4444V6.8C3.00003 5.94342 3.00081 5.36113 3.03758 4.91104C3.0734 4.47262 3.13833 4.24842 3.21802 4.09202C3.40976 3.7157 3.71572 3.40973 4.09205 3.21799C4.24845 3.1383 4.47265 3.07337 4.91107 3.03755C5.36116 3.00078 5.94345 3 6.80003 3H14.2C15.0566 3 15.6389 3.00078 16.089 3.03755C16.5274 3.07337 16.7516 3.1383 16.908 3.21799C17.2843 3.40973 17.5903 3.7157 17.782 4.09202C17.8617 4.24842 17.9267 4.47262 17.9625 4.91104C17.9993 5.36113 18 5.94342 18 6.8V10L13.1615 10C12.6343 9.99998 12.1796 9.99997 11.805 10.0306C11.4097 10.0629 11.0164 10.1342 10.6381 10.327C10.0736 10.6146 9.61463 11.0735 9.32701 11.638C9.13422 12.0164 9.0629 12.4096 9.0306 12.805C9 13.1795 9.00001 13.6343 9.00003 14.1615L9.00003 14.5894Z"}));function U(){const s=[{text:"Send us a message",href:"mailto:cloud@zenml.io",icon:e.jsx(A,{className:"h-5 w-5 fill-neutral-500"})},{text:"Join our Slack Community",href:"https://zenml.io/slack",icon:e.jsx(q,{className:"h-5 w-5 fill-neutral-500"})}];return e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-lg font-semibold",children:"Support"}),e.jsx("ul",{className:"space-y-1",children:s.map((t,n)=>e.jsx("li",{children:e.jsx(p,{size:"md",className:"w-fit px-2 text-theme-text-secondary",intent:"secondary",emphasis:"minimal",asChild:!0,children:e.jsxs("a",{target:"_blank",rel:"noopener noreferrer",className:"flex gap-1",href:t.href,children:[t.icon,e.jsx("div",{children:t.text})]})})},n))})]})}function F(){const s=[{text:"Browse our docs",href:"https://docs.zenml.io",icon:e.jsx(N,{className:"h-5 w-5 fill-neutral-500"})},{text:"Discover projects",href:"https://github.com/zenml-io/zenml-projects",icon:e.jsx(I,{className:"h-5 w-5 fill-neutral-500"})},{text:"Navigate our examples",href:"https://github.com/zenml-io/zenml/tree/main/examples/",icon:e.jsx(b,{className:"h-5 w-5 fill-neutral-500"})},{text:"Read our blog",href:"https://zenml.io/blog",icon:e.jsx(y,{className:"h-5 w-5 fill-neutral-500"})}];return e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"mb-0.5 text-text-lg font-semibold",children:"Resources"}),e.jsx("ul",{className:"space-y-1",children:s.map((t,n)=>e.jsx("li",{children:e.jsx(p,{size:"md",className:"w-fit px-2 text-theme-text-secondary",intent:"secondary",emphasis:"minimal",asChild:!0,children:e.jsxs("a",{rel:"noopener noreferrer",target:"_blank",className:"flex gap-1",href:t.href,children:[t.icon,e.jsx("div",{children:t.text})]})})},n))})]})}function $(){const s=j(),t=h();if(s.isPending||t.isPending)return e.jsx(d,{className:"h-[32px] w-[150px]"});if(s.isError||t.isError)return null;const n=g(t.data.deployment_type||"other"),r=w(s.data,n),a=r.itemsDone,i=r.totalItems;return e.jsxs(S,{rounded:!1,color:"light-purple",className:"text-text-sm font-semibold",children:[a,"/",i," steps completed"]})}function J(){return e.jsxs("div",{className:"space-between flex flex-col flex-wrap items-center gap-1 space-x-5 overflow-x-hidden lg:flex-row",children:[e.jsxs("div",{className:"flex-1 space-y-1 overflow-x-hidden",children:[e.jsxs("h2",{className:"truncate text-display-xs font-semibold",children:["Welcome to ZenML",e.jsx(K,{})]}),e.jsx("p",{className:"truncate text-display-xs text-theme-text-secondary",children:"You can start by following your quick setup."})]}),e.jsx($,{})]})}function K(){const s=k();if(s.isError)return null;if(s.isPending)return e.jsx(d,{className:"h-6 w-[70px]"});const t=L(s.data);return e.jsx(e.Fragment,{children:t?`, ${t}`:""})}function W({className:s,...t}){return e.jsx("div",{className:v("flex h-[28px] w-[28px] shrink-0 items-center justify-center rounded-rounded border-2 border-warning-300 bg-warning-50",s),...t,children:e.jsx(O,{className:"h-3 w-3 fill-warning-300"})})}function m({completed:s,title:t,children:n,hasDownstream:r,active:a=!1}){const[i,o]=c.useState(a);return c.useEffect(()=>{o(a)},[a]),e.jsxs(z,{disabled:!(r||a||s),open:i,onOpenChange:o,children:[e.jsx("div",{className:"flex w-full flex-col gap-3 bg-theme-surface-primary px-5 py-3",children:e.jsxs("div",{className:"flex w-full justify-between gap-2",children:[s?e.jsx(Z,{className:"shrink-0"}):r?e.jsx(W,{}):e.jsx(_,{className:"shrink-0"}),e.jsx(C,{className:"w-full",children:e.jsx(X,{active:a,skipped:r,title:t,completed:s})}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(C,{children:e.jsx(V,{className:` ${i?"":"-rotate-90"} h-5 w-5 shrink-0 rounded-md fill-neutral-500`})})})]})}),n&&e.jsx(M,{className:"border-t border-theme-border-moderate",children:e.jsxs("div",{className:"flex w-full items-center gap-2 bg-theme-surface-primary p-5",children:[e.jsx("div",{className:"w-[28px] shrink-0"}),e.jsx("div",{className:"w-full min-w-0 flex-1",children:n})]})})]})}function X({completed:s,title:t,skipped:n,active:r}){return e.jsx("div",{className:"flex w-full items-center justify-between gap-2",children:e.jsx("div",{className:"flex w-full items-center",children:e.jsx("div",{className:v("text-text-xl",{"text-theme-text-tertiary line-through decoration-theme-text-tertiary":s||n,"font-semibold":r,"text-theme-text-secondary":!r&&!s}),children:t})})})}function Y({completed:s,hasDownstreamStep:t,active:n}){const{data:r}=h({throwOnError:!0});return e.jsx(m,{active:n,hasDownstream:t,completed:s,title:"Install and log in to ZenML (5 min)",children:e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Install ZenML"}),e.jsx(l,{code:`pip install "zenml==${r?r.version:e.jsx(d,{className:"w-7"})}"`})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Log in to your ZenML Server"}),e.jsx(l,{code:B((r==null?void 0:r.deployment_type)||"other")})]}),e.jsx(u,{link:"https://docs.zenml.io/user-guides/production-guide/deploying-zenml#connecting-to-a-deployed-zenml"})]})})}function G({active:s,completed:t,hasDownstreamStep:n}){return e.jsx(m,{active:s,hasDownstream:n,completed:t,title:"Run a pipeline (2 min)",children:e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Download the quickstart example to your local machine"}),e.jsx(l,{code:"git clone --depth 1 https://github.com/zenml-io/zenml.git && cd zenml/examples/quickstart"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Initialize ZenML in the current directory"}),e.jsx(l,{code:"zenml init"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Install the remaining requirements apart from ZenML"}),e.jsx(l,{code:"pip install -r requirements.txt"})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:["Run the training pipeline.",e.jsx("br",{}),"Once it is running, your dashboard will show all the details of the associated run, models, and artifacts."]}),e.jsx(l,{code:"python run.py"})]}),e.jsxs(R,{className:"flex w-full flex-wrap items-center justify-between gap-y-1 p-2",children:[e.jsxs("div",{className:"flex items-center gap-[10px]",children:[e.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-sm bg-teal-25",children:e.jsx(H,{className:"h-5 w-5 fill-teal-400"})}),e.jsx("p",{children:"Do you need help?"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("a",{target:"_blank",rel:"noopener noreferrer",className:f({intent:"secondary",emphasis:"subtle",size:"md"}),href:"https://github.com/zenml-io/zenml/blob/main/examples/quickstart/README.md",children:"Open the Readme"}),e.jsx("a",{target:"_blank",rel:"noopener noreferrer",className:f({intent:"primary",emphasis:"subtle",size:"md"}),href:"https://docs.zenml.io/user-guides/starter-guide/create-an-ml-pipeline",children:"Browse our docs"})]})]})]})})}function Q({completed:s,active:t,hasDownstreamStep:n}){const r=E.stacks.create.index+"?"+new URLSearchParams({origin:"onboarding"}).toString();return e.jsxs(m,{hasDownstream:n,completed:s,title:"Connect to a remote stack (5 min)",active:t,children:[e.jsxs("p",{className:"mb-3",children:["A stack configures how a pipeline is executed"," ",e.jsx(se,{href:"https://docs.zenml.io/user-guides/production-guide/understand-stacks"})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Connect your Cloud to deploy your ZenML pipelines in a remote stack."}),e.jsx(p,{className:"w-fit",size:"md",asChild:!0,children:e.jsxs(T,{className:"flex",to:r,children:[e.jsx(P,{className:"h-5 w-5 shrink-0 fill-white"}),"Register a remote stack"]})})]}),e.jsx(u,{link:"https://docs.zenml.io/user-guides/production-guide/understand-stacks"})]})]})}function ee({active:s,completed:t,hasDownstreamStep:n}){return e.jsx(m,{hasDownstream:n,completed:t,title:"Run a pipeline in a remote stack (3 min)",active:s,children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Set the new stack"}),e.jsx(l,{wrap:!0,codeClasses:"whitespace-pre-wrap",code:"zenml stack set REMOTE_STACK"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Run the pipeline"}),e.jsx(l,{wrap:!0,codeClasses:"whitespace-pre-wrap",code:"python run.py"})]}),e.jsx("div",{children:e.jsx(u,{link:"https://docs.zenml.io/user-guides/production-guide/understand-stacks"})})]})})}function se({href:s}){return e.jsx("a",{href:s,rel:"noopener noreferrer",target:"_blank",className:"link text-text-sm font-semibold text-theme-text-brand",children:"Learn more"})}function te(){const s=j({refetchInterval:5e3}),t=h();if(s.isPending||t.isPending)return e.jsx(d,{className:"h-[200px] w-full"});if(s.isError||t.isError)return null;const n=g(t.data.deployment_type||"other"),{getItem:r}=w(s.data,n),a=r("device_verified"),i=r("pipeline_run"),o=r("stack_with_remote_artifact_store_created"),x=r("pipeline_run_with_remote_artifact_store");return e.jsxs("ul",{className:"space-y-5",children:[!n&&e.jsx("li",{children:e.jsx(Y,{active:a.isActive,completed:a.isCompleted,hasDownstreamStep:a.hasDownStreamStep})}),e.jsx("li",{children:e.jsx(G,{active:i.isActive,completed:i.isCompleted,hasDownstreamStep:i.hasDownStreamStep})}),e.jsx("li",{children:e.jsx(Q,{active:o.isActive,completed:o.isCompleted,hasDownstreamStep:o.hasDownStreamStep})}),e.jsx("li",{children:e.jsx(ee,{active:x.isActive,completed:x.isCompleted,hasDownstreamStep:x.hasDownStreamStep})})]})}function ge(){const{setTourState:s,tourState:{tourActive:t}}=D();return c.useEffect(()=>{t&&s(n=>({...n,run:!0,stepIndex:n.stepIndex}))},[t]),e.jsxs("div",{className:"layout-container grid grid-cols-4 gap-5 py-5",children:[e.jsxs("div",{className:"col-span-4 space-y-5 lg:col-span-3",children:[e.jsx(J,{}),e.jsx(te,{})]}),e.jsxs("div",{className:"col-span-4 space-y-5 lg:col-span-1",children:[e.jsx(U,{}),e.jsx(F,{})]})]})}export{ge as default};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as u,j as a}from"./@radix-C7hRs6Kx.js";import{u as h,c as w,S as v,a as y,b as k}from"./form-schemas-
|
1
|
+
import{r as u,j as a}from"./@radix-C7hRs6Kx.js";import{u as h,c as w,S as v,a as y,b as k}from"./form-schemas-BaEJ1z87.js";import{S}from"./SetPassword-BDFVwnNB.js";import{I as x,h as j,j as N,o as A,F as C,p as q,e as P,f as z,i as E}from"./index-hsSXyS3H.js";import{u as F}from"./index.esm-D7jFlf5N.js";import{t as M}from"./zod-C0xYeTvL.js";import{b as T}from"./@tanstack-CSxjHCME.js";import{u as U}from"./login-mutation-CwraNa5G.js";import"./check-circle-mvyzYvIW.js";import"./@react-router-BGgzhn5D.js";import"./UpdatePasswordSchemas-3gg2tC-H.js";import"./PasswordChecker-lYTOtNom.js";import"./@reactflow-CQi1Z1Wq.js";const g=u.createContext(null);function $({children:e,initialSettings:r}){const[t,s]=u.useState(r||{});return a.jsx(g.Provider,{value:{serverSettings:t,setServerSettings:s},children:e})}function f(){const e=u.useContext(g);if(e===null)throw new Error("useServerActivationContext must be used within an ServerActivationProvider");return e}function I(){const{setSurveyStep:e}=h(),{setServerSettings:r}=f();function t({newPassword:s,username:o}){r(i=>({...i,admin_password:s,admin_username:o})),e(i=>i+1)}return a.jsx(S,{displayUsername:!0,headline:"Create your admin user and password",subHeadine:"Select a username and password for your admin account",submitHandler:t})}const m=e=>{e=1831565813+(e|=0)|0;let r=Math.imul(e^e>>>15,1|e);return r=r+Math.imul(r^r>>>7,61|r)^r,((r^r>>>14)>>>0)/4294967296};class L{constructor(r){this.dictionaries=void 0,this.length=void 0,this.separator=void 0,this.style=void 0,this.seed=void 0;const{length:t,separator:s,dictionaries:o,style:i,seed:l}=r;this.dictionaries=o,this.separator=s,this.length=t,this.style=i,this.seed=l}generate(){if(!this.dictionaries)throw new Error('Cannot find any dictionary. Please provide at least one, or leave the "dictionary" field empty in the config object');if(this.length<=0)throw new Error("Invalid length provided");if(this.length>this.dictionaries.length)throw new Error(`The length cannot be bigger than the number of dictionaries.
|
2
2
|
Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let r=this.seed;return this.dictionaries.slice(0,this.length).reduce((t,s)=>{let o;r?(o=(l=>{if(typeof l=="string"){const c=l.split("").map(d=>d.charCodeAt(0)).reduce((d,b)=>d+b,1),n=Math.floor(Number(c));return m(n)}return m(l)})(r),r=4294967296*o):o=Math.random();let i=s[Math.floor(o*s.length)]||"";if(this.style==="lowerCase")i=i.toLowerCase();else if(this.style==="capital"){const[l,...c]=i.split("");i=l.toUpperCase()+c.join("")}else this.style==="upperCase"&&(i=i.toUpperCase());return t?`${t}${this.separator}${i}`:`${i}`},"")}}const p={separator:"_",dictionaries:[]},_=e=>{const r=[...e&&e.dictionaries||p.dictionaries],t={...p,...e,length:e&&e.length||r.length,dictionaries:r};if(!e||!e.dictionaries||!e.dictionaries.length)throw new Error('A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide');return new L(t).generate()};var H=["aardvark","aardwolf","albatross","alligator","alpaca","amphibian","anaconda","angelfish","anglerfish","ant","anteater","antelope","antlion","ape","aphid","armadillo","asp","baboon","badger","bandicoot","barnacle","barracuda","basilisk","bass","bat","bear","beaver","bedbug","bee","beetle","bird","bison","blackbird","boa","boar","bobcat","bobolink","bonobo","booby","bovid","bug","butterfly","buzzard","camel","canid","canidae","capybara","cardinal","caribou","carp","cat","caterpillar","catfish","catshark","cattle","centipede","cephalopod","chameleon","cheetah","chickadee","chicken","chimpanzee","chinchilla","chipmunk","cicada","clam","clownfish","cobra","cockroach","cod","condor","constrictor","coral","cougar","cow","coyote","crab","crane","crawdad","crayfish","cricket","crocodile","crow","cuckoo","damselfly","deer","dingo","dinosaur","dog","dolphin","donkey","dormouse","dove","dragon","dragonfly","duck","eagle","earthworm","earwig","echidna","eel","egret","elephant","elk","emu","ermine","falcon","felidae","ferret","finch","firefly","fish","flamingo","flea","fly","flyingfish","fowl","fox","frog","galliform","gamefowl","gayal","gazelle","gecko","gerbil","gibbon","giraffe","goat","goldfish","goose","gopher","gorilla","grasshopper","grouse","guan","guanaco","guineafowl","gull","guppy","haddock","halibut","hamster","hare","harrier","hawk","hedgehog","heron","herring","hippopotamus","hookworm","hornet","horse","hoverfly","hummingbird","hyena","iguana","impala","jackal","jaguar","jay","jellyfish","junglefowl","kangaroo","kingfisher","kite","kiwi","koala","koi","krill","ladybug","lamprey","landfowl","lark","leech","lemming","lemur","leopard","leopon","limpet","lion","lizard","llama","lobster","locust","loon","louse","lungfish","lynx","macaw","mackerel","magpie","mammal","manatee","mandrill","marlin","marmoset","marmot","marsupial","marten","mastodon","meadowlark","meerkat","mink","minnow","mite","mockingbird","mole","mollusk","mongoose","monkey","moose","mosquito","moth","mouse","mule","muskox","narwhal","newt","nightingale","ocelot","octopus","opossum","orangutan","orca","ostrich","otter","owl","ox","panda","panther","parakeet","parrot","parrotfish","partridge","peacock","peafowl","pelican","penguin","perch","pheasant","pig","pigeon","pike","pinniped","piranha","planarian","platypus","pony","porcupine","porpoise","possum","prawn","primate","ptarmigan","puffin","puma","python","quail","quelea","quokka","rabbit","raccoon","rat","rattlesnake","raven","reindeer","reptile","rhinoceros","roadrunner","rodent","rook","rooster","roundworm","sailfish","salamander","salmon","sawfish","scallop","scorpion","seahorse","shark","sheep","shrew","shrimp","silkworm","silverfish","skink","skunk","sloth","slug","smelt","snail","snake","snipe","sole","sparrow","spider","spoonbill","squid","squirrel","starfish","stingray","stoat","stork","sturgeon","swallow","swan","swift","swordfish","swordtail","tahr","takin","tapir","tarantula","tarsier","termite","tern","thrush","tick","tiger","tiglon","toad","tortoise","toucan","trout","tuna","turkey","turtle","tyrannosaurus","unicorn","urial","vicuna","viper","vole","vulture","wallaby","walrus","warbler","wasp","weasel","whale","whippet","whitefish","wildcat","wildebeest","wildfowl","wolf","wolverine","wombat","woodpecker","worm","wren","xerinae","yak","zebra"],D=["amaranth","amber","amethyst","apricot","aqua","aquamarine","azure","beige","black","blue","blush","bronze","brown","chocolate","coffee","copper","coral","crimson","cyan","emerald","fuchsia","gold","gray","green","harlequin","indigo","ivory","jade","lavender","lime","magenta","maroon","moccasin","olive","orange","peach","pink","plum","purple","red","rose","salmon","sapphire","scarlet","silver","tan","teal","tomato","turquoise","violet","white","yellow"];const R=["booby","swallow"];function V(){return _({dictionaries:[D,H.filter(e=>!R.includes(e))]})}function Y({submitHandler:e}){const r=u.useId(),{handleSubmit:t,register:s,formState:{isValid:o}}=F({resolver:M(w),defaultValues:{serverName:V()}});return a.jsxs("div",{className:"max-w-[570px] space-y-5",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-display-xs font-semibold",children:"Almost there! Select a server name"}),a.jsx("p",{className:"text-theme-text-secondary",children:"This will identify your ZenML server. You can use the generated name or create your own."})]}),a.jsxs("form",{onSubmit:t(e),className:"space-y-5",children:[a.jsx("div",{className:"space-y-2",children:a.jsxs("div",{className:"space-y-0.5",children:[a.jsx("label",{htmlFor:r,className:"text-text-sm",children:"Server Name"}),a.jsx(x,{...s("serverName"),id:r,className:"w-full"})]})}),a.jsx(j,{disabled:!o,className:"w-full text-center",size:"md",children:a.jsx("span",{className:"w-full",children:"Activate your Server"})})]})]})}async function Z(e){const r=A(q.activate),t=await N(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const s=await t.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>"Failed to activate server");throw new C({status:t.status,statusText:t.statusText,message:s})}return t.json()}function B(e){return T({mutationFn:async r=>Z(r),...e})}function G({setUsername:e}){const{serverSettings:r}=f(),{setSurveyStep:t}=h(),{setAuthState:s}=P(),{toast:o}=z(),{mutate:i}=U({onSuccess:()=>{s("true"),t(n=>n+1)}}),{mutate:l}=B({onSuccess:async n=>{e(n.name),i({username:n.name,password:r.admin_password??void 0})},onError:n=>{n instanceof Error&&o({status:"error",emphasis:"subtle",icon:a.jsx(E,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:n.message,rounded:!0})}});function c({serverName:n}){l({...r,server_name:n})}return a.jsx(Y,{submitHandler:c})}function J(){const{surveyStep:e}=h(),[r,t]=u.useState("");return a.jsx(a.Fragment,{children:a.jsxs($,{children:[a.jsx(v,{stepAmount:2}),e===1&&a.jsx(I,{}),e===2&&a.jsx(G,{setUsername:t}),e===3&&a.jsx(y,{subHeader:"Your created your ZenML account",username:r})]})})}function le(){return a.jsx(k,{children:a.jsx(J,{})})}export{le as default};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as v,j as s}from"./@radix-C7hRs6Kx.js";import{q as R,j as U,o as H,F as L,p as F,aI as l,ak as B,am as W,an as q,ao as J,h as w,a7 as Z,r as G,f as V,c as K,S as Q,m as X,aJ as Y,at as ee,B as D}from"./index-
|
1
|
+
import{r as v,j as s}from"./@radix-C7hRs6Kx.js";import{q as R,j as U,o as H,F as L,p as F,aI as l,ak as B,am as W,an as q,ao as J,h as w,a7 as Z,r as G,f as V,c as K,S as Q,m as X,aJ as Y,at as ee,B as D}from"./index-hsSXyS3H.js";import{b as te}from"./@tanstack-CSxjHCME.js";import{S as re}from"./clock-CPA5cYxq.js";import{S as ne}from"./link-external-DUhCSKNm.js";import{C}from"./CodeSnippet-nRnOvbOJ.js";import{I as oe}from"./Infobox-C4Op55B8.js";import{T as se}from"./Tick-C4gtED35.js";import{E as ae}from"./react-error-boundary.esm-fyoUBS25.js";import{L as ie}from"./@react-router-BGgzhn5D.js";import"./@reactflow-CQi1Z1Wq.js";import"./check-DK77doTf.js";async function ce({params:t}){const r=R(t).toString(),o=H(F.apiToken+(r?`?${r}`:"")),n=await U(o,{credentials:"include",headers:{"Content-Type":"application/json"}});if(!n.ok){const e=await n.json().then(a=>Array.isArray(a.detail)?a.detail[1]:a.detail).catch(()=>"Error while creating API Token");throw new L({status:n.status,statusText:n.statusText,message:e})}return n.json()}function le(t){return te({mutationFn:async r=>ce(r),...t})}class T extends Error{}T.prototype.name="InvalidTokenError";function ue(t){return decodeURIComponent(atob(t).replace(/(.)/g,(r,o)=>{let n=o.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function de(t){let r=t.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return ue(r)}catch{return atob(r)}}function pe(t,r){if(typeof t!="string")throw new T("Invalid token specified: must be a string");r||(r={});const o=r.header===!0?0:1,n=t.split(".")[o];if(typeof n!="string")throw new T(`Invalid token specified: missing part #${o+1}`);let e;try{e=de(n)}catch(a){throw new T(`Invalid token specified: invalid base64 for part #${o+1} (${a.message})`)}try{return JSON.parse(e)}catch(a){throw new T(`Invalid token specified: invalid json for part #${o+1} (${a.message})`)}}function O(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function me(t,r){for(var o=0;o<r.length;o++){var n=r[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function I(t,r,o){return r&&me(t.prototype,r),t}function N(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&b(t,r)}function g(t){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)},g(t)}function b(t,r){return b=Object.setPrototypeOf||function(n,e){return n.__proto__=e,n},b(t,r)}function fe(){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 he(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ye(t,r){return r&&(typeof r=="object"||typeof r=="function")?r:he(t)}function A(t){var r=fe();return function(){var n=g(t),e;if(r){var a=g(this).constructor;e=Reflect.construct(n,arguments,a)}else e=n.apply(this,arguments);return ye(this,e)}}function ve(t){return xe(t)||Te(t)||ge(t)||be()}function xe(t){if(Array.isArray(t))return S(t)}function Te(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function ge(t,r){if(t){if(typeof t=="string")return S(t,r);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 S(t,r)}}function S(t,r){(r==null||r>t.length)&&(r=t.length);for(var o=0,n=new Array(r);o<r;o++)n[o]=t[o];return n}function be(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,o=String(t);if(r===0)return o;var n=o.match(/(.*?)([0-9]+)(.*)/),e=n?n[1]:"",a=n?n[3]:"",i=n?n[2]:o,c=i.length>=r?i:(ve(Array(r)).map(function(){return"0"}).join("")+i).slice(r*-1);return"".concat(e).concat(c).concat(a)}var E={daysInHours:!1,zeroPadTime:2};function Se(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=r.now,n=o===void 0?Date.now:o,e=r.precision,a=e===void 0?0:e,i=r.controlled,c=r.offsetTime,u=c===void 0?0:c,p=r.overtime,f;typeof t=="string"?f=new Date(t).getTime():t instanceof Date?f=t.getTime():f=t,i||(f+=u);var m=i?f:f-n(),h=Math.min(20,Math.max(0,a)),d=Math.round(parseFloat(((p?m:Math.max(0,m))/1e3).toFixed(h))*1e3),y=Math.abs(d)/1e3;return{total:d,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:d<=0}}function je(t,r){var o=t.days,n=t.hours,e=t.minutes,a=t.seconds,i=Object.assign(Object.assign({},E),r),c=i.daysInHours,u=i.zeroPadTime,p=i.zeroPadDays,f=p===void 0?u:p,m=Math.min(2,u),h=c?x(n+o*24,u):x(n,m);return{days:c?"":x(o,f),hours:h,minutes:x(e,m),seconds:x(a,m)}}var _=function(t){N(o,t);var r=A(o);function o(){var n;return O(this,o),n=r.apply(this,arguments),n.state={count:n.props.count||3},n.startCountdown=function(){n.interval=window.setInterval(function(){var e=n.state.count-1;e===0?(n.stopCountdown(),n.props.onComplete&&n.props.onComplete()):n.setState(function(a){return{count:a.count-1}})},1e3)},n.stopCountdown=function(){clearInterval(n.interval)},n.addTime=function(e){n.stopCountdown(),n.setState(function(a){return{count:a.count+e}},n.startCountdown)},n}return I(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);_.propTypes={count:l.number,children:l.element,onComplete:l.func};var P=function(t){N(o,t);var r=A(o);function o(n){var e;if(O(this,o),e=r.call(this,n),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")},n.date){var a=e.calcTimeDelta();e.state={timeDelta:a,status:a.completed?"COMPLETED":"STOPPED"}}else e.legacyMode=!0;return e}return I(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,u=e.controlled,p=e.overtime;return Se(a,{now:i,precision:c,controlled:u,offsetTime:this.offsetTime,overtime:p})}},{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 u=e.completed&&!this.state.timeDelta.completed,p=e.completed&&a==="STARTED";u&&!this.props.overtime&&this.clearTimer();var f=function(){i&&i(c.state.timeDelta),c.props.onComplete&&(u||p)&&c.props.onComplete(e,p)};return this.setState(function(m){var h=a||m.status;return e.completed&&!c.props.overtime?h="COMPLETED":!a&&h==="COMPLETED"&&(h="STOPPED"),{timeDelta:e,status:h}},f)}}},{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,u=this.state.timeDelta;return Object.assign(Object.assign({},u),{api:this.getApi(),props:this.props,formatted:je(u,{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(_,{ref:this.setLegacyCountdownRef,count:a,onComplete:c},i)}var u=this.props,p=u.className,f=u.overtime,m=u.children,h=u.renderer,d=this.getRenderProps();if(h)return h(d);if(m&&this.state.timeDelta.completed&&!f)return v.cloneElement(m,{countdown:d});var y=d.formatted,k=y.days,M=y.hours,$=y.minutes,z=y.seconds;return v.createElement("span",{className:p},d.total<0?"-":"",k,k?":":"",M,":",$,":",z)}}]),o}(v.Component);P.defaultProps=Object.assign(Object.assign({},E),{controlled:!1,intervalDelay:1e3,precision:0,autoStart:!0});P.propTypes={date:l.oneOfType([l.instanceOf(Date),l.string,l.number]),daysInHours:l.bool,zeroPadTime:l.number,zeroPadDays:l.number,controlled:l.bool,intervalDelay:l.number,precision:l.number,autoStart:l.bool,overtime:l.bool,className:l.string,children:l.element,renderer:l.func,now:l.func,onMount:l.func,onStart:l.func,onPause:l.func,onStop:l.func,onTick:l.func,onComplete:l.func};function we({token:t,open:r,setOpen:o}){return s.jsx(B,{open:r,onOpenChange:o,children:s.jsxs(W,{className:"max-w-[700px]",children:[s.jsx(q,{children:s.jsx(J,{children:"API Token Created Successfully"})}),s.jsxs("div",{className:"space-y-3 overflow-hidden px-7 py-5",children:[s.jsx(Pe,{}),s.jsx(ke,{}),s.jsx(De,{token:t}),s.jsx(ae,{fallbackRender:()=>null,children:s.jsx(Oe,{token:t})}),s.jsx("div",{role:"separator","aria-hidden":"true",className:"h-[1px] bg-theme-border-moderate"}),s.jsx(Ie,{token:t}),s.jsx(Ne,{}),s.jsx("div",{role:"separator","aria-hidden":"true",className:"h-[1px] bg-theme-border-moderate"}),s.jsx(Ae,{})]})]})})}function Pe(){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 ke(){return s.jsx(oe,{children:"Important: This token expires in 1 hour and cannot be retrieved later. Please, copy it now."})}function De({token:t}){const[r,o]=v.useState(!1);function n(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}),r?s.jsxs("div",{className:"flex h-7 items-center",children:[s.jsx(se,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary"}),s.jsx("p",{className:"sr-only",children:"copied successfully"})]}):s.jsxs(w,{onClick:()=>n(t),size:"md",intent:"secondary",className:"flex items-center gap-1",emphasis:"subtle",children:[s.jsx(Z,{className:"size-4 shrink-0 fill-inherit"}),"Copy"]})]})}const Ce=({days:t,hours:r,minutes:o,seconds:n,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||r>0)&&i.push(`${a(r)}`),(t>0||r>0||o>0)&&i.push(`${a(o)}`),i.push(`${a(n)}`),s.jsx("span",{className:"font-semibold",children:i.join(":")})};function Oe({token:t}){if(!t)return null;const r=pe(t);return r.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(re,{className:"size-5 shrink-0 fill-theme-text-secondary"}),s.jsxs("div",{children:["Expires in:"," ",s.jsx(P,{daysInHours:!0,renderer:Ce,zeroPadTime:2,date:new Date(r.exp*1e3)})]})]}):null}function Ie({token:t}){const r=`${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(C,{code:Ee(t,r)}),s.jsx(C,{code:_e(t,r)})]})]})}function Ne(){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(w,{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(ne,{className:"size-5 shrink-0 fill-inherit"})]})})]})}function Ae(){return s.jsxs("p",{children:["For long-term programmatic access, consider"," ",s.jsx(ie,{className:"link text-theme-text-brand",to:G.settings.service_accounts.overview,children:"setting up a service account instead."})]})}function Ee(t,r){return`curl -H "Authorization: Bearer ${t}" "${encodeURI(r)}"`}function _e(t,r){return`wget -qO- --header="Authorization: Bearer ${t}" "${encodeURI(r)}"`}const j=v.forwardRef(({className:t,onClick:r,...o},n)=>{const{toast:e}=V(),[a,i]=v.useState(""),[c,u]=v.useState(!1),p=K(),{mutate:f,isPending:m}=le({onError:d=>{ee(d)&&e({title:"Error",emphasis:"subtle",rounded:!0,status:"error",description:d.message}),console.log(d)},onSuccess:d=>{i(d),u(!0)}});function h(d){u(d),d||i("")}return p.isPending?s.jsx(Q,{className:"h-7 w-10"}):p.isError?null:s.jsxs(s.Fragment,{children:[s.jsxs(w,{disabled:m||Y(p.data.auth_scheme||"other"),ref:n,...o,onClick:()=>f({params:{token_type:"generic"}}),className:X(t),children:[m&&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(we,{open:c,setOpen:h,token:a})]})});j.displayName="CreateTokenButton";function Ze(){return s.jsxs(D,{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(j,{size:"sm"})}),s.jsxs(D,{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(j,{size:"md"})]})]})}export{Ze as default};
|