zenml-nightly 0.82.0.dev20250514__py3-none-any.whl → 0.82.1.dev20250518__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zenml/VERSION +1 -1
- zenml/zen_server/dashboard/assets/{404-D4aYbspS.js → 404-_AtuLtaX.js} +1 -1
- zenml/zen_server/dashboard/assets/{AlertDialogDropdownItem-CRZjthRL.js → AlertDialogDropdownItem-BG7-Ki1L.js} +1 -1
- zenml/zen_server/dashboard/assets/{CodeSnippet-Di-loaZu.js → CodeSnippet-CvI6D0wx.js} +1 -1
- zenml/zen_server/dashboard/assets/{CollapsibleCard-Dr5zb5T5.js → CollapsibleCard-D20FtrzC.js} +1 -1
- zenml/zen_server/dashboard/assets/{Commands-CD9Y7FOE.js → Commands-DGbAvMDk.js} +1 -1
- zenml/zen_server/dashboard/assets/{ComponentBadge-BgGnzcLu.js → ComponentBadge-DKw7Gndh.js} +1 -1
- zenml/zen_server/dashboard/assets/{ComponentIcon-B_7Y_oV-.js → ComponentIcon-ils7uNAk.js} +1 -1
- zenml/zen_server/dashboard/assets/{CsvVizualization-CDrjL6bW.js → CsvVizualization-DVN541XF.js} +1 -1
- zenml/zen_server/dashboard/assets/{DeleteAlertDialog-9RTDnEx3.js → DeleteAlertDialog-DVvXt-S6.js} +1 -1
- zenml/zen_server/dashboard/assets/{DialogItem-0fWTH7ki.js → DialogItem-BHWf3sIB.js} +1 -1
- zenml/zen_server/dashboard/assets/{Error-vBjUYjb-.js → Error-BWaXP0VK.js} +1 -1
- zenml/zen_server/dashboard/assets/{ExecutionStatus-B-ysY113.js → ExecutionStatus-XrvT2r65.js} +1 -1
- zenml/zen_server/dashboard/assets/{Helpbox-Dt3q7NGd.js → Helpbox-iE1xLmiZ.js} +1 -1
- zenml/zen_server/dashboard/assets/{Infobox-Bai0JtFs.js → Infobox-D9k5TFH4.js} +1 -1
- zenml/zen_server/dashboard/assets/{InlineAvatar-Cpj0lVRQ.js → InlineAvatar-Cfz4WSLK.js} +1 -1
- zenml/zen_server/dashboard/assets/{NestedCollapsible-DbhKdWx-.js → NestedCollapsible-Dor-bi98.js} +1 -1
- zenml/zen_server/dashboard/assets/{Partials-BNBtCjuT.js → Partials-DQJFw1yW.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProBadge-3vtouJQf.js → ProBadge-Cp4hb1YT.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProCta-BoTLdAdV.js → ProCta-EYoV9CvK.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderIcon-kkODO9tx.js → ProviderIcon-DLo7t1lo.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderRadio-26EB5tY-.js → ProviderRadio-BVDA-fAr.js} +1 -1
- zenml/zen_server/dashboard/assets/{RunSelector-j0C_TPVp.js → RunSelector-BLuBYNJt.js} +1 -1
- zenml/zen_server/dashboard/assets/{RunsBody-DexNouV4.js → RunsBody-W4WHf-sq.js} +1 -1
- zenml/zen_server/dashboard/assets/{SearchField-DMCywawn.js → SearchField-D-h6jXyg.js} +1 -1
- zenml/zen_server/dashboard/assets/{SecretTooltip-LLGP7AIC.js → SecretTooltip-CePCL8kd.js} +1 -1
- zenml/zen_server/dashboard/assets/{SetPassword-CBHW-Su8.js → SetPassword-DR-EiLI5.js} +1 -1
- zenml/zen_server/dashboard/assets/{StackList-S-9I1R4n.js → StackList-CgmN5H-i.js} +1 -1
- zenml/zen_server/dashboard/assets/{Tabs-C2ufJX4t.js → Tabs-DxQ8PDOD.js} +1 -1
- zenml/zen_server/dashboard/assets/{Tick-ay3Bgtro.js → Tick-CEsT3HPR.js} +1 -1
- zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-p3RX0P-Q.js → UpdatePasswordSchemas-DbFEaezI.js} +1 -1
- zenml/zen_server/dashboard/assets/{UsageReason-C8sD2bOU.js → UsageReason-DjI5qMje.js} +1 -1
- zenml/zen_server/dashboard/assets/{Wizard-DIllc07n.js → Wizard-CMI6Ksgz.js} +1 -1
- zenml/zen_server/dashboard/assets/{WizardFooter-dNDpuero.js → WizardFooter-CFBHFZas.js} +1 -1
- zenml/zen_server/dashboard/assets/{all-pipeline-runs-query-BUT1PiTp.js → all-pipeline-runs-query-BGASHYtF.js} +1 -1
- zenml/zen_server/dashboard/assets/{configuration-form-DBZSb0FV.js → configuration-form-BtI2Y4eX.js} +1 -1
- zenml/zen_server/dashboard/assets/{create-stack-BXLyjE58.js → create-stack-BJ6x5rzj.js} +1 -1
- zenml/zen_server/dashboard/assets/{delete-run-DzcYxUnd.js → delete-run-DlSLEl5T.js} +1 -1
- zenml/zen_server/dashboard/assets/{flavor-select-BTEwByv6.js → flavor-select-BnPxvQDN.js} +1 -1
- zenml/zen_server/dashboard/assets/{form-schemas-BJN_25Ua.js → form-schemas-CbvoEUHr.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-wYtmKLnQ.js → index-CFESYpe4.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-D9-ukAem.js → index-CmLcvK2z.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-8uhUi12k.js → index-CrhdX_qG.js} +1 -1
- zenml/zen_server/dashboard/assets/index-CzX3ZYlI.css +1 -0
- zenml/zen_server/dashboard/assets/{index-BygJE88j.js → index-D2iSHVZq.js} +7 -7
- zenml/zen_server/dashboard/assets/{login-mutation-DywLqguW.js → login-mutation-CXc-Klim.js} +1 -1
- zenml/zen_server/dashboard/assets/{not-found-BOoklIG4.js → not-found-olRU3fnu.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-ByXQN8A-.js → page-7keIM1V3.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-4nVakAEl.js → page-B31neFwG.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-xa1EAPcI.js → page-B3zo4KYS.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DfTsntQI.js → page-BN3MHq1a.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BIYqUwTI.js → page-BNgVExjN.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-kzSGEVUs.js → page-BPtvu74G.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-uDGvpa5g.js → page-BTIuG0ki.js} +1 -1
- zenml/zen_server/dashboard/assets/{page--hSXKqyG.js → page-BcQzleH6.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-B3DscprQ.js → page-C05Jw4M2.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BE8jdyaM.js → page-C28a7K8h.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-B1Uq1S1Q.js → page-C9WLk0X-.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-RV8wpZ_4.js → page-CINMx64X.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-8AzB83Py.js → page-CSwZxZMQ.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-D2TtSfnb.js → page-CYrJbk7P.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-EXvws1ss.js → page-Ce0cqLo3.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-2BsNK_sZ.js → page-CgNsEkw-.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-cOEvFs_l.js → page-Ct2FUYuR.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DmteSSj6.js → page-D8G2B3Bu.js} +1 -1
- zenml/zen_server/dashboard/assets/page-DL8a4_lg.js +3 -0
- zenml/zen_server/dashboard/assets/{page-Ccnk_5ji.js → page-DMhYn1cF.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CPLlVRXx.js → page-Dd_Yq-Uf.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-K9yjbnd4.js → page-DfSvqT8g.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-B7Aj2XbV.js → page-Dt6ANUTx.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DHnkTzqs.js → page-DtvTleaT.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-uN0n_DE2.js → page-DwfGTiVs.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-Ci_n_x3a.js → page-JgomSTDc.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DkY7AIhj.js → page-L84ig6HB.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-bUVHi7DE.js → page-Mabsn4QJ.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DP2Ed-2m.js → page-P04L5cm9.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-D-ry_oLs.js → page-PfhAnvq4.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CI4a9CXs.js → page-WdRrlNt_.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-D_5R6E7b.js → page-ZfTtFicG.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-Dt3wHeWX.js → page-cqJDDDeK.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-B0r9dBEU.js → page-k-Wxh9L_.js} +1 -1
- zenml/zen_server/dashboard/assets/page-y-zV4n0c.js +1 -0
- zenml/zen_server/dashboard/assets/{persist-SSTTV5q0.js → persist-D87V82eO.js} +1 -1
- zenml/zen_server/dashboard/assets/{persist-CEeDYHW5.js → persist-UUym702q.js} +1 -1
- zenml/zen_server/dashboard/assets/{service-BRoAA1Kq.js → service-BQ9KIhls.js} +1 -1
- zenml/zen_server/dashboard/assets/{sharedSchema-BACERDat.js → sharedSchema-Bse2agAf.js} +1 -1
- zenml/zen_server/dashboard/assets/{stack-detail-query-ihiJr6nq.js → stack-detail-query-BAcZJrN3.js} +1 -1
- zenml/zen_server/dashboard/assets/{update-server-settings-mutation-CK6COmw9.js → update-server-settings-mutation-DwMM1LJz.js} +1 -1
- zenml/zen_server/dashboard/index.html +3 -3
- zenml/zen_stores/migrations/versions/0.82.1_release.py +23 -0
- {zenml_nightly-0.82.0.dev20250514.dist-info → zenml_nightly-0.82.1.dev20250518.dist-info}/METADATA +2 -2
- {zenml_nightly-0.82.0.dev20250514.dist-info → zenml_nightly-0.82.1.dev20250518.dist-info}/RECORD +95 -94
- zenml/zen_server/dashboard/assets/index-DmTFrHJm.css +0 -1
- zenml/zen_server/dashboard/assets/page-BTzhAVEn.js +0 -1
- zenml/zen_server/dashboard/assets/page-CSQOpvvK.js +0 -3
- {zenml_nightly-0.82.0.dev20250514.dist-info → zenml_nightly-0.82.1.dev20250518.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.82.0.dev20250514.dist-info → zenml_nightly-0.82.1.dev20250518.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.82.0.dev20250514.dist-info → zenml_nightly-0.82.1.dev20250518.dist-info}/entry_points.txt +0 -0
@@ -1 +1 @@
|
|
1
|
-
import{j as s,o as r,F as i,p as u}from"./index-
|
1
|
+
import{j as s,o as r,F as i,p as u}from"./index-D2iSHVZq.js";import{b as c}from"./@tanstack-CSxjHCME.js";async function h(a){const o=r(u.login),t=await s(o,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(a)});if(!t.ok){const e=await t.json().then(n=>n.detail).catch(()=>["","Failed to login"]);throw new i({status:t.status,statusText:t.statusText,message:e[1]||"Failed to login"})}return t.json()}function m(a){return c({mutationFn:async o=>h(o),...a})}export{m as u};
|
@@ -1 +1 @@
|
|
1
|
-
import{j as e}from"./@radix-C7hRs6Kx.js";import{i as s,h as r}from"./index-
|
1
|
+
import{j as e}from"./@radix-C7hRs6Kx.js";import{i as s,h as r}from"./index-D2iSHVZq.js";import{S as a}from"./arrow-left-CwgF2MEM.js";import{c as n}from"./@react-router-CNP6g_RL.js";import"./@tanstack-CSxjHCME.js";import"./@reactflow-CQi1Z1Wq.js";function h(){const t=n();return e.jsx(e.Fragment,{children:e.jsxs("section",{className:"layout-container my-9 flex flex-col items-center gap-5",children:[e.jsx(s,{className:"h-[120px] w-[120px] fill-neutral-300"}),e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"mb-2 text-display-xs font-semibold",children:"Error 404 - Run Not Found"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Oh no! It seems that the run you are looking for doesn't exist."})]}),e.jsxs(r,{intent:"primary",size:"lg",onClick:()=>t(-1),children:[e.jsx(a,{className:"h-5 w-5 fill-theme-text-negative"})," ",e.jsx("span",{children:"Go back"})]})]})})}export{h as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{j as e}from"./@radix-C7hRs6Kx.js";import{B as o,aE as n}from"./index-
|
1
|
+
import{j as e}from"./@radix-C7hRs6Kx.js";import{B as o,aE as n}from"./index-D2iSHVZq.js";import{I as r}from"./Infobox-D9k5TFH4.js";import{H as a}from"./Helpbox-iE1xLmiZ.js";import{V as s,g as c}from"./Commands-DGbAvMDk.js";import"./@tanstack-CSxjHCME.js";import"./@react-router-CNP6g_RL.js";import"./@reactflow-CQi1Z1Wq.js";import"./help-DyMolRxD.js";import"./CodeSnippet-CvI6D0wx.js";const l=[{command:"zenml code-repository register <NAME> --type=<CODE_REPOSITORY_TYPE] [--CODE_REPOSITORY_OPTIONS]",description:"Register a code repository"},{command:"zenml code-repository register <NAME> --type=custom --source=<CODE_REPOSITORY_SOURCE> [--CODE_REPOSITORY_OPTIONS]",description:"Use a custom repository "},{command:"zenml code-repository list",description:"List your registered code repositories"},{command:"zenml code-repository delete <REPOSITORY_NAME_OR_ID>",description:"Delete a code repository that you have previously registered"}],d="/assets/repos-video-D8kpu60k.svg";function m(){return e.jsx(r,{children:e.jsxs("div",{className:"flex w-full flex-wrap items-center gap-x-2 gap-y-0.5 text-text-md",children:[e.jsx("p",{className:"font-semibold",children:"We are creating a new Repositories experience"}),e.jsx("p",{children:"In the meanwhile you can use the CLI to add and manage your repos."})]})})}function p(){const t="https://zenml.portal.trainn.co/share/koVfVubiXfXLXtVcDAqPyg/embed?autoplay=false";return e.jsxs(o,{className:"flex flex-col-reverse items-stretch overflow-hidden md:flex-row",children:[e.jsxs("div",{className:"w-full p-7 md:w-2/3",children:[e.jsx("h2",{className:"text-display-xs font-semibold",children:"Learn More about Repositories"}),e.jsx("p",{className:"mt-2 text-text-lg text-theme-text-secondary",children:"Get started with ZenML Repositories for streamlined pipeline versioning and faster Docker builds."}),e.jsx(s,{videoLink:t,buttonText:"Watch the Starter Guide (2 min)"})]}),e.jsx("div",{className:"flex w-full items-center justify-center bg-primary-50 lg:w-1/3",children:e.jsx(s,{fallbackImage:e.jsx("img",{src:d,alt:"Purple squares with text indicating a starter guide for secrets",className:"h-full w-full"}),videoLink:t,isButton:!1})})]})}function x(){return e.jsxs("section",{className:"space-y-5 pl-8 pr-5",children:[e.jsx(r,{className:"text-text-md",intent:"neutral",children:"Code repositories enable ZenML to keep track of the code version that you use for your pipeline runs. Additionally, running a pipeline which is tracked in a registered code repository can decrease the time it takes Docker to build images for containerized stack components."}),l.map((t,i)=>e.jsx(e.Fragment,{children:c(t)},i)),e.jsx(a,{text:"Check all the commands and find more about Repositories in our Docs",link:"https://docs.zenml.io/how-to/setting-up-a-project-repository/connect-your-git-repository"})]})}function w(){return e.jsxs(o,{className:"space-y-4 p-5",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Repositories"}),e.jsx(m,{}),e.jsx(p,{}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(n,{}),"Administering your Code Repositories"]}),e.jsx(x,{})]})}export{w as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as x,j as e}from"./@radix-C7hRs6Kx.js";import{o as D,p as C,j as E,F as T,ai as H,aj as K,h,ak as F,al as P,am as O,f as J,I as j,ap as A,aq as V,ar as G,s as U,D as W,w as X,x as Y,aH as Z,r as N,J as S,z as f,l as ee,M as se,S as w,n as te,B as ae}from"./index-BygJE88j.js";import{S as re,P as ne}from"./SearchField-DMCywawn.js";import{S as ie,s as le,E as ce,a as oe,b as de}from"./SecretTooltip-LLGP7AIC.js";import{b as I,c as L,a as v}from"./@tanstack-CSxjHCME.js";import{w as me}from"./index-wYtmKLnQ.js";import{S as ue}from"./plus-COjQg3AG.js";import{S as q}from"./trash-BWSZ7NRK.js";import{t as xe}from"./zod-C0xYeTvL.js";import{u as he,a as pe,C as g}from"./index.esm-D7jFlf5N.js";import{S as fe}from"./Lock-DW-0_M0o.js";import{D as je}from"./DisplayDate-CYVBBSgr.js";import{I as ge}from"./InlineAvatar-Cpj0lVRQ.js";import{c as ye}from"./code-snippets-CqONne41.js";import{L as b,d as Ne}from"./@react-router-CNP6g_RL.js";import{S as Se}from"./dots-horizontal-BGRJCPCs.js";import{D as k}from"./DialogItem-0fWTH7ki.js";import"./@reactflow-CQi1Z1Wq.js";import"./chevron-right-double-uNWbJT-C.js";import"./index-DR30v9MZ.js";import"./CodeSnippet-Di-loaZu.js";async function we(s){const t=D(C.secrets.add(s.workspace)),a=await E(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!a.ok){const r=await a.json().then(n=>n.detail).catch(()=>"Failed to create Secret");throw new T({status:a.status,statusText:a.statusText,message:r})}return a.json()}function ve(s){return I({mutationFn:async t=>we(t),...s})}function be({id:s,workspace:t}){const[a,r]=x.useState(!1);return e.jsxs(H,{open:a,onOpenChange:r,children:[e.jsx(K,{asChild:!0,children:e.jsx(h,{className:"shrink-0",intent:"primary",children:"Add secret"})}),e.jsxs(F,{className:"mx-auto w-[90vw] max-w-[744px]",children:[e.jsx(P,{children:e.jsx(O,{children:"Register New Secret"})}),e.jsx(ke,{userId:s,setOpen:r,workspaceId:t.id})]})]})}function ke({userId:s,setOpen:t,workspaceId:a}){const{handleSubmit:r,control:n,watch:i,setValue:o,formState:{isValid:u},reset:p}=he({resolver:xe(le),defaultValues:{secretName:"",keysValues:[{key:"",value:""}]}}),{fields:m,append:_,remove:M}=pe({control:n,name:"keysValues"}),{toast:R}=J(),B=L(),{mutate:Q}=ve({onError(l){G(l)&&R({status:"error",emphasis:"subtle",description:l.message,rounded:!0})},onSuccess(){B.invalidateQueries({queryKey:["secrets"]}),t(!1),p()}}),z=l=>{Q({user:s,workspace:a,name:l.secretName,scope:"workspace",values:l.keysValues.reduce((c,d)=>(d.key&&d.value&&(c[d.key]=d.value),c),{})})},$=l=>{z(l)};return e.jsxs(e.Fragment,{children:[e.jsx("form",{id:"create-secret-form",className:"gap-5 p-5",onSubmit:r($),children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("label",{className:"font-inter text-sm text-left font-medium leading-5",children:["Secret Name",e.jsx("span",{className:"ml-1 text-theme-text-error",children:"*"})]}),e.jsx(g,{name:"secretName",control:n,render:({field:l})=>e.jsx(j,{...l,className:"mb-3 w-full",required:!0})})]}),e.jsxs("div",{className:"mt-10",children:[e.jsx("div",{children:e.jsx("h1",{className:"font-inter text-lg text-left font-semibold ",children:"Keys"})}),e.jsxs("div",{className:"mt-5 flex flex-row ",children:[e.jsx("div",{className:"flex-grow",children:e.jsx("label",{className:"font-inter text-sm text-left font-medium",children:"Key"})}),e.jsx("div",{className:"flex-grow pr-12",children:e.jsx("label",{className:"font-inter text-sm text-left font-medium",children:"Value"})})]})]}),m.map((l,c)=>e.jsxs("div",{className:"flex flex-row items-center space-x-1 ",children:[e.jsx("div",{className:"relative flex-grow ",children:e.jsx(g,{name:`keysValues.${c}.key`,control:n,render:({field:d})=>e.jsx(j,{...d,className:"mb-2 w-full",required:!0,placeholder:"key"})})}),e.jsx("div",{className:"relative flex-grow",children:e.jsxs("div",{className:"relative",children:[e.jsx(g,{name:`keysValues.${c}.value`,control:n,render:({field:d})=>e.jsx(j,{...d,className:"mb-2 w-full pr-10",required:!0,placeholder:"•••••••••",type:i(`keysValues.${c}.showPassword`)?"text":"password"})}),e.jsx("button",{type:"button",onClick:()=>{const d=i(`keysValues.${c}.showPassword`);o(`keysValues.${c}.showPassword`,!d)},className:"absolute inset-y-1 right-0 flex items-center pb-1 pr-3",children:e.jsx(ie,{className:"h-4 w-4 flex-shrink-0"})})]})}),e.jsxs("div",{className:"flex items-center",children:[c===m.length-1&&e.jsx(h,{intent:"primary",emphasis:"subtle",onClick:()=>_({key:"",value:""}),className:"mb-2 flex h-7 w-7 items-center justify-center",children:e.jsx(ue,{className:"flex-shrink-0 fill-primary-600"})}),c!==m.length-1&&e.jsx(h,{intent:"secondary",emphasis:"minimal",onClick:()=>M(c),className:"mb-2 h-7 w-7 items-center justify-center",children:e.jsx(q,{className:"flex-shrink-0 fill-theme-text-secondary"})})]})]},l.id))]})}),e.jsxs(A,{className:"gap-[10px]",children:[e.jsx(V,{asChild:!0,children:e.jsx(h,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(h,{intent:"primary",disabled:!u,type:"submit",form:"create-secret-form",children:"Register Secret"})]})]})}async function De(s){const t=D(C.secrets.detail(s)),a=await E(t,{method:"DELETE",headers:{"Content-Type":"application/json"}});if(a.status===404&&U(),!a.ok)throw new T({message:"Error deleting secret",status:a.status,statusText:a.statusText});return a.json()}function Ce(s){return I({mutationFn:async t=>De(t),...s})}function Ee({secretId:s}){const t=L(),{mutate:a}=Ce({onSuccess(){t.invalidateQueries({queryKey:["secrets"]})}}),[r,n]=x.useState("");function i(){a(s)}function o(u){n(u.target.value)}return e.jsxs(F,{children:[e.jsx(P,{children:e.jsx(O,{children:"Delete secret"})}),e.jsxs("div",{className:"gap-5 p-5",children:[e.jsx("p",{className:"text-text-md text-theme-text-secondary",children:"Are you sure you want to delete this secret?"}),e.jsx("p",{className:"text-text-md text-theme-text-secondary",children:"This action cannot be undone."}),e.jsx("h3",{className:"font-inter text-sm mb-1 mt-4 text-left font-medium leading-5",children:"Please type DELETE to confirm"}),e.jsx(j,{name:"key",onChange:o,className:"w-full",required:!0,value:r})]}),e.jsxs(A,{className:"gap-[10px]",children:[e.jsx(V,{asChild:!0,children:e.jsx(h,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(h,{intent:"danger",type:"submit",form:"edit-secret-form",onClick:i,disabled:r!=="DELETE",children:"Delete"})]})]})}function Te({secretId:s}){const[t,a]=x.useState(!1),[r,n]=x.useState(!1),i=x.useRef(null),o=x.useRef(null);function u(){o.current=i.current}function p(m){if(m===!1){a(!1),setTimeout(()=>{n(m)},200);return}n(m)}return e.jsxs(W,{onOpenChange:a,open:t,children:[e.jsx(X,{ref:i,children:e.jsx(Se,{className:"h-4 w-4 fill-theme-text-tertiary"})}),e.jsxs(Y,{hidden:r,onCloseAutoFocus:m=>{o.current&&(o.current.focus(),o.current=null,m.preventDefault())},align:"end",sideOffset:7,children:[e.jsx(k,{onSelect:u,onOpenChange:p,triggerChildren:"Edit ",icon:e.jsx(Z,{}),children:e.jsx(ce,{secretId:s,isSecretNameEditable:!0,dialogTitle:"Edit secret"})}),e.jsx(k,{onSelect:u,onOpenChange:p,triggerChildren:"Delete ",icon:e.jsx(q,{}),children:e.jsx(Ee,{secretId:s})})]})]})}const Fe=[{id:"secret",header:"Secret",accessorFn:s=>s.name,cell:({getValue:s,row:t})=>{const a=ye(t.original.name);return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(fe,{className:"h-5 w-5 flex-shrink-0 fill-primary-400"}),e.jsxs("div",{className:"group/copybutton flex flex-col",children:[e.jsxs("div",{className:"flex flex-row items-center space-x-1",children:[e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(b,{className:"text-text-md font-semibold text-theme-text-primary",to:N.settings.secrets.detail(t.original.id),children:t.original.name}),e.jsx(oe,{code:a})]}),e.jsx(S,{copyText:s()})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(b,{to:N.settings.secrets.detail(t.original.id),className:"flex items-center gap-1 text-text-sm text-theme-text-secondary",children:t.original.id.slice(0,8)}),e.jsx(S,{copyText:t.original.id})]})]})]})}},{id:"author",header:"Author",accessorFn:s=>{var t,a;return(a=(t=s.body)==null?void 0:t.user)==null?void 0:a.name},cell:({getValue:s})=>{const t=s();return t?e.jsx(ge,{username:t}):null}},{id:"created_at",header:"Created At",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(je,{dateString:s()})})},{id:"admin_actions",header:"",accessorFn:s=>String(s.id),cell:({row:s,getValue:t})=>{var r,n,i;const a=t();return(i=(n=(r=s.original.body)==null?void 0:r.user)==null?void 0:n.body)!=null&&i.is_admin?e.jsx(Te,{secretId:a}):e.jsx("p",{className:"text-sm text-theme-text-secondary",children:"No Actions"})}}],y=1,Pe=f.object({page:f.coerce.number().min(y).optional().default(y).catch(y),name:f.string().optional(),operator:f.enum(["and","or"]).optional()});function Oe(){const[s]=Ne(),{page:t,name:a,operator:r}=Pe.parse({page:s.get("page")||void 0,name:s.get("name")||void 0,operator:s.get("operator")||void 0});return{page:t,name:a,logical_operator:r}}function Ae(){const s=Oe(),{data:t}=v({...de.secretList({...s,sort_by:"desc:created"}),throwOnError:!0}),{data:a}=ee(),r=(a==null?void 0:a.id)||"",{data:n,isLoading:i,isError:o,isSuccess:u}=v({...me.workspaceDetail("default")});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx(re,{searchParams:s}),i?e.jsx("div",{children:"Loading..."}):o?e.jsx("div",{children:"Error loading workspace details."}):u&&e.jsx(be,{id:r,workspace:n})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:t?e.jsx(se,{columns:Fe,data:t.items}):e.jsx(w,{className:"h-[250px] w-full"})}),t?t.total_pages>1&&e.jsx(ne,{searchParams:s,paginate:t}):e.jsx(w,{className:"h-[36px] w-[300px]"})]})]})}function ss(){const{setCurrentBreadcrumbData:s}=te();return x.useEffect(()=>{s({segment:"secrets",data:null})},[]),e.jsxs(ae,{className:"space-y-4 p-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Secrets"}),e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:["Configure and manage your pipeline secrets and configurations."," ",e.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://docs.zenml.io/how-to/interact-with-secrets",className:"link text-primary-400",children:"Learn More"})]})]}),e.jsx(Ae,{})]})}export{ss as default};
|
1
|
+
import{r as x,j as e}from"./@radix-C7hRs6Kx.js";import{o as D,p as C,j as E,F as T,ai as H,aj as K,h,ak as F,al as P,am as O,f as J,I as j,ap as A,aq as V,ar as G,s as U,D as W,w as X,x as Y,aH as Z,r as N,J as S,z as f,l as ee,M as se,S as w,n as te,B as ae}from"./index-D2iSHVZq.js";import{S as re,P as ne}from"./SearchField-D-h6jXyg.js";import{S as ie,s as le,E as ce,a as oe,b as de}from"./SecretTooltip-CePCL8kd.js";import{b as I,c as L,a as v}from"./@tanstack-CSxjHCME.js";import{w as me}from"./index-CFESYpe4.js";import{S as ue}from"./plus-COjQg3AG.js";import{S as q}from"./trash-BWSZ7NRK.js";import{t as xe}from"./zod-C0xYeTvL.js";import{u as he,a as pe,C as g}from"./index.esm-D7jFlf5N.js";import{S as fe}from"./Lock-DW-0_M0o.js";import{D as je}from"./DisplayDate-CYVBBSgr.js";import{I as ge}from"./InlineAvatar-Cfz4WSLK.js";import{c as ye}from"./code-snippets-CqONne41.js";import{L as b,d as Ne}from"./@react-router-CNP6g_RL.js";import{S as Se}from"./dots-horizontal-BGRJCPCs.js";import{D as k}from"./DialogItem-BHWf3sIB.js";import"./@reactflow-CQi1Z1Wq.js";import"./chevron-right-double-uNWbJT-C.js";import"./index-DR30v9MZ.js";import"./CodeSnippet-CvI6D0wx.js";async function we(s){const t=D(C.secrets.add(s.workspace)),a=await E(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!a.ok){const r=await a.json().then(n=>n.detail).catch(()=>"Failed to create Secret");throw new T({status:a.status,statusText:a.statusText,message:r})}return a.json()}function ve(s){return I({mutationFn:async t=>we(t),...s})}function be({id:s,workspace:t}){const[a,r]=x.useState(!1);return e.jsxs(H,{open:a,onOpenChange:r,children:[e.jsx(K,{asChild:!0,children:e.jsx(h,{className:"shrink-0",intent:"primary",children:"Add secret"})}),e.jsxs(F,{className:"mx-auto w-[90vw] max-w-[744px]",children:[e.jsx(P,{children:e.jsx(O,{children:"Register New Secret"})}),e.jsx(ke,{userId:s,setOpen:r,workspaceId:t.id})]})]})}function ke({userId:s,setOpen:t,workspaceId:a}){const{handleSubmit:r,control:n,watch:i,setValue:o,formState:{isValid:u},reset:p}=he({resolver:xe(le),defaultValues:{secretName:"",keysValues:[{key:"",value:""}]}}),{fields:m,append:_,remove:M}=pe({control:n,name:"keysValues"}),{toast:R}=J(),B=L(),{mutate:Q}=ve({onError(l){G(l)&&R({status:"error",emphasis:"subtle",description:l.message,rounded:!0})},onSuccess(){B.invalidateQueries({queryKey:["secrets"]}),t(!1),p()}}),z=l=>{Q({user:s,workspace:a,name:l.secretName,scope:"workspace",values:l.keysValues.reduce((c,d)=>(d.key&&d.value&&(c[d.key]=d.value),c),{})})},$=l=>{z(l)};return e.jsxs(e.Fragment,{children:[e.jsx("form",{id:"create-secret-form",className:"gap-5 p-5",onSubmit:r($),children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("label",{className:"font-inter text-sm text-left font-medium leading-5",children:["Secret Name",e.jsx("span",{className:"ml-1 text-theme-text-error",children:"*"})]}),e.jsx(g,{name:"secretName",control:n,render:({field:l})=>e.jsx(j,{...l,className:"mb-3 w-full",required:!0})})]}),e.jsxs("div",{className:"mt-10",children:[e.jsx("div",{children:e.jsx("h1",{className:"font-inter text-lg text-left font-semibold ",children:"Keys"})}),e.jsxs("div",{className:"mt-5 flex flex-row ",children:[e.jsx("div",{className:"flex-grow",children:e.jsx("label",{className:"font-inter text-sm text-left font-medium",children:"Key"})}),e.jsx("div",{className:"flex-grow pr-12",children:e.jsx("label",{className:"font-inter text-sm text-left font-medium",children:"Value"})})]})]}),m.map((l,c)=>e.jsxs("div",{className:"flex flex-row items-center space-x-1 ",children:[e.jsx("div",{className:"relative flex-grow ",children:e.jsx(g,{name:`keysValues.${c}.key`,control:n,render:({field:d})=>e.jsx(j,{...d,className:"mb-2 w-full",required:!0,placeholder:"key"})})}),e.jsx("div",{className:"relative flex-grow",children:e.jsxs("div",{className:"relative",children:[e.jsx(g,{name:`keysValues.${c}.value`,control:n,render:({field:d})=>e.jsx(j,{...d,className:"mb-2 w-full pr-10",required:!0,placeholder:"•••••••••",type:i(`keysValues.${c}.showPassword`)?"text":"password"})}),e.jsx("button",{type:"button",onClick:()=>{const d=i(`keysValues.${c}.showPassword`);o(`keysValues.${c}.showPassword`,!d)},className:"absolute inset-y-1 right-0 flex items-center pb-1 pr-3",children:e.jsx(ie,{className:"h-4 w-4 flex-shrink-0"})})]})}),e.jsxs("div",{className:"flex items-center",children:[c===m.length-1&&e.jsx(h,{intent:"primary",emphasis:"subtle",onClick:()=>_({key:"",value:""}),className:"mb-2 flex h-7 w-7 items-center justify-center",children:e.jsx(ue,{className:"flex-shrink-0 fill-primary-600"})}),c!==m.length-1&&e.jsx(h,{intent:"secondary",emphasis:"minimal",onClick:()=>M(c),className:"mb-2 h-7 w-7 items-center justify-center",children:e.jsx(q,{className:"flex-shrink-0 fill-theme-text-secondary"})})]})]},l.id))]})}),e.jsxs(A,{className:"gap-[10px]",children:[e.jsx(V,{asChild:!0,children:e.jsx(h,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(h,{intent:"primary",disabled:!u,type:"submit",form:"create-secret-form",children:"Register Secret"})]})]})}async function De(s){const t=D(C.secrets.detail(s)),a=await E(t,{method:"DELETE",headers:{"Content-Type":"application/json"}});if(a.status===404&&U(),!a.ok)throw new T({message:"Error deleting secret",status:a.status,statusText:a.statusText});return a.json()}function Ce(s){return I({mutationFn:async t=>De(t),...s})}function Ee({secretId:s}){const t=L(),{mutate:a}=Ce({onSuccess(){t.invalidateQueries({queryKey:["secrets"]})}}),[r,n]=x.useState("");function i(){a(s)}function o(u){n(u.target.value)}return e.jsxs(F,{children:[e.jsx(P,{children:e.jsx(O,{children:"Delete secret"})}),e.jsxs("div",{className:"gap-5 p-5",children:[e.jsx("p",{className:"text-text-md text-theme-text-secondary",children:"Are you sure you want to delete this secret?"}),e.jsx("p",{className:"text-text-md text-theme-text-secondary",children:"This action cannot be undone."}),e.jsx("h3",{className:"font-inter text-sm mb-1 mt-4 text-left font-medium leading-5",children:"Please type DELETE to confirm"}),e.jsx(j,{name:"key",onChange:o,className:"w-full",required:!0,value:r})]}),e.jsxs(A,{className:"gap-[10px]",children:[e.jsx(V,{asChild:!0,children:e.jsx(h,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(h,{intent:"danger",type:"submit",form:"edit-secret-form",onClick:i,disabled:r!=="DELETE",children:"Delete"})]})]})}function Te({secretId:s}){const[t,a]=x.useState(!1),[r,n]=x.useState(!1),i=x.useRef(null),o=x.useRef(null);function u(){o.current=i.current}function p(m){if(m===!1){a(!1),setTimeout(()=>{n(m)},200);return}n(m)}return e.jsxs(W,{onOpenChange:a,open:t,children:[e.jsx(X,{ref:i,children:e.jsx(Se,{className:"h-4 w-4 fill-theme-text-tertiary"})}),e.jsxs(Y,{hidden:r,onCloseAutoFocus:m=>{o.current&&(o.current.focus(),o.current=null,m.preventDefault())},align:"end",sideOffset:7,children:[e.jsx(k,{onSelect:u,onOpenChange:p,triggerChildren:"Edit ",icon:e.jsx(Z,{}),children:e.jsx(ce,{secretId:s,isSecretNameEditable:!0,dialogTitle:"Edit secret"})}),e.jsx(k,{onSelect:u,onOpenChange:p,triggerChildren:"Delete ",icon:e.jsx(q,{}),children:e.jsx(Ee,{secretId:s})})]})]})}const Fe=[{id:"secret",header:"Secret",accessorFn:s=>s.name,cell:({getValue:s,row:t})=>{const a=ye(t.original.name);return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(fe,{className:"h-5 w-5 flex-shrink-0 fill-primary-400"}),e.jsxs("div",{className:"group/copybutton flex flex-col",children:[e.jsxs("div",{className:"flex flex-row items-center space-x-1",children:[e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(b,{className:"text-text-md font-semibold text-theme-text-primary",to:N.settings.secrets.detail(t.original.id),children:t.original.name}),e.jsx(oe,{code:a})]}),e.jsx(S,{copyText:s()})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(b,{to:N.settings.secrets.detail(t.original.id),className:"flex items-center gap-1 text-text-sm text-theme-text-secondary",children:t.original.id.slice(0,8)}),e.jsx(S,{copyText:t.original.id})]})]})]})}},{id:"author",header:"Author",accessorFn:s=>{var t,a;return(a=(t=s.body)==null?void 0:t.user)==null?void 0:a.name},cell:({getValue:s})=>{const t=s();return t?e.jsx(ge,{username:t}):null}},{id:"created_at",header:"Created At",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(je,{dateString:s()})})},{id:"admin_actions",header:"",accessorFn:s=>String(s.id),cell:({row:s,getValue:t})=>{var r,n,i;const a=t();return(i=(n=(r=s.original.body)==null?void 0:r.user)==null?void 0:n.body)!=null&&i.is_admin?e.jsx(Te,{secretId:a}):e.jsx("p",{className:"text-sm text-theme-text-secondary",children:"No Actions"})}}],y=1,Pe=f.object({page:f.coerce.number().min(y).optional().default(y).catch(y),name:f.string().optional(),operator:f.enum(["and","or"]).optional()});function Oe(){const[s]=Ne(),{page:t,name:a,operator:r}=Pe.parse({page:s.get("page")||void 0,name:s.get("name")||void 0,operator:s.get("operator")||void 0});return{page:t,name:a,logical_operator:r}}function Ae(){const s=Oe(),{data:t}=v({...de.secretList({...s,sort_by:"desc:created"}),throwOnError:!0}),{data:a}=ee(),r=(a==null?void 0:a.id)||"",{data:n,isLoading:i,isError:o,isSuccess:u}=v({...me.workspaceDetail("default")});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx(re,{searchParams:s}),i?e.jsx("div",{children:"Loading..."}):o?e.jsx("div",{children:"Error loading workspace details."}):u&&e.jsx(be,{id:r,workspace:n})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:t?e.jsx(se,{columns:Fe,data:t.items}):e.jsx(w,{className:"h-[250px] w-full"})}),t?t.total_pages>1&&e.jsx(ne,{searchParams:s,paginate:t}):e.jsx(w,{className:"h-[36px] w-[300px]"})]})]})}function ss(){const{setCurrentBreadcrumbData:s}=te();return x.useEffect(()=>{s({segment:"secrets",data:null})},[]),e.jsxs(ae,{className:"space-y-4 p-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Secrets"}),e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:["Configure and manage your pipeline secrets and configurations."," ",e.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://docs.zenml.io/how-to/interact-with-secrets",className:"link text-primary-400",children:"Learn More"})]})]}),e.jsx(Ae,{})]})}export{ss as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as i,j as e}from"./@radix-C7hRs6Kx.js";import{S as Z}from"./code-browser-j2EpcxIA.js";import{S as x}from"./help-DyMolRxD.js";import{B as T,m as B,aU as P,c as V,S as M,ag as E,r as d,T as a,E as l,G as n,a0 as m,H as c,aV as R}from"./index-BygJE88j.js";import{d as z,L as h}from"./@react-router-CNP6g_RL.js";import{S as F}from"./clock-CPA5cYxq.js";import{C as L}from"./ProviderIcon-kkODO9tx.js";import{S as _}from"./layout-h3cbx8WZ.js";import"./@tanstack-CSxjHCME.js";import"./@reactflow-CQi1Z1Wq.js";import"./gcp-CHNvgEss.js";const U=s=>i.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...s},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.56811 2C4.57873 2 4.58936 2.00001 4.60001 2.00001H5.40001C5.41065 2.00001 5.42128 2 5.4319 2C5.68429 1.99997 5.93008 1.99994 6.13824 2.01695C6.36683 2.03563 6.63656 2.07969 6.90799 2.21799C7.28431 2.40974 7.59027 2.7157 7.78202 3.09202C7.92032 3.36345 7.96438 3.63318 7.98306 3.86178C7.98669 3.90624 7.98955 3.95241 7.99179 4.00001L16.0082 4.00001C16.0105 3.95241 16.0133 3.90624 16.0169 3.86178C16.0356 3.63318 16.0797 3.36345 16.218 3.09202C16.4097 2.7157 16.7157 2.40974 17.092 2.21799C17.3634 2.07969 17.6332 2.03563 17.8618 2.01695C18.0699 1.99994 18.3157 1.99997 18.5681 2H19.4319C19.6843 1.99997 19.9301 1.99994 20.1382 2.01695C20.3668 2.03563 20.6366 2.07969 20.908 2.21799C21.2843 2.40974 21.5903 2.7157 21.782 3.09202C21.9203 3.36345 21.9644 3.63318 21.9831 3.86178C22.0001 4.06993 22 4.31571 22 4.56809V5.43192C22 5.6843 22.0001 5.93008 21.9831 6.13824C21.9644 6.36683 21.9203 6.63656 21.782 6.90799C21.5903 7.28431 21.2843 7.59027 20.908 7.78202C20.6366 7.92032 20.3668 7.96438 20.1382 7.98306C20.0938 7.98669 20.0476 7.98955 20 7.99179V11C20 11.5523 19.5523 12 19 12C18.4477 12 18 11.5523 18 11V7.99179C17.9524 7.98955 17.9062 7.98669 17.8618 7.98306C17.6332 7.96438 17.3634 7.92032 17.092 7.78202C16.7157 7.59027 16.4097 7.28431 16.218 6.90799C16.0797 6.63656 16.0356 6.36683 16.0169 6.13824C16.0133 6.09377 16.0105 6.0476 16.0082 6.00001L7.99179 6.00001C7.98955 6.0476 7.98669 6.09377 7.98306 6.13824C7.96438 6.36683 7.92032 6.63656 7.78202 6.90799C7.59027 7.28431 7.28431 7.59027 6.90799 7.78202C6.63656 7.92032 6.36683 7.96438 6.13824 7.98306C6.09377 7.98669 6.0476 7.98955 6.00001 7.99179V16.0082C6.0476 16.0105 6.09377 16.0133 6.13824 16.0169C6.36683 16.0356 6.63656 16.0797 6.90799 16.218C7.28431 16.4097 7.59027 16.7157 7.78202 17.092C7.92032 17.3634 7.96438 17.6332 7.98306 17.8618C7.98669 17.9062 7.98955 17.9524 7.99179 18H11C11.5523 18 12 18.4477 12 19C12 19.5523 11.5523 20 11 20H7.99179C7.98955 20.0476 7.98669 20.0938 7.98306 20.1382C7.96438 20.3668 7.92032 20.6366 7.78202 20.908C7.59027 21.2843 7.28431 21.5903 6.90799 21.782C6.63656 21.9203 6.36683 21.9644 6.13824 21.9831C5.93008 22.0001 5.6843 22 5.43192 22H4.56809C4.31571 22 4.06993 22.0001 3.86178 21.9831C3.63318 21.9644 3.36345 21.9203 3.09202 21.782C2.7157 21.5903 2.40974 21.2843 2.21799 20.908C2.07969 20.6366 2.03563 20.3668 2.01695 20.1382C1.99994 19.9301 1.99997 19.6843 2 19.4319V18.5681C1.99997 18.3157 1.99994 18.0699 2.01695 17.8618C2.03563 17.6332 2.07969 17.3634 2.21799 17.092C2.40974 16.7157 2.7157 16.4097 3.09202 16.218C3.36345 16.0797 3.63318 16.0356 3.86178 16.0169C3.90624 16.0133 3.95241 16.0105 4.00001 16.0082V7.99179C3.95241 7.98955 3.90624 7.98669 3.86178 7.98306C3.63318 7.96438 3.36345 7.92032 3.09202 7.78202C2.7157 7.59027 2.40974 7.28431 2.21799 6.90799C2.07969 6.63656 2.03563 6.36683 2.01695 6.13824C1.99994 5.93008 1.99997 5.68429 2 5.4319C2 5.42128 2.00001 5.41065 2.00001 5.40001V4.60001C2.00001 4.58936 2 4.57873 2 4.56811C1.99997 4.31572 1.99994 4.06993 2.01695 3.86178C2.03563 3.63318 2.07969 3.36345 2.21799 3.09202C2.40974 2.7157 2.7157 2.40974 3.09202 2.21799C3.36345 2.07969 3.63318 2.03563 3.86178 2.01695C4.06993 1.99994 4.31572 1.99997 4.56811 2ZM5.40001 6.00001C5.69653 6.00001 5.85879 5.99923 5.97537 5.9897C5.98001 5.98932 5.98441 5.98894 5.98856 5.98856C5.98894 5.98441 5.98932 5.98001 5.9897 5.97537C5.99923 5.85879 6.00001 5.69653 6.00001 5.40001V4.60001C6.00001 4.30348 5.99923 4.14122 5.9897 4.02464C5.98932 4.02 5.98894 4.0156 5.98856 4.01145C5.98441 4.01107 5.98001 4.01069 5.97537 4.01031C5.85879 4.00078 5.69653 4.00001 5.40001 4.00001H4.60001C4.30348 4.00001 4.14122 4.00078 4.02464 4.01031C4.02 4.01069 4.0156 4.01107 4.01145 4.01145C4.01107 4.0156 4.01069 4.02 4.01031 4.02464C4.00078 4.14122 4.00001 4.30348 4.00001 4.60001V5.40001C4.00001 5.69653 4.00078 5.85879 4.01031 5.97537C4.01069 5.98001 4.01107 5.98441 4.01145 5.98856C4.0156 5.98894 4.02 5.98932 4.02464 5.9897C4.14122 5.99923 4.30348 6.00001 4.60001 6.00001H5.40001ZM4.60001 18C4.30348 18 4.14122 18.0008 4.02464 18.0103C4.02 18.0107 4.0156 18.0111 4.01145 18.0115C4.01107 18.0156 4.01069 18.02 4.01031 18.0246C4.00078 18.1412 4.00001 18.3035 4.00001 18.6V19.4C4.00001 19.6965 4.00078 19.8588 4.01031 19.9754C4.01069 19.98 4.01107 19.9844 4.01145 19.9885C4.0156 19.9889 4.02 19.9893 4.02464 19.9897C4.14122 19.9992 4.30348 20 4.60001 20H5.40001C5.69653 20 5.85879 19.9992 5.97537 19.9897C5.98001 19.9893 5.98441 19.9889 5.98856 19.9885C5.98894 19.9844 5.98932 19.98 5.9897 19.9754C5.99923 19.8588 6.00001 19.6965 6.00001 19.4V18.6C6.00001 18.3035 5.99923 18.1412 5.9897 18.0246C5.98932 18.02 5.98894 18.0156 5.98856 18.0115C5.98441 18.0111 5.98001 18.0107 5.97537 18.0103C5.85879 18.0008 5.69653 18 5.40001 18H4.60001ZM18 5.40001C18 5.69653 18.0008 5.85879 18.0103 5.97537C18.0107 5.98001 18.0111 5.98441 18.0115 5.98856C18.0156 5.98894 18.02 5.98932 18.0246 5.9897C18.1412 5.99923 18.3035 6.00001 18.6 6.00001H19.4C19.6965 6.00001 19.8588 5.99923 19.9754 5.9897C19.98 5.98932 19.9844 5.98893 19.9886 5.98855C19.9889 5.9844 19.9893 5.98001 19.9897 5.97537C19.9992 5.85879 20 5.69653 20 5.40001V4.60001C20 4.30348 19.9992 4.14122 19.9897 4.02464C19.9893 4.02 19.9889 4.0156 19.9885 4.01145C19.9844 4.01107 19.98 4.01069 19.9754 4.01031C19.8588 4.00078 19.6965 4.00001 19.4 4.00001H18.6C18.3035 4.00001 18.1412 4.00078 18.0246 4.01031C18.02 4.01069 18.0156 4.01107 18.0115 4.01145C18.0111 4.0156 18.0107 4.02 18.0103 4.02464C18.0008 4.14122 18 4.30348 18 4.60001V5.40001ZM18 14C18.5523 14 19 14.4477 19 15V17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H19V21C19 21.5523 18.5523 22 18 22C17.4477 22 17 21.5523 17 21V19H15C14.4477 19 14 18.5523 14 18C14 17.4477 14.4477 17 15 17H17V15C17 14.4477 17.4477 14 18 14Z"}));function S(){return e.jsx("div",{className:"group absolute z-20 flex h-full w-full items-center justify-center rounded-md border border-theme-border-moderate bg-white/70",children:e.jsx("div",{className:"hidden rounded-md bg-theme-text-primary px-3 py-2 text-text-xs text-theme-text-negative shadow-lg animate-in fade-in-0 fade-out-0 zoom-in-95 group-hover:block",children:"This option is not available for local deployments"})})}const D=s=>i.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},i.createElement("path",{d:"M15.1636 8.68344V14.9934L20.644 11.8401V5.52344L15.1636 8.68344Z",fill:"#4040B2"}),i.createElement("path",{d:"M9.08185 5.52344L14.5622 8.68344V14.9934L9.08185 11.8368V5.52344Z",fill:"#5C4EE5"}),i.createElement("path",{d:"M3 2V8.31333L8.48033 11.47V5.15667L3 2ZM9.08183 18.8433L14.5622 22V15.6867L9.08183 12.53V18.8433Z",fill:"#5C4EE5"})),$=s=>i.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...s},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 4C7.84315 4 6.5 5.34315 6.5 7C6.5 8.65685 7.84315 10 9.5 10C11.1569 10 12.5 8.65685 12.5 7C12.5 5.34315 11.1569 4 9.5 4ZM4.5 7C4.5 4.23858 6.73858 2 9.5 2C12.2614 2 14.5 4.23858 14.5 7C14.5 9.76142 12.2614 12 9.5 12C6.73858 12 4.5 9.76142 4.5 7ZM14.5731 2.91554C14.7803 2.40361 15.3633 2.1566 15.8752 2.36382C17.7058 3.10481 19 4.90006 19 7C19 9.09994 17.7058 10.8952 15.8752 11.6362C15.3633 11.8434 14.7803 11.5964 14.5731 11.0845C14.3658 10.5725 14.6129 9.98953 15.1248 9.7823C16.2261 9.33652 17 8.25744 17 7C17 5.74256 16.2261 4.66348 15.1248 4.2177C14.6129 4.01047 14.3658 3.42748 14.5731 2.91554ZM7.96448 14H11.0355C11.9373 14 12.6647 14 13.2567 14.0404C13.8654 14.0819 14.4037 14.1695 14.9134 14.3806C16.1386 14.8881 17.1119 15.8614 17.6194 17.0866C17.8305 17.5963 17.9181 18.1346 17.9596 18.7433C18 19.3353 18 20.0627 18 20.9645V21C18 21.5523 17.5523 22 17 22C16.4477 22 16 21.5523 16 21C16 20.0544 15.9995 19.3953 15.9643 18.8794C15.9297 18.3725 15.865 18.0773 15.7716 17.8519C15.4672 17.1169 14.8831 16.5328 14.1481 16.2284C13.9227 16.135 13.6275 16.0703 13.1206 16.0357C12.6047 16.0005 11.9456 16 11 16H8C7.05444 16 6.39534 16.0005 5.87945 16.0357C5.37254 16.0703 5.07733 16.135 4.85195 16.2284C4.11687 16.5328 3.53284 17.1169 3.22836 17.8519C3.135 18.0773 3.07033 18.3725 3.03574 18.8794C3.00054 19.3953 3 20.0544 3 21C3 21.5523 2.55229 22 2 22C1.44772 22 1 21.5523 1 21L1 20.9645C0.999993 20.0627 0.999988 19.3353 1.04038 18.7433C1.08191 18.1346 1.16948 17.5963 1.3806 17.0866C1.88807 15.8614 2.86144 14.8881 4.08658 14.3806C4.59628 14.1695 5.13456 14.0819 5.74331 14.0404C6.33531 14 7.06272 14 7.96448 14ZM18.0316 14.8768C18.1692 14.3419 18.7144 14.0199 19.2493 14.1576C21.4056 14.7126 23 16.6688 23 19V21C23 21.5523 22.5523 22 22 22C21.4477 22 21 21.5523 21 21V19C21 17.6035 20.0449 16.4275 18.7507 16.0945C18.2159 15.9568 17.8939 15.4116 18.0316 14.8768Z"}));function C({children:s,className:r,...t}){return e.jsx(T,{...t,className:B("h-full w-full space-y-1 px-6 py-5",r),children:s})}function u({children:s}){return e.jsx(e.Fragment,{children:s})}function j({children:s}){return e.jsx("div",{className:"space-y-0.5",children:s})}function f({children:s}){return e.jsx("div",{className:"flex items-center gap-1",children:s})}function p({children:s}){return e.jsx("h2",{className:"text-text-lg font-semibold",children:s})}function g({children:s}){return e.jsx("p",{className:"text-theme-text-secondary",children:s})}function y({children:s}){return e.jsx("div",{className:"flex w-full flex-wrap items-start justify-between gap-y-1",children:s})}function v({hasTerraform:s=!1}){return e.jsxs("div",{className:"flex items-center gap-2",children:[s&&e.jsx(D,{className:"h-4 w-4 shrink-0"}),e.jsx(L,{className:"h-4 w-4",provider:"aws"}),e.jsx(L,{className:"h-4 w-4",provider:"gcp"}),e.jsx(L,{className:"h-4 w-4",provider:"azure"})]})}function w({min:s}){return e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx(F,{className:"h-3 w-3 shrink-0 fill-theme-text-tertiary"}),e.jsxs("p",{className:"text-text-xs text-theme-text-tertiary",children:["Estimated time: ",s," mins"]})]})}function N({flexibility:s,children:r}){return e.jsxs("div",{className:"flex w-full items-center gap-0.5 lg:w-1/3",children:[e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx("span",{className:"text-theme-text-secondary",children:"Flexibility"}),r]}),e.jsx(P,{className:"h-1 flex-1 shrink-0 rounded-rounded",value:s})]})}function k({children:s}){return e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-y-1 text-text-xs",children:s})}function b({recommendataion:s}){return e.jsxs("div",{className:"flex items-center gap-0.5 text-text-xs text-theme-text-success",children:[e.jsx($,{className:"h-3 w-3 shrink-0 fill-theme-text-success"}),e.jsxs("p",{children:["Recommended for ",s]})]})}const H="https://docs.zenml.io/how-to/infrastructure-deployment/stack-deployment/deploy-a-cloud-stack";function q(){const{isError:s,isPending:r,data:t}=V();if(r)return e.jsx(M,{className:"h-[200px] w-full"});if(s)return e.jsx("div",{children:"Failed to load server info"});const o=E(t.deployment_type||"other");return e.jsxs("section",{className:"w-full space-y-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-text-xl font-semibold",children:"Create New Infrastructure"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Use our smart tools to create a new Cloud infrastructure a quick and simplified way."})]}),e.jsxs("div",{className:"grid w-full grid-cols-1 gap-6 md:grid-cols-2",children:[e.jsx(O,{isLocalDeployment:o}),e.jsx(A,{isLocalDeployment:o})]})]})}function O({isLocalDeployment:s}){const[r]=z(),t=d.stacks.create.newInfra+(r.size>=1?`?${r.toString()}`:"");return e.jsxs("div",{className:"relative",children:[s&&e.jsx(S,{}),e.jsx(h,{to:t,children:e.jsxs(C,{children:[e.jsxs(y,{children:[e.jsx(u,{children:e.jsx(Z,{className:"h-6 w-6 fill-primary-400"})}),e.jsx(v,{})]}),e.jsxs(j,{children:[e.jsxs(f,{children:[e.jsx(p,{children:"In-browser Experience"}),e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(m,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{align:"start",side:"bottom",className:"z-50 flex max-w-[480px] flex-col gap-2 bg-theme-surface-primary p-5 text-text-sm text-theme-text-primary",children:[e.jsx("p",{children:"Deploy the necessary pieces of infrastructure on your selected cloud provider and get you started on remote stack with a single click."}),e.jsx("a",{className:"link text-primary-400",target:"_blank",href:H,children:"Learn More"})]})]})})]}),e.jsx(g,{children:"Provision cloud infrastructure via browser UI. No local installs needed. Quick setup for cloud resources."})]}),e.jsx(b,{recommendataion:"data scientists"}),e.jsxs(k,{children:[e.jsx(w,{min:"5"}),e.jsx(N,{flexibility:25,children:e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(x,{className:"h-3 w-3 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{className:"z-50 max-w-[480px] bg-theme-surface-primary text-theme-text-primary",children:[e.jsx("strong",{children:"Low flexibility:"})," Best for straightforward setups with minimal customization."]})]})})})]})]})})]})}function A({isLocalDeployment:s}){const[r]=z(),t=d.stacks.create.terraform+(r.size>=1?`?${r.toString()}`:"");return e.jsxs("div",{className:"relative",children:[s&&e.jsx(S,{}),e.jsx(h,{to:t,children:e.jsxs(C,{className:"flex flex-col justify-between space-y-0",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(y,{children:[e.jsx(u,{children:e.jsx(U,{className:"h-6 w-6 fill-primary-400"})}),e.jsx(v,{hasTerraform:!0})]}),e.jsxs(j,{children:[e.jsxs(f,{children:[e.jsx(p,{children:"Infrastructure-as-code"}),e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(m,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{align:"start",side:"bottom",className:"z-50 flex max-w-[480px] flex-col gap-2 bg-theme-surface-primary p-5 text-text-sm text-theme-text-primary",children:[e.jsx("p",{children:"Infrastructure-as-code (IaC) refers to using a dynamic codebase to provision and manage infrastructure, rather than deferring to manual processes."}),e.jsx("a",{className:"link text-primary-400",target:"_blank",href:H,children:"Learn More"})]})]})})]}),e.jsx(g,{children:"Use Terraform modules to deploy infrastructure and register it back to ZenML."})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{recommendataion:"infrastructure engineers"}),e.jsxs(k,{children:[e.jsx(w,{min:"3"}),e.jsx(N,{flexibility:75,children:e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(x,{className:"h-3 w-3 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{className:"z-50 max-w-[480px] bg-theme-surface-primary text-theme-text-primary",children:[e.jsx("strong",{children:"High flexibility:"})," Offers extensive customization for advanced users or complex setups."]})]})})})]})]})]})})]})}const I="https://docs.zenml.io/how-to/infrastructure-deployment/stack-deployment/deploy-a-cloud-stack";function G(){const{isError:s,isPending:r,data:t}=V();if(r)return e.jsx(M,{className:"h-[200px] w-full"});if(s)return e.jsx("div",{children:"Failed to load server info"});const o=E(t.deployment_type||"other");return e.jsxs("section",{className:"w-full space-y-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-text-xl font-semibold",children:"Connect Existing Infrastructure"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Register your stack and components using existing resources that are already provisioned."})]}),e.jsxs("div",{className:"grid w-full grid-cols-1 gap-6 md:grid-cols-2",children:[e.jsx(J,{isLocalDeployment:o}),e.jsx(Q,{})]})]})}function Q(){const[s]=z(),r=d.stacks.create.manual+(s.size>=1?`?${s.toString()}`:"");return e.jsx("div",{className:"relative",children:e.jsx(h,{to:r,children:e.jsxs(C,{children:[e.jsxs(y,{children:[e.jsx(u,{children:e.jsx(_,{className:"h-6 w-6 fill-primary-400"})}),e.jsx(v,{})]}),e.jsxs(j,{children:[e.jsxs(f,{children:[e.jsx(p,{children:"Manual Setup"}),e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(m,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{align:"start",side:"bottom",className:"z-50 flex max-w-[480px] flex-col gap-2 bg-theme-surface-primary p-5 text-text-sm text-theme-text-primary",children:[e.jsx("p",{children:"Customize your ML stack by selecting each component individually through the ZenML interface. Choose from a list of pre-configured components or add new ones tailored to your needs."}),e.jsx("a",{className:"link text-primary-400",target:"_blank",href:I,children:"Learn More"})]})]})})]}),e.jsx(g,{children:"Register stack and components manually using ZenML. Recommended for advanced or custom configurations."})]}),e.jsx(b,{recommendataion:"advanced users"}),e.jsxs(k,{children:[e.jsx(w,{min:"5-10"}),e.jsx(N,{flexibility:100,children:e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(x,{className:"h-3 w-3 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{className:"z-50 max-w-[480px] bg-theme-surface-primary text-theme-text-primary",children:[e.jsx("strong",{children:"Full flexibility:"})," Complete control and customization. For expert users and highly specialized requirements."]})]})})})]})]})})})}function J({isLocalDeployment:s}){return e.jsxs("div",{className:"relative",children:[s&&e.jsx(S,{}),e.jsx(h,{to:d.stacks.create.existingInfra,children:e.jsxs(C,{children:[e.jsxs(y,{children:[e.jsx(u,{children:e.jsx(R,{className:"h-6 w-6 fill-primary-400"})}),e.jsx(v,{})]}),e.jsxs(j,{children:[e.jsxs(f,{children:[e.jsx(p,{children:"Scan your Cloud"}),e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(m,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{align:"start",side:"bottom",className:"z-50 flex max-w-[480px] flex-col gap-2 bg-theme-surface-primary p-5 text-text-sm text-theme-text-primary",children:[e.jsx("p",{children:"The stack wizard allows you to browse through your existing infrastructure and use it to register a ZenML cloud stack."}),e.jsx("a",{className:"link text-primary-400",target:"_blank",href:I,children:"Learn More"})]})]})})]}),e.jsx(g,{children:"Input your credentials and scan existing infrastructure on your cloud provider. Best for users with existing resources."})]}),e.jsx(b,{recommendataion:"infrastructure engineers"}),e.jsxs(k,{children:[e.jsx(w,{min:"5"}),e.jsx(N,{flexibility:50,children:e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(x,{className:"h-3 w-3 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{className:"z-50 max-w-[480px] bg-theme-surface-primary text-theme-text-primary",children:[e.jsx("strong",{children:"Medium flexibility:"})," Balances ease-of-use with some customization options."]})]})})})]})]})})]})}function n1(){return e.jsxs("section",{className:"layout-container space-y-5 py-5",children:[e.jsx(q,{}),e.jsx(G,{})]})}export{n1 as default};
|
1
|
+
import{r as i,j as e}from"./@radix-C7hRs6Kx.js";import{S as Z}from"./code-browser-j2EpcxIA.js";import{S as x}from"./help-DyMolRxD.js";import{B as T,m as B,aU as P,c as V,S as M,ag as E,r as d,T as a,E as l,G as n,a0 as m,H as c,aV as R}from"./index-D2iSHVZq.js";import{d as z,L as h}from"./@react-router-CNP6g_RL.js";import{S as F}from"./clock-CPA5cYxq.js";import{C as L}from"./ProviderIcon-DLo7t1lo.js";import{S as _}from"./layout-h3cbx8WZ.js";import"./@tanstack-CSxjHCME.js";import"./@reactflow-CQi1Z1Wq.js";import"./gcp-CHNvgEss.js";const U=s=>i.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...s},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.56811 2C4.57873 2 4.58936 2.00001 4.60001 2.00001H5.40001C5.41065 2.00001 5.42128 2 5.4319 2C5.68429 1.99997 5.93008 1.99994 6.13824 2.01695C6.36683 2.03563 6.63656 2.07969 6.90799 2.21799C7.28431 2.40974 7.59027 2.7157 7.78202 3.09202C7.92032 3.36345 7.96438 3.63318 7.98306 3.86178C7.98669 3.90624 7.98955 3.95241 7.99179 4.00001L16.0082 4.00001C16.0105 3.95241 16.0133 3.90624 16.0169 3.86178C16.0356 3.63318 16.0797 3.36345 16.218 3.09202C16.4097 2.7157 16.7157 2.40974 17.092 2.21799C17.3634 2.07969 17.6332 2.03563 17.8618 2.01695C18.0699 1.99994 18.3157 1.99997 18.5681 2H19.4319C19.6843 1.99997 19.9301 1.99994 20.1382 2.01695C20.3668 2.03563 20.6366 2.07969 20.908 2.21799C21.2843 2.40974 21.5903 2.7157 21.782 3.09202C21.9203 3.36345 21.9644 3.63318 21.9831 3.86178C22.0001 4.06993 22 4.31571 22 4.56809V5.43192C22 5.6843 22.0001 5.93008 21.9831 6.13824C21.9644 6.36683 21.9203 6.63656 21.782 6.90799C21.5903 7.28431 21.2843 7.59027 20.908 7.78202C20.6366 7.92032 20.3668 7.96438 20.1382 7.98306C20.0938 7.98669 20.0476 7.98955 20 7.99179V11C20 11.5523 19.5523 12 19 12C18.4477 12 18 11.5523 18 11V7.99179C17.9524 7.98955 17.9062 7.98669 17.8618 7.98306C17.6332 7.96438 17.3634 7.92032 17.092 7.78202C16.7157 7.59027 16.4097 7.28431 16.218 6.90799C16.0797 6.63656 16.0356 6.36683 16.0169 6.13824C16.0133 6.09377 16.0105 6.0476 16.0082 6.00001L7.99179 6.00001C7.98955 6.0476 7.98669 6.09377 7.98306 6.13824C7.96438 6.36683 7.92032 6.63656 7.78202 6.90799C7.59027 7.28431 7.28431 7.59027 6.90799 7.78202C6.63656 7.92032 6.36683 7.96438 6.13824 7.98306C6.09377 7.98669 6.0476 7.98955 6.00001 7.99179V16.0082C6.0476 16.0105 6.09377 16.0133 6.13824 16.0169C6.36683 16.0356 6.63656 16.0797 6.90799 16.218C7.28431 16.4097 7.59027 16.7157 7.78202 17.092C7.92032 17.3634 7.96438 17.6332 7.98306 17.8618C7.98669 17.9062 7.98955 17.9524 7.99179 18H11C11.5523 18 12 18.4477 12 19C12 19.5523 11.5523 20 11 20H7.99179C7.98955 20.0476 7.98669 20.0938 7.98306 20.1382C7.96438 20.3668 7.92032 20.6366 7.78202 20.908C7.59027 21.2843 7.28431 21.5903 6.90799 21.782C6.63656 21.9203 6.36683 21.9644 6.13824 21.9831C5.93008 22.0001 5.6843 22 5.43192 22H4.56809C4.31571 22 4.06993 22.0001 3.86178 21.9831C3.63318 21.9644 3.36345 21.9203 3.09202 21.782C2.7157 21.5903 2.40974 21.2843 2.21799 20.908C2.07969 20.6366 2.03563 20.3668 2.01695 20.1382C1.99994 19.9301 1.99997 19.6843 2 19.4319V18.5681C1.99997 18.3157 1.99994 18.0699 2.01695 17.8618C2.03563 17.6332 2.07969 17.3634 2.21799 17.092C2.40974 16.7157 2.7157 16.4097 3.09202 16.218C3.36345 16.0797 3.63318 16.0356 3.86178 16.0169C3.90624 16.0133 3.95241 16.0105 4.00001 16.0082V7.99179C3.95241 7.98955 3.90624 7.98669 3.86178 7.98306C3.63318 7.96438 3.36345 7.92032 3.09202 7.78202C2.7157 7.59027 2.40974 7.28431 2.21799 6.90799C2.07969 6.63656 2.03563 6.36683 2.01695 6.13824C1.99994 5.93008 1.99997 5.68429 2 5.4319C2 5.42128 2.00001 5.41065 2.00001 5.40001V4.60001C2.00001 4.58936 2 4.57873 2 4.56811C1.99997 4.31572 1.99994 4.06993 2.01695 3.86178C2.03563 3.63318 2.07969 3.36345 2.21799 3.09202C2.40974 2.7157 2.7157 2.40974 3.09202 2.21799C3.36345 2.07969 3.63318 2.03563 3.86178 2.01695C4.06993 1.99994 4.31572 1.99997 4.56811 2ZM5.40001 6.00001C5.69653 6.00001 5.85879 5.99923 5.97537 5.9897C5.98001 5.98932 5.98441 5.98894 5.98856 5.98856C5.98894 5.98441 5.98932 5.98001 5.9897 5.97537C5.99923 5.85879 6.00001 5.69653 6.00001 5.40001V4.60001C6.00001 4.30348 5.99923 4.14122 5.9897 4.02464C5.98932 4.02 5.98894 4.0156 5.98856 4.01145C5.98441 4.01107 5.98001 4.01069 5.97537 4.01031C5.85879 4.00078 5.69653 4.00001 5.40001 4.00001H4.60001C4.30348 4.00001 4.14122 4.00078 4.02464 4.01031C4.02 4.01069 4.0156 4.01107 4.01145 4.01145C4.01107 4.0156 4.01069 4.02 4.01031 4.02464C4.00078 4.14122 4.00001 4.30348 4.00001 4.60001V5.40001C4.00001 5.69653 4.00078 5.85879 4.01031 5.97537C4.01069 5.98001 4.01107 5.98441 4.01145 5.98856C4.0156 5.98894 4.02 5.98932 4.02464 5.9897C4.14122 5.99923 4.30348 6.00001 4.60001 6.00001H5.40001ZM4.60001 18C4.30348 18 4.14122 18.0008 4.02464 18.0103C4.02 18.0107 4.0156 18.0111 4.01145 18.0115C4.01107 18.0156 4.01069 18.02 4.01031 18.0246C4.00078 18.1412 4.00001 18.3035 4.00001 18.6V19.4C4.00001 19.6965 4.00078 19.8588 4.01031 19.9754C4.01069 19.98 4.01107 19.9844 4.01145 19.9885C4.0156 19.9889 4.02 19.9893 4.02464 19.9897C4.14122 19.9992 4.30348 20 4.60001 20H5.40001C5.69653 20 5.85879 19.9992 5.97537 19.9897C5.98001 19.9893 5.98441 19.9889 5.98856 19.9885C5.98894 19.9844 5.98932 19.98 5.9897 19.9754C5.99923 19.8588 6.00001 19.6965 6.00001 19.4V18.6C6.00001 18.3035 5.99923 18.1412 5.9897 18.0246C5.98932 18.02 5.98894 18.0156 5.98856 18.0115C5.98441 18.0111 5.98001 18.0107 5.97537 18.0103C5.85879 18.0008 5.69653 18 5.40001 18H4.60001ZM18 5.40001C18 5.69653 18.0008 5.85879 18.0103 5.97537C18.0107 5.98001 18.0111 5.98441 18.0115 5.98856C18.0156 5.98894 18.02 5.98932 18.0246 5.9897C18.1412 5.99923 18.3035 6.00001 18.6 6.00001H19.4C19.6965 6.00001 19.8588 5.99923 19.9754 5.9897C19.98 5.98932 19.9844 5.98893 19.9886 5.98855C19.9889 5.9844 19.9893 5.98001 19.9897 5.97537C19.9992 5.85879 20 5.69653 20 5.40001V4.60001C20 4.30348 19.9992 4.14122 19.9897 4.02464C19.9893 4.02 19.9889 4.0156 19.9885 4.01145C19.9844 4.01107 19.98 4.01069 19.9754 4.01031C19.8588 4.00078 19.6965 4.00001 19.4 4.00001H18.6C18.3035 4.00001 18.1412 4.00078 18.0246 4.01031C18.02 4.01069 18.0156 4.01107 18.0115 4.01145C18.0111 4.0156 18.0107 4.02 18.0103 4.02464C18.0008 4.14122 18 4.30348 18 4.60001V5.40001ZM18 14C18.5523 14 19 14.4477 19 15V17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H19V21C19 21.5523 18.5523 22 18 22C17.4477 22 17 21.5523 17 21V19H15C14.4477 19 14 18.5523 14 18C14 17.4477 14.4477 17 15 17H17V15C17 14.4477 17.4477 14 18 14Z"}));function S(){return e.jsx("div",{className:"group absolute z-20 flex h-full w-full items-center justify-center rounded-md border border-theme-border-moderate bg-white/70",children:e.jsx("div",{className:"hidden rounded-md bg-theme-text-primary px-3 py-2 text-text-xs text-theme-text-negative shadow-lg animate-in fade-in-0 fade-out-0 zoom-in-95 group-hover:block",children:"This option is not available for local deployments"})})}const D=s=>i.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},i.createElement("path",{d:"M15.1636 8.68344V14.9934L20.644 11.8401V5.52344L15.1636 8.68344Z",fill:"#4040B2"}),i.createElement("path",{d:"M9.08185 5.52344L14.5622 8.68344V14.9934L9.08185 11.8368V5.52344Z",fill:"#5C4EE5"}),i.createElement("path",{d:"M3 2V8.31333L8.48033 11.47V5.15667L3 2ZM9.08183 18.8433L14.5622 22V15.6867L9.08183 12.53V18.8433Z",fill:"#5C4EE5"})),$=s=>i.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...s},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 4C7.84315 4 6.5 5.34315 6.5 7C6.5 8.65685 7.84315 10 9.5 10C11.1569 10 12.5 8.65685 12.5 7C12.5 5.34315 11.1569 4 9.5 4ZM4.5 7C4.5 4.23858 6.73858 2 9.5 2C12.2614 2 14.5 4.23858 14.5 7C14.5 9.76142 12.2614 12 9.5 12C6.73858 12 4.5 9.76142 4.5 7ZM14.5731 2.91554C14.7803 2.40361 15.3633 2.1566 15.8752 2.36382C17.7058 3.10481 19 4.90006 19 7C19 9.09994 17.7058 10.8952 15.8752 11.6362C15.3633 11.8434 14.7803 11.5964 14.5731 11.0845C14.3658 10.5725 14.6129 9.98953 15.1248 9.7823C16.2261 9.33652 17 8.25744 17 7C17 5.74256 16.2261 4.66348 15.1248 4.2177C14.6129 4.01047 14.3658 3.42748 14.5731 2.91554ZM7.96448 14H11.0355C11.9373 14 12.6647 14 13.2567 14.0404C13.8654 14.0819 14.4037 14.1695 14.9134 14.3806C16.1386 14.8881 17.1119 15.8614 17.6194 17.0866C17.8305 17.5963 17.9181 18.1346 17.9596 18.7433C18 19.3353 18 20.0627 18 20.9645V21C18 21.5523 17.5523 22 17 22C16.4477 22 16 21.5523 16 21C16 20.0544 15.9995 19.3953 15.9643 18.8794C15.9297 18.3725 15.865 18.0773 15.7716 17.8519C15.4672 17.1169 14.8831 16.5328 14.1481 16.2284C13.9227 16.135 13.6275 16.0703 13.1206 16.0357C12.6047 16.0005 11.9456 16 11 16H8C7.05444 16 6.39534 16.0005 5.87945 16.0357C5.37254 16.0703 5.07733 16.135 4.85195 16.2284C4.11687 16.5328 3.53284 17.1169 3.22836 17.8519C3.135 18.0773 3.07033 18.3725 3.03574 18.8794C3.00054 19.3953 3 20.0544 3 21C3 21.5523 2.55229 22 2 22C1.44772 22 1 21.5523 1 21L1 20.9645C0.999993 20.0627 0.999988 19.3353 1.04038 18.7433C1.08191 18.1346 1.16948 17.5963 1.3806 17.0866C1.88807 15.8614 2.86144 14.8881 4.08658 14.3806C4.59628 14.1695 5.13456 14.0819 5.74331 14.0404C6.33531 14 7.06272 14 7.96448 14ZM18.0316 14.8768C18.1692 14.3419 18.7144 14.0199 19.2493 14.1576C21.4056 14.7126 23 16.6688 23 19V21C23 21.5523 22.5523 22 22 22C21.4477 22 21 21.5523 21 21V19C21 17.6035 20.0449 16.4275 18.7507 16.0945C18.2159 15.9568 17.8939 15.4116 18.0316 14.8768Z"}));function C({children:s,className:r,...t}){return e.jsx(T,{...t,className:B("h-full w-full space-y-1 px-6 py-5",r),children:s})}function u({children:s}){return e.jsx(e.Fragment,{children:s})}function j({children:s}){return e.jsx("div",{className:"space-y-0.5",children:s})}function f({children:s}){return e.jsx("div",{className:"flex items-center gap-1",children:s})}function p({children:s}){return e.jsx("h2",{className:"text-text-lg font-semibold",children:s})}function g({children:s}){return e.jsx("p",{className:"text-theme-text-secondary",children:s})}function y({children:s}){return e.jsx("div",{className:"flex w-full flex-wrap items-start justify-between gap-y-1",children:s})}function v({hasTerraform:s=!1}){return e.jsxs("div",{className:"flex items-center gap-2",children:[s&&e.jsx(D,{className:"h-4 w-4 shrink-0"}),e.jsx(L,{className:"h-4 w-4",provider:"aws"}),e.jsx(L,{className:"h-4 w-4",provider:"gcp"}),e.jsx(L,{className:"h-4 w-4",provider:"azure"})]})}function w({min:s}){return e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx(F,{className:"h-3 w-3 shrink-0 fill-theme-text-tertiary"}),e.jsxs("p",{className:"text-text-xs text-theme-text-tertiary",children:["Estimated time: ",s," mins"]})]})}function N({flexibility:s,children:r}){return e.jsxs("div",{className:"flex w-full items-center gap-0.5 lg:w-1/3",children:[e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx("span",{className:"text-theme-text-secondary",children:"Flexibility"}),r]}),e.jsx(P,{className:"h-1 flex-1 shrink-0 rounded-rounded",value:s})]})}function k({children:s}){return e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-y-1 text-text-xs",children:s})}function b({recommendataion:s}){return e.jsxs("div",{className:"flex items-center gap-0.5 text-text-xs text-theme-text-success",children:[e.jsx($,{className:"h-3 w-3 shrink-0 fill-theme-text-success"}),e.jsxs("p",{children:["Recommended for ",s]})]})}const H="https://docs.zenml.io/how-to/infrastructure-deployment/stack-deployment/deploy-a-cloud-stack";function q(){const{isError:s,isPending:r,data:t}=V();if(r)return e.jsx(M,{className:"h-[200px] w-full"});if(s)return e.jsx("div",{children:"Failed to load server info"});const o=E(t.deployment_type||"other");return e.jsxs("section",{className:"w-full space-y-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-text-xl font-semibold",children:"Create New Infrastructure"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Use our smart tools to create a new Cloud infrastructure a quick and simplified way."})]}),e.jsxs("div",{className:"grid w-full grid-cols-1 gap-6 md:grid-cols-2",children:[e.jsx(O,{isLocalDeployment:o}),e.jsx(A,{isLocalDeployment:o})]})]})}function O({isLocalDeployment:s}){const[r]=z(),t=d.stacks.create.newInfra+(r.size>=1?`?${r.toString()}`:"");return e.jsxs("div",{className:"relative",children:[s&&e.jsx(S,{}),e.jsx(h,{to:t,children:e.jsxs(C,{children:[e.jsxs(y,{children:[e.jsx(u,{children:e.jsx(Z,{className:"h-6 w-6 fill-primary-400"})}),e.jsx(v,{})]}),e.jsxs(j,{children:[e.jsxs(f,{children:[e.jsx(p,{children:"In-browser Experience"}),e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(m,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{align:"start",side:"bottom",className:"z-50 flex max-w-[480px] flex-col gap-2 bg-theme-surface-primary p-5 text-text-sm text-theme-text-primary",children:[e.jsx("p",{children:"Deploy the necessary pieces of infrastructure on your selected cloud provider and get you started on remote stack with a single click."}),e.jsx("a",{className:"link text-primary-400",target:"_blank",href:H,children:"Learn More"})]})]})})]}),e.jsx(g,{children:"Provision cloud infrastructure via browser UI. No local installs needed. Quick setup for cloud resources."})]}),e.jsx(b,{recommendataion:"data scientists"}),e.jsxs(k,{children:[e.jsx(w,{min:"5"}),e.jsx(N,{flexibility:25,children:e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(x,{className:"h-3 w-3 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{className:"z-50 max-w-[480px] bg-theme-surface-primary text-theme-text-primary",children:[e.jsx("strong",{children:"Low flexibility:"})," Best for straightforward setups with minimal customization."]})]})})})]})]})})]})}function A({isLocalDeployment:s}){const[r]=z(),t=d.stacks.create.terraform+(r.size>=1?`?${r.toString()}`:"");return e.jsxs("div",{className:"relative",children:[s&&e.jsx(S,{}),e.jsx(h,{to:t,children:e.jsxs(C,{className:"flex flex-col justify-between space-y-0",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(y,{children:[e.jsx(u,{children:e.jsx(U,{className:"h-6 w-6 fill-primary-400"})}),e.jsx(v,{hasTerraform:!0})]}),e.jsxs(j,{children:[e.jsxs(f,{children:[e.jsx(p,{children:"Infrastructure-as-code"}),e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(m,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{align:"start",side:"bottom",className:"z-50 flex max-w-[480px] flex-col gap-2 bg-theme-surface-primary p-5 text-text-sm text-theme-text-primary",children:[e.jsx("p",{children:"Infrastructure-as-code (IaC) refers to using a dynamic codebase to provision and manage infrastructure, rather than deferring to manual processes."}),e.jsx("a",{className:"link text-primary-400",target:"_blank",href:H,children:"Learn More"})]})]})})]}),e.jsx(g,{children:"Use Terraform modules to deploy infrastructure and register it back to ZenML."})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(b,{recommendataion:"infrastructure engineers"}),e.jsxs(k,{children:[e.jsx(w,{min:"3"}),e.jsx(N,{flexibility:75,children:e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(x,{className:"h-3 w-3 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{className:"z-50 max-w-[480px] bg-theme-surface-primary text-theme-text-primary",children:[e.jsx("strong",{children:"High flexibility:"})," Offers extensive customization for advanced users or complex setups."]})]})})})]})]})]})})]})}const I="https://docs.zenml.io/how-to/infrastructure-deployment/stack-deployment/deploy-a-cloud-stack";function G(){const{isError:s,isPending:r,data:t}=V();if(r)return e.jsx(M,{className:"h-[200px] w-full"});if(s)return e.jsx("div",{children:"Failed to load server info"});const o=E(t.deployment_type||"other");return e.jsxs("section",{className:"w-full space-y-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-text-xl font-semibold",children:"Connect Existing Infrastructure"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Register your stack and components using existing resources that are already provisioned."})]}),e.jsxs("div",{className:"grid w-full grid-cols-1 gap-6 md:grid-cols-2",children:[e.jsx(J,{isLocalDeployment:o}),e.jsx(Q,{})]})]})}function Q(){const[s]=z(),r=d.stacks.create.manual+(s.size>=1?`?${s.toString()}`:"");return e.jsx("div",{className:"relative",children:e.jsx(h,{to:r,children:e.jsxs(C,{children:[e.jsxs(y,{children:[e.jsx(u,{children:e.jsx(_,{className:"h-6 w-6 fill-primary-400"})}),e.jsx(v,{})]}),e.jsxs(j,{children:[e.jsxs(f,{children:[e.jsx(p,{children:"Manual Setup"}),e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(m,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{align:"start",side:"bottom",className:"z-50 flex max-w-[480px] flex-col gap-2 bg-theme-surface-primary p-5 text-text-sm text-theme-text-primary",children:[e.jsx("p",{children:"Customize your ML stack by selecting each component individually through the ZenML interface. Choose from a list of pre-configured components or add new ones tailored to your needs."}),e.jsx("a",{className:"link text-primary-400",target:"_blank",href:I,children:"Learn More"})]})]})})]}),e.jsx(g,{children:"Register stack and components manually using ZenML. Recommended for advanced or custom configurations."})]}),e.jsx(b,{recommendataion:"advanced users"}),e.jsxs(k,{children:[e.jsx(w,{min:"5-10"}),e.jsx(N,{flexibility:100,children:e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(x,{className:"h-3 w-3 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{className:"z-50 max-w-[480px] bg-theme-surface-primary text-theme-text-primary",children:[e.jsx("strong",{children:"Full flexibility:"})," Complete control and customization. For expert users and highly specialized requirements."]})]})})})]})]})})})}function J({isLocalDeployment:s}){return e.jsxs("div",{className:"relative",children:[s&&e.jsx(S,{}),e.jsx(h,{to:d.stacks.create.existingInfra,children:e.jsxs(C,{children:[e.jsxs(y,{children:[e.jsx(u,{children:e.jsx(R,{className:"h-6 w-6 fill-primary-400"})}),e.jsx(v,{})]}),e.jsxs(j,{children:[e.jsxs(f,{children:[e.jsx(p,{children:"Scan your Cloud"}),e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(m,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{align:"start",side:"bottom",className:"z-50 flex max-w-[480px] flex-col gap-2 bg-theme-surface-primary p-5 text-text-sm text-theme-text-primary",children:[e.jsx("p",{children:"The stack wizard allows you to browse through your existing infrastructure and use it to register a ZenML cloud stack."}),e.jsx("a",{className:"link text-primary-400",target:"_blank",href:I,children:"Learn More"})]})]})})]}),e.jsx(g,{children:"Input your credentials and scan existing infrastructure on your cloud provider. Best for users with existing resources."})]}),e.jsx(b,{recommendataion:"infrastructure engineers"}),e.jsxs(k,{children:[e.jsx(w,{min:"5"}),e.jsx(N,{flexibility:50,children:e.jsx(a,{children:e.jsxs(l,{children:[e.jsx(n,{asChild:!0,children:e.jsx("div",{className:"z-10",children:e.jsx(x,{className:"h-3 w-3 shrink-0 fill-theme-text-tertiary"})})}),e.jsxs(c,{className:"z-50 max-w-[480px] bg-theme-surface-primary text-theme-text-primary",children:[e.jsx("strong",{children:"Medium flexibility:"})," Balances ease-of-use with some customization options."]})]})})})]})]})})]})}function n1(){return e.jsxs("section",{className:"layout-container space-y-5 py-5",children:[e.jsx(q,{}),e.jsx(G,{})]})}export{n1 as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{j as e,r as d,aG as N,aH as q,aI as P,aJ as U}from"./@radix-C7hRs6Kx.js";import{T as V,E as Z,G,a0 as J,H as K,al as O,am as E,ac as p,ah as W,h as f,ap as X,aq as Y,ai as ee,aj as te,ak as se,aW as re,I as R,X as ae,_ as ne,Z as ie,r as Q,z as x,f as oe,i as ce,m as le}from"./index-BygJE88j.js";import{b as u,C as de,u as me,F as pe}from"./index.esm-D7jFlf5N.js";import{C as B}from"./ComponentIcon-B_7Y_oV-.js";import{D as ue}from"./DisplayDate-CYVBBSgr.js";import{I as he}from"./InlineAvatar-Cpj0lVRQ.js";import{h as xe,j as fe,a as ge,c as je}from"./@tanstack-CSxjHCME.js";import{d as ke}from"./index-DR30v9MZ.js";import{s as be,R as ve,a as ye,u as Ne}from"./create-stack-BXLyjE58.js";import{S as Se}from"./flavor-select-BTEwByv6.js";import{S as we}from"./arrow-left-CwgF2MEM.js";import{C as Ce}from"./configuration-form-DBZSb0FV.js";import{s as v}from"./constants-DP3ZEnXH.js";import{S as Le}from"./check-circle-mvyzYvIW.js";import{L as _e,c as Te}from"./@react-router-CNP6g_RL.js";import{s as Fe}from"./index-8uhUi12k.js";import{w as ze}from"./index-wYtmKLnQ.js";import{t as Ie}from"./zod-C0xYeTvL.js";import{s as Me}from"./sharedSchema-BACERDat.js";import"./@reactflow-CQi1Z1Wq.js";import"./layout-h3cbx8WZ.js";import"./rocket-Cf-B-XOR.js";import"./index-D9-ukAem.js";import"./plus-COjQg3AG.js";import"./trash-BWSZ7NRK.js";import"./type-guards-CaeD8wHO.js";import"./check-DK77doTf.js";import"./CodeSnippet-Di-loaZu.js";import"./file-text-BdxZdjP_.js";import"./terminal-square-DMtel8mb.js";import"./stack-detail-query-ihiJr6nq.js";const S={helpLink:"https://docs.zenml.io/stack-components/orchestrators",description:"An orchestrator is a special kind of backend that manages the running of each step of the pipeline. Orchestrators administer the actual pipeline runs. By default, ZenML initializes your repository with an orchestrator that runs everything on your local machine."},w={helpLink:"https://docs.zenml.io/stack-components/artifact-stores",description:"The Artifact Store is a central component in any MLOps stack. As the name suggests, it acts as a data persistence layer where artifacts (e.g. datasets, models) ingested or generated by the machine learning pipelines are stored."},C={helpLink:"https://docs.zenml.io/stack-components/container-registries",description:"Container registry is used to store container images that are built to run machine learning pipelines in remote environments. Containerization of the pipeline code creates a portable environment that allows code to run in an isolated manner."},L={description:"Step operators allow you to run individual steps in a custom environment different from the default one used by your active orchestrator.",helpLink:"https://docs.zenml.io/stack-components/step-operators"},_={description:"Model deployers are stack components responsible for online model serving. They are responsible for deploying models to a remote server. Model deployers also act as a registry for models that are served with ZenML.",helpLink:"https://docs.zenml.io/stack-components/model-deployers"},T={description:"ZenML supports connecting to a Redis-backed Feast feature store as a stack component integration.",helpLink:"https://docs.zenml.io/stack-components/feature-stores"},F={description:"Experiment trackers let you track your ML experiments by logging the parameters and allowing you to compare between different runs.",helpLink:"https://docs.zenml.io/stack-components/experiment-trackers"},z={description:"Alerters allow you to send messages to chat services (like Slack, Discord, Mattermost, etc.) from within your pipelines. This is useful to immediately get notified when failures happen, for general monitoring/reporting, and also for building human-in-the-loop ML.",helpLink:"https://docs.zenml.io/stack-components/alerters "},I={description:"Annotators are a stack component that enables the use of data annotation as part of your ZenML stack and pipelines.",helpLink:"https://docs.zenml.io/stack-components/annotators"},M={description:"Data Validators used in ZenML pipelines usually generate data profiles and data quality check reports that are versioned and stored in the Artifact Store and can be retrieved and visualized later.",helpLink:"https://docs.zenml.io/stack-components/data-validators"},D={description:"The image builder is an essential part of most remote MLOps stacks. It is used to build container images such that your machine-learning pipelines and steps can be executed in remote environments.",helpLink:"https://docs.zenml.io/stack-components/image-builders"},A={description:"Model registries are centralized storage solutions for managing and tracking machine learning models across various stages of development and deployment.",helpLink:"https://docs.zenml.io/stack-components/model-registries"};function De({type:t}){const{description:s,link:r}=Ae(t);return e.jsx(V,{children:e.jsxs(Z,{delayDuration:200,children:[e.jsxs(G,{children:[e.jsx(J,{className:"h-4 w-4 shrink-0 fill-theme-text-tertiary"}),e.jsxs("div",{className:"sr-only",children:["Info for ",t]})]}),e.jsxs(K,{align:"start",side:"bottom",className:"flex max-w-xl flex-col gap-2 bg-theme-surface-primary p-5 text-text-sm text-theme-text-primary",children:[e.jsx("p",{children:s}),e.jsx("a",{className:"link mt-2 text-primary-400",target:"_blank",href:r,children:"Learn more"})]})]})})}function Ae(t){switch(t){case"orchestrator":return{description:S.description,link:S.helpLink};case"alerter":return{description:z.description,link:z.helpLink};case"annotator":return{description:I.description,link:I.helpLink};case"artifact_store":return{description:w.description,link:w.helpLink};case"container_registry":return{description:C.description,link:C.helpLink};case"data_validator":return{description:M.description,link:M.helpLink};case"experiment_tracker":return{description:F.description,link:F.helpLink};case"feature_store":return{description:T.description,link:T.helpLink};case"image_builder":return{description:D.description,link:D.helpLink};case"model_deployer":return{description:_.description,link:_.helpLink};case"model_registry":return{description:A.description,link:A.helpLink};case"step_operator":return{description:L.description,link:L.helpLink}}}function $e({type:t,setSelectedFlavor:s}){return e.jsxs(e.Fragment,{children:[e.jsx(O,{children:e.jsxs(E,{children:["Select ",p(t)," Flavor"]})}),e.jsx(W,{viewportClassName:"max-h-[70vh]",children:e.jsx("div",{className:"p-5",children:e.jsx(Se,{setSelectedFlavor:s,type:t})})})]})}function Oe({name:t,id:s,backHandler:r,type:n,successHandler:i}){const o=d.useId();return e.jsxs(e.Fragment,{children:[e.jsx(O,{className:"w-full",children:e.jsxs("div",{className:"flex w-0 flex-1 items-center gap-2",children:[e.jsxs(f,{intent:"secondary",emphasis:"subtle",className:"flex aspect-square size-6 items-center justify-center",onClick:()=>r(),children:[e.jsx(we,{className:"size-5 shrink-0"}),e.jsx("span",{className:"sr-only",children:"Go step back"})]}),e.jsxs(E,{className:"truncate",children:["Configure your ",p(t)," ",p(n)]})]})}),e.jsx(Ce,{useMaxHeight:!0,flavorId:s,formId:o,successHandler:i,FooterComponent:Ee})]})}function Ee({formId:t,isPending:s}){return e.jsx(X,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Y,{asChild:!0,children:e.jsx(f,{size:"md",intent:"secondary",children:"Cancel"})}),e.jsxs(f,{size:"md",disabled:s,type:"submit",form:t,children:[s&&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"}),"Register Component"]})]})})}function Re({type:t}){const[s,r]=d.useState(!1),[n,i]=d.useState(0),[o,l]=d.useState(null);async function a(c){r(c),await be(100),c||(i(0),l(null))}function g(c){var m;l({id:c.id,name:c.name,logoUrl:((m=c.body)==null?void 0:m.logo_url)??void 0}),i(h=>h+1)}function j(){i(0),l(null)}return e.jsxs(ee,{open:s,onOpenChange:c=>a(c),children:[e.jsx(te,{asChild:!0,children:e.jsxs("button",{className:"w-full rounded-md border border-dashed border-neutral-300 bg-theme-surface-tertiary py-5 text-theme-text-secondary",children:["New ",p(t)]})}),e.jsxs(se,{className:"w-full sm:max-w-[640px] md:max-w-3xl xl:max-w-[1080px]",children:[n===0&&e.jsx($e,{setSelectedFlavor:g,type:t}),n===1&&!!o&&e.jsx(Oe,{successHandler:()=>a(!1),backHandler:j,...o,type:t})]})]})}function Qe(){return e.jsxs(e.Fragment,{children:[v.map(t=>e.jsx(N,{className:"h-full space-y-5 p-5",value:t,children:e.jsx(qe,{type:t})},t)),e.jsx(N,{className:"h-full",value:"",children:e.jsx("div",{className:"flex h-full w-full items-center justify-center text-theme-text-tertiary",children:"Select a category to add a new component"})})]})}function Be({type:t,search:s}){const r=xe({...ae.componentListInfinite({sort_by:"desc:updated",type:t,...s?{name:`contains:${s}`}:{}})}),{control:n,watch:i,setValue:o}=u();return r.isError?e.jsx("p",{children:"Error while fetching Components"}):r.isPending?e.jsx("div",{className:"flex w-full flex-1 items-center justify-center",children:e.jsx(ne,{})}):e.jsxs("div",{className:"space-y-1",children:[e.jsx("ul",{className:"space-y-1",children:r.data.pages.map(l=>l.items.map(a=>e.jsx("li",{children:e.jsx(de,{name:`components.${t}.id`,control:n,render:({field:{onChange:g,...j}})=>{var c,m,h,k;return e.jsxs(ve,{className:"justify-between bg-theme-surface-primary font-medium","data-state":i(`components.${t}.id`)===a.id?"selected":"unselected",htmlFor:a.id,children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(ye,{...j,id:a.id,type:"radio",value:a.id,onChange:H=>{var y;o(`components.${t}.name`,a.name),o(`components.${t}.logoUrl`,((y=a.body)==null?void 0:y.logo_url)||""),g(H)},checked:i(`components.${t}.id`)===a.id,name:t}),e.jsx("img",{alt:"flavor icon",src:ie(((c=a.body)==null?void 0:c.logo_url)||""),width:24,height:24}),e.jsxs("div",{className:"min-w-0 truncate",children:[e.jsx("div",{className:"truncate font-semibold",children:a.name}),e.jsx("div",{className:"truncate text-text-xs text-theme-text-secondary",children:a.id.split("-")[0]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-text-sm",children:[((h=(m=a.body)==null?void 0:m.user)==null?void 0:h.name)&&e.jsx(he,{username:a.body.user.name}),((k=a.body)==null?void 0:k.updated)&&e.jsx("div",{className:"whitespace-nowrap text-theme-text-secondary",children:e.jsx(ue,{short:!0,dateString:a.body.updated})})]})]})}})},a.id)))}),e.jsx(Re,{type:t}),r.hasNextPage&&e.jsx(f,{onClick:()=>r.fetchNextPage(),type:"button",size:"md",intent:"secondary",emphasis:"subtle",className:"flex w-full items-center justify-center bg-theme-surface-primary",children:e.jsxs("div",{className:"flex items-center gap-1",children:[r.isFetchingNextPage&&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"}),"Load more"]})})]})}function He({type:t}){return e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(B,{className:"h-5 w-5 fill-primary-400",type:t}),e.jsx("h2",{className:"text-text-lg font-semibold",children:p(t)}),e.jsx(De,{type:t})]}),e.jsxs("p",{className:"text-theme-text-secondary",children:["Select a existing ",re(t)," from your server:"]})]})}function qe({type:t}){const[s,r]=d.useState(""),{watch:n,setValue:i}=u(),o=n(`components.${t}`);return d.useEffect(()=>{o&&!o.id&&i(`components.${t}`,null)},[o,i,t]),e.jsxs(e.Fragment,{children:[e.jsx(He,{type:t}),e.jsx(Pe,{search:s,setSearch:r}),e.jsx(Be,{search:s,type:t})]})}function Pe({setSearch:t,search:s}){const[r,n]=d.useState(s),i=d.useCallback(ke(t,500),[]);d.useEffect(()=>()=>{i.cancel()},[i]);function o(l){n(l),i(l)}return e.jsx(R,{value:r,onChange:l=>o(l.target.value),placeholder:"Search..."})}function Ue({type:t}){const{watch:s,formState:{errors:r}}=u(),n=s(`components.${t}`),i=n&&n.id;return e.jsx("div",{"data-error":!i&&r.components&&r.components[t]?"true":"false","data-filled":i?"true":"false",className:"flex h-[110px] flex-col items-center justify-center space-y-2 truncate whitespace-nowrap rounded-md border border-theme-border-moderate bg-theme-surface-secondary py-5 text-center text-text-sm text-theme-text-secondary transition-all duration-150 hover:bg-theme-surface-primary hover:shadow-sm data-[error=true]:border-theme-text-error data-[filled=true]:border-success-400 data-[filled=true]:bg-theme-surface-primary data-[state=active]:bg-theme-surface-primary group-data-[state=active]/trigger:bg-theme-surface-primary group-data-[state=active]/trigger:shadow-md data-[error=false]:data-[filled=false]:group-data-[state=active]/trigger:border-theme-border-bold",children:i?e.jsx(Ve,{type:t}):e.jsx(Ze,{type:t})})}function Ve({type:t}){const{watch:s}=u(),r=s(`components.${t}`);return r&&r.id?e.jsxs("div",{className:"flex flex-col items-center gap-2 text-text-sm",children:[e.jsx("img",{width:24,height:24,src:r.logoUrl,alt:`Icon of ${r.name}`}),e.jsxs("div",{className:"space-y-0.25",children:[e.jsx("div",{className:"text-theme-text-primary",children:r.name}),e.jsx("div",{className:"text-text-xs text-theme-text-tertiary",children:p(t)})]})]}):null}function Ze({type:t}){return e.jsxs(e.Fragment,{children:[e.jsx(B,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary group-data-[state=active]/trigger:fill-theme-surface-strong",type:t}),e.jsx("span",{children:p(t)})]})}function Ge(){return e.jsxs("div",{className:"flex h-full flex-col justify-between space-y-5",children:[e.jsxs("div",{className:"space-y-5 p-5",children:[e.jsx(We,{}),e.jsx(Je,{})]}),e.jsx(Ke,{})]})}function Je(){const{watch:t,resetField:s}=u();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-text-lg font-semibold",children:"Add Components"}),e.jsxs("p",{className:"text-theme-text-secondary",children:["All stacks have at minimum an orchestrator and an artifact store."," ",e.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://docs.zenml.io/stack-components/component-guide",className:"link text-primary-400",children:"Learn more"})]})]}),e.jsx(q,{children:e.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-4",children:v.map(r=>e.jsxs("div",{className:"relative",children:[e.jsx(P,{className:"group/trigger w-full",value:r,children:e.jsx(Ue,{type:r})}),t(`components.${r}.id`)&&e.jsx("button",{type:"button",onClick:n=>{n.preventDefault(),s(`components.${r}`)},className:"absolute right-[-12px] top-[-12px] flex aspect-square h-[28px] w-[28px] items-center justify-center rounded-rounded bg-theme-surface-primary",children:e.jsx(Le,{className:"h-5 w-5 shrink-0 fill-success-400"})})]},r))})})]})}function Ke(){const{formState:{isSubmitting:t}}=u(),s=!!fe();return e.jsxs("div",{className:"flex items-center justify-end space-x-2 border-t border-theme-border-moderate p-5",children:[e.jsx(f,{asChild:!0,intent:"secondary",size:"md",children:e.jsx(_e,{to:Q.stacks.create.index,children:"Cancel"})}),e.jsxs(f,{className:"flex items-center gap-1",disabled:t||s,size:"md",children:[(s||t)&&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"}),"Register Stack"]})]})}function We(){var r;const{register:t,formState:{errors:s}}=u();return e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-text-sm",htmlFor:"stack-name",children:"Stack Name"}),e.jsx(R,{id:"stack-name",className:`${s.stackName?"border-red-500":""} w-full`,placeholder:"zenml-stack",...t("stackName")}),s.stackName&&e.jsx("p",{className:"text-text-xs text-red-500",children:(r=s.stackName.message)==null?void 0:r.toString()})]})}const b=x.object({id:x.string().trim().min(1),name:x.string().trim().min(1),logoUrl:x.string().trim().min(1)}),Xe=v.reduce((t,s)=>(t[s]=b.nullable(),t),{}),Ye=x.object({stackName:Me,components:x.object({...Xe,orchestrator:b,artifact_store:b})});function et(){const t=ge({...ze.workspaceDetail("default")}),{toast:s}=oe(),r=Te(),n=je(),i=Ne({onSuccess:async()=>{n.invalidateQueries({queryKey:Fe.all}),r(Q.stacks.overview)},onError:a=>{s({status:"error",emphasis:"subtle",icon:e.jsx(ce,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:a.message,rounded:!0})}});function o(a){var c;const g=Object.entries(a.components).reduce((m,[h,k])=>(k&&(m[h]=[k.id]),m),{}),j={name:a.stackName,components:g};i.mutate({workspaceId:((c=t.data)==null?void 0:c.id)||"",payload:j})}const l=me({resolver:Ie(Ye),defaultValues:{components:{alerter:null,orchestrator:{},annotator:null,artifact_store:{},container_registry:null,data_validator:null,experiment_tracker:null,feature_store:null,model_registry:null,image_builder:null,model_deployer:null,step_operator:null},stackName:""}});return{createManualStack:o,form:l}}function It(){const[t,s]=d.useState(""),{createManualStack:r,form:n}=et();return e.jsx(pe,{...n,children:e.jsx(U,{value:t,onValueChange:s,className:"h-full",children:e.jsxs("form",{onSubmit:n.handleSubmit(r),className:"flex h-[calc(100vh_-_4rem_-_4rem_-_2px)] flex-1 flex-col divide-y divide-theme-border-moderate xl:flex-row-reverse xl:divide-x xl:divide-y-0 xl:divide-x-reverse",children:[e.jsx($,{className:"h-full flex-1 bg-theme-surface-primary",children:e.jsx(Ge,{})}),e.jsx($,{children:e.jsx(Qe,{})})]})})})}function $({className:t,...s}){return e.jsx("div",{className:le("w-full overflow-y-auto xl:w-1/2",t),...s})}export{It as default};
|
1
|
+
import{j as e,r as d,aG as N,aH as q,aI as P,aJ as U}from"./@radix-C7hRs6Kx.js";import{T as V,E as Z,G,a0 as J,H as K,al as O,am as E,ac as p,ah as W,h as f,ap as X,aq as Y,ai as ee,aj as te,ak as se,aW as re,I as R,X as ae,_ as ne,Z as ie,r as Q,z as x,f as oe,i as ce,m as le}from"./index-D2iSHVZq.js";import{b as u,C as de,u as me,F as pe}from"./index.esm-D7jFlf5N.js";import{C as B}from"./ComponentIcon-ils7uNAk.js";import{D as ue}from"./DisplayDate-CYVBBSgr.js";import{I as he}from"./InlineAvatar-Cfz4WSLK.js";import{h as xe,j as fe,a as ge,c as je}from"./@tanstack-CSxjHCME.js";import{d as ke}from"./index-DR30v9MZ.js";import{s as be,R as ve,a as ye,u as Ne}from"./create-stack-BJ6x5rzj.js";import{S as Se}from"./flavor-select-BnPxvQDN.js";import{S as we}from"./arrow-left-CwgF2MEM.js";import{C as Ce}from"./configuration-form-BtI2Y4eX.js";import{s as v}from"./constants-DP3ZEnXH.js";import{S as Le}from"./check-circle-mvyzYvIW.js";import{L as _e,c as Te}from"./@react-router-CNP6g_RL.js";import{s as Fe}from"./index-CrhdX_qG.js";import{w as ze}from"./index-CFESYpe4.js";import{t as Ie}from"./zod-C0xYeTvL.js";import{s as Me}from"./sharedSchema-Bse2agAf.js";import"./@reactflow-CQi1Z1Wq.js";import"./layout-h3cbx8WZ.js";import"./rocket-Cf-B-XOR.js";import"./index-CmLcvK2z.js";import"./plus-COjQg3AG.js";import"./trash-BWSZ7NRK.js";import"./type-guards-CaeD8wHO.js";import"./check-DK77doTf.js";import"./CodeSnippet-CvI6D0wx.js";import"./file-text-BdxZdjP_.js";import"./terminal-square-DMtel8mb.js";import"./stack-detail-query-BAcZJrN3.js";const S={helpLink:"https://docs.zenml.io/stack-components/orchestrators",description:"An orchestrator is a special kind of backend that manages the running of each step of the pipeline. Orchestrators administer the actual pipeline runs. By default, ZenML initializes your repository with an orchestrator that runs everything on your local machine."},w={helpLink:"https://docs.zenml.io/stack-components/artifact-stores",description:"The Artifact Store is a central component in any MLOps stack. As the name suggests, it acts as a data persistence layer where artifacts (e.g. datasets, models) ingested or generated by the machine learning pipelines are stored."},C={helpLink:"https://docs.zenml.io/stack-components/container-registries",description:"Container registry is used to store container images that are built to run machine learning pipelines in remote environments. Containerization of the pipeline code creates a portable environment that allows code to run in an isolated manner."},L={description:"Step operators allow you to run individual steps in a custom environment different from the default one used by your active orchestrator.",helpLink:"https://docs.zenml.io/stack-components/step-operators"},_={description:"Model deployers are stack components responsible for online model serving. They are responsible for deploying models to a remote server. Model deployers also act as a registry for models that are served with ZenML.",helpLink:"https://docs.zenml.io/stack-components/model-deployers"},T={description:"ZenML supports connecting to a Redis-backed Feast feature store as a stack component integration.",helpLink:"https://docs.zenml.io/stack-components/feature-stores"},F={description:"Experiment trackers let you track your ML experiments by logging the parameters and allowing you to compare between different runs.",helpLink:"https://docs.zenml.io/stack-components/experiment-trackers"},z={description:"Alerters allow you to send messages to chat services (like Slack, Discord, Mattermost, etc.) from within your pipelines. This is useful to immediately get notified when failures happen, for general monitoring/reporting, and also for building human-in-the-loop ML.",helpLink:"https://docs.zenml.io/stack-components/alerters "},I={description:"Annotators are a stack component that enables the use of data annotation as part of your ZenML stack and pipelines.",helpLink:"https://docs.zenml.io/stack-components/annotators"},M={description:"Data Validators used in ZenML pipelines usually generate data profiles and data quality check reports that are versioned and stored in the Artifact Store and can be retrieved and visualized later.",helpLink:"https://docs.zenml.io/stack-components/data-validators"},D={description:"The image builder is an essential part of most remote MLOps stacks. It is used to build container images such that your machine-learning pipelines and steps can be executed in remote environments.",helpLink:"https://docs.zenml.io/stack-components/image-builders"},A={description:"Model registries are centralized storage solutions for managing and tracking machine learning models across various stages of development and deployment.",helpLink:"https://docs.zenml.io/stack-components/model-registries"};function De({type:t}){const{description:s,link:r}=Ae(t);return e.jsx(V,{children:e.jsxs(Z,{delayDuration:200,children:[e.jsxs(G,{children:[e.jsx(J,{className:"h-4 w-4 shrink-0 fill-theme-text-tertiary"}),e.jsxs("div",{className:"sr-only",children:["Info for ",t]})]}),e.jsxs(K,{align:"start",side:"bottom",className:"flex max-w-xl flex-col gap-2 bg-theme-surface-primary p-5 text-text-sm text-theme-text-primary",children:[e.jsx("p",{children:s}),e.jsx("a",{className:"link mt-2 text-primary-400",target:"_blank",href:r,children:"Learn more"})]})]})})}function Ae(t){switch(t){case"orchestrator":return{description:S.description,link:S.helpLink};case"alerter":return{description:z.description,link:z.helpLink};case"annotator":return{description:I.description,link:I.helpLink};case"artifact_store":return{description:w.description,link:w.helpLink};case"container_registry":return{description:C.description,link:C.helpLink};case"data_validator":return{description:M.description,link:M.helpLink};case"experiment_tracker":return{description:F.description,link:F.helpLink};case"feature_store":return{description:T.description,link:T.helpLink};case"image_builder":return{description:D.description,link:D.helpLink};case"model_deployer":return{description:_.description,link:_.helpLink};case"model_registry":return{description:A.description,link:A.helpLink};case"step_operator":return{description:L.description,link:L.helpLink}}}function $e({type:t,setSelectedFlavor:s}){return e.jsxs(e.Fragment,{children:[e.jsx(O,{children:e.jsxs(E,{children:["Select ",p(t)," Flavor"]})}),e.jsx(W,{viewportClassName:"max-h-[70vh]",children:e.jsx("div",{className:"p-5",children:e.jsx(Se,{setSelectedFlavor:s,type:t})})})]})}function Oe({name:t,id:s,backHandler:r,type:n,successHandler:i}){const o=d.useId();return e.jsxs(e.Fragment,{children:[e.jsx(O,{className:"w-full",children:e.jsxs("div",{className:"flex w-0 flex-1 items-center gap-2",children:[e.jsxs(f,{intent:"secondary",emphasis:"subtle",className:"flex aspect-square size-6 items-center justify-center",onClick:()=>r(),children:[e.jsx(we,{className:"size-5 shrink-0"}),e.jsx("span",{className:"sr-only",children:"Go step back"})]}),e.jsxs(E,{className:"truncate",children:["Configure your ",p(t)," ",p(n)]})]})}),e.jsx(Ce,{useMaxHeight:!0,flavorId:s,formId:o,successHandler:i,FooterComponent:Ee})]})}function Ee({formId:t,isPending:s}){return e.jsx(X,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Y,{asChild:!0,children:e.jsx(f,{size:"md",intent:"secondary",children:"Cancel"})}),e.jsxs(f,{size:"md",disabled:s,type:"submit",form:t,children:[s&&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"}),"Register Component"]})]})})}function Re({type:t}){const[s,r]=d.useState(!1),[n,i]=d.useState(0),[o,l]=d.useState(null);async function a(c){r(c),await be(100),c||(i(0),l(null))}function g(c){var m;l({id:c.id,name:c.name,logoUrl:((m=c.body)==null?void 0:m.logo_url)??void 0}),i(h=>h+1)}function j(){i(0),l(null)}return e.jsxs(ee,{open:s,onOpenChange:c=>a(c),children:[e.jsx(te,{asChild:!0,children:e.jsxs("button",{className:"w-full rounded-md border border-dashed border-neutral-300 bg-theme-surface-tertiary py-5 text-theme-text-secondary",children:["New ",p(t)]})}),e.jsxs(se,{className:"w-full sm:max-w-[640px] md:max-w-3xl xl:max-w-[1080px]",children:[n===0&&e.jsx($e,{setSelectedFlavor:g,type:t}),n===1&&!!o&&e.jsx(Oe,{successHandler:()=>a(!1),backHandler:j,...o,type:t})]})]})}function Qe(){return e.jsxs(e.Fragment,{children:[v.map(t=>e.jsx(N,{className:"h-full space-y-5 p-5",value:t,children:e.jsx(qe,{type:t})},t)),e.jsx(N,{className:"h-full",value:"",children:e.jsx("div",{className:"flex h-full w-full items-center justify-center text-theme-text-tertiary",children:"Select a category to add a new component"})})]})}function Be({type:t,search:s}){const r=xe({...ae.componentListInfinite({sort_by:"desc:updated",type:t,...s?{name:`contains:${s}`}:{}})}),{control:n,watch:i,setValue:o}=u();return r.isError?e.jsx("p",{children:"Error while fetching Components"}):r.isPending?e.jsx("div",{className:"flex w-full flex-1 items-center justify-center",children:e.jsx(ne,{})}):e.jsxs("div",{className:"space-y-1",children:[e.jsx("ul",{className:"space-y-1",children:r.data.pages.map(l=>l.items.map(a=>e.jsx("li",{children:e.jsx(de,{name:`components.${t}.id`,control:n,render:({field:{onChange:g,...j}})=>{var c,m,h,k;return e.jsxs(ve,{className:"justify-between bg-theme-surface-primary font-medium","data-state":i(`components.${t}.id`)===a.id?"selected":"unselected",htmlFor:a.id,children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(ye,{...j,id:a.id,type:"radio",value:a.id,onChange:H=>{var y;o(`components.${t}.name`,a.name),o(`components.${t}.logoUrl`,((y=a.body)==null?void 0:y.logo_url)||""),g(H)},checked:i(`components.${t}.id`)===a.id,name:t}),e.jsx("img",{alt:"flavor icon",src:ie(((c=a.body)==null?void 0:c.logo_url)||""),width:24,height:24}),e.jsxs("div",{className:"min-w-0 truncate",children:[e.jsx("div",{className:"truncate font-semibold",children:a.name}),e.jsx("div",{className:"truncate text-text-xs text-theme-text-secondary",children:a.id.split("-")[0]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-text-sm",children:[((h=(m=a.body)==null?void 0:m.user)==null?void 0:h.name)&&e.jsx(he,{username:a.body.user.name}),((k=a.body)==null?void 0:k.updated)&&e.jsx("div",{className:"whitespace-nowrap text-theme-text-secondary",children:e.jsx(ue,{short:!0,dateString:a.body.updated})})]})]})}})},a.id)))}),e.jsx(Re,{type:t}),r.hasNextPage&&e.jsx(f,{onClick:()=>r.fetchNextPage(),type:"button",size:"md",intent:"secondary",emphasis:"subtle",className:"flex w-full items-center justify-center bg-theme-surface-primary",children:e.jsxs("div",{className:"flex items-center gap-1",children:[r.isFetchingNextPage&&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"}),"Load more"]})})]})}function He({type:t}){return e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(B,{className:"h-5 w-5 fill-primary-400",type:t}),e.jsx("h2",{className:"text-text-lg font-semibold",children:p(t)}),e.jsx(De,{type:t})]}),e.jsxs("p",{className:"text-theme-text-secondary",children:["Select a existing ",re(t)," from your server:"]})]})}function qe({type:t}){const[s,r]=d.useState(""),{watch:n,setValue:i}=u(),o=n(`components.${t}`);return d.useEffect(()=>{o&&!o.id&&i(`components.${t}`,null)},[o,i,t]),e.jsxs(e.Fragment,{children:[e.jsx(He,{type:t}),e.jsx(Pe,{search:s,setSearch:r}),e.jsx(Be,{search:s,type:t})]})}function Pe({setSearch:t,search:s}){const[r,n]=d.useState(s),i=d.useCallback(ke(t,500),[]);d.useEffect(()=>()=>{i.cancel()},[i]);function o(l){n(l),i(l)}return e.jsx(R,{value:r,onChange:l=>o(l.target.value),placeholder:"Search..."})}function Ue({type:t}){const{watch:s,formState:{errors:r}}=u(),n=s(`components.${t}`),i=n&&n.id;return e.jsx("div",{"data-error":!i&&r.components&&r.components[t]?"true":"false","data-filled":i?"true":"false",className:"flex h-[110px] flex-col items-center justify-center space-y-2 truncate whitespace-nowrap rounded-md border border-theme-border-moderate bg-theme-surface-secondary py-5 text-center text-text-sm text-theme-text-secondary transition-all duration-150 hover:bg-theme-surface-primary hover:shadow-sm data-[error=true]:border-theme-text-error data-[filled=true]:border-success-400 data-[filled=true]:bg-theme-surface-primary data-[state=active]:bg-theme-surface-primary group-data-[state=active]/trigger:bg-theme-surface-primary group-data-[state=active]/trigger:shadow-md data-[error=false]:data-[filled=false]:group-data-[state=active]/trigger:border-theme-border-bold",children:i?e.jsx(Ve,{type:t}):e.jsx(Ze,{type:t})})}function Ve({type:t}){const{watch:s}=u(),r=s(`components.${t}`);return r&&r.id?e.jsxs("div",{className:"flex flex-col items-center gap-2 text-text-sm",children:[e.jsx("img",{width:24,height:24,src:r.logoUrl,alt:`Icon of ${r.name}`}),e.jsxs("div",{className:"space-y-0.25",children:[e.jsx("div",{className:"text-theme-text-primary",children:r.name}),e.jsx("div",{className:"text-text-xs text-theme-text-tertiary",children:p(t)})]})]}):null}function Ze({type:t}){return e.jsxs(e.Fragment,{children:[e.jsx(B,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary group-data-[state=active]/trigger:fill-theme-surface-strong",type:t}),e.jsx("span",{children:p(t)})]})}function Ge(){return e.jsxs("div",{className:"flex h-full flex-col justify-between space-y-5",children:[e.jsxs("div",{className:"space-y-5 p-5",children:[e.jsx(We,{}),e.jsx(Je,{})]}),e.jsx(Ke,{})]})}function Je(){const{watch:t,resetField:s}=u();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-text-lg font-semibold",children:"Add Components"}),e.jsxs("p",{className:"text-theme-text-secondary",children:["All stacks have at minimum an orchestrator and an artifact store."," ",e.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://docs.zenml.io/stack-components/component-guide",className:"link text-primary-400",children:"Learn more"})]})]}),e.jsx(q,{children:e.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-4",children:v.map(r=>e.jsxs("div",{className:"relative",children:[e.jsx(P,{className:"group/trigger w-full",value:r,children:e.jsx(Ue,{type:r})}),t(`components.${r}.id`)&&e.jsx("button",{type:"button",onClick:n=>{n.preventDefault(),s(`components.${r}`)},className:"absolute right-[-12px] top-[-12px] flex aspect-square h-[28px] w-[28px] items-center justify-center rounded-rounded bg-theme-surface-primary",children:e.jsx(Le,{className:"h-5 w-5 shrink-0 fill-success-400"})})]},r))})})]})}function Ke(){const{formState:{isSubmitting:t}}=u(),s=!!fe();return e.jsxs("div",{className:"flex items-center justify-end space-x-2 border-t border-theme-border-moderate p-5",children:[e.jsx(f,{asChild:!0,intent:"secondary",size:"md",children:e.jsx(_e,{to:Q.stacks.create.index,children:"Cancel"})}),e.jsxs(f,{className:"flex items-center gap-1",disabled:t||s,size:"md",children:[(s||t)&&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"}),"Register Stack"]})]})}function We(){var r;const{register:t,formState:{errors:s}}=u();return e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-text-sm",htmlFor:"stack-name",children:"Stack Name"}),e.jsx(R,{id:"stack-name",className:`${s.stackName?"border-red-500":""} w-full`,placeholder:"zenml-stack",...t("stackName")}),s.stackName&&e.jsx("p",{className:"text-text-xs text-red-500",children:(r=s.stackName.message)==null?void 0:r.toString()})]})}const b=x.object({id:x.string().trim().min(1),name:x.string().trim().min(1),logoUrl:x.string().trim().min(1)}),Xe=v.reduce((t,s)=>(t[s]=b.nullable(),t),{}),Ye=x.object({stackName:Me,components:x.object({...Xe,orchestrator:b,artifact_store:b})});function et(){const t=ge({...ze.workspaceDetail("default")}),{toast:s}=oe(),r=Te(),n=je(),i=Ne({onSuccess:async()=>{n.invalidateQueries({queryKey:Fe.all}),r(Q.stacks.overview)},onError:a=>{s({status:"error",emphasis:"subtle",icon:e.jsx(ce,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:a.message,rounded:!0})}});function o(a){var c;const g=Object.entries(a.components).reduce((m,[h,k])=>(k&&(m[h]=[k.id]),m),{}),j={name:a.stackName,components:g};i.mutate({workspaceId:((c=t.data)==null?void 0:c.id)||"",payload:j})}const l=me({resolver:Ie(Ye),defaultValues:{components:{alerter:null,orchestrator:{},annotator:null,artifact_store:{},container_registry:null,data_validator:null,experiment_tracker:null,feature_store:null,model_registry:null,image_builder:null,model_deployer:null,step_operator:null},stackName:""}});return{createManualStack:o,form:l}}function It(){const[t,s]=d.useState(""),{createManualStack:r,form:n}=et();return e.jsx(pe,{...n,children:e.jsx(U,{value:t,onValueChange:s,className:"h-full",children:e.jsxs("form",{onSubmit:n.handleSubmit(r),className:"flex h-[calc(100vh_-_4rem_-_4rem_-_2px)] flex-1 flex-col divide-y divide-theme-border-moderate xl:flex-row-reverse xl:divide-x xl:divide-y-0 xl:divide-x-reverse",children:[e.jsx($,{className:"h-full flex-1 bg-theme-surface-primary",children:e.jsx(Ge,{})}),e.jsx($,{children:e.jsx(Qe,{})})]})})})}function $({className:t,...s}){return e.jsx("div",{className:le("w-full overflow-y-auto xl:w-1/2",t),...s})}export{It as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as x,j as e}from"./@radix-C7hRs6Kx.js";import{ai as M,aj as ne,h as y,ak as E,al as _,am as q,f as b,I as K,ap as z,aq as B,ar 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,ao as $,T as ie,E as oe,G as ce,a0 as le,H as de,S as v,D as ue,w as me,x as xe,af as he,as as pe,aI as ye,at as fe,aJ as je,av as ge,B as H,M as Ae,n as ve,R as be}from"./index-BygJE88j.js";import{c as j,b as P,a as F}from"./@tanstack-CSxjHCME.js";import{s as g,A as G,d as De,u as Ne,b as O,a as L}from"./service-BRoAA1Kq.js";import{P as Ke,S as we}from"./SearchField-DMCywawn.js";import{t as J}from"./zod-C0xYeTvL.js";import{u as U,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-9RTDnEx3.js";import{S as X}from"./key-icon-DO4DPJHZ.js";import{D as I}from"./DisplayDate-CYVBBSgr.js";import{i as Ce,a as Se}from"./dates-3pMLCNrD.js";import{S as ke}from"./dots-horizontal-BGRJCPCs.js";import{S as Te}from"./refresh-CM5T3QeU.js";import{A as Pe}from"./AlertDialogDropdownItem-CRZjthRL.js";import{I as Fe}from"./Infobox-Bai0JtFs.js";import{a as R}from"./@react-router-CNP6g_RL.js";import"./@reactflow-CQi1Z1Wq.js";import"./CodeSnippet-Di-loaZu.js";import"./Tick-ay3Bgtro.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(M,{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}=b(),r=j(),{handleSubmit:i,control:o,formState:{isValid:l},reset:m}=U({resolver:J(De),defaultValues:{name:"",description:""}}),{mutate:c}=Ne({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 Ie(t){return P({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n})=>{await Re(s,n)}})}const te=x.createContext(null);function Me({children:t}){const[s,n]=x.useState([]),a=j(),{toast:r}=b(),i=Ie(),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-y-0 bg-white",size:"md",emphasis:"subtle",intent:"secondary",children:[e.jsx(Y,{className:"h-5 w-5 shrink-0 gap-1 fill-neutral-400"}),"Delete"]})}),e.jsx(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(M,{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}=b(),r=j(),{control:i,watch:o,register:l,handleSubmit:m,formState:{errors:c,isValid:d}}=U({resolver:J(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(v,{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(ke,{className:"h-5 w-5 fill-theme-text-secondary"})}),e.jsxs(xe,{hidden:o,onCloseAutoFocus:h=>{c.current&&(c.current.focus(),c.current=null,h.preventDefault())},align:"end",sideOffset:7,children:[e.jsx(he,{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 Je({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 Ue(t){return P({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n,body:a})=>{await Je({serviceAccountId:s,apiKeyId:n,body:a})}})}function Ye({isActive:t,serviceAccountId:s,apiKeyId:n}){const{toast:a}=b(),r=j(),[i,o]=x.useState(!1),{mutate:l}=Ue({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(pe,{children:[e.jsx(ye,{children:e.jsx(fe,{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(je,{className:"gap-[10px]",children:[e.jsx(ge,{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(I,{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=Ce(n),r=Se(n);return e.jsxs("div",{children:[e.jsx("p",{children:e.jsx(I,{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(Me,{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(Ae,{columns:n,data:a.items}):e.jsx(v,{className:"h-[500px] w-full"})}),a?a.total_pages>1&&e.jsx(Ke,{searchParams:s,paginate:a}):e.jsx(v,{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(we,{searchParams:s})}),e.jsx(ee,{isFallback:!1,serviceAccountId:t})]})}function Kt(){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(v,{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(be,{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,Kt as default};
|
1
|
+
import{r as x,j as e}from"./@radix-C7hRs6Kx.js";import{ai as M,aj as ne,h as y,ak as E,al as _,am as q,f as b,I as K,ap as z,aq as B,ar 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,ao as $,T as ie,E as oe,G as ce,a0 as le,H as de,S as v,D as ue,w as me,x as xe,af as he,as as pe,aI as ye,at as fe,aJ as je,av as ge,B as H,M as Ae,n as ve,R as be}from"./index-D2iSHVZq.js";import{c as j,b as P,a as F}from"./@tanstack-CSxjHCME.js";import{s as g,A as G,d as De,u as Ne,b as O,a as L}from"./service-BQ9KIhls.js";import{P as Ke,S as we}from"./SearchField-D-h6jXyg.js";import{t as J}from"./zod-C0xYeTvL.js";import{u as U,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-DVvXt-S6.js";import{S as X}from"./key-icon-DO4DPJHZ.js";import{D as I}from"./DisplayDate-CYVBBSgr.js";import{i as Ce,a as Se}from"./dates-3pMLCNrD.js";import{S as ke}from"./dots-horizontal-BGRJCPCs.js";import{S as Te}from"./refresh-CM5T3QeU.js";import{A as Pe}from"./AlertDialogDropdownItem-BG7-Ki1L.js";import{I as Fe}from"./Infobox-D9k5TFH4.js";import{a as R}from"./@react-router-CNP6g_RL.js";import"./@reactflow-CQi1Z1Wq.js";import"./CodeSnippet-CvI6D0wx.js";import"./Tick-CEsT3HPR.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(M,{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}=b(),r=j(),{handleSubmit:i,control:o,formState:{isValid:l},reset:m}=U({resolver:J(De),defaultValues:{name:"",description:""}}),{mutate:c}=Ne({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 Ie(t){return P({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n})=>{await Re(s,n)}})}const te=x.createContext(null);function Me({children:t}){const[s,n]=x.useState([]),a=j(),{toast:r}=b(),i=Ie(),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-y-0 bg-white",size:"md",emphasis:"subtle",intent:"secondary",children:[e.jsx(Y,{className:"h-5 w-5 shrink-0 gap-1 fill-neutral-400"}),"Delete"]})}),e.jsx(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(M,{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}=b(),r=j(),{control:i,watch:o,register:l,handleSubmit:m,formState:{errors:c,isValid:d}}=U({resolver:J(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(v,{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(ke,{className:"h-5 w-5 fill-theme-text-secondary"})}),e.jsxs(xe,{hidden:o,onCloseAutoFocus:h=>{c.current&&(c.current.focus(),c.current=null,h.preventDefault())},align:"end",sideOffset:7,children:[e.jsx(he,{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 Je({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 Ue(t){return P({...t,mutationFn:async({serviceAccountId:s,apiKeyId:n,body:a})=>{await Je({serviceAccountId:s,apiKeyId:n,body:a})}})}function Ye({isActive:t,serviceAccountId:s,apiKeyId:n}){const{toast:a}=b(),r=j(),[i,o]=x.useState(!1),{mutate:l}=Ue({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(pe,{children:[e.jsx(ye,{children:e.jsx(fe,{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(je,{className:"gap-[10px]",children:[e.jsx(ge,{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(I,{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=Ce(n),r=Se(n);return e.jsxs("div",{children:[e.jsx("p",{children:e.jsx(I,{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(Me,{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(Ae,{columns:n,data:a.items}):e.jsx(v,{className:"h-[500px] w-full"})}),a?a.total_pages>1&&e.jsx(Ke,{searchParams:s,paginate:a}):e.jsx(v,{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(we,{searchParams:s})}),e.jsx(ee,{isFallback:!1,serviceAccountId:t})]})}function Kt(){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(v,{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(be,{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,Kt 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,ai as F,aj as E,h,ak as P,al as U,am as k,an as O,f as v,I,ao as R,ap as _,aq as q,ar as H,i as D,z as m,as as z,at as Z,au as B,av as K,aw as Q,D as V,w as L,x as G,R as w,l as J,S as f,M as $,B as W}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,ai as F,aj as E,h,ak as P,al as U,am as k,an as O,f as v,I,ao as R,ap as _,aq as q,ar as H,i as D,z as m,as as z,at as Z,au as B,av as K,aw as Q,D as V,w as L,x as G,R as w,l as J,S as f,M as $,B as W}from"./index-D2iSHVZq.js";import{S as X,P as Y}from"./SearchField-D-h6jXyg.js";import{a as ee,b as N,c as A}from"./@tanstack-CSxjHCME.js";import{C as se}from"./CodeSnippet-CvI6D0wx.js";import{u as te}from"./index.esm-D7jFlf5N.js";import{D as ae}from"./DisplayDate-CYVBBSgr.js";import{I as re}from"./InlineAvatar-Cfz4WSLK.js";import{S as ne}from"./dots-horizontal-BGRJCPCs.js";import{A as ie}from"./AlertDialogDropdownItem-BG7-Ki1L.js";import{d as oe}from"./@react-router-CNP6g_RL.js";import"./@reactflow-CQi1Z1Wq.js";import"./chevron-right-double-uNWbJT-C.js";import"./index-DR30v9MZ.js";function le({params:a}){return["users",a]}async function ce({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 de(a,s){return ee({queryKey:le(a),queryFn:()=>ce(a),...s})}const ue=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 me(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 he(a){return N({mutationFn:async s=>me(s),...a})}function xe(){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(fe,{name:t.name,token:O(t)}):e.jsx(pe,{setSuccessMember:r})]})]})}m.object({username:m.string(),isAdmin:m.boolean()});function pe({setSuccessMember:a}){const{toast:s}=v(),t=A(),{mutate:r,isPending:n}=he({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}=te();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 fe({token:a,name:s}){return e.jsxs("div",{className:"space-y-5 overflow-hidden p-7 text-center",children:[e.jsx(ue,{className:"m-auto mb-5 h-[110px] w-[110px] fill-success-500"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-lg font-semibold text-theme-text-primary",children:`The user ${s} was created successfully!`}),e.jsx("p",{className:"text-text-md text-theme-text-secondary",children:"Share the invitation link with the user to complete the registration."})]}),e.jsx(se,{className:"mx-auto",code:a})]})}const ge=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 je(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 Ce(a){return N({mutationFn:async s=>je(s),...a})}function ye({userId:a,name:s}){const{toast:t}=v(),r=A(),{isPending:n,mutate:c}=Ce({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 be({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(ne,{className:"h-4 w-4 fill-theme-text-tertiary"})}),e.jsx(G,{hidden:t,onCloseAutoFocus:u=>{i.current&&(i.current.focus(),i.current=null,u.preventDefault())},align:"end",sideOffset:7,children:e.jsx(ie,{onSelect:x,onOpenChange:p,triggerChildren:"Remove Member",icon:e.jsx(ge,{fill:"red"}),children:e.jsx(ye,{name:s,userId:a})})})]})}function we({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(re,{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(ae,{dateString:s()})})},...a?[{id:"actions",header:"",accessorFn:s=>({id:s.id,name:s.name}),meta:{width:"5%"},cell:({getValue:s})=>{const{id:t,name:r}=s();return e.jsx(be,{name:r,userId:t})}}]:[]]}const g=1,ve=m.object({page:m.coerce.number().min(g).optional().default(g).catch(g),name:m.string().optional(),operator:m.enum(["and","or"]).optional()});function De(){const[a]=oe(),{page:s,name:t,operator:r}=ve.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 Ne(){var l,i;const a=De(),{data:s,isError:t}=de({params:{...a,sort_by:"desc:created"}},{throwOnError:!0}),{data:r,isPending:n,isError:c}=J();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(X,{searchParams:a}),((l=r.body)==null?void 0:l.is_admin)&&e.jsx(xe,{})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:s?e.jsx($,{columns:we({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(Y,{searchParams:a,paginate:s}):e.jsx(f,{className:"h-[36px] w-[300px]"})]})]})}function He(){return e.jsxs(W,{className:"flex flex-col gap-4 p-5",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Members"}),e.jsx(Ne,{})]})}export{He 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,aF as l,ai as B,ak as W,al as q,am as G,h as w,a5 as Z,r as J,f as V,c as K,S as Q,m as X,aG as Y,ar 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,aF as l,ai as B,ak as W,al as q,am as G,h as w,a5 as Z,r as J,f as V,c as K,S as Q,m as X,aG as Y,ar as ee,B as D}from"./index-D2iSHVZq.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-CvI6D0wx.js";import{I as oe}from"./Infobox-D9k5TFH4.js";import{T as se}from"./Tick-CEsT3HPR.js";import{E as ae}from"./react-error-boundary.esm-fyoUBS25.js";import{L as ie}from"./@react-router-CNP6g_RL.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(G,{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:J.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};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as f,j as e}from"./@radix-C7hRs6Kx.js";import{S as X,u as y,C as v,P as N,a as $,W as ee,L as te}from"./ProviderRadio-
|
1
|
+
import{r as f,j as e}from"./@radix-C7hRs6Kx.js";import{S as X,u as y,C as v,P as N,a as $,W as ee,L as te}from"./ProviderRadio-BVDA-fAr.js";import{u,R as se,a as re,E as ae,D as F,G as oe,A as ne,C as O,b as ie,N as ce}from"./Partials-DQJFw1yW.js";import{S as V,B as Y,aN as de,h as le,r as T}from"./index-D2iSHVZq.js";import{d as me,c as ue}from"./@react-router-CNP6g_RL.js";import{I as G}from"./Infobox-D9k5TFH4.js";import{t as H}from"./zod-C0xYeTvL.js";import{u as Q,F as pe}from"./index.esm-D7jFlf5N.js";import{a as xe,c as q,b as fe,p as he}from"./persist-D87V82eO.js";import{C as h}from"./ProviderIcon-DLo7t1lo.js";import{s as J}from"./index-CrhdX_qG.js";import{a as K}from"./@tanstack-CSxjHCME.js";import"./Tick-CEsT3HPR.js";import"./check-DK77doTf.js";import"./package-D1Mhqeh8.js";import"./ComponentBadge-DKw7Gndh.js";import"./ComponentIcon-ils7uNAk.js";import"./layout-h3cbx8WZ.js";import"./rocket-Cf-B-XOR.js";import"./logs-B5n0U7tB.js";import"./CodeSnippet-CvI6D0wx.js";import"./NumberBox-D2A7ENHb.js";import"./link-external-DUhCSKNm.js";import"./@reactflow-CQi1Z1Wq.js";import"./sharedSchema-Bse2agAf.js";import"./gcp-CHNvgEss.js";import"./stack-detail-query-BAcZJrN3.js";function je(){const{formRef:t,setIsNextButtonDisabled:s,setData:a,data:o}=u(),n=Q({resolver:H(xe),mode:"onChange",defaultValues:{region:o.location,stackName:o.stackName||""}});f.useEffect(()=>{s(!n.formState.isValid)},[n.formState.isValid,s]);function l(r){a(m=>({...m,location:r.region,stackName:r.stackName}))}return e.jsx(j,{title:"Review Stack Configuration",children:e.jsx(pe,{...n,children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs(G,{className:"text-text-sm",children:[e.jsx("p",{className:"font-semibold",children:"Important"}),e.jsx("p",{children:"This will create new resources in your account. Ensure you have the necessary permissions and are aware of any potential costs."})]}),e.jsxs("form",{onSubmit:n.handleSubmit(l),ref:t,className:"space-y-5",children:[e.jsx(se,{provider:o.provider||"aws"}),e.jsx(X,{})]}),e.jsx(re,{provider:o.provider||"aws"}),e.jsx(ae,{provider:o.provider||"aws"})]})})})}function ve(){const{data:t,timestamp:s,setIsNextButtonDisabled:a}=u(),{setCurrentStep:o}=y(),{isPending:n,isError:l,data:r}=K({...J.stackDeploymentStack({provider:t.provider,stack_name:t.stackName,date_start:s}),refetchInterval:5e3,throwOnError:!0});return f.useEffect(()=>{r&&(q(),o(m=>m+1),a(!1))},[r]),n?e.jsx(V,{className:"h-[200px] w-full"}):l?null:e.jsxs("div",{className:"space-y-5",children:[e.jsx(Ne,{}),e.jsx(ye,{stack:r})]})}function Ne(){const{data:t}=u();return e.jsxs("section",{className:"space-y-5 border-b border-theme-border-moderate pb-5",children:[e.jsxs(Y,{className:"flex items-center justify-between gap-4 px-6 py-5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(h,{provider:t.provider,className:"h-6 w-6 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-text-lg font-semibold",children:"Deploying the Stack..."}),e.jsx("p",{className:"text-theme-text-secondary",children:"Follow the steps in your Cloud console to finish the setup. You can come back to check once your components are deployed."})]})]}),t.provider==="azure"?e.jsx(F,{children:e.jsx("span",{children:"Deploy in Azure"})}):e.jsx(F,{})]}),t.provider==="gcp"&&e.jsx(oe,{}),t.provider==="azure"&&e.jsx(ne,{})]})}function ye({stack:t}){const s=!!t;return e.jsxs("div",{className:"space-y-5",children:[!s&&e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[e.jsx(de,{className:"h-5 w-5 fill-primary-400"}),"Creating your stack and components..."]}),e.jsx("p",{className:"text-theme-text-secondary",children:"We are creating your stack and stack components based on your configuration. Once you finish the setup, come back to check your brand new stack and components ready."})]}),e.jsx(Se,{isReady:s}),e.jsx(ge,{stack:t})]})}function ge({stack:t}){const s=!!t,{data:a}=u();return e.jsxs("div",{className:"relative overflow-hidden rounded-md",children:[!s&&e.jsx("div",{className:"absolute z-50 h-full w-full bg-neutral-50/50"}),e.jsx(O,{type:a.provider,componentProps:{isLoading:!s,isSuccess:s,stackName:a.stackName}})]})}function Se({isReady:t}){const[s,a]=f.useState(!1);return f.useEffect(()=>{const o=setTimeout(()=>{a(!0)},3e5);return()=>clearTimeout(o)},[]),!s||t?null:e.jsx(G,{children:"Your stack is taking longer than usual to deploy. Please check your Cloud console, or the stacks list in ZenML."})}function ke(){return e.jsx(j,{title:"Deploy ZenML Stack",children:e.jsx(be,{})})}function be(){const{setIsNextButtonDisabled:t,isLoading:s}=u();return f.useEffect(()=>{t(!0)},[]),s?e.jsx(ve,{}):e.jsx(ie,{})}function we(){const{formRef:t,setIsNextButtonDisabled:s,setData:a,data:o}=u(),{register:n,handleSubmit:l,formState:{isValid:r}}=Q({resolver:H(fe),defaultValues:{provider:o.provider}});f.useEffect(()=>{s(!r)},[r,s]);function m(d){a(c=>({...c,provider:d.provider}))}return e.jsx(j,{title:"New Cloud Infrastructure",children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-lg font-semibold",children:"Select a Cloud Provider"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Select the cloud provider where your want to create your infrastructure and deploy your ZenML models. You will be able to remove the ZenML stack at any time."})]}),e.jsxs("form",{id:"provider-form",onSubmit:l(m),className:"grid grid-cols-1 gap-3 xl:grid-cols-3",ref:t,children:[e.jsx(v,{id:"aws-provider",...n("provider"),value:"aws",children:e.jsx(N,{icon:e.jsx(h,{provider:"aws",className:"h-6 w-6 shrink-0"}),title:"AWS",subtitle:"ZenML stack with S3, ECR, and SageMaker integration"})}),e.jsx(v,{id:"gcp-provider",...n("provider"),value:"gcp",children:e.jsx(N,{icon:e.jsx(h,{provider:"gcp",className:"h-6 w-6 shrink-0"}),title:"GCP",subtitle:"Create ZenML infrastructure using GCS, Artifact Registry, and Vertex AI"})}),e.jsx(v,{id:"azure-provider",...n("provider"),value:"azure",children:e.jsx(N,{icon:e.jsx(h,{provider:"azure",className:"h-6 w-6 shrink-0"}),title:"Azure",subtitle:"Set up ZenML with Azure Storage, Container Registry, and ML services"})})]})]})})}function Ce({provider:t,stackName:s,timestamp:a,isTerraform:o}){var g,S,k,b,w,C,P,D,I,z,L,R,B,E,W,M,_,A;const{isPending:n,isError:l,data:r}=K({...J.stackDeploymentStack({provider:t,stack_name:s,date_start:a,terraform:o}),throwOnError:!0});if(n)return e.jsx(V,{className:"h-[200px] w-full"});if(l)return null;const m=r.stack.name,d=(g=r.stack.metadata)==null?void 0:g.components.orchestrator,c=(S=r.stack.metadata)==null?void 0:S.components.artifact_store,i=(k=r.stack.metadata)==null?void 0:k.components.container_registry,p=(b=r.stack.metadata)==null?void 0:b.components.image_builder,x=(w=r.stack.metadata)==null?void 0:w.components.step_operator,U={orchestrator:{name:((C=d==null?void 0:d[0])==null?void 0:C.name)??"Orchestrator",id:((P=d==null?void 0:d[0])==null?void 0:P.id.split("-")[0])??""},artifactStore:{name:((D=c==null?void 0:c[0])==null?void 0:D.name)??"Artifact Store",id:((I=c==null?void 0:c[0])==null?void 0:I.id.split("-")[0])??""},registry:{name:((z=i==null?void 0:i[0])==null?void 0:z.name)??"Container Registry",id:((L=i==null?void 0:i[0])==null?void 0:L.id.split("-")[0])??""},connector:{name:(R=r.service_connector)==null?void 0:R.name,id:((E=(B=r.service_connector)==null?void 0:B.id)==null?void 0:E.split("-")[0])??""},imageBuilder:{name:((W=p==null?void 0:p[0])==null?void 0:W.name)??"Image Builder",id:((M=p==null?void 0:p[0])==null?void 0:M.id.split("-")[0])??""},operator:{name:((_=x==null?void 0:x[0])==null?void 0:_.name)??"Step Operator",id:((A=x==null?void 0:x[0])==null?void 0:A.id.split("-")[0])??""}};return e.jsx(O,{type:t,componentProps:{components:U,isSuccess:!0,stackName:m}})}function Pe(){const{setIsNextButtonDisabled:t,data:s,timestamp:a}=u();return t(!1),e.jsx(j,{title:"Your Stack",children:e.jsxs("div",{className:"space-y-5",children:[e.jsx("p",{className:"text-theme-text-secondary",children:"Here you can review the created stack and stack components. Now you can start running pipelines using this new configuration."}),e.jsx(Ce,{provider:s.provider||"aws",stackName:s.stackName||"",timestamp:a})]})})}function De(){const{currentStep:t}=y();if(t===1)return e.jsx(we,{});if(t===2)return e.jsx(je,{});if(t===3)return e.jsx(ke,{});if(t===4)return e.jsx(Pe,{})}function Ie(){var c;const[s]=me(),{setCurrentStep:a,currentStep:o}=y(),{formRef:n,isNextButtonDisabled:l}=u(),r=ue(),m=s.get("origin")==="onboarding";async function d(){n.current&&(n.current.requestSubmit(),await new Promise(i=>setTimeout(i,20))),a(i=>i<4?i+1:i),o===4&&(q(),r(m?T.onboarding:T.stacks.overview))}return e.jsx(le,{form:(c=n.current)==null?void 0:c.id,disabled:l,onClick:()=>d(),size:"md",children:o===4?"Finish":"Next"})}function j({children:t,title:s}){return e.jsxs(Y,{className:"w-full",children:[e.jsx("div",{className:"border-b border-theme-border-moderate px-5 py-3 text-display-xs font-semibold",children:s}),e.jsx("div",{className:"p-5",children:t}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-theme-border-moderate p-5",children:[e.jsx($,{}),e.jsx(Ie,{})]})]})}const Z=["Infrastructure Type","Cloud Provider","Review Configuration","Deploy Stack"];function rt(){const{success:t}=he();return e.jsx(ee,{maxSteps:Z.length,initialStep:t?3:1,children:e.jsx(ce,{children:e.jsxs("section",{className:"layout-container flex flex-col gap-5 p-5 xl:flex-row",children:[e.jsx(te,{entries:Z}),e.jsx("div",{className:"w-full overflow-y-hidden",children:e.jsx(De,{})})]})})})}export{rt as default};
|