zenml-nightly 0.81.0.dev20250429__py3-none-any.whl → 0.82.0.dev20250503__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- zenml/VERSION +1 -1
- zenml/cli/model.py +2 -7
- zenml/client.py +17 -2
- zenml/config/docker_settings.py +1 -1
- zenml/config/resource_settings.py +1 -1
- zenml/config/strict_base_model.py +1 -1
- zenml/environment.py +36 -4
- zenml/integrations/azure/__init__.py +3 -0
- zenml/integrations/evidently/metrics.py +1 -1
- zenml/integrations/evidently/tests.py +1 -1
- zenml/integrations/kubeflow/orchestrators/kubeflow_orchestrator.py +1 -1
- zenml/integrations/pandas/materializers/pandas_materializer.py +118 -22
- zenml/integrations/tekton/orchestrators/tekton_orchestrator.py +1 -1
- zenml/models/v2/core/model_version.py +28 -33
- zenml/models/v2/core/pipeline_deployment.py +4 -4
- zenml/models/v2/core/pipeline_run.py +5 -12
- zenml/models/v2/core/user.py +1 -1
- zenml/secret/base_secret.py +1 -1
- zenml/stack/stack_component.py +1 -1
- zenml/stack/utils.py +1 -1
- zenml/zen_server/dashboard/assets/{404-o3nB5iwI.js → 404-D4aYbspS.js} +1 -1
- zenml/zen_server/dashboard/assets/{@react-router-BGgzhn5D.js → @react-router-CNP6g_RL.js} +1 -1
- zenml/zen_server/dashboard/assets/{AlertDialogDropdownItem-C_qWs-4u.js → AlertDialogDropdownItem-CRZjthRL.js} +1 -1
- zenml/zen_server/dashboard/assets/{CodeSnippet-nRnOvbOJ.js → CodeSnippet-Di-loaZu.js} +1 -1
- zenml/zen_server/dashboard/assets/CollapsibleCard-Dr5zb5T5.js +1 -0
- zenml/zen_server/dashboard/assets/{Commands-BwBzFj-5.js → Commands-CD9Y7FOE.js} +1 -1
- zenml/zen_server/dashboard/assets/{ComponentBadge-CMx2DbsV.js → ComponentBadge-BgGnzcLu.js} +1 -1
- zenml/zen_server/dashboard/assets/{ComponentIcon-CSxdApv8.js → ComponentIcon-B_7Y_oV-.js} +1 -1
- zenml/zen_server/dashboard/assets/{CsvVizualization-lxB2iyEh.js → CsvVizualization-CDrjL6bW.js} +1 -1
- zenml/zen_server/dashboard/assets/{DeleteAlertDialog-Bp0o-UXZ.js → DeleteAlertDialog-9RTDnEx3.js} +1 -1
- zenml/zen_server/dashboard/assets/DialogItem-0fWTH7ki.js +1 -0
- zenml/zen_server/dashboard/assets/{Error-DRhVeVHQ.js → Error-vBjUYjb-.js} +1 -1
- zenml/zen_server/dashboard/assets/{ExecutionStatus-HnZXi9bW.js → ExecutionStatus-B-ysY113.js} +1 -1
- zenml/zen_server/dashboard/assets/{Helpbox-Dsr3ZYcL.js → Helpbox-Dt3q7NGd.js} +1 -1
- zenml/zen_server/dashboard/assets/{Infobox-C4Op55B8.js → Infobox-Bai0JtFs.js} +1 -1
- zenml/zen_server/dashboard/assets/{InlineAvatar-CrAwe7Pl.js → InlineAvatar-Cpj0lVRQ.js} +1 -1
- zenml/zen_server/dashboard/assets/NestedCollapsible-DbhKdWx-.js +1 -0
- zenml/zen_server/dashboard/assets/{Partials-DjTM0Oe-.js → Partials-BNBtCjuT.js} +1 -1
- zenml/zen_server/dashboard/assets/ProBadge-3vtouJQf.js +1 -0
- zenml/zen_server/dashboard/assets/{ProCta-BYSSivgY.js → ProCta-BoTLdAdV.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderIcon-B8W7AGNk.js → ProviderIcon-kkODO9tx.js} +1 -1
- zenml/zen_server/dashboard/assets/{ProviderRadio-BWFJPEY2.js → ProviderRadio-26EB5tY-.js} +1 -1
- zenml/zen_server/dashboard/assets/RunSelector-j0C_TPVp.js +1 -0
- zenml/zen_server/dashboard/assets/RunsBody-DexNouV4.js +1 -0
- zenml/zen_server/dashboard/assets/SearchField-DMCywawn.js +1 -0
- zenml/zen_server/dashboard/assets/{SecretTooltip-CCn9HfEh.js → SecretTooltip-LLGP7AIC.js} +1 -1
- zenml/zen_server/dashboard/assets/{SetPassword-BDFVwnNB.js → SetPassword-CBHW-Su8.js} +1 -1
- zenml/zen_server/dashboard/assets/StackList-S-9I1R4n.js +1 -0
- zenml/zen_server/dashboard/assets/Tabs-C2ufJX4t.js +1 -0
- zenml/zen_server/dashboard/assets/Tick-ay3Bgtro.js +1 -0
- zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-3gg2tC-H.js → UpdatePasswordSchemas-p3RX0P-Q.js} +1 -1
- zenml/zen_server/dashboard/assets/{UsageReason-DOMAzO02.js → UsageReason-C8sD2bOU.js} +1 -1
- zenml/zen_server/dashboard/assets/{Wizard-BSH_lIfi.js → Wizard-DIllc07n.js} +1 -1
- zenml/zen_server/dashboard/assets/{WizardFooter-CnM-50jL.js → WizardFooter-dNDpuero.js} +1 -1
- zenml/zen_server/dashboard/assets/{all-pipeline-runs-query-D9XfZpmV.js → all-pipeline-runs-query-BUT1PiTp.js} +1 -1
- zenml/zen_server/dashboard/assets/{configuration-form-Ci_QlfZC.js → configuration-form-DBZSb0FV.js} +1 -1
- zenml/zen_server/dashboard/assets/{create-stack-CoQ5SEJL.js → create-stack-BXLyjE58.js} +1 -1
- zenml/zen_server/dashboard/assets/{delete-run-B5xUZwdP.js → delete-run-DzcYxUnd.js} +1 -1
- zenml/zen_server/dashboard/assets/dots-horizontal-BGRJCPCs.js +1 -0
- zenml/zen_server/dashboard/assets/{flavor-select-DOLAl-S4.js → flavor-select-BTEwByv6.js} +1 -1
- zenml/zen_server/dashboard/assets/{form-schemas-BaEJ1z87.js → form-schemas-BJN_25Ua.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-e8udi7QT.js → index-8uhUi12k.js} +1 -1
- zenml/zen_server/dashboard/assets/{index-hsSXyS3H.js → index-BygJE88j.js} +8 -8
- zenml/zen_server/dashboard/assets/{index-ojAuWXMf.js → index-D9-ukAem.js} +1 -1
- zenml/zen_server/dashboard/assets/index-DmTFrHJm.css +1 -0
- zenml/zen_server/dashboard/assets/{index-BoWZ9rXk.js → index-wYtmKLnQ.js} +1 -1
- zenml/zen_server/dashboard/assets/{login-mutation-CwraNa5G.js → login-mutation-DywLqguW.js} +1 -1
- zenml/zen_server/dashboard/assets/{not-found-BuK1QrF2.js → not-found-BOoklIG4.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-0AIX3VK8.js → page--hSXKqyG.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CIDo1Ajk.js → page-2BsNK_sZ.js} +1 -1
- zenml/zen_server/dashboard/assets/page-4nVakAEl.js +1 -0
- zenml/zen_server/dashboard/assets/{page-CjRoKEQs.js → page-8AzB83Py.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-BQVPbNps.js → page-B0r9dBEU.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-hVng6ANV.js → page-B1Uq1S1Q.js} +1 -1
- zenml/zen_server/dashboard/assets/page-B3DscprQ.js +1 -0
- zenml/zen_server/dashboard/assets/{page-KRP_w5zH.js → page-B7Aj2XbV.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CZgeF_wQ.js → page-BE8jdyaM.js} +1 -1
- zenml/zen_server/dashboard/assets/page-BIYqUwTI.js +1 -0
- zenml/zen_server/dashboard/assets/page-BTzhAVEn.js +1 -0
- zenml/zen_server/dashboard/assets/{page-_Zt6UwiG.js → page-ByXQN8A-.js} +1 -1
- zenml/zen_server/dashboard/assets/page-CI4a9CXs.js +1 -0
- zenml/zen_server/dashboard/assets/page-CPLlVRXx.js +6 -0
- zenml/zen_server/dashboard/assets/page-CSQOpvvK.js +3 -0
- zenml/zen_server/dashboard/assets/{page-DwIlrsF0.js → page-Ccnk_5ji.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-C-6XUKSp.js → page-Ci_n_x3a.js} +1 -1
- zenml/zen_server/dashboard/assets/page-D-ry_oLs.js +1 -0
- zenml/zen_server/dashboard/assets/{page-DbEn9V9E.js → page-D2TtSfnb.js} +1 -1
- zenml/zen_server/dashboard/assets/page-DHnkTzqs.js +1 -0
- zenml/zen_server/dashboard/assets/{page-B5clbTo4.js → page-DP2Ed-2m.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-C30HZCTR.js → page-D_5R6E7b.js} +1 -1
- zenml/zen_server/dashboard/assets/page-DfTsntQI.js +1 -0
- zenml/zen_server/dashboard/assets/page-DkY7AIhj.js +1 -0
- zenml/zen_server/dashboard/assets/page-DmteSSj6.js +1 -0
- zenml/zen_server/dashboard/assets/page-Dt3wHeWX.js +1 -0
- zenml/zen_server/dashboard/assets/page-EXvws1ss.js +1 -0
- zenml/zen_server/dashboard/assets/{page-Czj8fu8q.js → page-K9yjbnd4.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DHDeVaMO.js → page-RV8wpZ_4.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-DLVtrRa5.js → page-bUVHi7DE.js} +1 -1
- zenml/zen_server/dashboard/assets/page-cOEvFs_l.js +1 -0
- zenml/zen_server/dashboard/assets/page-kzSGEVUs.js +1 -0
- zenml/zen_server/dashboard/assets/{page-C7buw8xJ.js → page-uDGvpa5g.js} +2 -2
- zenml/zen_server/dashboard/assets/{page-BbygQpf-.js → page-uN0n_DE2.js} +1 -1
- zenml/zen_server/dashboard/assets/{page-CgJcperk.js → page-xa1EAPcI.js} +1 -1
- zenml/zen_server/dashboard/assets/{persist-xOAq24Bm.js → persist-CEeDYHW5.js} +1 -1
- zenml/zen_server/dashboard/assets/{persist-DLvsEXh0.js → persist-SSTTV5q0.js} +1 -1
- zenml/zen_server/dashboard/assets/{service-MHyqhRgp.js → service-BRoAA1Kq.js} +1 -1
- zenml/zen_server/dashboard/assets/sharedSchema-BACERDat.js +14 -0
- zenml/zen_server/dashboard/assets/{stack-detail-query-C1GoxBeK.js → stack-detail-query-ihiJr6nq.js} +1 -1
- zenml/zen_server/dashboard/assets/{update-server-settings-mutation-DduehrZn.js → update-server-settings-mutation-CK6COmw9.js} +1 -1
- zenml/zen_server/dashboard/index.html +4 -4
- zenml/zen_server/deploy/daemon/daemon_zen_server.py +1 -1
- zenml/zen_server/deploy/docker/docker_zen_server.py +1 -1
- zenml/zen_server/routers/model_versions_endpoints.py +10 -19
- zenml/zen_server/routers/runs_endpoints.py +7 -1
- zenml/zen_stores/migrations/versions/0.82.0_release.py +23 -0
- zenml/zen_stores/schemas/pipeline_deployment_schemas.py +20 -3
- zenml/zen_stores/schemas/pipeline_run_schemas.py +21 -1
- zenml/zen_stores/secrets_stores/hashicorp_secrets_store.py +1 -1
- zenml/zen_stores/secrets_stores/sql_secrets_store.py +1 -1
- zenml/zen_stores/sql_zen_store.py +10 -34
- {zenml_nightly-0.81.0.dev20250429.dist-info → zenml_nightly-0.82.0.dev20250503.dist-info}/METADATA +2 -2
- {zenml_nightly-0.81.0.dev20250429.dist-info → zenml_nightly-0.82.0.dev20250503.dist-info}/RECORD +125 -123
- zenml/zen_server/dashboard/assets/CollapsibleCard-9sSz7n1R.js +0 -1
- zenml/zen_server/dashboard/assets/DialogItem-DHw2ihTx.js +0 -1
- zenml/zen_server/dashboard/assets/NestedCollapsible-Ce1bmT8N.js +0 -1
- zenml/zen_server/dashboard/assets/ProBadge-CDEqgzh8.js +0 -1
- zenml/zen_server/dashboard/assets/RunSelector-DoL_gMHJ.js +0 -1
- zenml/zen_server/dashboard/assets/RunsBody-B6mBjv-_.js +0 -1
- zenml/zen_server/dashboard/assets/SearchField-DHl5flXv.js +0 -1
- zenml/zen_server/dashboard/assets/StackList-dhdUtky3.js +0 -1
- zenml/zen_server/dashboard/assets/Tabs-BuZG8ft1.js +0 -1
- zenml/zen_server/dashboard/assets/Tick-C4gtED35.js +0 -1
- zenml/zen_server/dashboard/assets/index-6mLFgFwe.css +0 -1
- zenml/zen_server/dashboard/assets/page-3lW9eIer.js +0 -1
- zenml/zen_server/dashboard/assets/page-9PzQok8O.js +0 -1
- zenml/zen_server/dashboard/assets/page-BEibNYiA.js +0 -6
- zenml/zen_server/dashboard/assets/page-BOE2XBFy.js +0 -1
- zenml/zen_server/dashboard/assets/page-Bki79xdd.js +0 -1
- zenml/zen_server/dashboard/assets/page-BnKwJnOb.js +0 -1
- zenml/zen_server/dashboard/assets/page-CBGeo-7W.js +0 -2
- zenml/zen_server/dashboard/assets/page-Co-FJ5ds.js +0 -1
- zenml/zen_server/dashboard/assets/page-Cu8vuohQ.js +0 -1
- zenml/zen_server/dashboard/assets/page-D0QcEBi1.js +0 -1
- zenml/zen_server/dashboard/assets/page-DKY_U5Sz.js +0 -1
- zenml/zen_server/dashboard/assets/page-DQHU5o_C.js +0 -1
- zenml/zen_server/dashboard/assets/page-DpY1koQY.js +0 -1
- zenml/zen_server/dashboard/assets/page-DrS4WOup.js +0 -1
- zenml/zen_server/dashboard/assets/page-HIAPXq4w.js +0 -1
- zenml/zen_server/dashboard/assets/page-Jw2QAdxa.js +0 -1
- zenml/zen_server/dashboard/assets/sharedSchema-CQA5lnlU.js +0 -14
- {zenml_nightly-0.81.0.dev20250429.dist-info → zenml_nightly-0.82.0.dev20250503.dist-info}/LICENSE +0 -0
- {zenml_nightly-0.81.0.dev20250429.dist-info → zenml_nightly-0.82.0.dev20250503.dist-info}/WHEEL +0 -0
- {zenml_nightly-0.81.0.dev20250429.dist-info → zenml_nightly-0.82.0.dev20250503.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
import{r as c,j as e}from"./@radix-C7hRs6Kx.js";import{S as T}from"./plus-COjQg3AG.js";import{S as g}from"./refresh-CM5T3QeU.js";import{S as y,P as N}from"./SearchField-DMCywawn.js";import{L as k,r as x,T as L,E,G as F,H as _,J as p,h as o,M as v,S as m,A as D,b as H,a2 as z,a3 as M,a4 as R,aL as A,D as Q,w as q,x as B,af as I,aH as Z,Z as b,ac as $,K as G,z as h,X as K}from"./index-BygJE88j.js";import{a as S}from"./@tanstack-CSxjHCME.js";import{L as u,c as O,d as U}from"./@react-router-CNP6g_RL.js";import{D as C}from"./DisplayDate-CYVBBSgr.js";import{I as P}from"./InlineAvatar-Cpj0lVRQ.js";import{S as V}from"./CollapsibleCard-Dr5zb5T5.js";import{S as J}from"./Tabs-C2ufJX4t.js";import{u as X}from"./all-pipeline-runs-query-BUT1PiTp.js";import{g as W,E as Y}from"./ExecutionStatus-B-ysY113.js";import{s as ee}from"./index-8uhUi12k.js";import{C as se}from"./ComponentBadge-BgGnzcLu.js";import{S as te}from"./dots-horizontal-BGRJCPCs.js";import"./chevron-right-double-uNWbJT-C.js";import"./index-DR30v9MZ.js";import"./@reactflow-CQi1Z1Wq.js";import"./chevron-down-A-rmltmI.js";import"./ComponentIcon-B_7Y_oV-.js";import"./layout-h3cbx8WZ.js";import"./rocket-Cf-B-XOR.js";import"./NestedCollapsible-DbhKdWx-.js";import"./type-guards-CaeD8wHO.js";import"./CodeSnippet-Di-loaZu.js";import"./check-circle-mvyzYvIW.js";import"./stack-detail-query-ihiJr6nq.js";const ae=t=>c.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...t},c.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 4C14.4477 4 14 3.55228 14 3C14 2.44772 14.4477 2 15 2H21C21.5523 2 22 2.44772 22 3V9C22 9.55228 21.5523 10 21 10C20.4477 10 20 9.55228 20 9V5.41421L14.7071 10.7071C14.3166 11.0976 13.6834 11.0976 13.2929 10.7071C12.9024 10.3166 12.9024 9.68342 13.2929 9.29289L18.5858 4H15ZM10.7071 13.2929C11.0976 13.6834 11.0976 14.3166 10.7071 14.7071L5.41421 20H9C9.55228 20 10 20.4477 10 21C10 21.5523 9.55228 22 9 22H3C2.73478 22 2.48043 21.8946 2.29289 21.7071C2.10536 21.5196 2 21.2652 2 21L2 15C2 14.4477 2.44772 14 3 14C3.55229 14 4 14.4477 4 15L4 18.5858L9.29289 13.2929C9.68342 12.9024 10.3166 12.9024 10.7071 13.2929Z"})),re=[{id:"name",header:"Run",accessorFn:t=>{var s;return{id:t.id,name:t.name,status:(s=t.body)==null?void 0:s.status}},cell:({getValue:t})=>{const{name:s,status:a,id:r}=t();return e.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[e.jsx(k,{className:`h-5 w-5 ${W(a)}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(u,{to:x.runs.detail(r),className:"flex items-center gap-1",children:e.jsx("span",{className:"text-text-md font-semibold text-theme-text-primary",children:s})}),e.jsx(L,{children:e.jsxs(E,{children:[e.jsx(F,{className:"hover:text-theme-text-brand hover:underline",children:e.jsx(Y,{status:a})}),e.jsx(_,{className:"z-20 capitalize",children:a})]})}),e.jsx(p,{copyText:s})]}),e.jsxs(u,{to:x.runs.detail(r),className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-text-xs text-theme-text-secondary",children:r.split("-")[0]}),e.jsx(p,{copyText:r})]})]})]})}},{id:"created-at",header:"Created at",accessorFn:t=>{var s;return{date:(s=t.body)==null?void 0:s.created}},cell:({getValue:t})=>{const{date:s}=t();return e.jsx("div",{className:"text-text-sm text-theme-text-secondary",children:e.jsx(C,{dateString:s})})}}];function ne({componentId:t}){const[s,a]=c.useState(void 0),[r,n]=c.useState(1),j={name:s,page:r},{data:i,refetch:l}=X({params:{...j,stack_component:t,sort_by:"desc:updated"}});return e.jsx("section",{children:e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-y-4",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(y,{inMemoryHandler:d=>{n(1),d||a(void 0),a(`contains:${d}`)},searchParams:{}})}),e.jsx("div",{className:"flex items-center justify-between gap-2",children:e.jsxs(o,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>l(),children:[e.jsx(g,{className:"h-5 w-5 fill-theme-text-brand"}),"Refresh"]})})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:i?e.jsx(v,{columns:re,data:i.items}):e.jsx(m,{className:"h-[500px] w-full"})}),i?i.total_pages>1&&e.jsx(N,{inMemoryHandler:n,searchParams:{},paginate:i}):e.jsx(m,{className:"h-[36px] w-[300px]"})]})]})})}function ie(){return[{id:"name",header:"Stack",accessorFn:t=>t.name,cell:({row:t})=>{const{name:s,id:a}=t.original;return e.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[e.jsx(D,{type:"square",size:"md",children:e.jsx(H,{size:"md",children:s[0]})}),e.jsxs("div",{children:[e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("h2",{className:"text-text-md font-semibold",children:s})}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-text-xs text-theme-text-secondary",children:a.split("-")[0]}),e.jsx(p,{copyText:a})]})]})]})}},{id:"author",header:"Author",accessorFn:t=>{var s;return{author:(s=t.body)==null?void 0:s.user}},cell:({getValue:t})=>{const{author:s}=t();return s?e.jsx(P,{username:s.name||"default"}):null}},{id:"created",header:"Created at",accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.created},cell:({getValue:t})=>e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.jsx(C,{dateString:t()})})}]}function le({componentId:t}){const[s,a]=c.useState(void 0),[r,n]=c.useState(1),j={name:s,page:r},{refetch:i,data:l}=S(ee.stackList({...j,component_id:t,sort_by:"desc:updated"}));return e.jsx("section",{children:e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-y-4",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(y,{inMemoryHandler:d=>{n(1),d||a(void 0),a(`contains:${d}`)},searchParams:{}})}),e.jsx("div",{className:"flex items-center justify-between gap-2",children:e.jsxs(o,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>i(),children:[e.jsx(g,{className:"h-5 w-5 fill-theme-text-brand"}),"Refresh"]})})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:l?e.jsx(v,{columns:ie(),data:l.items}):e.jsx(m,{className:"h-[500px] w-full"})}),l?l.total_pages>1&&e.jsx(N,{inMemoryHandler:n,searchParams:{},paginate:l}):e.jsx(m,{className:"h-[36px] w-[300px]"})]})]})})}function w({children:t,onOpenChange:s,componentId:a}){return e.jsxs(z,{onOpenChange:s,children:[e.jsx(M,{asChild:!0,children:t}),e.jsxs(R,{className:"w-[1000px] overflow-y-auto",children:[e.jsx(V,{className:"gap-0.5",children:e.jsx(o,{className:"flex aspect-square items-center justify-center p-0",intent:"secondary",asChild:!0,emphasis:"minimal",children:e.jsxs(u,{to:x.components.detail(a),children:[e.jsx(ae,{className:"h-5 w-5 shrink-0 fill-neutral-500"}),e.jsx("span",{className:"sr-only",children:"Expand component detail to page"})]})})}),e.jsxs("div",{className:"@container",children:[e.jsx(A,{isPanel:!0,componentId:a}),e.jsx(J,{isPanel:!0,runsTabContent:e.jsx(ne,{componentId:a}),stacksTabContent:e.jsx(le,{componentId:a}),componentId:a})]})]})]})}function ce({id:t}){const s=O();return e.jsxs(Q,{children:[e.jsx(q,{asChild:!0,children:e.jsx(o,{intent:"secondary",emphasis:"minimal",className:"flex aspect-square items-center justify-center p-0",children:e.jsx(te,{className:"h-4 w-4 shrink-0 fill-theme-text-tertiary"})})}),e.jsx(B,{align:"end",sideOffset:7,children:e.jsxs(I,{onSelect:()=>s(x.components.edit(t)),className:"cursor-pointer space-x-2",children:[e.jsx(Z,{className:"h-3 w-3 fill-neutral-400"}),e.jsx("p",{children:"Edit"})]})})]})}function oe(){return[{id:"name",header:"Component",accessorKey:"name",cell:({row:t})=>{var r;const s=t.original.id,a=t.original.name;return e.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[e.jsx("img",{width:32,height:32,src:b(((r=t.original.body)==null?void 0:r.logo_url)||""),alt:"Flavor Icon"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{componentId:s,children:e.jsx("button",{children:e.jsx("h2",{className:"text-text-md font-semibold",children:a})})}),e.jsx(p,{copyText:a})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{componentId:s,children:e.jsx("button",{className:"text-text-xs text-theme-text-secondary",children:s.split("-")[0]})}),e.jsx(p,{copyText:s})]})]})]})}},{id:"type",header:"Component Type",accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.type},cell:({row:t})=>{var a;const s=((a=t.original.body)==null?void 0:a.type)||"orchestrator";return e.jsx(se,{type:s,children:$(s)})}},{id:"flavor",header:"Flavor",accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.flavor_name},cell:({row:t})=>{var a,r;const s=(a=t.original.body)==null?void 0:a.flavor_name;return e.jsxs(G,{rounded:!1,className:"w-fit gap-1 text-theme-text-primary",color:"grey",emphasis:"minimal",children:[e.jsx("img",{width:20,height:20,src:b(((r=t.original.body)==null?void 0:r.logo_url)||""),alt:"Flavor Icon of Component"}),e.jsx("p",{children:s})]})}},{id:"author",header:"Author",accessorFn:t=>{var s,a;return(a=(s=t.body)==null?void 0:s.user)==null?void 0:a.name},cell:({row:t})=>{var a,r;const s=(r=(a=t.original.body)==null?void 0:a.user)==null?void 0:r.name;return s?e.jsx(P,{username:s}):null}},{id:"created",header:"Created at",accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.created},cell:({row:t})=>{var s;return e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.jsx(C,{dateString:((s=t.original.body)==null?void 0:s.created)||""})})}},{id:"admin_actions",header:"",cell:({row:t})=>e.jsx(ce,{id:t.original.id})}]}const f=1,me=h.object({page:h.coerce.number().min(f).optional().default(f).catch(f),name:h.string().optional(),operator:h.enum(["and","or"]).optional()});function de(){const[t]=U(),{page:s,name:a,operator:r}=me.parse({page:t.get("page")||void 0,name:t.get("name")||void 0});return{page:s,name:a,logical_operator:r}}function xe(){const t=de(),s=S({...K.componentList({...t,sort_by:"desc:updated"}),throwOnError:!0}),a=oe();if(s.isError)return null;const{data:r,refetch:n}=s;return e.jsx("section",{children:e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-y-4",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(y,{searchParams:t})}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs(o,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>n(),children:[e.jsx(g,{className:"h-5 w-5 fill-theme-text-brand"}),"Refresh"]}),e.jsx(o,{size:"md",asChild:!0,children:e.jsxs(u,{to:x.components.create,children:[e.jsx(T,{className:"h-5 w-5 shrink-0 fill-white"}),e.jsx("span",{children:"New Component"})]})})]})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:r?e.jsx(v,{columns:a,data:r.items}):e.jsx(m,{className:"h-[500px] w-full"})}),r?r.total_pages>1&&e.jsx(N,{searchParams:t,paginate:r}):e.jsx(m,{className:"h-[36px] w-[300px]"})]})]})})}function Be(){return e.jsx(xe,{})}export{Be as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as o,j as e}from"./@radix-C7hRs6Kx.js";import{z as i,f as v,
|
1
|
+
import{r as o,j as e}from"./@radix-C7hRs6Kx.js";import{z as i,f as v,ao as y,ay as j,ar as S,i as C,u as k,B as w,S as E}from"./index-BygJE88j.js";import{u as F}from"./update-server-settings-mutation-CK6COmw9.js";import{t as q}from"./zod-C0xYeTvL.js";import{c as A}from"./@tanstack-CSxjHCME.js";import{u as I,C as b}from"./index.esm-D7jFlf5N.js";import"./@react-router-CNP6g_RL.js";import"./@reactflow-CQi1Z1Wq.js";const _=i.object({announcements:i.boolean(),updates:i.boolean()});function K({settings:t}){var h,f;const c=o.useId(),d=o.useId(),{toast:l}=v(),u=A(),{mutate:g}=F({onError:s=>{u.invalidateQueries({queryKey:j()}),S(s)&&l({status:"error",emphasis:"subtle",icon:e.jsx(C,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:s.message,rounded:!0})},onSuccess:()=>{u.invalidateQueries({queryKey:j()}),l({status:"success",emphasis:"subtle",rounded:!0,description:"Settings updated successfully"})}}),{control:m,handleSubmit:p,watch:x}=I({resolver:q(_),defaultValues:{announcements:((h=t.body)==null?void 0:h.display_announcements)??void 0,updates:((f=t.body)==null?void 0:f.display_updates)??void 0}});function N({announcements:s,updates:a}){g({display_announcements:s,display_updates:a})}return o.useEffect(()=>{const s=x(()=>p(N)());return()=>s.unsubscribe()},[p,x]),e.jsx("form",{id:"create-user-form",className:"space-y-5",children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(b,{control:m,name:"announcements",render:({field:{value:s,onChange:a,ref:n}})=>e.jsx(y,{ref:n,checked:s,onCheckedChange:r=>{a(!!r)},id:c})}),e.jsxs("label",{htmlFor:c,className:"text-text-md",children:[e.jsx("p",{className:"font-semibold",children:"Announcements"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Enable Announcements for important ZenML updates, surveys, and feedback opportunities."})]})]}),e.jsx("hr",{}),e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(b,{control:m,name:"updates",render:({field:{value:s,onChange:a,ref:n}})=>e.jsx(y,{ref:n,checked:s,onCheckedChange:r=>{a(!!r)},id:d})}),e.jsxs("label",{htmlFor:d,className:"text-text-md",children:[e.jsx("p",{className:"font-semibold",children:"Updates"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Activate Updates to receive the latest ZenML news and feature releases."})]})]})]})})}function P(){const{data:t}=k({throwOnError:!0});return e.jsxs(w,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Notifications"}),e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"ZenML comes equipped with default widgets designed to enhance your experience by analyzing usage patterns, gathering your feedback, and ensuring you stay informed about our latest updates and features."})]}),e.jsx("div",{className:"",children:t?e.jsx(K,{settings:t}):e.jsx(E,{className:"h-[250px] w-full"})})]})}export{P as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{j as e,r as f}from"./@radix-C7hRs6Kx.js";import{z as d,o as x,p as h,q as N,j,F as p,B as m,f as S,C as D,h as C,i as P,_}from"./index-BygJE88j.js";import{d as E}from"./@react-router-CNP6g_RL.js";import{E as F}from"./EmptyState-M1jafpg6.js";import{a as T,b as k}from"./@tanstack-CSxjHCME.js";import{E as I}from"./Error-vBjUYjb-.js";import{t as A}from"./zod-C0xYeTvL.js";import{u as V,C as q}from"./index.esm-D7jFlf5N.js";import{S as z}from"./check-circle-mvyzYvIW.js";import"./@reactflow-CQi1Z1Wq.js";const B=d.object({device_id:d.string().optional(),user_code:d.string().optional()});function Y(){const[s]=E(),{device_id:t,user_code:i}=B.parse({device_id:s.get("device_id")||void 0,user_code:s.get("user_code")||void 0});return{user_code:i,device_id:t}}const K=d.object({trustDevice:d.boolean()});function L({deviceId:s,queryParams:t}){return["devices",s,t]}async function R({deviceId:s,queryParams:t}){const i=x(h.devices.detail(s)+"?"+N(t)),r=await j(i,{method:"GET",credentials:"include",headers:{"Content-Type":"application/json"}});if(!r.ok)throw new p({message:"Error while fetching Device details",status:r.status,statusText:r.statusText});return r.json()}function W(s,t){return T({queryKey:L(s),queryFn:async()=>R(s),...t})}function G({device:s}){var t,i,r,a,c,n;return e.jsx(m,{className:"w-full p-5",children:e.jsxs("dl",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("dt",{children:"IP Address"}),e.jsx("dd",{children:(t=s.body)==null?void 0:t.ip_address})]}),((i=s.metadata)==null?void 0:i.city)&&((r=s.metadata)==null?void 0:r.country)&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("dt",{children:"Location"}),e.jsxs("dd",{children:[(a=s.metadata)==null?void 0:a.city,", ",(c=s.metadata)==null?void 0:c.country]})]}),e.jsxs("div",{className:"flex min-w-0 items-center justify-between",children:[e.jsx("dt",{children:"Hostname"}),e.jsx("dd",{className:"truncate",children:(n=s.body)==null?void 0:n.hostname})]})]})})}async function H({deviceId:s,payload:t}){const i=x(h.devices.verify(s)),r=await j(i,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){const a=await r.json().then(c=>c.detail).catch(()=>["","Failed to verify device."]);throw new p({status:r.status,statusText:r.statusText,message:a[1]||"Failed to verify device."})}return r.json()}function J(s){return k({mutationFn:async t=>H(t),...s})}function M({deviceId:s,user_code:t,setSuccess:i}){const r=f.useId(),{handleSubmit:a,formState:{isValid:c},control:n}=V({resolver:A(K),defaultValues:{trustDevice:!1}}),{toast:l}=S(),{mutate:v,isPending:y}=J({onSuccess:()=>{i(!0)},onError:o=>{o instanceof Error&&l({status:"error",emphasis:"subtle",icon:e.jsx(P,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:o.message,rounded:!0})}});function g(o){v({deviceId:s,payload:{user_code:t,trusted_device:o.trustDevice}})}return e.jsxs("form",{onSubmit:a(g),className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(q,{control:n,name:"trustDevice",render:({field:{onChange:o,value:w}})=>e.jsx(D,{checked:w,onCheckedChange:b=>o(!!b),id:r})}),e.jsxs("label",{htmlFor:r,children:[e.jsx("p",{children:"Trust this device"}),e.jsx("p",{className:"text-theme-text-secondary",children:"We won't ask you again soon on this device."})]})]}),e.jsx(C,{disabled:y||!c,size:"md",className:"flex w-full justify-center",children:"Authorize this device"})]})}function O(){return e.jsxs(m,{className:"flex min-w-[540px] flex-col items-center justify-center space-y-7 px-7 py-9",children:[e.jsx(z,{className:"h-[120px] w-[120px] fill-theme-text-success"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"You successfully added your device"}),e.jsx("p",{className:"text-theme-text-secondary",children:"You may close this screen and return to your CLI."})]})]})}function ae(){const{device_id:s,user_code:t}=Y(),[i,r]=f.useState(!1),{data:a,isPending:c,isError:n,error:l}=W({deviceId:s,queryParams:{user_code:t}},{enabled:!!s&&!!t});return!s||!t?e.jsx(F,{children:e.jsx("p",{children:"Invalid device verification link."})}):n?e.jsx(u,{children:e.jsx(I,{isAlertCircle:!0,err:l})}):c?e.jsx(u,{children:e.jsx(_,{})}):i?e.jsx(O,{}):e.jsx(u,{children:e.jsxs("div",{className:"w-full space-y-7",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"mb-0.5 text-display-xs font-semibold",children:"Authorize a new device"}),e.jsx("p",{className:"text-theme-text-secondary",children:"You are logging in from a new device."})]}),e.jsx(G,{device:a}),e.jsx(M,{setSuccess:r,deviceId:s,user_code:t})]})})}function u({children:s}){return e.jsx(m,{className:"flex w-full min-w-[540px] flex-col items-center justify-center gap-5 p-7",children:s})}export{ae as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{j as e}from"./@radix-C7hRs6Kx.js";import{B as r,
|
1
|
+
import{j as e}from"./@radix-C7hRs6Kx.js";import{B as r,V as n}from"./index-BygJE88j.js";import{P as o}from"./ProBadge-3vtouJQf.js";import{P as i,a as l,b as c,c as m,d,e as x}from"./ProCta-BoTLdAdV.js";import{C as f}from"./CodeSnippet-Di-loaZu.js";import{d as p}from"./@react-router-CNP6g_RL.js";import"./@tanstack-CSxjHCME.js";import"./@reactflow-CQi1Z1Wq.js";import"./check-DK77doTf.js";const u="/assets/acp-DOsXjFc7.webp";function h(){const[a]=p(),t=a.get("artifact");function s(){return t?`zenml artifact list --name='contains:${t}'`:"zenml artifact list"}return e.jsxs(r,{className:"flex flex-wrap justify-between p-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-text-xl font-semibold",children:"Staying Open Source? "}),e.jsx("p",{className:"text-theme-text-secondary",children:"No problem! Use this CLI command to list your artifacts"})]}),e.jsx(f,{code:s()})]})}function A(){return e.jsxs("div",{children:[e.jsxs(n,{className:"flex items-center gap-1",children:[e.jsx("h1",{className:"text-display-xs font-semibold",children:"Artifacts"}),e.jsx(o,{})]}),e.jsxs("div",{className:"layout-container space-y-5 py-5",children:[e.jsxs(i,{className:"relative overflow-y-hidden",children:[e.jsxs("div",{className:"w-full max-w-none space-y-5 lg:max-w-[900px]",children:[e.jsx(l,{children:"Advanced Artifact Management Features with ZenML Pro"}),e.jsx(c,{}),e.jsx(m,{features:[{title:"Artifact Control Plane Dashboard",subtitle:"Artifact management and monitoring"},{title:"Enterprise Security",subtitle:"Social SSO, RBAC, and User Management"},{title:"Managed ZenML Server",subtitle:"On your VPC or hosted on our infrastructure"},{title:"Advanced MLOps",subtitle:"CI/CD/CT, Model Control Plane and more"}]}),e.jsx(d,{})]}),e.jsx(x,{className:"absolute translate-x-[30%] translate-y-[15%] scale-[40%]",src:u,alt:"Screenshot of the ZenML Pro Artifact Control Plane"})]}),e.jsx(h,{})]})]})}export{A as default};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import{r as u,j as a}from"./@radix-C7hRs6Kx.js";import{u as h,c as w,S as v,a as y,b as k}from"./form-schemas-
|
1
|
+
import{r as u,j as a}from"./@radix-C7hRs6Kx.js";import{u as h,c as w,S as v,a as y,b as k}from"./form-schemas-BJN_25Ua.js";import{S}from"./SetPassword-CBHW-Su8.js";import{I as x,h as j,j as N,o as A,F as C,p as q,e as P,f as z,i as E}from"./index-BygJE88j.js";import{u as F}from"./index.esm-D7jFlf5N.js";import{t as M}from"./zod-C0xYeTvL.js";import{b as T}from"./@tanstack-CSxjHCME.js";import{u as U}from"./login-mutation-DywLqguW.js";import"./check-circle-mvyzYvIW.js";import"./@react-router-CNP6g_RL.js";import"./UpdatePasswordSchemas-p3RX0P-Q.js";import"./PasswordChecker-lYTOtNom.js";import"./@reactflow-CQi1Z1Wq.js";const g=u.createContext(null);function $({children:e,initialSettings:r}){const[t,s]=u.useState(r||{});return a.jsx(g.Provider,{value:{serverSettings:t,setServerSettings:s},children:e})}function f(){const e=u.useContext(g);if(e===null)throw new Error("useServerActivationContext must be used within an ServerActivationProvider");return e}function I(){const{setSurveyStep:e}=h(),{setServerSettings:r}=f();function t({newPassword:s,username:o}){r(i=>({...i,admin_password:s,admin_username:o})),e(i=>i+1)}return a.jsx(S,{displayUsername:!0,headline:"Create your admin user and password",subHeadine:"Select a username and password for your admin account",submitHandler:t})}const m=e=>{e=1831565813+(e|=0)|0;let r=Math.imul(e^e>>>15,1|e);return r=r+Math.imul(r^r>>>7,61|r)^r,((r^r>>>14)>>>0)/4294967296};class L{constructor(r){this.dictionaries=void 0,this.length=void 0,this.separator=void 0,this.style=void 0,this.seed=void 0;const{length:t,separator:s,dictionaries:o,style:i,seed:l}=r;this.dictionaries=o,this.separator=s,this.length=t,this.style=i,this.seed=l}generate(){if(!this.dictionaries)throw new Error('Cannot find any dictionary. Please provide at least one, or leave the "dictionary" field empty in the config object');if(this.length<=0)throw new Error("Invalid length provided");if(this.length>this.dictionaries.length)throw new Error(`The length cannot be bigger than the number of dictionaries.
|
2
2
|
Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let r=this.seed;return this.dictionaries.slice(0,this.length).reduce((t,s)=>{let o;r?(o=(l=>{if(typeof l=="string"){const c=l.split("").map(d=>d.charCodeAt(0)).reduce((d,b)=>d+b,1),n=Math.floor(Number(c));return m(n)}return m(l)})(r),r=4294967296*o):o=Math.random();let i=s[Math.floor(o*s.length)]||"";if(this.style==="lowerCase")i=i.toLowerCase();else if(this.style==="capital"){const[l,...c]=i.split("");i=l.toUpperCase()+c.join("")}else this.style==="upperCase"&&(i=i.toUpperCase());return t?`${t}${this.separator}${i}`:`${i}`},"")}}const p={separator:"_",dictionaries:[]},_=e=>{const r=[...e&&e.dictionaries||p.dictionaries],t={...p,...e,length:e&&e.length||r.length,dictionaries:r};if(!e||!e.dictionaries||!e.dictionaries.length)throw new Error('A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide');return new L(t).generate()};var H=["aardvark","aardwolf","albatross","alligator","alpaca","amphibian","anaconda","angelfish","anglerfish","ant","anteater","antelope","antlion","ape","aphid","armadillo","asp","baboon","badger","bandicoot","barnacle","barracuda","basilisk","bass","bat","bear","beaver","bedbug","bee","beetle","bird","bison","blackbird","boa","boar","bobcat","bobolink","bonobo","booby","bovid","bug","butterfly","buzzard","camel","canid","canidae","capybara","cardinal","caribou","carp","cat","caterpillar","catfish","catshark","cattle","centipede","cephalopod","chameleon","cheetah","chickadee","chicken","chimpanzee","chinchilla","chipmunk","cicada","clam","clownfish","cobra","cockroach","cod","condor","constrictor","coral","cougar","cow","coyote","crab","crane","crawdad","crayfish","cricket","crocodile","crow","cuckoo","damselfly","deer","dingo","dinosaur","dog","dolphin","donkey","dormouse","dove","dragon","dragonfly","duck","eagle","earthworm","earwig","echidna","eel","egret","elephant","elk","emu","ermine","falcon","felidae","ferret","finch","firefly","fish","flamingo","flea","fly","flyingfish","fowl","fox","frog","galliform","gamefowl","gayal","gazelle","gecko","gerbil","gibbon","giraffe","goat","goldfish","goose","gopher","gorilla","grasshopper","grouse","guan","guanaco","guineafowl","gull","guppy","haddock","halibut","hamster","hare","harrier","hawk","hedgehog","heron","herring","hippopotamus","hookworm","hornet","horse","hoverfly","hummingbird","hyena","iguana","impala","jackal","jaguar","jay","jellyfish","junglefowl","kangaroo","kingfisher","kite","kiwi","koala","koi","krill","ladybug","lamprey","landfowl","lark","leech","lemming","lemur","leopard","leopon","limpet","lion","lizard","llama","lobster","locust","loon","louse","lungfish","lynx","macaw","mackerel","magpie","mammal","manatee","mandrill","marlin","marmoset","marmot","marsupial","marten","mastodon","meadowlark","meerkat","mink","minnow","mite","mockingbird","mole","mollusk","mongoose","monkey","moose","mosquito","moth","mouse","mule","muskox","narwhal","newt","nightingale","ocelot","octopus","opossum","orangutan","orca","ostrich","otter","owl","ox","panda","panther","parakeet","parrot","parrotfish","partridge","peacock","peafowl","pelican","penguin","perch","pheasant","pig","pigeon","pike","pinniped","piranha","planarian","platypus","pony","porcupine","porpoise","possum","prawn","primate","ptarmigan","puffin","puma","python","quail","quelea","quokka","rabbit","raccoon","rat","rattlesnake","raven","reindeer","reptile","rhinoceros","roadrunner","rodent","rook","rooster","roundworm","sailfish","salamander","salmon","sawfish","scallop","scorpion","seahorse","shark","sheep","shrew","shrimp","silkworm","silverfish","skink","skunk","sloth","slug","smelt","snail","snake","snipe","sole","sparrow","spider","spoonbill","squid","squirrel","starfish","stingray","stoat","stork","sturgeon","swallow","swan","swift","swordfish","swordtail","tahr","takin","tapir","tarantula","tarsier","termite","tern","thrush","tick","tiger","tiglon","toad","tortoise","toucan","trout","tuna","turkey","turtle","tyrannosaurus","unicorn","urial","vicuna","viper","vole","vulture","wallaby","walrus","warbler","wasp","weasel","whale","whippet","whitefish","wildcat","wildebeest","wildfowl","wolf","wolverine","wombat","woodpecker","worm","wren","xerinae","yak","zebra"],D=["amaranth","amber","amethyst","apricot","aqua","aquamarine","azure","beige","black","blue","blush","bronze","brown","chocolate","coffee","copper","coral","crimson","cyan","emerald","fuchsia","gold","gray","green","harlequin","indigo","ivory","jade","lavender","lime","magenta","maroon","moccasin","olive","orange","peach","pink","plum","purple","red","rose","salmon","sapphire","scarlet","silver","tan","teal","tomato","turquoise","violet","white","yellow"];const R=["booby","swallow"];function V(){return _({dictionaries:[D,H.filter(e=>!R.includes(e))]})}function Y({submitHandler:e}){const r=u.useId(),{handleSubmit:t,register:s,formState:{isValid:o}}=F({resolver:M(w),defaultValues:{serverName:V()}});return a.jsxs("div",{className:"max-w-[570px] space-y-5",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-display-xs font-semibold",children:"Almost there! Select a server name"}),a.jsx("p",{className:"text-theme-text-secondary",children:"This will identify your ZenML server. You can use the generated name or create your own."})]}),a.jsxs("form",{onSubmit:t(e),className:"space-y-5",children:[a.jsx("div",{className:"space-y-2",children:a.jsxs("div",{className:"space-y-0.5",children:[a.jsx("label",{htmlFor:r,className:"text-text-sm",children:"Server Name"}),a.jsx(x,{...s("serverName"),id:r,className:"w-full"})]})}),a.jsx(j,{disabled:!o,className:"w-full text-center",size:"md",children:a.jsx("span",{className:"w-full",children:"Activate your Server"})})]})]})}async function Z(e){const r=A(q.activate),t=await N(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const s=await t.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>"Failed to activate server");throw new C({status:t.status,statusText:t.statusText,message:s})}return t.json()}function B(e){return T({mutationFn:async r=>Z(r),...e})}function G({setUsername:e}){const{serverSettings:r}=f(),{setSurveyStep:t}=h(),{setAuthState:s}=P(),{toast:o}=z(),{mutate:i}=U({onSuccess:()=>{s("true"),t(n=>n+1)}}),{mutate:l}=B({onSuccess:async n=>{e(n.name),i({username:n.name,password:r.admin_password??void 0})},onError:n=>{n instanceof Error&&o({status:"error",emphasis:"subtle",icon:a.jsx(E,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:n.message,rounded:!0})}});function c({serverName:n}){l({...r,server_name:n})}return a.jsx(Y,{submitHandler:c})}function J(){const{surveyStep:e}=h(),[r,t]=u.useState("");return a.jsx(a.Fragment,{children:a.jsxs($,{children:[a.jsx(v,{stepAmount:2}),e===1&&a.jsx(I,{}),e===2&&a.jsx(G,{setUsername:t}),e===3&&a.jsx(y,{subHeader:"Your created your ZenML account",username:r})]})})}function le(){return a.jsx(k,{children:a.jsx(J,{})})}export{le as default};
|
@@ -0,0 +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};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as i,j as s}from"./@radix-C7hRs6Kx.js";import{ai as D,aj as k,h as f,ak as z,al as E,am as A,f as b,ax as v,ar as S,i as C,I as o,ap as T,aq as q,z as a,l as B,B as M,S as P,A as Q,b as V}from"./index-BygJE88j.js";import{c as _}from"./@tanstack-CSxjHCME.js";import{u as F}from"./index.esm-D7jFlf5N.js";import{S as K}from"./tick-circle-m94Aa6Zt.js";import{t as I}from"./zod-C0xYeTvL.js";import{P as O}from"./PasswordChecker-lYTOtNom.js";import{u as H}from"./UpdatePasswordSchemas-p3RX0P-Q.js";import{D as R}from"./DisplayDate-CYVBBSgr.js";import"./@react-router-CNP6g_RL.js";import"./@reactflow-CQi1Z1Wq.js";function G(){const[e,l]=i.useState(!1);return s.jsxs(D,{onOpenChange:()=>{l(!1)},children:[s.jsx(k,{asChild:!0,children:s.jsx(f,{size:"md",className:"shrink-0",intent:"primary",emphasis:"subtle",children:"Change Password"})}),s.jsxs(z,{children:[s.jsx(E,{children:s.jsx(A,{children:" Update Credentials"})}),e?s.jsx(L,{}):s.jsx(J,{setSuccess:l})]})]})}function J({setSuccess:e}){var u;const l=i.useId(),d=i.useId(),n=i.useId(),{toast:x}=b(),{mutate:p,isPending:j}=v({onSuccess(){e(!0)},onError(t){S(t)&&x({status:"error",emphasis:"subtle",icon:s.jsx(C,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:t.message,rounded:!0})}}),{register:c,handleSubmit:m,watch:w,formState:{isValid:N,errors:y}}=F({resolver:I(H),mode:"onChange",criteriaMode:"all"});function g(t){p({old_password:t.oldPassword,password:t.newPassword})}const h=(u=y.newPassword)==null?void 0:u.types;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-5 p-7",children:[s.jsx("form",{id:"update-password-form",onSubmit:m(g),children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:l,className:"text-text-sm",children:"Old Password"}),s.jsx(o,{...c("oldPassword"),type:"password",id:l,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:d,className:"text-text-sm",children:"New Password"}),s.jsx(o,{...c("newPassword"),type:"password",id:d,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:n,className:"text-text-sm",children:"Confirm Password"}),s.jsx(o,{...c("confirmPassword"),type:"password",id:n,className:"w-full"})]})]})}),s.jsx(O,{val:w("newPassword"),errors:h||[]})]}),s.jsxs(T,{className:"gap-[10px]",children:[s.jsx(q,{asChild:!0,children:s.jsx(f,{size:"sm",intent:"secondary",children:"Cancel"})}),s.jsx(f,{disabled:!N||j,form:"update-password-form",size:"sm",children:"Update Password"})]})]})}function L(){return s.jsxs("div",{className:"space-y-5 p-7 text-center",children:[s.jsx(K,{className:"mx-auto h-[110px] w-[110px] fill-success-500"}),s.jsx("p",{className:"text-text-lg font-semibold text-theme-text-primary",children:"The password was updated successfully!"})]})}const W=a.object({fullName:a.union([a.string(),a.literal("")]),username:a.union([a.string(),a.literal("")]),email:a.union([a.string().email(),a.literal("")])}).refine(e=>e.fullName!==""||e.username!==""||e.email!=="");function X({user:e}){var h,u,t;const l=_(),{toast:d}=b(),n=i.useId(),x=i.useId(),p=i.useId(),{isPending:j,mutate:c}=v({onError(r){S(r)&&d({status:"error",emphasis:"subtle",icon:s.jsx(C,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:r.message,rounded:!0})},onSuccess:()=>{l.invalidateQueries({queryKey:["current-user"]}),l.invalidateQueries({queryKey:["users"]}),w(),d({status:"success",emphasis:"subtle",rounded:!0,description:"User updated successfully"})}}),{register:m,reset:w,handleSubmit:N,formState:{isValid:y}}=F({resolver:I(W),defaultValues:{email:void 0,fullName:void 0,username:void 0}});function g(r){const U={...r.fullName&&{full_name:r.fullName},...r.username&&{name:r.username},...r.email&&{email:r.email}};c(U)}return s.jsxs("div",{className:"w-full max-w-[600px]",children:[s.jsx("form",{onSubmit:N(g),children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:n,className:"text-text-sm",children:"Full Name"}),s.jsx(o,{placeholder:(h=e.body)==null?void 0:h.full_name,...m("fullName"),id:n,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:x,className:"text-text-sm",children:"Username"}),s.jsx(o,{...m("username"),placeholder:e.name,id:x,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:p,className:"text-text-sm",children:"Email"}),s.jsx(o,{placeholder:((u=e.metadata)==null?void 0:u.email)??void 0,...m("email"),id:p,className:"w-full"})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx(f,{disabled:j||!y,size:"md",intent:"primary",children:"Update"})})]})}),s.jsx(G,{}),s.jsxs("p",{className:"mt-5 text-text-sm text-theme-text-secondary",children:["Created on ",s.jsx(R,{dateString:((t=e.body)==null?void 0:t.created)||""})]})]})}function ds(){const{data:e}=B();return s.jsxs(M,{className:"flex flex-col gap-5 p-5",children:[s.jsx("h1",{className:"text-text-xl font-semibold",children:"Profile"}),s.jsxs("div",{className:"flex justify-between",children:[e?s.jsx(X,{user:e}):s.jsx(P,{className:"h-[350px] w-full"}),e?s.jsx(Q,{size:"xxl",className:"ml-5 h-[140px] w-[140px]",type:"rounded",children:s.jsx(V,{className:"text-display-lg",size:"xxl",children:e.name[0]})}):s.jsx(P,{className:"h-[140px] w-[140px] rounded-rounded"})]})]})}export{ds as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as i,j as e}from"./@radix-C7hRs6Kx.js";import{S as o,h as n,r as c,aP as d}from"./index-BygJE88j.js";import{S as h}from"./StackList-S-9I1R4n.js";import{p as m,c as j}from"./persist-SSTTV5q0.js";import{p as l,c as k}from"./persist-CEeDYHW5.js";import{I as p}from"./Infobox-Bai0JtFs.js";import{s as u}from"./index-8uhUi12k.js";import{a as f}from"./@tanstack-CSxjHCME.js";import{L as x}from"./@react-router-CNP6g_RL.js";import"./@reactflow-CQi1Z1Wq.js";import"./plus-COjQg3AG.js";import"./refresh-CM5T3QeU.js";import"./SearchField-DMCywawn.js";import"./dots-horizontal-BGRJCPCs.js";import"./chevron-right-double-uNWbJT-C.js";import"./index-DR30v9MZ.js";import"./DisplayDate-CYVBBSgr.js";import"./InlineAvatar-Cpj0lVRQ.js";import"./CodeSnippet-Di-loaZu.js";import"./CollapsibleCard-Dr5zb5T5.js";import"./chevron-down-A-rmltmI.js";import"./components-Br2ezRib.js";import"./NumberBox-D2A7ENHb.js";import"./ComponentBadge-BgGnzcLu.js";import"./ComponentIcon-B_7Y_oV-.js";import"./layout-h3cbx8WZ.js";import"./rocket-Cf-B-XOR.js";import"./trash-BWSZ7NRK.js";import"./DialogItem-0fWTH7ki.js";import"./AlertDialogDropdownItem-CRZjthRL.js";import"./sharedSchema-BACERDat.js";import"./stack-detail-query-ihiJr6nq.js";function w({setHasResumeableStack:a}){const{success:t,data:s}=m(),r=f({...u.stackDeploymentStack({provider:(s==null?void 0:s.provider)||"aws",stack_name:(s==null?void 0:s.stackName)||"",date_start:s==null?void 0:s.timestamp}),enabled:t,throwOnError:!0});return i.useEffect(()=>{r.data&&(j(),a(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(o,{className:"h-[70px] w-full"}):e.jsx(p,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(n,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(x,{to:c.stacks.create.newInfra,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function S({setHasResumeableTerraform:a}){const{success:t,data:s}=l(),r=f({...u.stackDeploymentStack({provider:(s==null?void 0:s.provider)||"aws",stack_name:(s==null?void 0:s.stackName)||"",date_start:s==null?void 0:s.timestamp}),enabled:t,throwOnError:!0});return i.useEffect(()=>{r.data&&(k(),a(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(o,{className:"h-[70px] w-full"}):e.jsx(p,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Terraform Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(n,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(x,{to:c.stacks.create.terraform,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function v(){const[a,t]=i.useState(m().success),[s,r]=i.useState(l().success);return e.jsxs("div",{className:"space-y-5",children:[a&&e.jsx(w,{setHasResumeableStack:t}),s&&e.jsx(S,{setHasResumeableTerraform:r})]})}function ee(){const{setTourState:a,tourState:{tourActive:t}}=d();return i.useEffect(()=>{t&&a(s=>({...s,run:!0,stepIndex:s.stepIndex}))},[t]),e.jsxs("div",{className:"space-y-5",children:[e.jsx(v,{}),e.jsx(h,{})]})}export{ee as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as p,j as t}from"./@radix-C7hRs6Kx.js";import{u as F,g as He,S as Ue,C as oe,P as ie,W as Ke,L as Qe}from"./ProviderRadio-26EB5tY-.js";import{W as D,H as O,B as E}from"./Wizard-DIllc07n.js";import{t as q}from"./zod-C0xYeTvL.js";import{z as y,S as Y,Z as Ge,I as ge,h as M,az as Ye,aA as Je,aB as Xe,aC as et,ah as tt,aD as rt,ai as st,ak as nt,am as ot,d as it,_ as at,j as ct,o as lt,F as ut,p as dt,f as Ie,i as ft,A as mt,b as ht,ac as xt,r as pt}from"./index-BygJE88j.js";import{b as v,C as k,u as W,F as $}from"./index.esm-D7jFlf5N.js";import{S as R}from"./WizardFooter-dNDpuero.js";import{C as je,b as yt}from"./ComponentIcon-B_7Y_oV-.js";import{R as H,a as U,s as gt,u as jt}from"./create-stack-BXLyjE58.js";import{f as _t,s as De,g as vt,a as St,D as Ct,b as bt,z as wt}from"./index-D9-ukAem.js";import{a as J,b as Nt,j as Oe,c as Pt}from"./@tanstack-CSxjHCME.js";import{C as L}from"./ProviderIcon-kkODO9tx.js";import{s as Ft}from"./sharedSchema-BACERDat.js";import{S as kt}from"./Lock-DW-0_M0o.js";import{S as zt}from"./dots-horizontal-BGRJCPCs.js";import{T as _e}from"./Tick-ay3Bgtro.js";import{s as Ee}from"./index-8uhUi12k.js";import{C as At}from"./ComponentBadge-BgGnzcLu.js";import{e as It}from"./components-Br2ezRib.js";import{L as Dt}from"./@react-router-CNP6g_RL.js";import"./persist-SSTTV5q0.js";import"./@reactflow-CQi1Z1Wq.js";import"./layout-h3cbx8WZ.js";import"./rocket-Cf-B-XOR.js";import"./plus-COjQg3AG.js";import"./trash-BWSZ7NRK.js";import"./type-guards-CaeD8wHO.js";import"./gcp-CHNvgEss.js";import"./check-DK77doTf.js";import"./stack-detail-query-ihiJr6nq.js";const Me=p.createContext(null);function Ot({children:e}){const[r,s]=p.useState({stackName:null,createdStackId:null,connectorConfig:null,fullstackResources:null,artifactStoreConfig:null,registryConfig:null,orchestratorConfig:null});return t.jsx(Me.Provider,{value:{data:r,setData:s},children:e})}function S(){const e=p.useContext(Me);if(e===null)throw new Error("useExistingInfraContext must be used within an ExistingInfraProvider");return e}const Re=p.createContext(null);function be({children:e,initialSchema:r}){const[s,n]=p.useState(r),[o,a]=p.useState({});return t.jsx(Re.Provider,{value:{schema:s,setSchema:n,defaultValues:o,setDefaultValues:a},children:e})}function X(){const e=p.useContext(Re);if(!e)throw new Error("useSchemaContext must be used within a SchemaProvider");return e}const Et=y.object({resourceId:y.string().min(1),flavor:y.string()});function Mt(){return t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(je,{type:"artifact_store",className:"h-5 w-5 fill-primary-400"}),"Select your Artifact Store"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Choose one of the storages for the new Artifact Store."})]})}var Le=Symbol.for("immer-nothing"),we=Symbol.for("immer-draftable"),g=Symbol.for("immer-state");function _(e,...r){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var z=Object.getPrototypeOf;function A(e){return!!e&&!!e[g]}function N(e){var r;return e?Te(e)||Array.isArray(e)||!!e[we]||!!((r=e.constructor)!=null&&r[we])||te(e)||re(e):!1}var Rt=Object.prototype.constructor.toString();function Te(e){if(!e||typeof e!="object")return!1;const r=z(e);if(r===null)return!0;const s=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return s===Object?!0:typeof s=="function"&&Function.toString.call(s)===Rt}function K(e,r){ee(e)===0?Reflect.ownKeys(e).forEach(s=>{r(s,e[s],e)}):e.forEach((s,n)=>r(n,s,e))}function ee(e){const r=e[g];return r?r.type_:Array.isArray(e)?1:te(e)?2:re(e)?3:0}function de(e,r){return ee(e)===2?e.has(r):Object.prototype.hasOwnProperty.call(e,r)}function Be(e,r,s){const n=ee(e);n===2?e.set(r,s):n===3?e.add(s):e[r]=s}function Lt(e,r){return e===r?e!==0||1/e===1/r:e!==e&&r!==r}function te(e){return e instanceof Map}function re(e){return e instanceof Set}function w(e){return e.copy_||e.base_}function fe(e,r){if(te(e))return new Map(e);if(re(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const s=Te(e);if(r===!0||r==="class_only"&&!s){const n=Object.getOwnPropertyDescriptors(e);delete n[g];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){const l=o[a],u=n[l];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(n[l]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[l]})}return Object.create(z(e),n)}else{const n=z(e);if(n!==null&&s)return{...e};const o=Object.create(n);return Object.assign(o,e)}}function ve(e,r=!1){return se(e)||A(e)||!N(e)||(ee(e)>1&&(e.set=e.add=e.clear=e.delete=Tt),Object.freeze(e),r&&Object.entries(e).forEach(([s,n])=>ve(n,!0))),e}function Tt(){_(2)}function se(e){return Object.isFrozen(e)}var Bt={};function P(e){const r=Bt[e];return r||_(0,e),r}var T;function Ve(){return T}function Vt(e,r){return{drafts_:[],parent_:e,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ne(e,r){r&&(P("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=r)}function me(e){he(e),e.drafts_.forEach(qt),e.drafts_=null}function he(e){e===T&&(T=e.parent_)}function Pe(e){return T=Vt(T,e)}function qt(e){const r=e[g];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function Fe(e,r){r.unfinalizedDrafts_=r.drafts_.length;const s=r.drafts_[0];return e!==void 0&&e!==s?(s[g].modified_&&(me(r),_(4)),N(e)&&(e=Q(r,e),r.parent_||G(r,e)),r.patches_&&P("Patches").generateReplacementPatches_(s[g].base_,e,r.patches_,r.inversePatches_)):e=Q(r,s,[]),me(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),e!==Le?e:void 0}function Q(e,r,s){if(se(r))return r;const n=r[g];if(!n)return K(r,(o,a)=>ke(e,n,r,o,a,s)),r;if(n.scope_!==e)return r;if(!n.modified_)return G(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const o=n.copy_;let a=o,l=!1;n.type_===3&&(a=new Set(o),o.clear(),l=!0),K(a,(u,f)=>ke(e,n,o,u,f,s,l)),G(e,o,!1),s&&e.patches_&&P("Patches").generatePatches_(n,s,e.patches_,e.inversePatches_)}return n.copy_}function ke(e,r,s,n,o,a,l){if(A(o)){const u=a&&r&&r.type_!==3&&!de(r.assigned_,n)?a.concat(n):void 0,f=Q(e,o,u);if(Be(s,n,f),A(f))e.canAutoFreeze_=!1;else return}else l&&s.add(o);if(N(o)&&!se(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Q(e,o),(!r||!r.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(s,n)&&G(e,o)}}function G(e,r,s=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ve(r,s)}function Wt(e,r){const s=Array.isArray(e),n={type_:s?1:0,scope_:r?r.scope_:Ve(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,a=Se;s&&(o=[n],a=B);const{revoke:l,proxy:u}=Proxy.revocable(o,a);return n.draft_=u,n.revoke_=l,u}var Se={get(e,r){if(r===g)return e;const s=w(e);if(!de(s,r))return $t(e,s,r);const n=s[r];return e.finalized_||!N(n)?n:n===ae(e.base_,r)?(ce(e),e.copy_[r]=pe(n,e)):n},has(e,r){return r in w(e)},ownKeys(e){return Reflect.ownKeys(w(e))},set(e,r,s){const n=qe(w(e),r);if(n!=null&&n.set)return n.set.call(e.draft_,s),!0;if(!e.modified_){const o=ae(w(e),r),a=o==null?void 0:o[g];if(a&&a.base_===s)return e.copy_[r]=s,e.assigned_[r]=!1,!0;if(Lt(s,o)&&(s!==void 0||de(e.base_,r)))return!0;ce(e),xe(e)}return e.copy_[r]===s&&(s!==void 0||r in e.copy_)||Number.isNaN(s)&&Number.isNaN(e.copy_[r])||(e.copy_[r]=s,e.assigned_[r]=!0),!0},deleteProperty(e,r){return ae(e.base_,r)!==void 0||r in e.base_?(e.assigned_[r]=!1,ce(e),xe(e)):delete e.assigned_[r],e.copy_&&delete e.copy_[r],!0},getOwnPropertyDescriptor(e,r){const s=w(e),n=Reflect.getOwnPropertyDescriptor(s,r);return n&&{writable:!0,configurable:e.type_!==1||r!=="length",enumerable:n.enumerable,value:s[r]}},defineProperty(){_(11)},getPrototypeOf(e){return z(e.base_)},setPrototypeOf(){_(12)}},B={};K(Se,(e,r)=>{B[e]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}});B.deleteProperty=function(e,r){return B.set.call(this,e,r,void 0)};B.set=function(e,r,s){return Se.set.call(this,e[0],r,s,e[0])};function ae(e,r){const s=e[g];return(s?w(s):e)[r]}function $t(e,r,s){var o;const n=qe(r,s);return n?"value"in n?n.value:(o=n.get)==null?void 0:o.call(e.draft_):void 0}function qe(e,r){if(!(r in e))return;let s=z(e);for(;s;){const n=Object.getOwnPropertyDescriptor(s,r);if(n)return n;s=z(s)}}function xe(e){e.modified_||(e.modified_=!0,e.parent_&&xe(e.parent_))}function ce(e){e.copy_||(e.copy_=fe(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Zt=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(r,s,n)=>{if(typeof r=="function"&&typeof s!="function"){const a=s;s=r;const l=this;return function(f=a,...d){return l.produce(f,c=>s.call(this,c,...d))}}typeof s!="function"&&_(6),n!==void 0&&typeof n!="function"&&_(7);let o;if(N(r)){const a=Pe(this),l=pe(r,void 0);let u=!0;try{o=s(l),u=!1}finally{u?me(a):he(a)}return Ne(a,n),Fe(o,a)}else if(!r||typeof r!="object"){if(o=s(r),o===void 0&&(o=r),o===Le&&(o=void 0),this.autoFreeze_&&ve(o,!0),n){const a=[],l=[];P("Patches").generateReplacementPatches_(r,o,a,l),n(a,l)}return o}else _(1,r)},this.produceWithPatches=(r,s)=>{if(typeof r=="function")return(l,...u)=>this.produceWithPatches(l,f=>r(f,...u));let n,o;return[this.produce(r,s,(l,u)=>{n=l,o=u}),n,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){N(e)||_(8),A(e)&&(e=Ht(e));const r=Pe(this),s=pe(e,void 0);return s[g].isManual_=!0,he(r),s}finishDraft(e,r){const s=e&&e[g];(!s||!s.isManual_)&&_(9);const{scope_:n}=s;return Ne(n,r),Fe(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,r){let s;for(s=r.length-1;s>=0;s--){const o=r[s];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}s>-1&&(r=r.slice(s+1));const n=P("Patches").applyPatches_;return A(e)?n(e,r):this.produce(e,o=>n(o,r))}};function pe(e,r){const s=te(e)?P("MapSet").proxyMap_(e,r):re(e)?P("MapSet").proxySet_(e,r):Wt(e,r);return(r?r.scope_:Ve()).drafts_.push(s),s}function Ht(e){return A(e)||_(10,e),We(e)}function We(e){if(!N(e)||se(e))return e;const r=e[g];let s;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,s=fe(e,r.scope_.immer_.useStrictShallowCopy_)}else s=fe(e,!0);return K(s,(n,o)=>{Be(s,n,We(o))}),r&&(r.finalized_=!1),s}var j=new Zt,I=j.produce;j.produceWithPatches.bind(j);j.setAutoFreeze.bind(j);j.setUseStrictShallowCopy.bind(j);j.applyPatches.bind(j);j.createDraft.bind(j);j.finishDraft.bind(j);function Ut(){const{data:e,setData:r}=S(),{setCurrentStep:s}=F();if(!e.fullstackResources)return s(2),{handleFormSubmit:()=>{},flattenedInstances:[]};const n=e.fullstackResources.components_resources_info.artifact_store,o=n.flatMap(l=>l.accessible_by_service_connector.map(u=>({...l,value:u})));function a({flavor:l,resourceId:u}){const f=n.find(d=>d.flavor===l);f&&(r(d=>I(d,c=>{c.artifactStoreConfig={flavor:l,configuration:Object.fromEntries(Object.keys(f.required_configuration||{}).map(h=>[h,u])),service_connector_resource_id:u}})),s(d=>d+1))}return{handleFormSubmit:a,flattenedInstances:o}}function V({flavor:e,type:r,width:s=32,height:n=32,...o}){var l;const a=J({..._t.flavorList({name:e,type:r})});return a.isError?null:a.isPending?t.jsx(Y,{style:{height:`${n}px`,width:`${s}px`}}):t.jsx("img",{width:s,height:n,alt:`${e} logo`,...o,src:Ge(((l=a.data.items[0].body)==null?void 0:l.logo_url)??"")})}const Kt="artifact_store";function Qt(){const[e,r]=p.useState(""),{control:s,setValue:n,handleSubmit:o,register:a,watch:l,trigger:u,reset:f}=v(),{flattenedInstances:d,handleFormSubmit:c}=Ut(),h=d.filter(i=>i.value.toLocaleLowerCase().includes(e.toLocaleLowerCase()));return t.jsxs(t.Fragment,{children:[t.jsx(ge,{placeholder:"Search...",onChange:i=>{f(),r(i.target.value)}}),t.jsxs("form",{onSubmit:o(c),id:"artifact-store-form",children:[t.jsx("input",{type:"hidden",...a("flavor")}),t.jsx("ul",{className:"space-y-1",children:h.map(i=>t.jsx("li",{children:t.jsx(k,{name:"resourceId",control:s,render:({field:{onChange:m,...x}})=>t.jsxs(H,{"data-state":l("resourceId")===i.value?"selected":"unselected",htmlFor:i.value,children:[t.jsx(U,{id:i.value,type:"radio",...x,onChange:C=>{n("flavor",i.flavor,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),m(C.target.value),u()},value:i.value,name:"connector-radio"}),t.jsx(V,{type:Kt,width:24,height:24,flavor:i.flavor})," ",t.jsx("span",{children:i.value})]})})},i.value))})]})]})}function Gt(){const e=W({resolver:q(Et),shouldUnregister:!0});return t.jsx($,{...e,children:t.jsxs(D,{children:[t.jsx(O,{children:"Artifact Store"}),t.jsx(E,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(Mt,{}),t.jsx(Qt,{})]})}),t.jsx(R,{children:t.jsx(Yt,{})})]})})}function Yt(){const e=v();return t.jsx(M,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}const $e=y.object({authMethod:y.string().min(1),stackName:Ft});function Jt(){var h,i;const{data:e}=S(),{setCurrentStep:r}=F(),{control:s,watch:n,resetField:o}=v(),{setSchema:a,setDefaultValues:l}=X(),u=J({...De.serviceConnectorTypeDetail(((h=e.connectorConfig)==null?void 0:h.type)||"")});if(u.isError)return null;if(u.isPending)return t.jsx(Y,{className:"h-[40px] w-[100px]"});const f=u.data.auth_methods.filter(m=>m.auth_method!=="implicit").map(m=>({name:m.name,auth_method:m.auth_method}));if(!((i=e.connectorConfig)!=null&&i.type)){r(1);return}function d(){var Ce;const m=n("authMethod"),x=(Ce=u.data)==null?void 0:Ce.auth_methods.find(ne=>ne.auth_method===m);if(!x)return;const C=x.config_schema,b=vt(C),Ze=St(C);a($e.merge(b)),l(Ze),Object.keys(b.shape).forEach(ne=>o(ne))}const c=e.connectorConfig.type||"";return t.jsx(k,{control:s,name:"authMethod",render:({field:{onChange:m,ref:x,...C}})=>t.jsxs(Ye,{...C,onValueChange:b=>{m(b),d()},children:[t.jsx(Je,{className:"w-fit border border-neutral-300 text-left text-text-md",children:t.jsx(Xe,{className:"flex items-center gap-2",placeholder:"Select your Auth Method"})}),t.jsx(et,{children:t.jsx(tt,{viewportClassName:"max-h-[300px]",children:f.map(b=>t.jsx(rt,{className:"space-x-2",value:b.auth_method,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(L,{provider:c}),t.jsx("div",{children:b.name})]})},b.auth_method))})})]})})}function Xt(){return t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(yt,{className:"h-5 w-5 fill-primary-400"}),"Select an Authentication Method"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Connect ZenML to your resources for seamless integration of cloud services into your ML pipelines."})]}),t.jsx(Jt,{})]})}function er(){return t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(kt,{className:"h-5 w-5 fill-primary-400"}),"Add your Configuration"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Your credentials are securely stored and encrypted. ZenML uses these credentials to interact with your resources."})]}),t.jsx(tr,{})]})}function tr(){var c,h;const{data:e}=S(),{watch:r}=v(),s=J({...De.serviceConnectorTypeDetail(((c=e.connectorConfig)==null?void 0:c.type)||"")}),n=r("authMethod"),o=(h=s.data)==null?void 0:h.auth_methods.find(i=>i.auth_method===n);if(s.isError)return null;if(s.isPending)return t.jsx(Y,{className:"h-[200px] w-full"});if(!o)return null;const a=o.config_schema,l=a.properties||{},u=a.required||[],f=a.$defs,d=Object.entries(l).sort(([i],[m])=>u.includes(i)&&!u.includes(m)?-1:!u.includes(i)&&u.includes(m)?1:0);return t.jsx("div",{className:"space-y-5",children:d.map(([i,m])=>t.jsx(Ct,{definitions:f,isOptional:bt(i,u),name:i,schema:m},i))})}function rr({open:e,loadingComponents:r}){var n,o;const{data:s}=S();return(n=s.connectorConfig)!=null&&n.type?t.jsx(st,{open:e,children:t.jsxs(nt,{onPointerDownOutside:a=>a.preventDefault(),onEscapeKeyDown:a=>a.preventDefault(),className:"max-w-[600px]",children:[t.jsx("div",{className:"flex items-center justify-between border-b border-theme-border-moderate py-2 pl-5 pr-3",children:t.jsx(ot,{className:"text-text-lg",children:"Connecting and loading your components..."})}),t.jsxs("div",{className:"flex h-[200px] items-center justify-center gap-5 bg-primary-50",children:[t.jsx(it,{className:"h-[60px] w-[60px]"}),t.jsx("div",{className:"flex h-[60px] w-[60px] items-center justify-center",children:t.jsx(zt,{className:"h-5 w-5 fill-theme-text-tertiary"})}),t.jsx(L,{className:"h-[60px] w-[60px]",provider:s.connectorConfig.type})]}),t.jsxs("div",{className:"flex flex-col gap-1 px-7 pb-6 pt-5",children:[t.jsxs("p",{className:"text-theme-text-secondary",children:["We're securely connecting to ",He(((o=s.connectorConfig)==null?void 0:o.type)||"aws")," ","and retrieving your custom components. This process typically takes about 30-60 seconds."]}),t.jsx(sr,{loadingComponents:r})]})]})}):null}function sr({loadingComponents:e}){const[r,s]=p.useState(!0),[n,o]=p.useState(!0);return p.useEffect(()=>{const a=setTimeout(()=>{s(!1)},Math.floor(Math.random()*1e3)+500),l=setTimeout(()=>{o(!1)},1500);return()=>{clearTimeout(a),clearTimeout(l)}},[]),t.jsxs("ul",{className:"mt-3 space-y-3 text-theme-text-secondary",children:[t.jsxs(ue,{children:[t.jsx(le,{loading:r}),"Establishing a secure connection"]}),t.jsxs(ue,{children:[t.jsx(le,{loading:n}),"Authenticating your account"]}),t.jsxs(ue,{children:[t.jsx(le,{loading:e}),"Fetching your existing components"]})]})}function le({loading:e}){return e?t.jsx(at,{className:"h-5 w-5 border-2"}):t.jsx(_e,{className:"h-5 w-5",tickClasses:"w-3 h-3"})}function ue({children:e}){return t.jsx("li",{className:"flex items-center gap-1",children:e})}async function nr({payload:e}){const r=lt(dt.serviceConnectors.fullStackResources),s=await ct(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!s.ok){const n=await s.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>"Error while fetching service connector type");throw new ut({status:s.status,statusText:s.statusText,message:n})}return s.json()}function or(e){return Nt({...e,mutationFn:async({payload:r})=>nr({payload:r})})}function ir(){const{setCurrentStep:e}=F(),[r,s]=p.useState(!0),{toast:n}=Ie(),{setData:o,data:a}=S(),l=or({onSuccess:async f=>{o(d=>I(d,c=>{c.fullstackResources=f})),s(!1),await gt(200),e(d=>d+1)},onError:f=>{n({status:"error",emphasis:"subtle",description:f.message,rounded:!0})}});return{handleFormSubmit:({authMethod:f,stackName:d,...c})=>{Object.keys(c).forEach(i=>{(c[i]===""||c[i]===null||c[i]===void 0||Array.isArray(c[i])&&c[i].length===0)&&delete c[i]});const h=I(a,i=>{i.stackName=d,i.connectorConfig&&(i.connectorConfig.auth_method=f,i.connectorConfig.configuration={...c})});o(h),h.connectorConfig&&l.mutate({payload:h.connectorConfig})},fullStackResources:l,loadingComponents:r}}function ar(){const{handleSubmit:e,formState:{isSubmitting:r}}=v(),{handleFormSubmit:s,fullStackResources:n,loadingComponents:o}=ir();return t.jsxs("form",{onSubmit:e(s),id:"connect-form",children:[t.jsx(rr,{loadingComponents:o,open:r||n.isPending}),t.jsx(Xt,{}),t.jsx(Ue,{}),t.jsx(er,{})]})}function cr(){const{schema:e,defaultValues:r}=X(),s=W({shouldUnregister:!0,mode:"onChange",resolver:q(e),defaultValues:{stackName:"",authMethod:"",...r}});return t.jsx($,{...s,children:t.jsxs(D,{children:[t.jsx(O,{children:"Connect to your Cloud"}),t.jsx(E,{children:t.jsx(ar,{})}),t.jsx(R,{children:t.jsx(lr,{})})]})})}function lr(){const{formState:{isValid:e,isSubmitting:r}}=v(),s=!!Oe();return t.jsx(M,{className:"justify-center gap-2",disabled:!e||s||r,form:"connect-form",size:"md",children:s||r?"Loading...":"Next"})}function ur(){const{data:e,setData:r}=S(),s=Pt(),{toast:n}=Ie(),{setCurrentStep:o}=F(),{mutate:a}=jt({onError:d=>{d instanceof Error&&n({status:"error",emphasis:"subtle",icon:t.jsx(ft,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:d.message,rounded:!0})},onSuccess:async d=>{r(c=>I(c,h=>{h.createdStackId=d.id})),o(c=>c+1),s.invalidateQueries({queryKey:Ee.all})}});if(!e.fullstackResources)return o(2),{handleFormSubmit:()=>{},flattenedInstances:[]};const l=e.fullstackResources.components_resources_info.container_registry,u=l.flatMap(d=>d.accessible_by_service_connector.map(c=>({...d,value:c})));function f({flavor:d,resourceId:c}){const h=l.find(m=>m.flavor===d);if(!h)return;const i=I(e,m=>{m.registryConfig={flavor:d,configuration:Object.fromEntries(Object.keys(h.required_configuration||{}).map(x=>[x,c])),service_connector_resource_id:c}});r(i),a({workspaceId:"default",payload:{name:i.stackName||Math.random().toString(36).substring(7),service_connectors:i.connectorConfig?[i.connectorConfig]:[],components:{orchestrator:[{...i.orchestratorConfig,service_connector_index:0}],artifact_store:[{...i.artifactStoreConfig,service_connector_index:0}],container_registry:[{...i.registryConfig,service_connector_index:0}]}}})}return{handleFormSubmit:f,flattenedInstances:u}}const dr="container_registry";function fr(){const[e,r]=p.useState(""),{control:s,setValue:n,handleSubmit:o,register:a,watch:l,trigger:u,reset:f}=v(),{flattenedInstances:d,handleFormSubmit:c}=ur(),h=d.filter(i=>i.value.toLocaleLowerCase().includes(e.toLocaleLowerCase()));return t.jsxs(t.Fragment,{children:[t.jsx(ge,{placeholder:"Search...",onChange:i=>{f(),r(i.target.value)}}),t.jsxs("form",{onSubmit:o(c),id:"artifact-store-form",children:[t.jsx("input",{type:"hidden",...a("flavor")}),t.jsx("ul",{className:"space-y-1",children:h.map(i=>t.jsx("li",{children:t.jsx(k,{name:"resourceId",control:s,render:({field:{onChange:m,...x}})=>t.jsxs(H,{"data-state":l("resourceId")===i.value?"selected":"unselected",htmlFor:i.value,children:[t.jsx(U,{id:i.value,type:"radio",...x,onChange:C=>{n("flavor",i.flavor,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),m(C.target.value),u()},value:i.value,name:"connector-radio"}),t.jsx(V,{width:24,height:24,type:dr,flavor:i.flavor})," ",t.jsx("span",{children:i.value})]})})},i.value))})]})]})}function mr(){return t.jsx("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(je,{type:"container_registry",className:"h-5 w-5 fill-primary-400"}),"Select your Container Registry"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Select one of the Container Registries for your new stack"})]})})}const hr=y.object({flavor:y.string().min(1),resourceId:y.string().min(1)});function xr(){const e=W({resolver:q(hr),shouldUnregister:!0});return t.jsx($,{...e,children:t.jsxs(D,{children:[t.jsx(O,{children:"Container Registry"}),t.jsx(E,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(mr,{}),t.jsx(fr,{})]})}),t.jsx(R,{children:t.jsx(pr,{})})]})})}function pr(){const e=v(),r=!!Oe();return t.jsxs(M,{className:"justify-center gap-2",disabled:!e.formState.isValid||r,form:"artifact-store-form",size:"md",children:[r&&t.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"}),r?"Loading...":"Next"]})}function yr(){var a;const{data:e,setData:r}=S(),{setCurrentStep:s}=F();if(!e.fullstackResources)return s(2),{orchestrators:[],handleFormSubmit:()=>{}};const n=((a=e.fullstackResources.components_resources_info)==null?void 0:a.orchestrator)||[];function o({flavor:l,resourceId:u,...f}){const d=n.find(c=>c.flavor===l);d&&(r(c=>{const h=d!=null&&d.use_resource_value_as_fixed_config?Object.fromEntries(Object.keys(d.required_configuration||{}).map(i=>[i,u])):{...f};return I(c,i=>{i.orchestratorConfig={flavor:l,configuration:h,service_connector_resource_id:u}})}),s(c=>c+1))}return{orchestrators:n,handleFormSubmit:o}}const ye=y.object({flavor:y.string().min(1),resourceId:y.string().min(1)}),Z="kubernetes",ze="orchestrator";function gr(){const{orchestrators:e,handleFormSubmit:r}=yr(),{setSchema:s}=X(),{control:n,watch:o,setValue:a,register:l,reset:u,handleSubmit:f}=v(),d=o("flavor");return t.jsxs("form",{onSubmit:f(r),id:"artifact-store-form",children:[d!==Z&&t.jsx("input",{...l("resourceId"),type:"hidden"}),t.jsx("ul",{className:"space-y-1",children:e.map((c,h)=>t.jsxs("li",{children:[t.jsx(k,{control:n,name:"flavor",render:({field:{onChange:i,...m}})=>t.jsxs(H,{"data-state":d===c.flavor?"selected":"unselected",htmlFor:c.flavor,children:[t.jsx(U,{onChange:x=>{u({flavor:c.flavor}),c.use_resource_value_as_fixed_config===!0&&s(ye),c.use_resource_value_as_fixed_config===!1&&c.required_configuration&&s(ye.merge(wt(c.required_configuration))),c.flavor!==Z&&c.accessible_by_service_connector.length>0&&a("resourceId",c.accessible_by_service_connector[0]),i(x)},...m,id:c.flavor,type:"radio",value:c.flavor,name:"orchestrator-flavor-radio"}),t.jsx(V,{width:24,height:24,type:ze,flavor:c.flavor}),t.jsx("span",{children:c.flavor_display_name})]})}),d===c.flavor&&(c.flavor===Z||c.use_resource_value_as_fixed_config===!1)&&t.jsxs("div",{className:"space-y-3 py-5 pl-8",children:[c.flavor===Z&&t.jsx("ul",{className:"space-y-1",children:c.accessible_by_service_connector.map(i=>t.jsx("li",{children:t.jsx(k,{control:n,name:"resourceId",render:({field:m})=>t.jsxs(H,{"data-state":o("resourceId")===i?"selected":"unselected",htmlFor:i,children:[t.jsx(U,{...m,id:i,type:"radio",value:i,name:"instance-radio"}),t.jsx(V,{type:ze,width:24,height:24,flavor:c.flavor}),t.jsx("span",{children:i})]})})},i))}),c.use_resource_value_as_fixed_config===!1&&c.required_configuration&&Object.keys(c.required_configuration).length>=1&&t.jsx("div",{children:Object.entries(c.required_configuration).map(([i,m])=>t.jsx("div",{children:t.jsx(k,{defaultValue:"",name:i,control:n,render:({field:x})=>t.jsxs("div",{children:[t.jsx("label",{htmlFor:i,className:"text-text-sm",children:m}),t.jsx(ge,{...x,inputSize:"md",required:!0,className:"w-full",id:i})]})})},i))})]})]},h))})]})}function jr(){return t.jsx("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(je,{type:"orchestrator",className:"h-5 w-5 fill-primary-400"}),"Select your Orchestrator"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Select one of the connected orchestrators for your new stack"})]})})}function _r(){const{schema:e}=X(),r=W({resolver:q(e),shouldUnregister:!0,defaultValues:{resourceId:""}});return t.jsx($,{...r,children:t.jsxs(D,{children:[t.jsx(O,{children:"Orchestrator"}),t.jsxs(E,{children:[t.jsx(jr,{}),t.jsx(gr,{})]}),t.jsx(R,{children:t.jsx(vr,{})})]})})}function vr(){const e=v();return t.jsx(M,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}const Sr=y.object({provider:y.string().min(1)});function Cr(){var a;const{setData:e,data:r}=S(),{setCurrentStep:s}=F(),n=W({resolver:q(Sr),defaultValues:{provider:((a=r.connectorConfig)==null?void 0:a.type)||""}});function o(l){e(u=>({...u,connectorConfig:{type:l.provider,auth_method:""}})),s(u=>u+1)}return t.jsx($,{...n,children:t.jsxs(D,{children:[t.jsx(O,{children:"Select Your Existing Cloud Infrastructure"}),t.jsx(E,{children:t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-text-lg font-semibold",children:"Select a Cloud Provider"}),t.jsx("p",{className:"text-theme-text-secondary",children:"Select the cloud provider where you have existing infrastructure to connect with ZenML. This will allow you to integrate your current cloud resources with ZenML for model deployment and management."})]}),t.jsxs("form",{id:"provider-form",onSubmit:n.handleSubmit(o),className:"grid grid-cols-1 gap-3 xl:grid-cols-3",children:[t.jsx(oe,{id:"aws-provider",...n.register("provider"),value:"aws",children:t.jsx(ie,{icon:t.jsx(L,{provider:"aws",className:"h-6 w-6 shrink-0"}),title:"AWS",subtitle:"Connect your existing S3, ECR, and Sagemaker components to ZenML"})}),t.jsx(oe,{id:"gcp-provider",...n.register("provider"),value:"gcp",children:t.jsx(ie,{icon:t.jsx(L,{provider:"gcp",className:"h-6 w-6 shrink-0"}),title:"GCP",subtitle:"Link your GCS, Artifact Registry, and Vertex AI components to ZenML"})}),t.jsx(oe,{id:"azure-provider",...n.register("provider"),value:"azure",children:t.jsx(ie,{icon:t.jsx(L,{provider:"azure",className:"h-6 w-6 shrink-0"}),title:"Azure",subtitle:"Integrate ZenML with your Blob Storage, Container Registry, and Azure ML"})})]})]})}),t.jsx(R,{children:t.jsx(br,{})})]})})}function br(){const{formState:{isValid:e}}=v();return t.jsx(M,{form:"provider-form",disabled:!e,size:"md",children:"Next"})}function wr(){var o;const{data:e}=S(),r=J({...Ee.stackDetail(e.createdStackId||""),throwOnError:!0});if(r.isError)return null;if(r.isPending)return t.jsx(Y,{className:"h-[200px] w-full"});const s=r.data,n=It((o=r.data.metadata)==null?void 0:o.components);return t.jsxs(D,{children:[t.jsx(O,{children:"Your stack"}),t.jsx(E,{children:t.jsxs("div",{className:"space-y-5",children:[t.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."}),t.jsxs("div",{className:"divide-y divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[t.jsx(Pr,{stack:s}),n.map(a=>t.jsx(Fr,{component:a},a.id))]})]})}),t.jsx(R,{displayCancel:!1,children:t.jsx(Nr,{})})]})}function Nr(){return t.jsx(M,{size:"md",asChild:!0,children:t.jsx(Dt,{to:pt.stacks.overview,children:"Finish"})})}function Pr({stack:e}){return t.jsxs("div",{className:"flex items-center gap-3 bg-theme-surface-secondary p-5 font-semibold",children:[t.jsx(_e,{className:"h-5 w-5",tickClasses:"w-3 h-3"}),t.jsx(mt,{type:"square",size:"lg",children:t.jsx(ht,{size:"lg",children:e.name[0]})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-text-lg",children:e.name}),t.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.id.split("-")[0]})]})]})}function Fr({component:e}){var r,s,n,o;return t.jsxs("div",{className:"flex items-center justify-between py-3 pl-9 pr-5",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(_e,{className:"h-5 w-5",tickClasses:"w-3 h-3"}),t.jsx(V,{width:24,height:24,flavor:((r=e.body)==null?void 0:r.flavor_name)||"",type:((s=e.body)==null?void 0:s.type)||"orchestrator"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-text-lg font-semibold",children:e.name}),t.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.id.split("-")[0]})]})]}),t.jsx(At,{type:((n=e.body)==null?void 0:n.type)||"alerter",children:xt((o=e.body)==null?void 0:o.type)})]},e.id)}function kr(){const{currentStep:e}=F();if(e===1)return t.jsx(Cr,{});if(e===2)return t.jsx(be,{initialSchema:$e,children:t.jsx(cr,{})});if(e===3)return t.jsx(Gt,{});if(e===4)return t.jsx(be,{initialSchema:ye,children:t.jsx(_r,{})});if(e===5)return t.jsx(xr,{});if(e===6)return t.jsx(wr,{})}const Ae=["Infrastructure Type","Cloud Provider","Connect your Cloud","Artifact Store","Orchestrator","Container Registry"];function as(){return t.jsx(Ke,{maxSteps:Ae.length+1,initialStep:1,children:t.jsx(Ot,{children:t.jsxs("section",{className:"layout-container flex flex-col gap-5 py-5 xl:flex-row",children:[t.jsx(Qe,{entries:Ae}),t.jsx("div",{className:"w-full",children:t.jsx(kr,{})})]})})})}export{as as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as m,j as e}from"./@radix-C7hRs6Kx.js";import{j as S,o as D,F as b,p as C,f as w,ar as y,t as O,v as H,h,s as $,as as R,aI as V,at as J,aJ as U,av as G,ao as Y,D as Z,w as W,x as X,C as K,r as k,ai as ee,aj as te,ak as se,al as ne,am as re,I as F,ap as ce,aq as ae,B as q,n as ie,M as oe,S as T}from"./index-BygJE88j.js";import{P as le,S as ue}from"./SearchField-DMCywawn.js";import{s as f,A as de,u as me,c as xe,a as E,b as he}from"./service-BRoAA1Kq.js";import{b as N,c as g,a as pe}from"./@tanstack-CSxjHCME.js";import{S as I}from"./trash-BWSZ7NRK.js";import{D as M,a as Q}from"./DeleteAlertDialog-9RTDnEx3.js";import{S as fe}from"./Lock-DW-0_M0o.js";import{L as P}from"./@react-router-CNP6g_RL.js";import{S as je}from"./dots-horizontal-BGRJCPCs.js";import{A as ve}from"./AlertDialogDropdownItem-CRZjthRL.js";import{t as ye}from"./zod-C0xYeTvL.js";import{u as ge,F as Ae,b as Se,C as A}from"./index.esm-D7jFlf5N.js";import"./@reactflow-CQi1Z1Wq.js";import"./chevron-right-double-uNWbJT-C.js";import"./index-DR30v9MZ.js";import"./CodeSnippet-Di-loaZu.js";import"./Infobox-Bai0JtFs.js";import"./Tick-ay3Bgtro.js";import"./check-DK77doTf.js";async function De(t){const s=D(C.serviceAccounts.detail(t)),r=await S(s,{method:"DELETE",headers:{"Content-Type":"application/json"}});if(!r.ok){const n=await r.json().then(c=>Array.isArray(c.detail)?c.detail[1]:c.detail).catch(()=>`Failed to delete service account ${t}`);throw new b({status:r.status,statusText:r.statusText,message:n})}return r.json()}function be(t){return N({...t,mutationFn:async s=>{await De(s)}})}const z=m.createContext(null);function Ce({children:t}){const[s,r]=m.useState([]),n=g(),{toast:c}=w(),a=be(),u=async o=>{try{const d=o.map(l=>a.mutateAsync(l));await Promise.all(d),c({description:"Deleted successfully.",status:"success",emphasis:"subtle",rounded:!0}),n.invalidateQueries({queryKey:f.serviceAccountsKey()}),r([])}catch(d){y(d)&&c({status:"error",emphasis:"subtle",description:d.message,rounded:!0}),console.error("Failed to delete some pipelines:",d)}};return e.jsx(z.Provider,{value:{selectedServiceAccounts:s,setSelectedServiceAccounts:r,bulkDeleteServiceAccounts:u},children:t})}function j(){const t=m.useContext(z);if(!t)throw new Error("useServiceAccountSelectorContext must be used within a ServiceAccountsSelectorProvider");return t}function we(){const[t,s]=m.useState(!1),{bulkDeleteServiceAccounts:r,selectedServiceAccounts:n}=j();async function c(){await r(n),s(!1)}return e.jsxs(O,{open:t,onOpenChange:s,children:[e.jsx(H,{asChild:!0,children:e.jsxs(h,{className:"rounded-sharp border-y-0 bg-white",size:"md",emphasis:"subtle",intent:"secondary",children:[e.jsx(I,{className:"h-5 w-5 shrink-0 gap-1 fill-neutral-400"}),"Delete"]})}),e.jsx(M,{title:`Delete Service Account${n.length>=2?"s":""}`,handleDelete:c,children:e.jsxs(Q,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})]})}function Ne(){const{selectedServiceAccounts:t}=j();return e.jsxs("div",{className:"flex items-center divide-x divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[e.jsx("div",{className:"bg-primary-25 px-2 py-1 font-semibold text-theme-text-brand",children:`${t==null?void 0:t.length} Service Account${(t==null?void 0:t.length)>1?"s":""} selected`}),e.jsx(we,{})]})}async function ke({body:t,serviceAccountId:s}){const r=D(C.serviceAccounts.detail(s)),n=await S(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(n.status===404&&$(),!n.ok){const c=await n.json().then(a=>Array.isArray(a.detail)?a.detail[1]:a.detail).catch(()=>`Failed to update service account ${s}`);throw new b({status:n.status,statusText:n.statusText,message:c})}return n.json()}function Fe(t){return N({...t,mutationFn:async({serviceAccountId:s,body:r})=>ke({serviceAccountId:s,body:r})})}function Te({isActive:t,serviceAccountId:s}){const{toast:r}=w(),n=g(),[c,a]=m.useState(!1),{mutate:u}=Fe({onError(l){y(l)&&r({status:"error",emphasis:"subtle",description:l.message,rounded:!0})},onSuccess(){n.invalidateQueries({queryKey:f.serviceAccountsKey()})}});function o(l){l?d(l):a(!0)}async function d(l){u({serviceAccountId:s,body:{active:l}})}return e.jsxs(e.Fragment,{children:[e.jsx(O,{open:c,onOpenChange:a,children:e.jsxs(R,{children:[e.jsx(V,{children:e.jsx(J,{children:"Deactivate Service Account"})}),e.jsxs("div",{className:"p-5 text-text-md text-theme-text-secondary",children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"You won't be able to use any API keys of this service account to authenticate with the server anymore."})]}),e.jsxs(U,{className:"gap-[10px]",children:[e.jsx(G,{asChild:!0,children:e.jsx(h,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(h,{onClick:()=>d(!1).then(l=>a(!1)),intent:"primary",type:"button",children:"Deactivate"})]})]})}),e.jsx(Y,{checked:t,onCheckedChange:o})]})}function Pe({serviceAccountId:t}){const[s,r]=m.useState(!1),[n,c]=m.useState(!1),{bulkDeleteServiceAccounts:a}=j(),u=m.useRef(null),o=m.useRef(null);function d(){o.current=u.current}async function l(){await a([t]),p(!1)}function p(x){if(x===!1){r(!1),setTimeout(()=>{c(x)},200);return}c(x)}return e.jsxs(Z,{onOpenChange:r,open:s,children:[e.jsx(W,{ref:u,children:e.jsx(je,{className:"h-5 w-5 fill-theme-text-secondary"})}),e.jsx(X,{hidden:n,onCloseAutoFocus:x=>{o.current&&(o.current.focus(),o.current=null,x.preventDefault())},align:"end",sideOffset:7,children:e.jsx(ve,{onSelect:d,open:n,onOpenChange:p,triggerChildren:"Delete",icon:e.jsx(I,{fill:"red"}),children:e.jsx(M,{title:"Delete Service Account",handleDelete:l,children:e.jsxs(Q,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})})})]})}const Oe=({id:t})=>{const{selectedServiceAccounts:s,setSelectedServiceAccounts:r}=j(),n=(c,a)=>{r(u=>c?[...u,a]:u.filter(o=>o!==a))};return e.jsx(K,{id:t,onCheckedChange:c=>n(c,t),checked:s.includes(t),className:"h-3 w-3"})};function Ke(){return[{id:"check",header:"",meta:{width:"1%"},accessorFn:t=>t.id,cell:({row:t})=>e.jsx(Oe,{id:t.original.id})},{id:"service-account",header:"Service Account",accessorFn:t=>t.name,cell:({row:t})=>{var s;return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(fe,{className:"h-5 w-5 flex-shrink-0 fill-primary-400"}),e.jsxs("div",{className:"group/copybutton flex flex-col",children:[e.jsx("div",{className:"flex flex-row items-center space-x-1",children:e.jsx("div",{className:"flex items-center space-x-1",children:e.jsx(P,{className:"text-text-md font-semibold text-theme-text-primary",to:k.settings.service_accounts.detail(t.original.id),children:t.original.name})})}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(P,{className:"flex items-center gap-1 text-text-sm text-theme-text-secondary",to:k.settings.service_accounts.detail(t.original.id),children:(s=t.original.metadata)==null?void 0:s.description})})]})]})}},{id:"active",header:"Active",accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.active},cell:({row:t})=>{var s;return e.jsx(Te,{isActive:!!((s=t.original.body)!=null&&s.active),serviceAccountId:t.original.id})}},{id:"actions",meta:{width:"5%"},header:"",cell:({row:t})=>e.jsx("div",{className:"flex items-center justify-end",children:e.jsx(Pe,{serviceAccountId:t.original.id})})}]}async function qe({body:t}){const s=D(C.serviceAccounts.all),r=await S(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){const n=await r.json().then(c=>Array.isArray(c.detail)?c.detail[1]:c.detail).catch(()=>"Failed to create service account");throw new b({status:r.status,statusText:r.statusText,message:n})}return r.json()}function Ee(t){return N({...t,mutationFn:async s=>qe({body:s})})}function B({isFallback:t}){const[s,r]=m.useState(!1),[n,c]=m.useState(""),a=g(),u=ge({resolver:ye(xe),defaultValues:{name:"",description:"",createDefault:!1}}),o=!!n&&u.watch("createDefault");function d(){return o?e.jsx(de,{value:n}):e.jsx(Ie,{isFallback:t,setApiKeyValue:c,setOpen:r})}return e.jsx(Ae,{...u,children:e.jsxs(ee,{open:s,onOpenChange:l=>{t&&!l&&a.invalidateQueries({queryKey:f.serviceAccountsKey()}),r(l),c(""),u.reset()},children:[e.jsx(te,{asChild:!0,children:e.jsx(h,{className:"shrink-0",size:"sm",intent:"primary",children:"Add service account"})}),e.jsxs(se,{"data-success":o,className:"mx-auto overflow-x-auto transition-none data-[success=true]:max-w-[800px]",children:[e.jsx(ne,{children:e.jsx(re,{children:"Add service account"})}),d()]})]})})}function Ie({setApiKeyValue:t,setOpen:s,isFallback:r}){const{watch:n,handleSubmit:c,control:a,formState:{isValid:u}}=Se(),{toast:o}=w(),d=g(),{mutate:l}=Ee({onError(i){y(i)&&o({status:"error",emphasis:"subtle",description:i.message,rounded:!0})},async onSuccess(i){if(o({description:"The service account has been added successfully.",status:"success",emphasis:"subtle",rounded:!0}),n("createDefault")){x(i.id);return}d.invalidateQueries({queryKey:f.serviceAccountsKey()}),s(!1)}}),{mutate:p}=me({onSuccess(i){var v;r||d.invalidateQueries({queryKey:f.serviceAccountsKey()}),t(((v=i.body)==null?void 0:v.key)||"")},onError(i){y(i)&&o({status:"error",emphasis:"subtle",description:i.message,rounded:!0})}}),x=i=>{p({serviceAccountId:i,body:{name:"default",description:"Default api key"}})},L=i=>{l({name:i.name,description:i.description,active:!0})};return e.jsxs(e.Fragment,{children:[e.jsxs("form",{id:"create-secret-form",className:"space-y-5 p-7",onSubmit:c(L),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(A,{name:"name",control:a,render:({field:i})=>e.jsx(F,{...i,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(A,{name:"description",control:a,render:({field:i})=>e.jsx(F,{...i,className:"w-full",placeholder:"Add description"})})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{control:a,name:"createDefault",render:({field:{onChange:i,value:v}})=>e.jsx(K,{checked:v,id:"default-key",onCheckedChange:_=>i(!!_)})}),e.jsx("label",{htmlFor:"default-key",children:"Create a default API Key"})]}),e.jsx("p",{className:"pl-[30px] text-text-xs text-theme-text-secondary",children:"This will include a default API Key for your service account."})]})]}),e.jsxs(ce,{className:"gap-[10px]",children:[e.jsx(ae,{asChild:!0,children:e.jsx(h,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(h,{intent:"primary",size:"sm",disabled:!u,type:"submit",form:"create-secret-form",children:"Add service account"})]})]})}function Me(){return e.jsxs(q,{className:"flex flex-col items-center justify-center space-y-4 p-9",children:[e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold text-theme-text-primary",children:"There are no service accounts yet."}),e.jsx("p",{className:"text-theme-text-secondary",children:"Create your first one now to automate your processes securely with ZenML."})]}),e.jsx(B,{isFallback:!0})]})}function Qe(){const{setCurrentBreadcrumbData:t}=ie(),s=E();m.useEffect(()=>{t({segment:"service_accounts",data:null})},[]);const r=m.useMemo(()=>Ke(),[]),{data:n}=pe({...he.serviceAccountList({...s,sort_by:"desc:created",hydrate:!0})});return n&&n.items.length<1&&!s.name?e.jsx(Me,{}):e.jsxs(Ce,{children:[e.jsx(ze,{}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:n?e.jsx(oe,{columns:r,data:n.items}):e.jsx(T,{className:"h-[500px] w-full"})}),n?n.total_pages>1&&e.jsx(le,{searchParams:s,paginate:n}):e.jsx(T,{className:"h-[36px] w-[300px]"})]})]})}function ze(){const t=E(),{selectedServiceAccounts:s}=j();return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.length?e.jsx(Ne,{}):e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(ue,{searchParams:t})}),e.jsx(B,{isFallback:!1})]})}function it(){return e.jsxs(q,{className:"space-y-4 p-5",children:[e.jsx(Be,{}),e.jsx(Qe,{})]})}function Be(){return e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Service Accounts"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Configure automated access for background tasks and integrations."}),e.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://docs.zenml.io/how-to/project-setup-and-management/connecting-to-zenml/connect-with-a-service-account",className:"link text-text-sm text-primary-400",children:"Learn More"})]})]})}export{it as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as l,j as e}from"./@radix-C7hRs6Kx.js";import{u as m,S as I,C as x,P as f,W as B,L as M}from"./ProviderRadio-BWFJPEY2.js";import{p as C,s as A,c as k}from"./persist-xOAq24Bm.js";import{I as b}from"./Infobox-C4Op55B8.js";import{W as v,H as g,B as y}from"./Wizard-BSH_lIfi.js";import{t as z}from"./zod-C0xYeTvL.js";import{h as u,aQ as F,S as P,r as Z,z as _}from"./index-hsSXyS3H.js";import{u as T,F as L,b as W}from"./index.esm-D7jFlf5N.js";import{S as N}from"./WizardFooter-CnM-50jL.js";import{R as V,a as H,E as O,C as Q}from"./Partials-DjTM0Oe-.js";import{a as $,d as G}from"./persist-DLvsEXh0.js";import{S as Y}from"./link-external-DUhCSKNm.js";import{S as q}from"./logs-B5n0U7tB.js";import{C as j}from"./CodeSnippet-nRnOvbOJ.js";import{N as w}from"./NumberBox-D2A7ENHb.js";import{s as E}from"./index-e8udi7QT.js";import{a as D}from"./@tanstack-CSxjHCME.js";import{a as J}from"./@react-router-BGgzhn5D.js";import{C as h}from"./ProviderIcon-B8W7AGNk.js";import"./Tick-C4gtED35.js";import"./check-DK77doTf.js";import"./@reactflow-CQi1Z1Wq.js";import"./package-D1Mhqeh8.js";import"./ComponentBadge-CMx2DbsV.js";import"./ComponentIcon-CSxdApv8.js";import"./layout-h3cbx8WZ.js";import"./rocket-Cf-B-XOR.js";import"./sharedSchema-CQA5lnlU.js";import"./stack-detail-query-C1GoxBeK.js";import"./gcp-CHNvgEss.js";const R=l.createContext(null);function K({children:r}){const{setCurrentStep:t}=m(),[i,s]=l.useState({}),[o,c]=l.useState("");return l.useEffect(()=>{const{success:a,data:n}=C();if(a){t(3),s({location:n.location,provider:n.provider,stackName:n.stackName}),c(n.timestamp);return}t(1)},[C]),e.jsx(R.Provider,{value:{data:i,setData:s,timestamp:o,setTimestamp:c},children:r})}function d(){const r=l.useContext(R);if(r===null)throw new Error("useCreateTerraformContext must be used within an CreateTerraformContext");return r}function U(){const{setData:r,data:t,setTimestamp:i}=d(),{setCurrentStep:s}=m(),o=T({resolver:z($,{async:!0}),defaultValues:{region:t.location||"",stackName:t.stackName||""}});function c(a){const n=new Date().toISOString().slice(0,-1);A({location:a.region,provider:t.provider||"aws",stackName:a.stackName,timestamp:n}),i(n),r(p=>({...p,location:a.region,stackName:a.stackName})),s(p=>p+1)}return e.jsx(L,{...o,children:e.jsxs(v,{children:[e.jsx(g,{children:"Review Stack Configuration"}),e.jsx(y,{children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs(b,{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",{id:"configuration-form",onSubmit:o.handleSubmit(c),className:"space-y-5",children:[e.jsx(V,{provider:t.provider||"aws"}),e.jsx(I,{})]}),e.jsx(H,{provider:t.provider||"aws"}),e.jsx(O,{provider:t.provider||"aws"})]})}),e.jsx(N,{children:e.jsx(X,{})})]})})}function X(){const{formState:{isSubmitting:r}}=W();return e.jsx(u,{disabled:r,form:"configuration-form",size:"md",children:"Next"})}function ee(){return e.jsxs("div",{className:"space-y-5",children:[e.jsx("div",{className:"space-y-1",children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{children:"3"}),e.jsx("span",{className:"text-text-lg font-semibold",children:"Run the following commands"})]})}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Initialize the Terraform configuration."}),e.jsx(j,{code:"terraform init --upgrade"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Run terraform apply to deploy the ZenML stack to Azure."}),e.jsx(j,{code:"terraform apply"})]})]})}function re(){const{data:r,timestamp:t}=d(),{setCurrentStep:i}=m(),s=D({...E.stackDeploymentStack({provider:r.provider,stack_name:r.stackName,date_start:t,terraform:!0}),refetchInterval:5e3,throwOnError:!0});return l.useEffect(()=>{s.data&&(k(),i(o=>o+1))},[s.data]),{fullstackDeployment:s,data:r}}function te(){const{fullstackDeployment:r,data:t}=re();return r.isError?e.jsx("p",{children:"Error fetching Terraform Command"}):r.isPending?e.jsx(P,{className:"h-[200px] w-full"}):e.jsx(ae,{provider:t.provider||"aws",stackName:t.stackName||""})}function se(){return e.jsxs("section",{className:"space-y-5 border-t border-theme-border-moderate pt-5",children:[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(F,{className:"h-5 w-5 fill-primary-400"}),"Waiting for your Terraform script to finish..."]}),e.jsx("p",{className:"text-theme-text-secondary",children:"We are detecting whether your Terraform script ran through successfully. Once the terraform script has finished successfully, come back to check your brand new stack and components ready."})]}),e.jsx(te,{})]})}function ae({stackName:r,provider:t}){return e.jsxs("div",{className:"relative overflow-hidden rounded-md",children:[e.jsx("div",{className:"absolute z-50 h-full w-full bg-neutral-50/50"}),e.jsx(Q,{type:t,componentProps:{isLoading:!0,isSuccess:!1,stackName:r}})]})}function oe(){return e.jsxs(v,{children:[e.jsx(g,{children:"Deploy ZenML Stack"}),e.jsx(y,{children:e.jsxs("section",{className:"space-y-5",children:[e.jsx(ne,{}),e.jsx(de,{}),e.jsx(me,{}),e.jsx(ee,{}),e.jsx(se,{})]})}),e.jsxs(N,{displayCancel:!1,children:[e.jsx(pe,{}),e.jsx(ie,{})]})]})}function ie(){return e.jsx(u,{disabled:!0,size:"md",children:"Next"})}function ne(){return 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(q,{className:"h-5 w-5 fill-primary-400"}),"Configuration"]}),e.jsx("p",{className:"text-theme-text-secondary",children:"Follow the steps to deploy your Stack."})]})}function ce(r){switch(r){case"aws":return"https://aws.amazon.com/cli/";case"azure":return"https://learn.microsoft.com/en-us/cli/azure/";case"gcp":return"https://cloud.google.com/sdk/gcloud"}}function le(r){switch(r){case"aws":return"AWS";case"gcp":return"gcloud";case"azure":return"Azure"}}function de(){const{data:r}=d();return e.jsx("div",{className:"space-y-5",children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{children:"1"}),e.jsxs("span",{className:"text-text-lg font-semibold",children:["Login locally with the ",le(r.provider||"aws")," CLI"]})]}),e.jsx("p",{className:"text-theme-text-secondary",children:"Make sure you are logged in locally with an account with appropriate permissions."}),e.jsx(u,{asChild:!0,className:"w-fit gap-1",intent:"secondary",emphasis:"subtle",size:"md",children:e.jsxs("a",{rel:"noopener noreferrer",target:"_blank",href:ce(r.provider||"aws"),children:[e.jsx("span",{children:"Learn More"}),e.jsx(Y,{className:"h-5 w-5 shrink-0 fill-primary-900"})]})})]})})}function me(){const{data:r}=d();return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{children:"2"}),e.jsx("span",{className:"text-text-lg font-semibold",children:"Create a file with the following configuration"})]}),e.jsxs("p",{className:"text-theme-text-secondary",children:["Create a file named ",e.jsx("code",{className:"font-mono text-primary-400",children:"main.tf"})," in the Cloud Shell and copy and paste the Terraform configuration below into it."]})]}),r.provider==="gcp"&&e.jsxs(b,{intent:"warning",children:["Please replace ",e.jsx("code",{className:"font-mono text-primary-400",children:"project_id"})," in the following Terraform script with your own one."]}),e.jsx(ue,{})]})}function ue(){const{data:r}=d(),t=D({...E.stackDeploymentConfig({provider:r.provider||"aws",terraform:!0,stack_name:r.stackName,location:r.location}),enabled:!!r.stackName});return t.isError?null:t.isPending?e.jsx(P,{className:"h-[200px] w-full"}):e.jsx(j,{fullWidth:!0,highlightCode:!0,codeClasses:"whitespace-pre-wrap word-break-all",wrap:!0,code:t.data.configuration||""})}function pe(){const r=J();function t(){k(),r(Z.stacks.create.index)}return e.jsx(u,{onClick:()=>t(),intent:"secondary",size:"md",children:"Cancel"})}const xe=_.object({provider:G});function fe(){const{setData:r,data:t}=d(),{setCurrentStep:i}=m(),s=T({resolver:z(xe),defaultValues:{provider:t.provider||void 0}});function o(c){r(a=>({...a,provider:c.provider})),i(a=>a+1)}return e.jsx(L,{...s,children:e.jsxs(v,{children:[e.jsx(g,{children:"New Cloud infrastructure"}),e.jsx(y,{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. You will be able to remove the ZenML stack at any time."})]}),e.jsxs("form",{id:"provider-form",onSubmit:s.handleSubmit(o),className:"grid grid-cols-1 gap-3 xl:grid-cols-3",children:[e.jsx(x,{id:"aws-provider",...s.register("provider"),value:"aws",children:e.jsx(f,{icon:e.jsx(h,{provider:"aws",className:"h-6 w-6 shrink-0"}),title:"AWS",subtitle:"Connect your existing S3, ECR, and Sagemaker components to ZenML"})}),e.jsx(x,{id:"gcp-provider",...s.register("provider"),value:"gcp",children:e.jsx(f,{icon:e.jsx(h,{provider:"gcp",className:"h-6 w-6 shrink-0"}),title:"GCP",subtitle:"Link your GCS, Artifact Registry, and Vertex AI components to ZenML"})}),e.jsx(x,{id:"azure-provider",...s.register("provider"),value:"azure",children:e.jsx(f,{icon:e.jsx(h,{provider:"azure",className:"h-6 w-6 shrink-0"}),title:"Azure",subtitle:"Integrate ZenML with your Blob Storage, Container Registry, and Azure ML"})})]})]})}),e.jsx(N,{children:e.jsx(he,{})})]})})}function he(){const{formState:{isValid:r}}=W();return e.jsx(u,{form:"provider-form",disabled:!r,size:"md",children:"Next"})}function je(){const{currentStep:r}=m();if(r===1)return e.jsx(fe,{});if(r===2)return e.jsx(U,{});if(r===3)return e.jsx(oe,{})}const S=["Infrastructure Type","Cloud Provider","Review Configuration","Deploy Stack"];function Ye(){return e.jsx(B,{maxSteps:S.length,initialStep:0,children:e.jsx(K,{children:e.jsxs("section",{className:"layout-container flex flex-col gap-5 py-5 xl:flex-row",children:[e.jsx(M,{entries:S}),e.jsx("div",{className:"w-full overflow-y-hidden",children:e.jsx(je,{})})]})})})}export{Ye as default};
|
1
|
+
import{r as l,j as e}from"./@radix-C7hRs6Kx.js";import{u as m,S as I,C as x,P as f,W as B,L as M}from"./ProviderRadio-26EB5tY-.js";import{p as C,s as A,c as k}from"./persist-CEeDYHW5.js";import{I as b}from"./Infobox-Bai0JtFs.js";import{W as v,H as g,B as y}from"./Wizard-DIllc07n.js";import{t as z}from"./zod-C0xYeTvL.js";import{h as u,aN as F,S as P,r as Z,z as _}from"./index-BygJE88j.js";import{u as T,F as L,b as W}from"./index.esm-D7jFlf5N.js";import{S as N}from"./WizardFooter-dNDpuero.js";import{R as V,a as H,E as O,C as $}from"./Partials-BNBtCjuT.js";import{a as G,d as Q}from"./persist-SSTTV5q0.js";import{S as Y}from"./link-external-DUhCSKNm.js";import{S as q}from"./logs-B5n0U7tB.js";import{C as j}from"./CodeSnippet-Di-loaZu.js";import{N as w}from"./NumberBox-D2A7ENHb.js";import{s as E}from"./index-8uhUi12k.js";import{a as D}from"./@tanstack-CSxjHCME.js";import{c as J}from"./@react-router-CNP6g_RL.js";import{C as h}from"./ProviderIcon-kkODO9tx.js";import"./Tick-ay3Bgtro.js";import"./check-DK77doTf.js";import"./@reactflow-CQi1Z1Wq.js";import"./package-D1Mhqeh8.js";import"./ComponentBadge-BgGnzcLu.js";import"./ComponentIcon-B_7Y_oV-.js";import"./layout-h3cbx8WZ.js";import"./rocket-Cf-B-XOR.js";import"./sharedSchema-BACERDat.js";import"./stack-detail-query-ihiJr6nq.js";import"./gcp-CHNvgEss.js";const R=l.createContext(null);function K({children:r}){const{setCurrentStep:t}=m(),[i,s]=l.useState({}),[o,c]=l.useState("");return l.useEffect(()=>{const{success:a,data:n}=C();if(a){t(3),s({location:n.location,provider:n.provider,stackName:n.stackName}),c(n.timestamp);return}t(1)},[C]),e.jsx(R.Provider,{value:{data:i,setData:s,timestamp:o,setTimestamp:c},children:r})}function d(){const r=l.useContext(R);if(r===null)throw new Error("useCreateTerraformContext must be used within an CreateTerraformContext");return r}function U(){const{setData:r,data:t,setTimestamp:i}=d(),{setCurrentStep:s}=m(),o=T({resolver:z(G,{async:!0}),defaultValues:{region:t.location||"",stackName:t.stackName||""}});function c(a){const n=new Date().toISOString().slice(0,-1);A({location:a.region,provider:t.provider||"aws",stackName:a.stackName,timestamp:n}),i(n),r(p=>({...p,location:a.region,stackName:a.stackName})),s(p=>p+1)}return e.jsx(L,{...o,children:e.jsxs(v,{children:[e.jsx(g,{children:"Review Stack Configuration"}),e.jsx(y,{children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs(b,{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",{id:"configuration-form",onSubmit:o.handleSubmit(c),className:"space-y-5",children:[e.jsx(V,{provider:t.provider||"aws"}),e.jsx(I,{})]}),e.jsx(H,{provider:t.provider||"aws"}),e.jsx(O,{provider:t.provider||"aws"})]})}),e.jsx(N,{children:e.jsx(X,{})})]})})}function X(){const{formState:{isSubmitting:r}}=W();return e.jsx(u,{disabled:r,form:"configuration-form",size:"md",children:"Next"})}function ee(){return e.jsxs("div",{className:"space-y-5",children:[e.jsx("div",{className:"space-y-1",children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{children:"3"}),e.jsx("span",{className:"text-text-lg font-semibold",children:"Run the following commands"})]})}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Initialize the Terraform configuration."}),e.jsx(j,{code:"terraform init --upgrade"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Run terraform apply to deploy the ZenML stack to Azure."}),e.jsx(j,{code:"terraform apply"})]})]})}function re(){const{data:r,timestamp:t}=d(),{setCurrentStep:i}=m(),s=D({...E.stackDeploymentStack({provider:r.provider,stack_name:r.stackName,date_start:t,terraform:!0}),refetchInterval:5e3,throwOnError:!0});return l.useEffect(()=>{s.data&&(k(),i(o=>o+1))},[s.data]),{fullstackDeployment:s,data:r}}function te(){const{fullstackDeployment:r,data:t}=re();return r.isError?e.jsx("p",{children:"Error fetching Terraform Command"}):r.isPending?e.jsx(P,{className:"h-[200px] w-full"}):e.jsx(ae,{provider:t.provider||"aws",stackName:t.stackName||""})}function se(){return e.jsxs("section",{className:"space-y-5 border-t border-theme-border-moderate pt-5",children:[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(F,{className:"h-5 w-5 fill-primary-400"}),"Waiting for your Terraform script to finish..."]}),e.jsx("p",{className:"text-theme-text-secondary",children:"We are detecting whether your Terraform script ran through successfully. Once the terraform script has finished successfully, come back to check your brand new stack and components ready."})]}),e.jsx(te,{})]})}function ae({stackName:r,provider:t}){return e.jsxs("div",{className:"relative overflow-hidden rounded-md",children:[e.jsx("div",{className:"absolute z-50 h-full w-full bg-neutral-50/50"}),e.jsx($,{type:t,componentProps:{isLoading:!0,isSuccess:!1,stackName:r}})]})}function oe(){return e.jsxs(v,{children:[e.jsx(g,{children:"Deploy ZenML Stack"}),e.jsx(y,{children:e.jsxs("section",{className:"space-y-5",children:[e.jsx(ne,{}),e.jsx(de,{}),e.jsx(me,{}),e.jsx(ee,{}),e.jsx(se,{})]})}),e.jsxs(N,{displayCancel:!1,children:[e.jsx(pe,{}),e.jsx(ie,{})]})]})}function ie(){return e.jsx(u,{disabled:!0,size:"md",children:"Next"})}function ne(){return 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(q,{className:"h-5 w-5 fill-primary-400"}),"Configuration"]}),e.jsx("p",{className:"text-theme-text-secondary",children:"Follow the steps to deploy your Stack."})]})}function ce(r){switch(r){case"aws":return"https://aws.amazon.com/cli/";case"azure":return"https://learn.microsoft.com/en-us/cli/azure/";case"gcp":return"https://cloud.google.com/sdk/gcloud"}}function le(r){switch(r){case"aws":return"AWS";case"gcp":return"gcloud";case"azure":return"Azure"}}function de(){const{data:r}=d();return e.jsx("div",{className:"space-y-5",children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{children:"1"}),e.jsxs("span",{className:"text-text-lg font-semibold",children:["Login locally with the ",le(r.provider||"aws")," CLI"]})]}),e.jsx("p",{className:"text-theme-text-secondary",children:"Make sure you are logged in locally with an account with appropriate permissions."}),e.jsx(u,{asChild:!0,className:"w-fit gap-1",intent:"secondary",emphasis:"subtle",size:"md",children:e.jsxs("a",{rel:"noopener noreferrer",target:"_blank",href:ce(r.provider||"aws"),children:[e.jsx("span",{children:"Learn More"}),e.jsx(Y,{className:"h-5 w-5 shrink-0 fill-primary-900"})]})})]})})}function me(){const{data:r}=d();return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{children:"2"}),e.jsx("span",{className:"text-text-lg font-semibold",children:"Create a file with the following configuration"})]}),e.jsxs("p",{className:"text-theme-text-secondary",children:["Create a file named ",e.jsx("code",{className:"font-mono text-primary-400",children:"main.tf"})," in the Cloud Shell and copy and paste the Terraform configuration below into it."]})]}),r.provider==="gcp"&&e.jsxs(b,{intent:"warning",children:["Please replace ",e.jsx("code",{className:"font-mono text-primary-400",children:"project_id"})," in the following Terraform script with your own one."]}),e.jsx(ue,{})]})}function ue(){const{data:r}=d(),t=D({...E.stackDeploymentConfig({provider:r.provider||"aws",terraform:!0,stack_name:r.stackName,location:r.location}),enabled:!!r.stackName});return t.isError?null:t.isPending?e.jsx(P,{className:"h-[200px] w-full"}):e.jsx(j,{fullWidth:!0,highlightCode:!0,codeClasses:"whitespace-pre-wrap word-break-all",wrap:!0,code:t.data.configuration||""})}function pe(){const r=J();function t(){k(),r(Z.stacks.create.index)}return e.jsx(u,{onClick:()=>t(),intent:"secondary",size:"md",children:"Cancel"})}const xe=_.object({provider:Q});function fe(){const{setData:r,data:t}=d(),{setCurrentStep:i}=m(),s=T({resolver:z(xe),defaultValues:{provider:t.provider||void 0}});function o(c){r(a=>({...a,provider:c.provider})),i(a=>a+1)}return e.jsx(L,{...s,children:e.jsxs(v,{children:[e.jsx(g,{children:"New Cloud infrastructure"}),e.jsx(y,{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. You will be able to remove the ZenML stack at any time."})]}),e.jsxs("form",{id:"provider-form",onSubmit:s.handleSubmit(o),className:"grid grid-cols-1 gap-3 xl:grid-cols-3",children:[e.jsx(x,{id:"aws-provider",...s.register("provider"),value:"aws",children:e.jsx(f,{icon:e.jsx(h,{provider:"aws",className:"h-6 w-6 shrink-0"}),title:"AWS",subtitle:"Connect your existing S3, ECR, and Sagemaker components to ZenML"})}),e.jsx(x,{id:"gcp-provider",...s.register("provider"),value:"gcp",children:e.jsx(f,{icon:e.jsx(h,{provider:"gcp",className:"h-6 w-6 shrink-0"}),title:"GCP",subtitle:"Link your GCS, Artifact Registry, and Vertex AI components to ZenML"})}),e.jsx(x,{id:"azure-provider",...s.register("provider"),value:"azure",children:e.jsx(f,{icon:e.jsx(h,{provider:"azure",className:"h-6 w-6 shrink-0"}),title:"Azure",subtitle:"Integrate ZenML with your Blob Storage, Container Registry, and Azure ML"})})]})]})}),e.jsx(N,{children:e.jsx(he,{})})]})})}function he(){const{formState:{isValid:r}}=W();return e.jsx(u,{form:"provider-form",disabled:!r,size:"md",children:"Next"})}function je(){const{currentStep:r}=m();if(r===1)return e.jsx(fe,{});if(r===2)return e.jsx(U,{});if(r===3)return e.jsx(oe,{})}const S=["Infrastructure Type","Cloud Provider","Review Configuration","Deploy Stack"];function Ye(){return e.jsx(B,{maxSteps:S.length,initialStep:0,children:e.jsx(K,{children:e.jsxs("section",{className:"layout-container flex flex-col gap-5 py-5 xl:flex-row",children:[e.jsx(M,{entries:S}),e.jsx("div",{className:"w-full overflow-y-hidden",children:e.jsx(je,{})})]})})})}export{Ye as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as l,j as e}from"./@radix-C7hRs6Kx.js";import{u as m,S as x,a as y,b as v}from"./form-schemas-
|
1
|
+
import{r as l,j as e}from"./@radix-C7hRs6Kx.js";import{u as m,S as x,a as y,b as v}from"./form-schemas-BJN_25Ua.js";import{A as j,I as U,P as b,U as h,S as _}from"./UsageReason-C8sD2bOU.js";import{f as g,ax as C,i as P,bd as w,l as A,S as E}from"./index-BygJE88j.js";import{c as F}from"./@tanstack-CSxjHCME.js";import"./check-circle-mvyzYvIW.js";import"./@react-router-CNP6g_RL.js";import"./UpdatePasswordSchemas-p3RX0P-Q.js";import"./zod-C0xYeTvL.js";import"./index.esm-D7jFlf5N.js";import"./gcp-CHNvgEss.js";import"./kubernetes-D6OUjwSK.js";import"./rocket-Cf-B-XOR.js";import"./@reactflow-CQi1Z1Wq.js";const S=l.createContext(null);function H({children:t,initialUser:n}){const[a,r]=l.useState(n||{});return e.jsx(S.Provider,{value:{user:a,setUser:r},children:t})}function d(){const t=l.useContext(S);if(t===null)throw new Error("useSurveyUserContext must be used within an SurveyUserProvider");return t}function D({user:t}){var u,i;const{setSurveyStep:n}=m(),{setUser:a}=d();function r({fullName:s,getUpdates:c,email:o}){a(p=>({...p,...o?{email:o}:{email:null},full_name:s,email_opted_in:c})),n(2)}return e.jsx(j,{email:(u=t.metadata)==null?void 0:u.email,fullName:(i=t.body)==null?void 0:i.full_name,submitHandler:r})}function I(){const{user:t}=d(),{setSurveyStep:n}=m(),{toast:a}=g(),r=F(),{mutate:u}=C({onSuccess:async()=>{await r.invalidateQueries({queryKey:w()}),n(s=>s+1)},onError:s=>{s instanceof Error&&a({status:"error",emphasis:"subtle",icon:e.jsx(P,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:s.message,rounded:!0})}});function i({other:s,providers:c,otherVal:o}){const f={infra_providers:s?[...c,o]:c,finished_onboarding_survey:!0};u({...t,user_metadata:{...t.user_metadata,...f}})}return e.jsx(U,{submitHandler:i})}function R({user:t}){const{setSurveyStep:n}=m(),{setUser:a}=d();function r({primaryUse:u}){const i={primary_use:u};a(s=>({...s,user_metadata:{...s.user_metadata,...i}})),n(3)}return e.jsx(b,{user:t,submitHandler:r})}function k(){const{setSurveyStep:t}=m(),{setUser:n}=d();function a({usageReason:r,comparison_tools:u,otherTool:i,otherToolVal:s}){const c={usage_reason:r,...!!u&&{comparing_tools:i&&s?[...u,s]:u}};n(o=>({...o,user_metadata:{...o.user_metadata,...c}})),t(o=>o+1)}return e.jsx(h,{submitHandler:a})}function M(){const{data:t,isPending:n,isError:a}=A({throwOnError:!0}),{surveyStep:r}=m();return a?null:n?e.jsx(E,{className:"h-[300px]"}):e.jsx(e.Fragment,{children:e.jsxs(H,{children:[e.jsx(x,{stepAmount:5}),r===1&&e.jsx(D,{user:t}),r===2&&e.jsx(R,{user:t}),r===3&&e.jsx(k,{}),r===4&&e.jsx(I,{}),r===5&&e.jsx(_,{}),r===6&&e.jsx(y,{subHeader:"Your ZenML account is now updated",displayBody:!1,username:t.name})]})})}function X(){return e.jsx("div",{children:e.jsx(v,{children:e.jsx(M,{})})})}export{X as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{j as e}from"./@radix-C7hRs6Kx.js";import{u as o,A as i,a as d,g as c,b as x,S as a,c as n,d as m,B as f,r as u}from"./index-
|
1
|
+
import{j as e}from"./@radix-C7hRs6Kx.js";import{u as o,A as i,a as d,g as c,b as x,S as a,c as n,d as m,B as f,r as u}from"./index-BygJE88j.js";import{g as h}from"./login-command-CkqxPtV3.js";import{L as p}from"./@react-router-CNP6g_RL.js";import{C as j}from"./CodeSnippet-Di-loaZu.js";import"./@tanstack-CSxjHCME.js";import"./@reactflow-CQi1Z1Wq.js";const v="/assets/cloud-squares-DeRLMopf.svg";function g(){var r,t,l;const{data:s}=o({throwOnError:!0});return e.jsx("div",{className:"w-full items-center border-b border-theme-border-moderate bg-white py-5",children:e.jsx("div",{className:"layout-container flex flex-col flex-wrap items-center justify-between md:flex-row",children:e.jsxs("div",{className:"flex flex-col items-center gap-5 md:flex-row",children:[s?e.jsxs(i,{size:"xxl",type:"square",children:[e.jsx(d,{alt:"Logo displayed for the server",src:c(((r=s.body)==null?void 0:r.server_name)||"default",64)}),e.jsx(x,{size:"xxl",children:((t=s.body)==null?void 0:t.server_name[0])||"D"})]}):e.jsx(a,{className:"h-[96px] w-[96px]"}),e.jsx("div",{children:e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row",children:[s?e.jsx("h1",{className:"mb-1 text-display-xs font-semibold",children:((l=s.body)==null?void 0:l.server_name)||"default"}):e.jsx(a,{className:"h-full w-8"}),e.jsx("div",{className:"flex flex-row flex-wrap gap-0.5",children:e.jsx(w,{})})]})})]})})})}function w(){const{data:s,isError:r,isPending:t}=n({throwOnError:!0});return r?null:t?e.jsx(a,{className:"w-6"}):e.jsxs("div",{className:"flex h-6 items-center gap-0.5 rounded-md border border-theme-border-moderate px-1 py-0.5 text-text-sm text-theme-text-secondary",children:[e.jsx(m,{className:"h-4 w-4 fill-theme-text-brand"}),s.version]})}function k(){return e.jsxs("div",{children:[e.jsx(g,{}),e.jsx("div",{className:"layout-container space-y-5 py-5",children:e.jsx(b,{})})]})}function b(){const{data:s}=n();return e.jsxs(f,{className:"flex flex-col-reverse overflow-hidden lg:flex-row",children:[e.jsxs("div",{className:"w-full px-7 py-5 lg:w-2/3",children:[e.jsx("h2",{className:"text-display-xs font-semibold",children:"Welcome to ZenML"}),e.jsxs("p",{className:"mt-2 text-text-lg text-theme-text-secondary",children:["You successfully installed ZenML dashboard. ",e.jsx("br",{}),"Now you can get started with your new ZenML server.",e.jsx("br",{}),"To get started"," ",e.jsx(p,{className:"link text-theme-text-brand",to:u.onboarding,children:"checkout the onboarding guide"}),"."]}),e.jsx("hr",{className:"mb-5 mt-5 w-[100px]"}),e.jsxs("div",{className:"",children:[e.jsx("p",{className:"mb-1 text-text-sm",children:"Copy your ZenML server URL"}),e.jsx("div",{className:"",children:e.jsx(j,{codeClasses:"truncate",className:"truncate",code:h((s==null?void 0:s.deployment_type)||"other")})})]})]}),e.jsx("div",{className:"flex w-full items-center justify-center bg-primary-50 lg:w-1/3",children:e.jsx("img",{alt:"illustration of different purple squares",src:v,className:"h-full w-full"})})]})}export{k as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{j as e}from"./@radix-C7hRs6Kx.js";import{I as m}from"./InlineAvatar-Cpj0lVRQ.js";import{u as x,S as c,A as d,a as f,g as u,b as v,r,c as h,d as p,l as g}from"./index-BygJE88j.js";import{u as j,h as N,O as b}from"./@react-router-CNP6g_RL.js";import"./@tanstack-CSxjHCME.js";import"./@reactflow-CQi1Z1Wq.js";function w({children:s,isActiveOverride:t,...n}){const a=j(),i=t?t(a.pathname):!1;return e.jsx(N,{...n,className:({isActive:l})=>` ${i||l?"bg-primary-50 text-theme-text-brand":"hover:bg-neutral-200"} block rounded-md px-4 py-1 text-text-sm font-semibold `,children:s})}function o({items:s}){return e.jsx("nav",{className:"flex w-full flex-col items-center",children:e.jsx("ul",{className:"flex w-full flex-row flex-wrap items-center gap-1 lg:flex-col lg:items-start",children:s.map(t=>e.jsx("li",{className:"lg:w-full",children:e.jsx(w,{end:!0,to:t.href,isActiveOverride:t.isActiveOverride,children:t.name})},t.name))})})}function y(){var a,i,l;const{data:s,isError:t,isPending:n}=x({throwOnError:!0});return n?e.jsx(c,{className:"h-9 w-full"}):t?null:e.jsxs("div",{className:"flex w-full items-center gap-2 rounded-md border border-theme-border-moderate bg-theme-surface-primary p-2",children:[e.jsxs(d,{size:"md",type:"square",children:[e.jsx(f,{src:u(((a=s.body)==null?void 0:a.server_name)||"default")}),e.jsx(v,{size:"md",children:((i=s.body)==null?void 0:i.server_name[0])||"D"})]}),e.jsx("p",{className:"truncate text-text-sm font-semibold",children:(l=s.body)==null?void 0:l.server_name})]})}function S(){function s(){return[{name:"General",href:r.settings.general},{name:"Members",href:r.settings.members},{name:"API Tokens",href:r.settings.apiTokens},{name:"Repositories",href:r.settings.repositories.overview},{name:"Secrets",href:r.settings.secrets.overview,isActiveOverride:n=>n.startsWith(r.settings.secrets.overview)},{name:"Connectors",href:r.settings.connectors.overview},{name:"Service Accounts",href:r.settings.service_accounts.overview,isActiveOverride:n=>n.startsWith(r.settings.service_accounts.overview)},{name:"Notifications",href:r.settings.notifications}]}const t=s();return e.jsx(o,{items:t})}function A(){function s(){return[{name:"Profile",href:r.settings.profile}]}const t=s();return e.jsx(o,{items:t})}function I(){const{data:s,isPending:t,isError:n}=h();return t?e.jsx(c,{className:"h-[70px] w-full"}):n?null:e.jsxs("div",{className:"rounded-md border border-theme-border-moderate bg-theme-surface-primary p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center",children:[e.jsx(p,{className:"h-4 w-4 fill-theme-text-brand"}),e.jsx("p",{className:"ml-2 text-text-sm font-semibold",children:"Open source"})]}),e.jsxs("p",{className:"mb-1 text-text-sm text-theme-text-tertiary",children:["ZenML v",s.version]}),e.jsxs("p",{className:"text-text-sm text-theme-text-tertiary",children:["UI Version ","v0.32.0"]})]})}function L(){const{data:s}=g();return e.jsxs("div",{className:"layout-container flex flex-col gap-7 pt-5 lg:flex-row lg:px-10",children:[e.jsxs("div",{className:"flex shrink-0 flex-col gap-4 lg:w-[200px]",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-text-xs font-semibold uppercase text-theme-text-tertiary",children:"Server"}),e.jsx(y,{}),e.jsx(S,{})]}),s?e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-text-xs font-semibold uppercase text-theme-text-tertiary",children:"Account"}),e.jsx(m,{username:s.name})]}):e.jsx(c,{className:"h-[70px] w-full"}),e.jsx("div",{className:"flex flex-col gap-4",children:e.jsx(A,{})}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-text-xs font-semibold uppercase text-theme-text-tertiary",children:"Version"}),e.jsx(I,{})]})]}),e.jsx("div",{className:"w-full",children:e.jsx(b,{})})]})}export{L as default};
|
@@ -0,0 +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-BygJE88j.js";import{S as X,P as Y}from"./SearchField-DMCywawn.js";import{a as ee,b as N,c as A}from"./@tanstack-CSxjHCME.js";import{C as se}from"./CodeSnippet-Di-loaZu.js";import{u as te}from"./index.esm-D7jFlf5N.js";import{D as ae}from"./DisplayDate-CYVBBSgr.js";import{I as re}from"./InlineAvatar-Cpj0lVRQ.js";import{S as ne}from"./dots-horizontal-BGRJCPCs.js";import{A as ie}from"./AlertDialogDropdownItem-CRZjthRL.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,
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,o=String(t);if(r===0)return o;var n=o.match(/(.*?)([0-9]+)(.*)/),e=n?n[1]:"",a=n?n[3]:"",i=n?n[2]:o,c=i.length>=r?i:(ve(Array(r)).map(function(){return"0"}).join("")+i).slice(r*-1);return"".concat(e).concat(c).concat(a)}var E={daysInHours:!1,zeroPadTime:2};function Se(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=r.now,n=o===void 0?Date.now:o,e=r.precision,a=e===void 0?0:e,i=r.controlled,c=r.offsetTime,u=c===void 0?0:c,p=r.overtime,f;typeof t=="string"?f=new Date(t).getTime():t instanceof Date?f=t.getTime():f=t,i||(f+=u);var m=i?f:f-n(),h=Math.min(20,Math.max(0,a)),d=Math.round(parseFloat(((p?m:Math.max(0,m))/1e3).toFixed(h))*1e3),y=Math.abs(d)/1e3;return{total:d,days:Math.floor(y/(3600*24)),hours:Math.floor(y/3600%24),minutes:Math.floor(y/60%60),seconds:Math.floor(y%60),milliseconds:Number((y%1*1e3).toFixed()),completed:d<=0}}function je(t,r){var o=t.days,n=t.hours,e=t.minutes,a=t.seconds,i=Object.assign(Object.assign({},E),r),c=i.daysInHours,u=i.zeroPadTime,p=i.zeroPadDays,f=p===void 0?u:p,m=Math.min(2,u),h=c?x(n+o*24,u):x(n,m);return{days:c?"":x(o,f),hours:h,minutes:x(e,m),seconds:x(a,m)}}var _=function(t){N(o,t);var r=A(o);function o(){var n;return O(this,o),n=r.apply(this,arguments),n.state={count:n.props.count||3},n.startCountdown=function(){n.interval=window.setInterval(function(){var e=n.state.count-1;e===0?(n.stopCountdown(),n.props.onComplete&&n.props.onComplete()):n.setState(function(a){return{count:a.count-1}})},1e3)},n.stopCountdown=function(){clearInterval(n.interval)},n.addTime=function(e){n.stopCountdown(),n.setState(function(a){return{count:a.count+e}},n.startCountdown)},n}return I(o,[{key:"componentDidMount",value:function(){this.startCountdown()}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"render",value:function(){return this.props.children?v.cloneElement(this.props.children,{count:this.state.count}):null}}]),o}(v.Component);_.propTypes={count:l.number,children:l.element,onComplete:l.func};var P=function(t){N(o,t);var r=A(o);function o(n){var e;if(O(this,o),e=r.call(this,n),e.mounted=!1,e.initialTimestamp=e.calcOffsetStartTimestamp(),e.offsetStartTimestamp=e.props.autoStart?0:e.initialTimestamp,e.offsetTime=0,e.legacyMode=!1,e.legacyCountdownRef=null,e.tick=function(){var i=e.calcTimeDelta(),c=i.completed&&!e.props.overtime?void 0:e.props.onTick;e.setTimeDeltaState(i,void 0,c)},e.setLegacyCountdownRef=function(i){e.legacyCountdownRef=i},e.start=function(){if(!e.isStarted()){var i=e.offsetStartTimestamp;e.offsetStartTimestamp=0,e.offsetTime+=i?e.calcOffsetStartTimestamp()-i:0;var c=e.calcTimeDelta();e.setTimeDeltaState(c,"STARTED",e.props.onStart),!e.props.controlled&&(!c.completed||e.props.overtime)&&(e.clearTimer(),e.interval=window.setInterval(e.tick,e.props.intervalDelay))}},e.pause=function(){e.isPaused()||(e.clearTimer(),e.offsetStartTimestamp=e.calcOffsetStartTimestamp(),e.setTimeDeltaState(e.state.timeDelta,"PAUSED",e.props.onPause))},e.stop=function(){e.isStopped()||(e.clearTimer(),e.offsetStartTimestamp=e.calcOffsetStartTimestamp(),e.offsetTime=e.offsetStartTimestamp-e.initialTimestamp,e.setTimeDeltaState(e.calcTimeDelta(),"STOPPED",e.props.onStop))},e.isStarted=function(){return e.isStatus("STARTED")},e.isPaused=function(){return e.isStatus("PAUSED")},e.isStopped=function(){return e.isStatus("STOPPED")},e.isCompleted=function(){return e.isStatus("COMPLETED")},n.date){var a=e.calcTimeDelta();e.state={timeDelta:a,status:a.completed?"COMPLETED":"STOPPED"}}else e.legacyMode=!0;return e}return I(o,[{key:"componentDidMount",value:function(){this.legacyMode||(this.mounted=!0,this.props.onMount&&this.props.onMount(this.calcTimeDelta()),this.props.autoStart&&this.start())}},{key:"componentDidUpdate",value:function(e){this.legacyMode||this.props.date!==e.date&&(this.initialTimestamp=this.calcOffsetStartTimestamp(),this.offsetStartTimestamp=this.initialTimestamp,this.offsetTime=0,this.setTimeDeltaState(this.calcTimeDelta()))}},{key:"componentWillUnmount",value:function(){this.legacyMode||(this.mounted=!1,this.clearTimer())}},{key:"calcTimeDelta",value:function(){var e=this.props,a=e.date,i=e.now,c=e.precision,u=e.controlled,p=e.overtime;return Se(a,{now:i,precision:c,controlled:u,offsetTime:this.offsetTime,overtime:p})}},{key:"calcOffsetStartTimestamp",value:function(){return Date.now()}},{key:"addTime",value:function(e){this.legacyCountdownRef.addTime(e)}},{key:"clearTimer",value:function(){window.clearInterval(this.interval)}},{key:"isStatus",value:function(e){return this.state.status===e}},{key:"setTimeDeltaState",value:function(e,a,i){var c=this;if(this.mounted){var u=e.completed&&!this.state.timeDelta.completed,p=e.completed&&a==="STARTED";u&&!this.props.overtime&&this.clearTimer();var f=function(){i&&i(c.state.timeDelta),c.props.onComplete&&(u||p)&&c.props.onComplete(e,p)};return this.setState(function(m){var h=a||m.status;return e.completed&&!c.props.overtime?h="COMPLETED":!a&&h==="COMPLETED"&&(h="STOPPED"),{timeDelta:e,status:h}},f)}}},{key:"getApi",value:function(){return this.api=this.api||{start:this.start,pause:this.pause,stop:this.stop,isStarted:this.isStarted,isPaused:this.isPaused,isStopped:this.isStopped,isCompleted:this.isCompleted}}},{key:"getRenderProps",value:function(){var e=this.props,a=e.daysInHours,i=e.zeroPadTime,c=e.zeroPadDays,u=this.state.timeDelta;return Object.assign(Object.assign({},u),{api:this.getApi(),props:this.props,formatted:je(u,{daysInHours:a,zeroPadTime:i,zeroPadDays:c})})}},{key:"render",value:function(){if(this.legacyMode){var e=this.props,a=e.count,i=e.children,c=e.onComplete;return v.createElement(_,{ref:this.setLegacyCountdownRef,count:a,onComplete:c},i)}var u=this.props,p=u.className,f=u.overtime,m=u.children,h=u.renderer,d=this.getRenderProps();if(h)return h(d);if(m&&this.state.timeDelta.completed&&!f)return v.cloneElement(m,{countdown:d});var y=d.formatted,k=y.days,M=y.hours,$=y.minutes,z=y.seconds;return v.createElement("span",{className:p},d.total<0?"-":"",k,k?":":"",M,":",$,":",z)}}]),o}(v.Component);P.defaultProps=Object.assign(Object.assign({},E),{controlled:!1,intervalDelay:1e3,precision:0,autoStart:!0});P.propTypes={date:l.oneOfType([l.instanceOf(Date),l.string,l.number]),daysInHours:l.bool,zeroPadTime:l.number,zeroPadDays:l.number,controlled:l.bool,intervalDelay:l.number,precision:l.number,autoStart:l.bool,overtime:l.bool,className:l.string,children:l.element,renderer:l.func,now:l.func,onMount:l.func,onStart:l.func,onPause:l.func,onStop:l.func,onTick:l.func,onComplete:l.func};function we({token:t,open:r,setOpen:o}){return s.jsx(B,{open:r,onOpenChange:o,children:s.jsxs(W,{className:"max-w-[700px]",children:[s.jsx(q,{children:s.jsx(J,{children:"API Token Created Successfully"})}),s.jsxs("div",{className:"space-y-3 overflow-hidden px-7 py-5",children:[s.jsx(Pe,{}),s.jsx(ke,{}),s.jsx(De,{token:t}),s.jsx(ae,{fallbackRender:()=>null,children:s.jsx(Oe,{token:t})}),s.jsx("div",{role:"separator","aria-hidden":"true",className:"h-[1px] bg-theme-border-moderate"}),s.jsx(Ie,{token:t}),s.jsx(Ne,{}),s.jsx("div",{role:"separator","aria-hidden":"true",className:"h-[1px] bg-theme-border-moderate"}),s.jsx(Ae,{})]})]})})}function Pe(){return s.jsxs("section",{children:[s.jsx("p",{className:"font-semibold",children:"Here is your new API Token"}),s.jsx("p",{className:"text-theme-text-secondary",children:"This token provides temporary access to your ZenML Server"})]})}function ke(){return s.jsx(oe,{children:"Important: This token expires in 1 hour and cannot be retrieved later. Please, copy it now."})}function De({token:t}){const[r,o]=v.useState(!1);function n(e){navigator.clipboard&&(navigator.clipboard.writeText(e),o(!0),setTimeout(()=>{o(!1)},2e3))}return s.jsxs("section",{className:"flex items-center gap-5 py-5",children:[s.jsx("code",{className:"block overflow-x-auto whitespace-nowrap font-sans text-display-xs",children:t}),r?s.jsxs("div",{className:"flex h-7 items-center",children:[s.jsx(se,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary"}),s.jsx("p",{className:"sr-only",children:"copied successfully"})]}):s.jsxs(w,{onClick:()=>n(t),size:"md",intent:"secondary",className:"flex items-center gap-1",emphasis:"subtle",children:[s.jsx(Z,{className:"size-4 shrink-0 fill-inherit"}),"Copy"]})]})}const Ce=({days:t,hours:r,minutes:o,seconds:n,completed:e})=>{if(e)return s.jsx("span",{className:"font-semibold text-theme-text-error",children:"Expired"});const a=c=>String(c).padStart(2,"0"),i=[];return t>0&&i.push(`${t}`),(t>0||r>0)&&i.push(`${a(r)}`),(t>0||r>0||o>0)&&i.push(`${a(o)}`),i.push(`${a(n)}`),s.jsx("span",{className:"font-semibold",children:i.join(":")})};function Oe({token:t}){if(!t)return null;const r=pe(t);return r.exp?s.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3 rounded-sm border border-theme-border-moderate bg-theme-surface-tertiary py-1 text-center",children:[s.jsx(re,{className:"size-5 shrink-0 fill-theme-text-secondary"}),s.jsxs("div",{children:["Expires in:"," ",s.jsx(P,{daysInHours:!0,renderer:Ce,zeroPadTime:2,date:new Date(r.exp*1e3)})]})]}):null}function Ie({token:t}){const r=`${window.location.origin}/api/v1/current-user`;return s.jsxs("section",{className:"space-y-1",children:[s.jsx("div",{className:"font-semibold",children:"Using your API Token"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-theme-text-secondary",children:"To use the API token to run queries against the Server API, you can run the following commands:"}),s.jsx(C,{code:Ee(t,r)}),s.jsx(C,{code:_e(t,r)})]})]})}function Ne(){const t=`${window.location.origin}/docs`;return s.jsxs("section",{className:"space-y-2",children:[s.jsx("p",{className:"font-semibold",children:"API Documentation"}),s.jsx("p",{className:"text-theme-text-secondary",children:"Access our OpenAPI dashboard for comprehensive documentation on all available REST API endpoints:"}),s.jsx(w,{asChild:!0,size:"md",intent:"secondary",className:"flex w-fit items-center gap-1",emphasis:"subtle",children:s.jsxs("a",{target:"_blank",rel:"noopener noreferrer",href:t,children:[s.jsx("span",{children:"Open the documentation"}),s.jsx(ne,{className:"size-5 shrink-0 fill-inherit"})]})})]})}function Ae(){return s.jsxs("p",{children:["For long-term programmatic access, consider"," ",s.jsx(ie,{className:"link text-theme-text-brand",to:G.settings.service_accounts.overview,children:"setting up a service account instead."})]})}function Ee(t,r){return`curl -H "Authorization: Bearer ${t}" "${encodeURI(r)}"`}function _e(t,r){return`wget -qO- --header="Authorization: Bearer ${t}" "${encodeURI(r)}"`}const j=v.forwardRef(({className:t,onClick:r,...o},n)=>{const{toast:e}=V(),[a,i]=v.useState(""),[c,u]=v.useState(!1),p=K(),{mutate:f,isPending:m}=le({onError:d=>{ee(d)&&e({title:"Error",emphasis:"subtle",rounded:!0,status:"error",description:d.message}),console.log(d)},onSuccess:d=>{i(d),u(!0)}});function h(d){u(d),d||i("")}return p.isPending?s.jsx(Q,{className:"h-7 w-10"}):p.isError?null:s.jsxs(s.Fragment,{children:[s.jsxs(w,{disabled:m||Y(p.data.auth_scheme||"other"),ref:n,...o,onClick:()=>f({params:{token_type:"generic"}}),className:X(t),children:[m&&s.jsx("div",{role:"alert","aria-busy":"true",className:"full h-[20px] w-[20px] animate-spin rounded-rounded border-2 border-theme-text-negative border-b-theme-text-brand"}),"Create new token"]}),s.jsx(we,{open:c,setOpen:h,token:a})]})});j.displayName="CreateTokenButton";function Ze(){return s.jsxs(D,{className:"flex flex-col gap-5 p-5",children:[s.jsx("h1",{className:"text-text-xl font-semibold",children:"API Tokens"}),s.jsx("div",{className:"flex items-center justify-end",children:s.jsx(j,{size:"sm"})}),s.jsxs(D,{className:"flex w-full flex-col items-center justify-center space-y-5 p-9 text-center",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("h2",{className:"text-display-xs font-semibold",children:"Create a new API Token"}),s.jsx("p",{className:"text-text-xl text-theme-text-secondary",children:"Generate a temporary access key for quick, secure automation tasks in your Tenant. An API Token is temporary (max. 1 hour) and won't be stored anywhere."})]}),s.jsx(j,{size:"md"})]})]})}export{Ze as default};
|
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-BygJE88j.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-Di-loaZu.js";import{I as oe}from"./Infobox-Bai0JtFs.js";import{T as se}from"./Tick-ay3Bgtro.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
|
+
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};
|