mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-20 03:11:46 +00:00
feat: frontend refactors (#66)
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
import{c as B,F as $,G as F,x as C,j as s,w as K,H as b,I as k,L}from"./index.js";import{u as E}from"./useSuspenseQuery.js";import{B as O}from"./back-link.js";import{E as S}from"./error-banner.js";import{a as U}from"./s3.js";import{U as A,F as I,O as R}from"./upload-button.js";import"./alert-dialog.js";import"./download.js";import"./trash-2.js";function J(){const e=B.c(24),{bucket:n,_splat:v}=$.useParams(),r=F(v||""),{data:m}=E(C(n,r)),a=U();let d;e[0]!==m.Contents?(d=m.Contents||[],e[0]=m.Contents,e[1]=d):d=e[1];const o=d;let p;e[2]!==m.CommonPrefixes?(p=m.CommonPrefixes||[],e[2]=m.CommonPrefixes,e[3]=p):p=e[3];const i=p,u=r.split("/").filter(Boolean),y=[{name:n,path:`/s3/ls/${n}`},...u.map((t,l)=>{const c=`${u.slice(0,l+1).join("/")}/`;return{name:t,path:`/s3/ls/${n}/${c}`}})],P=u.length>1?`/s3/ls/${n}/${u.slice(0,-1).join("/")}/`:`/s3/ls/${n}`;let x;e[4]!==P?(x=s.jsx(O,{to:P,children:"Back"}),e[4]=P,e[5]=x):x=e[5];let f;e[6]!==n||e[7]!==r||e[8]!==a.isPending||e[9]!==a.mutateAsync?(f=s.jsx(A,{bucket:n,isPending:a.isPending,onUpload:a.mutateAsync,prefix:r}),e[6]=n,e[7]=r,e[8]=a.isPending,e[9]=a.mutateAsync,e[10]=f):f=e[10];let h;e[11]!==a.error?(h=a.error&&s.jsx(S,{error:a.error,msg:"Failed to upload object"}),e[11]=a.error,e[12]=h):h=e[12];let g;e[13]!==n||e[14]!==i||e[15]!==r?(g=i.length>0&&s.jsxs("div",{className:"mb-6",children:[s.jsx("h2",{className:"mb-3 font-semibold text-lg",children:"Folders"}),s.jsx("div",{className:"space-y-2",children:i.map(t=>{if(!t.Prefix)return null;const l=K(b(t.Prefix,r)),c=k(t.Prefix,r);return s.jsx(I,{bucketName:n,folderName:l,fullPrefix:c},t.Prefix)})})]}),e[13]=n,e[14]=i,e[15]=r,e[16]=g):g=e[16];let j;e[17]!==n||e[18]!==o||e[19]!==r?(j=o.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("h2",{className:"mb-3 font-semibold text-lg",children:"Objects"}),o.map(t=>{if(!t.Key)return null;const l=b(t.Key,r),c=k(t.Key,r);return s.jsx(R,{bucketName:n,displayName:l,fullKey:c,object:t},t.Key)})]}),e[17]=n,e[18]=o,e[19]=r,e[20]=j):j=e[20];let N;return e[21]!==i.length||e[22]!==o.length?(N=o.length===0&&i.length===0&&s.jsx("p",{className:"text-muted-foreground",children:"No objects found in this folder."}),e[21]=i.length,e[22]=o.length,e[23]=N):N=e[23],s.jsxs(s.Fragment,{children:[x,s.jsx("div",{className:"mb-6",children:s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:y.map((t,l)=>s.jsxs("div",{className:"flex items-center gap-2",children:[l>0&&s.jsx("span",{children:"/"}),l===y.length-1?s.jsx("span",{className:"text-foreground",children:t.name}):s.jsx(L,{className:"hover:text-foreground",to:t.path,children:t.name})]},t.path))}),f]})}),h,g,j,N]})}export{J as component};
|
||||
import{c as B,F as $,G as F,y as C,j as s,x as K,H as b,I as k,L}from"./index.js";import{u as E}from"./useSuspenseQuery.js";import{B as O}from"./back-link.js";import{E as S}from"./error-banner.js";import{a as U}from"./s3.js";import{U as A,F as I,O as R}from"./upload-button.js";import"./delete-confirmation-dialog.js";import"./alert-dialog.js";import"./download.js";import"./trash-2.js";function V(){const e=B.c(24),{bucket:n,_splat:v}=$.useParams(),r=F(v||""),{data:m}=E(C(n,r)),a=U();let d;e[0]!==m.Contents?(d=m.Contents||[],e[0]=m.Contents,e[1]=d):d=e[1];const o=d;let p;e[2]!==m.CommonPrefixes?(p=m.CommonPrefixes||[],e[2]=m.CommonPrefixes,e[3]=p):p=e[3];const i=p,u=r.split("/").filter(Boolean),y=[{name:n,path:`/s3/ls/${n}`},...u.map((t,l)=>{const c=`${u.slice(0,l+1).join("/")}/`;return{name:t,path:`/s3/ls/${n}/${c}`}})],P=u.length>1?`/s3/ls/${n}/${u.slice(0,-1).join("/")}/`:`/s3/ls/${n}`;let x;e[4]!==P?(x=s.jsx(O,{to:P,children:"Back"}),e[4]=P,e[5]=x):x=e[5];let f;e[6]!==n||e[7]!==r||e[8]!==a.isPending||e[9]!==a.mutateAsync?(f=s.jsx(A,{bucket:n,isPending:a.isPending,onUpload:a.mutateAsync,prefix:r}),e[6]=n,e[7]=r,e[8]=a.isPending,e[9]=a.mutateAsync,e[10]=f):f=e[10];let h;e[11]!==a.error?(h=a.error&&s.jsx(S,{error:a.error,msg:"Failed to upload object"}),e[11]=a.error,e[12]=h):h=e[12];let g;e[13]!==n||e[14]!==i||e[15]!==r?(g=i.length>0&&s.jsxs("div",{className:"mb-6",children:[s.jsx("h2",{className:"mb-3 font-semibold text-lg",children:"Folders"}),s.jsx("div",{className:"space-y-2",children:i.map(t=>{if(!t.Prefix)return null;const l=K(b(t.Prefix,r)),c=k(t.Prefix,r);return s.jsx(I,{bucketName:n,folderName:l,fullPrefix:c},t.Prefix)})})]}),e[13]=n,e[14]=i,e[15]=r,e[16]=g):g=e[16];let j;e[17]!==n||e[18]!==o||e[19]!==r?(j=o.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("h2",{className:"mb-3 font-semibold text-lg",children:"Objects"}),o.map(t=>{if(!t.Key)return null;const l=b(t.Key,r),c=k(t.Key,r);return s.jsx(R,{bucketName:n,displayName:l,fullKey:c,object:t},t.Key)})]}),e[17]=n,e[18]=o,e[19]=r,e[20]=j):j=e[20];let N;return e[21]!==i.length||e[22]!==o.length?(N=o.length===0&&i.length===0&&s.jsx("p",{className:"text-muted-foreground",children:"No objects found in this folder."}),e[21]=i.length,e[22]=o.length,e[23]=N):N=e[23],s.jsxs(s.Fragment,{children:[x,s.jsx("div",{className:"mb-6",children:s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:y.map((t,l)=>s.jsxs("div",{className:"flex items-center gap-2",children:[l>0&&s.jsx("span",{children:"/"}),l===y.length-1?s.jsx("span",{className:"text-foreground",children:t.name}):s.jsx(L,{className:"hover:text-foreground",to:t.path,children:t.name})]},t.path))}),f]})}),h,g,j,N]})}export{V as component};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{aJ as D,u as g,aK as b,t as f,r as v,j as e,B as C,L as I}from"./index.js";import{u as d}from"./useSuspenseQuery.js";import{B as u}from"./back-link.js";import{D as l,a as t}from"./detail-row.js";import{E as V}from"./error-banner.js";import{P as S}from"./page-heading.js";import{S as y}from"./state-badge.js";import{g as P,f as A,b as B,a as k,c as w,d as N,e as T,h as O}from"./alert-dialog.js";import{g as H}from"./ec2.js";import{T as R}from"./trash-2.js";function Y(){const{id:r}=D.useParams(),x=g(),{data:p}=d(b(r)),{data:m}=d(f),s=p.Vpcs?.[0],n=H(),[j,i]=v.useState(!1),o=m.Subnets?.filter(a=>a.VpcId===r)??[],h=async()=>{try{await n.mutateAsync(r),x({to:"/ec2/describe-vpcs"})}finally{i(!1)}};if(!s?.VpcId)return e.jsxs(e.Fragment,{children:[e.jsx(u,{to:"/ec2/describe-vpcs",children:"Back to VPCs"}),e.jsx("p",{className:"text-muted-foreground",children:"VPC not found."})]});const c=s.Tags?.find(a=>a.Key==="Name")?.Value;return e.jsxs(e.Fragment,{children:[e.jsx(u,{to:"/ec2/describe-vpcs",children:"Back to VPCs"}),n.error&&e.jsx(V,{error:n.error,msg:"Failed to delete VPC"}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(S,{actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(C,{onClick:()=>i(!0),size:"sm",variant:"destructive",children:[e.jsx(R,{className:"size-4"}),"Delete"]}),e.jsx(y,{state:s.State})]}),subtitle:"VPC Details",title:c?`${s.VpcId} (${c})`:s.VpcId}),e.jsxs(l,{children:[e.jsx(l.Header,{children:"VPC Information"}),e.jsxs(l.Content,{children:[e.jsx(t,{label:"VPC ID",value:s.VpcId}),e.jsx(t,{label:"State",value:s.State}),e.jsx(t,{label:"CIDR Block",value:s.CidrBlock}),e.jsx(t,{label:"Is Default",value:s.IsDefault?"Yes":"No"}),e.jsx(t,{label:"DHCP Options ID",value:s.DhcpOptionsId}),e.jsx(t,{label:"Instance Tenancy",value:s.InstanceTenancy}),e.jsx(t,{label:"Owner ID",value:s.OwnerId})]})]}),o.length>0&&e.jsxs(l,{children:[e.jsxs(l.Header,{children:["Subnets (",o.length,")"]}),o.map(a=>a.SubnetId?e.jsxs(l.Content,{children:[e.jsx(t,{label:"Subnet ID",value:e.jsx(I,{className:"text-primary hover:underline",params:{id:a.SubnetId},to:"/ec2/describe-subnets/$id",children:a.SubnetId})}),e.jsx(t,{label:"CIDR Block",value:a.CidrBlock}),e.jsx(t,{label:"Availability Zone",value:a.AvailabilityZone}),e.jsx(t,{label:"State",value:a.State})]},a.SubnetId):null)]})]}),e.jsx(P,{onOpenChange:i,open:j,children:e.jsxs(A,{children:[e.jsxs(B,{children:[e.jsx(k,{children:"Delete VPC"}),e.jsxs(w,{children:['Are you sure you want to delete the VPC "',s.VpcId,'"? This action cannot be undone. The VPC must have no associated subnets or internet gateways.']})]}),e.jsxs(N,{children:[e.jsx(T,{children:"Cancel"}),e.jsx(O,{disabled:n.isPending,onClick:h,children:n.isPending?"Deleting…":"Delete"})]})]})})]})}export{Y as component};
|
||||
import{aJ as D,u as f,aK as v,v as b,r as I,j as e,B as C,L as g}from"./index.js";import{u as d}from"./useSuspenseQuery.js";import{B as u}from"./back-link.js";import{D as V}from"./delete-confirmation-dialog.js";import{D as n,a}from"./detail-row.js";import{E as S}from"./error-banner.js";import{P as y}from"./page-heading.js";import{S as P}from"./state-badge.js";import{g as B}from"./ec2.js";import{T as k}from"./trash-2.js";import"./alert-dialog.js";function Q(){const{id:l}=D.useParams(),m=f(),{data:p}=d(v(l)),{data:x}=d(b),s=p.Vpcs?.[0],r=B(),[j,i]=I.useState(!1),o=x.Subnets?.filter(t=>t.VpcId===l)??[],h=async()=>{try{await r.mutateAsync(l),m({to:"/ec2/describe-vpcs"})}finally{i(!1)}};if(!s?.VpcId)return e.jsxs(e.Fragment,{children:[e.jsx(u,{to:"/ec2/describe-vpcs",children:"Back to VPCs"}),e.jsx("p",{className:"text-muted-foreground",children:"VPC not found."})]});const c=s.Tags?.find(t=>t.Key==="Name")?.Value;return e.jsxs(e.Fragment,{children:[e.jsx(u,{to:"/ec2/describe-vpcs",children:"Back to VPCs"}),r.error&&e.jsx(S,{error:r.error,msg:"Failed to delete VPC"}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(y,{actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(C,{onClick:()=>i(!0),size:"sm",variant:"destructive",children:[e.jsx(k,{className:"size-4"}),"Delete"]}),e.jsx(P,{state:s.State})]}),subtitle:"VPC Details",title:c?`${s.VpcId} (${c})`:s.VpcId}),e.jsxs(n,{children:[e.jsx(n.Header,{children:"VPC Information"}),e.jsxs(n.Content,{children:[e.jsx(a,{label:"VPC ID",value:s.VpcId}),e.jsx(a,{label:"State",value:s.State}),e.jsx(a,{label:"CIDR Block",value:s.CidrBlock}),e.jsx(a,{label:"Is Default",value:s.IsDefault?"Yes":"No"}),e.jsx(a,{label:"DHCP Options ID",value:s.DhcpOptionsId}),e.jsx(a,{label:"Instance Tenancy",value:s.InstanceTenancy}),e.jsx(a,{label:"Owner ID",value:s.OwnerId})]})]}),o.length>0&&e.jsxs(n,{children:[e.jsxs(n.Header,{children:["Subnets (",o.length,")"]}),o.map(t=>t.SubnetId?e.jsxs(n.Content,{children:[e.jsx(a,{label:"Subnet ID",value:e.jsx(g,{className:"text-primary hover:underline",params:{id:t.SubnetId},to:"/ec2/describe-subnets/$id",children:t.SubnetId})}),e.jsx(a,{label:"CIDR Block",value:t.CidrBlock}),e.jsx(a,{label:"Availability Zone",value:t.AvailabilityZone}),e.jsx(a,{label:"State",value:t.State})]},t.SubnetId):null)]})]}),e.jsx(V,{description:`Are you sure you want to delete the VPC "${s.VpcId}"? This action cannot be undone. The VPC must have no associated subnets or internet gateways.`,isPending:r.isPending,onConfirm:h,onOpenChange:i,open:j,title:"Delete VPC"})]})}export{Q as component};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{c as T,aL as q,u as D,j as s,aM as J,B as L}from"./index.js";import{a as K,u as U}from"./zod.js";import{u as W}from"./useSuspenseQuery.js";import{B as Q}from"./back-link.js";import{E as X}from"./error-banner.js";import{P as Y}from"./page-heading.js";import{F as Z,a as ee,b as se}from"./field.js";import{I as te}from"./input.js";import{h as ie}from"./ec2.js";import{m as re}from"./ec22.js";function xe(){const e=T.c(58),{id:R}=q.useParams(),o=D();let S;e[0]!==R?(S=J(R),e[0]=R,e[1]=S):S=e[1];const{data:H}=W(S),A=H.Volumes?.[0],t=A?.VolumeId,r=ie(),i=A?.Size??1;let a;e[2]!==i?(a=K(re.refine(l=>l.size>i,{message:`New size must be greater than current size (${i} GiB)`,path:["size"]})),e[2]=i,e[3]=a):a=e[3];let n;e[4]!==i?(n={size:i},e[4]=i,e[5]=n):n=e[5];let B;e[6]!==a||e[7]!==n?(B={resolver:a,defaultValues:n},e[6]=a,e[7]=n,e[8]=B):B=e[8];const{handleSubmit:k,register:E,formState:O}=U(B),{errors:V,isSubmitting:$}=O;if(!t){let l;return e[9]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(s.Fragment,{children:[s.jsx(Q,{to:"/ec2/describe-volumes",children:"Back to volumes"}),s.jsx("p",{className:"text-muted-foreground",children:"Volume not found."})]}),e[9]=l):l=e[9],l}let F;e[10]!==r||e[11]!==o||e[12]!==t?(F=async l=>{await r.mutateAsync({...l,volumeId:t}),o({to:"/ec2/describe-volumes/$id",params:{id:t}})},e[10]=r,e[11]=o,e[12]=t,e[13]=F):F=e[13];const w=F;let m,c;e[14]!==t?(m=s.jsx(Q,{params:{id:t},to:"/ec2/describe-volumes/$id",children:"Back to volume"}),c=s.jsx(Y,{subtitle:t,title:"Resize Volume"}),e[14]=t,e[15]=m,e[16]=c):(m=e[15],c=e[16]);let u;e[17]!==r.error?(u=r.error&&s.jsx(X,{error:r.error,msg:"Failed to resize volume"}),e[17]=r.error,e[18]=u):u=e[18];let d;e[19]!==k||e[20]!==w?(d=k(w),e[19]=k,e[20]=w,e[21]=d):d=e[21];let f;e[22]!==i?(f=s.jsx("div",{className:"space-y-2",children:s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Current size: ",i," GiB"]})}),e[22]=i,e[23]=f):f=e[23];let N;e[24]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(ee,{children:s.jsx("label",{htmlFor:"size",children:"New size (GiB)"})}),e[24]=N):N=e[24];const I=!!V.size,M=i+1;let p;e[25]!==E?(p=E("size",{valueAsNumber:!0}),e[25]=E,e[26]=p):p=e[26];let x;e[27]!==I||e[28]!==M||e[29]!==p?(x=s.jsx(te,{"aria-invalid":I,id:"size",min:M,type:"number",...p}),e[27]=I,e[28]=M,e[29]=p,e[30]=x):x=e[30];let h;e[31]!==V.size?(h=s.jsx(Z,{errors:[V.size]}),e[31]=V.size,e[32]=h):h=e[32];let b;e[33]!==x||e[34]!==h?(b=s.jsxs(se,{children:[N,x,h]}),e[33]=x,e[34]=h,e[35]=b):b=e[35];const _=$||r.isPending;let j;e[36]!==o||e[37]!==t?(j=()=>o({to:"/ec2/describe-volumes/$id",params:{id:t}}),e[36]=o,e[37]=t,e[38]=j):j=e[38];let z;e[39]!==_||e[40]!==j?(z=s.jsx(L,{disabled:_,onClick:j,type:"button",variant:"outline",children:"Cancel"}),e[39]=_,e[40]=j,e[41]=z):z=e[41];const C=$||r.isPending,G=$||r.isPending?"Resizing…":"Resize Volume";let g;e[42]!==C||e[43]!==G?(g=s.jsx(L,{disabled:C,type:"submit",children:G}),e[42]=C,e[43]=G,e[44]=g):g=e[44];let v;e[45]!==z||e[46]!==g?(v=s.jsxs("div",{className:"flex gap-2",children:[z,g]}),e[45]=z,e[46]=g,e[47]=v):v=e[47];let y;e[48]!==f||e[49]!==b||e[50]!==v||e[51]!==d?(y=s.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:d,children:[f,b,v]}),e[48]=f,e[49]=b,e[50]=v,e[51]=d,e[52]=y):y=e[52];let P;return e[53]!==y||e[54]!==m||e[55]!==c||e[56]!==u?(P=s.jsxs(s.Fragment,{children:[m,c,u,y]}),e[53]=y,e[54]=m,e[55]=c,e[56]=u,e[57]=P):P=e[57],P}export{xe as component};
|
||||
import{c as A,aL as G,u as C,j as s,aM as Q}from"./index.js";import{a as H,u as O}from"./zod.js";import{u as T}from"./useSuspenseQuery.js";import{B as L}from"./back-link.js";import{E as q}from"./error-banner.js";import{F as D}from"./form-actions.js";import{P as J}from"./page-heading.js";import{F as K,a as U,b as W}from"./field.js";import{I as X}from"./input.js";import{h as Y}from"./ec2.js";import{m as Z}from"./ec22.js";function ue(){const e=A.c(53),{id:N}=G.useParams(),l=C();let v;e[0]!==N?(v=Q(N),e[0]=N,e[1]=v):v=e[1];const{data:M}=T(v),I=M.Volumes?.[0],t=I?.VolumeId,r=Y(),i=I?.Size??1;let m;e[2]!==i?(m=H(Z.refine(o=>o.size>i,{message:`New size must be greater than current size (${i} GiB)`,path:["size"]})),e[2]=i,e[3]=m):m=e[3];let a;e[4]!==i?(a={size:i},e[4]=i,e[5]=a):a=e[5];let y;e[6]!==m||e[7]!==a?(y={resolver:m,defaultValues:a},e[6]=m,e[7]=a,e[8]=y):y=e[8];const{handleSubmit:P,register:R,formState:_}=O(y),{errors:F,isSubmitting:E}=_;if(!t){let o;return e[9]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(s.Fragment,{children:[s.jsx(L,{to:"/ec2/describe-volumes",children:"Back to volumes"}),s.jsx("p",{className:"text-muted-foreground",children:"Volume not found."})]}),e[9]=o):o=e[9],o}let S;e[10]!==r||e[11]!==l||e[12]!==t?(S=async o=>{await r.mutateAsync({...o,volumeId:t}),l({to:"/ec2/describe-volumes/$id",params:{id:t}})},e[10]=r,e[11]=l,e[12]=t,e[13]=S):S=e[13];const $=S;let n,c;e[14]!==t?(n=s.jsx(L,{params:{id:t},to:"/ec2/describe-volumes/$id",children:"Back to volume"}),c=s.jsx(J,{subtitle:t,title:"Resize Volume"}),e[14]=t,e[15]=n,e[16]=c):(n=e[15],c=e[16]);let u;e[17]!==r.error?(u=r.error&&s.jsx(q,{error:r.error,msg:"Failed to resize volume"}),e[17]=r.error,e[18]=u):u=e[18];let d;e[19]!==P||e[20]!==$?(d=P($),e[19]=P,e[20]=$,e[21]=d):d=e[21];let f;e[22]!==i?(f=s.jsx("div",{className:"space-y-2",children:s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Current size: ",i," GiB"]})}),e[22]=i,e[23]=f):f=e[23];let V;e[24]===Symbol.for("react.memo_cache_sentinel")?(V=s.jsx(U,{children:s.jsx("label",{htmlFor:"size",children:"New size (GiB)"})}),e[24]=V):V=e[24];const k=!!F.size,w=i+1;let p;e[25]!==R?(p=R("size",{valueAsNumber:!0}),e[25]=R,e[26]=p):p=e[26];let x;e[27]!==k||e[28]!==w||e[29]!==p?(x=s.jsx(X,{"aria-invalid":k,id:"size",min:w,type:"number",...p}),e[27]=k,e[28]=w,e[29]=p,e[30]=x):x=e[30];let z;e[31]!==F.size?(z=s.jsx(K,{errors:[F.size]}),e[31]=F.size,e[32]=z):z=e[32];let b;e[33]!==x||e[34]!==z?(b=s.jsxs(W,{children:[V,x,z]}),e[33]=x,e[34]=z,e[35]=b):b=e[35];let g;e[36]!==l||e[37]!==t?(g=()=>l({to:"/ec2/describe-volumes/$id",params:{id:t}}),e[36]=l,e[37]=t,e[38]=g):g=e[38];let h;e[39]!==E||e[40]!==r.isPending||e[41]!==g?(h=s.jsx(D,{isPending:r.isPending,isSubmitting:E,onCancel:g,pendingLabel:"Resizing\\u2026",submitLabel:"Resize Volume"}),e[39]=E,e[40]=r.isPending,e[41]=g,e[42]=h):h=e[42];let j;e[43]!==f||e[44]!==b||e[45]!==h||e[46]!==d?(j=s.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:d,children:[f,b,h]}),e[43]=f,e[44]=b,e[45]=h,e[46]=d,e[47]=j):j=e[47];let B;return e[48]!==j||e[49]!==n||e[50]!==c||e[51]!==u?(B=s.jsxs(s.Fragment,{children:[n,c,u,j]}),e[48]=j,e[49]=n,e[50]=c,e[51]=u,e[52]=B):B=e[52],B}export{ue as component};
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{cX as x,u as j,cY as p,r as h,j as e,B as D,L as g}from"./index.js";import{u as S}from"./useSuspenseQuery.js";import{B as o}from"./back-link.js";import{D as l,a as s}from"./detail-row.js";import{E as f}from"./error-banner.js";import{P as v}from"./page-heading.js";import{S as A}from"./state-badge.js";import{g as I,f as y,b as C,a as B,c as P,d as k,e as N,h as w}from"./alert-dialog.js";import{l as F}from"./ec2.js";import{T as L}from"./trash-2.js";function $(){const{id:r}=x.useParams(),c=j(),{data:u}=S(p(r)),t=u.Subnets?.[0],a=F(),[d,n]=h.useState(!1),b=async()=>{try{await a.mutateAsync(r),c({to:"/ec2/describe-subnets"})}finally{n(!1)}};if(!t?.SubnetId)return e.jsxs(e.Fragment,{children:[e.jsx(o,{to:"/ec2/describe-subnets",children:"Back to Subnets"}),e.jsx("p",{className:"text-muted-foreground",children:"Subnet not found."})]});const i=t.Tags?.find(m=>m.Key==="Name")?.Value;return e.jsxs(e.Fragment,{children:[e.jsx(o,{to:"/ec2/describe-subnets",children:"Back to Subnets"}),a.error&&e.jsx(f,{error:a.error,msg:"Failed to delete subnet"}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(v,{actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(D,{onClick:()=>n(!0),size:"sm",variant:"destructive",children:[e.jsx(L,{className:"size-4"}),"Delete"]}),e.jsx(A,{state:t.State})]}),subtitle:"Subnet Details",title:i?`${t.SubnetId} (${i})`:t.SubnetId}),e.jsxs(l,{children:[e.jsx(l.Header,{children:"Subnet Information"}),e.jsxs(l.Content,{children:[e.jsx(s,{label:"Subnet ID",value:t.SubnetId}),e.jsx(s,{label:"VPC ID",value:t.VpcId?e.jsx(g,{className:"text-primary hover:underline",params:{id:t.VpcId},to:"/ec2/describe-vpcs/$id",children:t.VpcId}):"—"}),e.jsx(s,{label:"State",value:t.State}),e.jsx(s,{label:"CIDR Block",value:t.CidrBlock}),e.jsx(s,{label:"Availability Zone",value:t.AvailabilityZone}),e.jsx(s,{label:"Available IP Count",value:t.AvailableIpAddressCount?.toString()}),e.jsx(s,{label:"Map Public IP on Launch",value:t.MapPublicIpOnLaunch?"Yes":"No"}),e.jsx(s,{label:"Default for AZ",value:t.DefaultForAz?"Yes":"No"})]})]})]}),e.jsx(I,{onOpenChange:n,open:d,children:e.jsxs(y,{children:[e.jsxs(C,{children:[e.jsx(B,{children:"Delete Subnet"}),e.jsxs(P,{children:['Are you sure you want to delete the subnet "',t.SubnetId,'"? This action cannot be undone.']})]}),e.jsxs(k,{children:[e.jsx(N,{children:"Cancel"}),e.jsx(w,{disabled:a.isPending,onClick:b,children:a.isPending?"Deleting…":"Delete"})]})]})})]})}export{$ as component};
|
||||
import{cX as p,u as x,cY as j,r as f,j as e,B as S,L as h}from"./index.js";import{u as D}from"./useSuspenseQuery.js";import{B as l}from"./back-link.js";import{D as v}from"./delete-confirmation-dialog.js";import{D as o,a as s}from"./detail-row.js";import{E as g}from"./error-banner.js";import{P as I}from"./page-heading.js";import{S as y}from"./state-badge.js";import{l as C}from"./ec2.js";import{T as B}from"./trash-2.js";import"./alert-dialog.js";function $(){const{id:r}=p.useParams(),u=x(),{data:c}=D(j(r)),t=c.Subnets?.[0],a=C(),[d,n]=f.useState(!1),m=async()=>{try{await a.mutateAsync(r),u({to:"/ec2/describe-subnets"})}finally{n(!1)}};if(!t?.SubnetId)return e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/ec2/describe-subnets",children:"Back to Subnets"}),e.jsx("p",{className:"text-muted-foreground",children:"Subnet not found."})]});const i=t.Tags?.find(b=>b.Key==="Name")?.Value;return e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/ec2/describe-subnets",children:"Back to Subnets"}),a.error&&e.jsx(g,{error:a.error,msg:"Failed to delete subnet"}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(I,{actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(S,{onClick:()=>n(!0),size:"sm",variant:"destructive",children:[e.jsx(B,{className:"size-4"}),"Delete"]}),e.jsx(y,{state:t.State})]}),subtitle:"Subnet Details",title:i?`${t.SubnetId} (${i})`:t.SubnetId}),e.jsxs(o,{children:[e.jsx(o.Header,{children:"Subnet Information"}),e.jsxs(o.Content,{children:[e.jsx(s,{label:"Subnet ID",value:t.SubnetId}),e.jsx(s,{label:"VPC ID",value:t.VpcId?e.jsx(h,{className:"text-primary hover:underline",params:{id:t.VpcId},to:"/ec2/describe-vpcs/$id",children:t.VpcId}):"—"}),e.jsx(s,{label:"State",value:t.State}),e.jsx(s,{label:"CIDR Block",value:t.CidrBlock}),e.jsx(s,{label:"Availability Zone",value:t.AvailabilityZone}),e.jsx(s,{label:"Available IP Count",value:t.AvailableIpAddressCount?.toString()}),e.jsx(s,{label:"Map Public IP on Launch",value:t.MapPublicIpOnLaunch?"Yes":"No"}),e.jsx(s,{label:"Default for AZ",value:t.DefaultForAz?"Yes":"No"})]})]})]}),e.jsx(v,{description:`Are you sure you want to delete the subnet "${t.SubnetId}"? This action cannot be undone.`,isPending:a.isPending,onConfirm:m,onOpenChange:n,open:d,title:"Delete Subnet"})]})}export{$ as component};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{J as R,cZ as E,u as V,c_ as O,f as L,r as l,j as e,z as H,B as u,L as M}from"./index.js";import{u as m}from"./useSuspenseQuery.js";import{B as x}from"./back-link.js";import{D as c,a as t}from"./detail-row.js";import{E as j}from"./error-banner.js";import{P as Q}from"./page-heading.js";import{S as _}from"./state-badge.js";import{g,f as D,b as y,a as S,c as f,d as C,e as b,h as v}from"./alert-dialog.js";import{b as $,a as G}from"./field.js";import{I as J}from"./input.js";import{m as Y,n as Z}from"./ec2.js";import{T as q}from"./trash-2.js";const K=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],U=R("copy",K);function de(){const{id:n}=E.useParams(),I=V(),{data:A}=m(O(n)),{data:k}=m(L),s=A.Snapshots?.[0],a=Y(),o=Z(),[w,i]=l.useState(!1),[N,r]=l.useState(!1),[d,p]=l.useState(""),B=k.Regions?.[0]?.RegionName??"ap-southeast-2",h=s?.State==="completed",P=async()=>{try{await a.mutateAsync(n),I({to:"/ec2/describe-snapshots"})}finally{i(!1)}},T=async()=>{try{await o.mutateAsync({sourceSnapshotId:n,sourceRegion:B,description:d||void 0}),r(!1),p("")}catch{}};if(!s?.SnapshotId)return e.jsxs(e.Fragment,{children:[e.jsx(x,{to:"/ec2/describe-snapshots",children:"Back to snapshots"}),e.jsx("p",{className:"text-muted-foreground",children:"Snapshot not found."})]});const z=H(s.StartTime);return e.jsxs(e.Fragment,{children:[e.jsx(x,{to:"/ec2/describe-snapshots",children:"Back to snapshots"}),a.error&&e.jsx(j,{error:a.error,msg:"Failed to delete snapshot"}),o.error&&e.jsx(j,{error:o.error,msg:"Failed to copy snapshot"}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(Q,{actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(u,{disabled:!h,onClick:()=>i(!0),size:"sm",variant:"destructive",children:[e.jsx(q,{className:"size-4"}),"Delete"]}),e.jsxs(u,{disabled:!h,onClick:()=>r(!0),size:"sm",variant:"outline",children:[e.jsx(U,{className:"size-4"}),"Copy Snapshot"]}),e.jsx(_,{state:s.State})]}),subtitle:"EC2 Snapshot Details",title:s.SnapshotId}),e.jsxs(c,{children:[e.jsx(c.Header,{children:"Snapshot Information"}),e.jsxs(c.Content,{children:[e.jsx(t,{label:"Snapshot ID",value:s.SnapshotId}),e.jsx(t,{label:"Volume ID",value:s.VolumeId?e.jsx(M,{className:"text-primary hover:underline",params:{id:s.VolumeId},to:"/ec2/describe-volumes/$id",children:s.VolumeId}):void 0}),e.jsx(t,{label:"Volume Size",value:`${s.VolumeSize} GiB`}),e.jsx(t,{label:"State",value:s.State}),e.jsx(t,{label:"Description",value:s.Description}),e.jsx(t,{label:"Progress",value:s.Progress}),e.jsx(t,{label:"Start Time",value:z}),e.jsx(t,{label:"Owner ID",value:s.OwnerId}),e.jsx(t,{label:"Encrypted",value:s.Encrypted?"Yes":"No"})]})]})]}),e.jsx(g,{onOpenChange:i,open:w,children:e.jsxs(D,{children:[e.jsxs(y,{children:[e.jsx(S,{children:"Delete Snapshot"}),e.jsxs(f,{children:['Are you sure you want to delete the snapshot "',s.SnapshotId,'"? This action cannot be undone.']})]}),e.jsxs(C,{children:[e.jsx(b,{children:"Cancel"}),e.jsx(v,{disabled:a.isPending,onClick:P,children:a.isPending?"Deleting…":"Delete"})]})]})}),e.jsx(g,{onOpenChange:r,open:N,children:e.jsxs(D,{children:[e.jsxs(y,{children:[e.jsx(S,{children:"Copy Snapshot"}),e.jsx(f,{children:"Create a copy of this snapshot in the current region."})]}),e.jsxs($,{children:[e.jsx(G,{children:e.jsx("label",{htmlFor:"copyDescription",children:"Description (optional)"})}),e.jsx(J,{id:"copyDescription",onChange:F=>p(F.target.value),placeholder:"Description for the snapshot copy",value:d})]}),e.jsxs(C,{children:[e.jsx(b,{children:"Cancel"}),e.jsx(v,{disabled:o.isPending,onClick:T,children:o.isPending?"Copying…":"Copy Snapshot"})]})]})})]})}export{de as component};
|
||||
import{J as w,cZ as k,u as N,c_ as B,f as P,r as l,j as e,i as T,B as m,L as F}from"./index.js";import{u}from"./useSuspenseQuery.js";import{B as x}from"./back-link.js";import{D as R}from"./delete-confirmation-dialog.js";import{D as c,a as t}from"./detail-row.js";import{E as g}from"./error-banner.js";import{P as z}from"./page-heading.js";import{S as E}from"./state-badge.js";import{g as V,f as O,b as L,a as H,c as M,d as Q,e as _,h as $}from"./alert-dialog.js";import{b as G,a as J}from"./field.js";import{I as Y}from"./input.js";import{m as Z,n as q}from"./ec2.js";import{T as K}from"./trash-2.js";const U=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],W=w("copy",U);function he(){const{id:n}=k.useParams(),j=N(),{data:D}=u(B(n)),{data:y}=u(P),s=D.Snapshots?.[0],a=Z(),o=q(),[S,i]=l.useState(!1),[f,r]=l.useState(!1),[p,d]=l.useState(""),C=y.Regions?.[0]?.RegionName??"ap-southeast-2",h=s?.State==="completed",v=async()=>{try{await a.mutateAsync(n),j({to:"/ec2/describe-snapshots"})}finally{i(!1)}},b=async()=>{try{await o.mutateAsync({sourceSnapshotId:n,sourceRegion:C,description:p||void 0}),r(!1),d("")}catch{}};if(!s?.SnapshotId)return e.jsxs(e.Fragment,{children:[e.jsx(x,{to:"/ec2/describe-snapshots",children:"Back to snapshots"}),e.jsx("p",{className:"text-muted-foreground",children:"Snapshot not found."})]});const I=T(s.StartTime);return e.jsxs(e.Fragment,{children:[e.jsx(x,{to:"/ec2/describe-snapshots",children:"Back to snapshots"}),a.error&&e.jsx(g,{error:a.error,msg:"Failed to delete snapshot"}),o.error&&e.jsx(g,{error:o.error,msg:"Failed to copy snapshot"}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(z,{actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(m,{disabled:!h,onClick:()=>i(!0),size:"sm",variant:"destructive",children:[e.jsx(K,{className:"size-4"}),"Delete"]}),e.jsxs(m,{disabled:!h,onClick:()=>r(!0),size:"sm",variant:"outline",children:[e.jsx(W,{className:"size-4"}),"Copy Snapshot"]}),e.jsx(E,{state:s.State})]}),subtitle:"EC2 Snapshot Details",title:s.SnapshotId}),e.jsxs(c,{children:[e.jsx(c.Header,{children:"Snapshot Information"}),e.jsxs(c.Content,{children:[e.jsx(t,{label:"Snapshot ID",value:s.SnapshotId}),e.jsx(t,{label:"Volume ID",value:s.VolumeId?e.jsx(F,{className:"text-primary hover:underline",params:{id:s.VolumeId},to:"/ec2/describe-volumes/$id",children:s.VolumeId}):void 0}),e.jsx(t,{label:"Volume Size",value:`${s.VolumeSize} GiB`}),e.jsx(t,{label:"State",value:s.State}),e.jsx(t,{label:"Description",value:s.Description}),e.jsx(t,{label:"Progress",value:s.Progress}),e.jsx(t,{label:"Start Time",value:I}),e.jsx(t,{label:"Owner ID",value:s.OwnerId}),e.jsx(t,{label:"Encrypted",value:s.Encrypted?"Yes":"No"})]})]})]}),e.jsx(R,{description:`Are you sure you want to delete the snapshot "${s.SnapshotId}"? This action cannot be undone.`,isPending:a.isPending,onConfirm:v,onOpenChange:i,open:S,title:"Delete Snapshot"}),e.jsx(V,{onOpenChange:r,open:f,children:e.jsxs(O,{children:[e.jsxs(L,{children:[e.jsx(H,{children:"Copy Snapshot"}),e.jsx(M,{children:"Create a copy of this snapshot in the current region."})]}),e.jsxs(G,{children:[e.jsx(J,{children:e.jsx("label",{htmlFor:"copyDescription",children:"Description (optional)"})}),e.jsx(Y,{id:"copyDescription",onChange:A=>d(A.target.value),placeholder:"Description for the snapshot copy",value:p})]}),e.jsxs(Q,{children:[e.jsx(_,{children:"Cancel"}),e.jsx($,{disabled:o.isPending,onClick:b,children:o.isPending?"Copying…":"Copy Snapshot"})]})]})})]})}export{he as component};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{c$ as x,u as p,d0 as h,r as j,j as e,z as g,B as D}from"./index.js";import{u as K}from"./useSuspenseQuery.js";import{B as o}from"./back-link.js";import{D as s,a as r}from"./detail-row.js";import{E as f}from"./error-banner.js";import{P as b}from"./page-heading.js";import{g as P,f as k,b as T,a as A,c as C,d as v,e as N,h as w}from"./alert-dialog.js";import{o as B}from"./ec2.js";import{T as F}from"./trash-2.js";function M(){const{id:l}=x.useParams(),c=p(),{data:d}=K(h(l)),a=d.KeyPairs?.[0],i=B(),[y,t]=j.useState(!1),m=async()=>{try{await i.mutateAsync(l),c({to:"/ec2/describe-key-pairs"})}finally{t(!1)}};if(!a?.KeyPairId)return e.jsxs(e.Fragment,{children:[e.jsx(o,{to:"/ec2/describe-key-pairs",children:"Back to key pairs"}),e.jsx("p",{className:"text-muted-foreground",children:"Key pair not found."})]});const u=g(a.CreateTime);return e.jsxs(e.Fragment,{children:[e.jsx(o,{to:"/ec2/describe-key-pairs",children:"Back to key pairs"}),i.error&&e.jsx(f,{error:i.error,msg:"Failed to delete key pair"}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(b,{actions:e.jsxs(D,{onClick:()=>t(!0),size:"sm",variant:"destructive",children:[e.jsx(F,{className:"size-4"}),"Delete"]}),subtitle:"EC2 Key Pair Details",title:a.KeyName??""}),e.jsxs(s,{children:[e.jsx(s.Header,{children:"Key Pair Information"}),e.jsxs(s.Content,{children:[e.jsx(r,{label:"Key Name",value:a.KeyName}),e.jsx(r,{label:"Key Pair ID",value:a.KeyPairId}),e.jsx(r,{label:"Key Type",value:a.KeyType}),e.jsx(r,{label:"Key Fingerprint",value:a.KeyFingerprint}),e.jsx(r,{label:"Creation Date",value:u})]})]}),a.Tags&&a.Tags.length>0&&e.jsxs(s,{children:[e.jsx(s.Header,{children:"Tags"}),e.jsx(s.Content,{children:a.Tags.map(n=>e.jsx(r,{label:n.Key||"",value:n.Value},n.Key))})]})]}),e.jsx(P,{onOpenChange:t,open:y,children:e.jsxs(k,{children:[e.jsxs(T,{children:[e.jsx(A,{children:"Delete Key Pair"}),e.jsxs(C,{children:['Are you sure you want to delete the key pair "',a.KeyName,'"? This action cannot be undone. Any instances using this key pair will no longer be able to be accessed with it.']})]}),e.jsxs(v,{children:[e.jsx(N,{children:"Cancel"}),e.jsx(w,{disabled:i.isPending,onClick:m,children:i.isPending?"Deleting…":"Delete"})]})]})})]})}export{M as component};
|
||||
import{c$ as p,u as x,d0 as j,r as h,j as e,i as g,B as K}from"./index.js";import{u as f}from"./useSuspenseQuery.js";import{B as l}from"./back-link.js";import{D}from"./delete-confirmation-dialog.js";import{D as s,a as r}from"./detail-row.js";import{E as P}from"./error-banner.js";import{P as b}from"./page-heading.js";import{o as k}from"./ec2.js";import{T}from"./trash-2.js";import"./alert-dialog.js";function R(){const{id:o}=p.useParams(),c=x(),{data:m}=f(j(o)),a=m.KeyPairs?.[0],t=k(),[y,i]=h.useState(!1),d=async()=>{try{await t.mutateAsync(o),c({to:"/ec2/describe-key-pairs"})}finally{i(!1)}};if(!a?.KeyPairId)return e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/ec2/describe-key-pairs",children:"Back to key pairs"}),e.jsx("p",{className:"text-muted-foreground",children:"Key pair not found."})]});const u=g(a.CreateTime);return e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/ec2/describe-key-pairs",children:"Back to key pairs"}),t.error&&e.jsx(P,{error:t.error,msg:"Failed to delete key pair"}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(b,{actions:e.jsxs(K,{onClick:()=>i(!0),size:"sm",variant:"destructive",children:[e.jsx(T,{className:"size-4"}),"Delete"]}),subtitle:"EC2 Key Pair Details",title:a.KeyName??""}),e.jsxs(s,{children:[e.jsx(s.Header,{children:"Key Pair Information"}),e.jsxs(s.Content,{children:[e.jsx(r,{label:"Key Name",value:a.KeyName}),e.jsx(r,{label:"Key Pair ID",value:a.KeyPairId}),e.jsx(r,{label:"Key Type",value:a.KeyType}),e.jsx(r,{label:"Key Fingerprint",value:a.KeyFingerprint}),e.jsx(r,{label:"Creation Date",value:u})]})]}),a.Tags&&a.Tags.length>0&&e.jsxs(s,{children:[e.jsx(s.Header,{children:"Tags"}),e.jsx(s.Content,{children:a.Tags.map(n=>e.jsx(r,{label:n.Key||"",value:n.Value},n.Key))})]})]}),e.jsx(D,{description:`Are you sure you want to delete the key pair "${a.KeyName}"? This action cannot be undone. Any instances using this key pair will no longer be able to be accessed with it.`,isPending:t.isPending,onConfirm:d,onOpenChange:i,open:y,title:"Delete Key Pair"})]})}export{R as component};
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{c as h,j as e,av as j,u as f,aw as P,r as g,ax as v,B as A,z as N}from"./index.js";import{u}from"./useSuspenseQuery.js";import{B as p}from"./back-link.js";import{D as n,a as l}from"./detail-row.js";import{E as b}from"./error-banner.js";import{P as C}from"./page-heading.js";import{g as w,f as I,b as B,a as R,c as k,d as E,e as O,h as S}from"./alert-dialog.js";import{h as T}from"./iam.js";import{T as V}from"./trash-2.js";function F(r){const t=h.c(4),{document:a}=r;let i;try{let s;t[0]!==a?(s=JSON.stringify(JSON.parse(a),null,2),t[0]=a,t[1]=s):s=t[1],i=s}catch{i=a}let o;return t[2]!==i?(o=e.jsx("pre",{className:"overflow-auto rounded-md border bg-muted p-4 font-mono text-sm",children:i}),t[2]=i,t[3]=o):o=t[3],o}function G(){const{policyArn:r}=j.useParams(),t=decodeURIComponent(r),a=f(),{data:i}=u(P(t)),o=i.Policy,s=T(),[x,c]=g.useState(!1),y=o?.DefaultVersionId??"v1",{data:d}=u(v(t,y)),m=d?.PolicyVersion?.Document?decodeURIComponent(d.PolicyVersion.Document):null,D=async()=>{try{await s.mutateAsync(t),a({to:"/iam/list-policies"})}finally{c(!1)}};return o?e.jsxs(e.Fragment,{children:[e.jsx(p,{to:"/iam/list-policies",children:"Back to policies"}),s.error&&e.jsx(b,{error:s.error,msg:"Failed to delete policy"}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(C,{actions:e.jsxs(A,{onClick:()=>c(!0),size:"sm",variant:"destructive",children:[e.jsx(V,{className:"size-4"}),"Delete"]}),subtitle:"IAM Policy Details",title:o.PolicyName??""}),e.jsxs(n,{children:[e.jsx(n.Header,{children:"Policy Information"}),e.jsxs(n.Content,{children:[e.jsx(l,{label:"Policy Name",value:o.PolicyName}),e.jsx(l,{label:"Policy ID",value:o.PolicyId}),e.jsx(l,{label:"ARN",value:o.Arn}),e.jsx(l,{label:"Path",value:o.Path}),e.jsx(l,{label:"Description",value:o.Description||"-"}),e.jsx(l,{label:"Created",value:N(o.CreateDate)})]})]}),m&&e.jsxs(n,{children:[e.jsx(n.Header,{children:"Policy Document"}),e.jsx("div",{className:"p-4",children:e.jsx(F,{document:m})})]})]}),e.jsx(w,{onOpenChange:c,open:x,children:e.jsxs(I,{children:[e.jsxs(B,{children:[e.jsx(R,{children:"Delete Policy"}),e.jsxs(k,{children:['Are you sure you want to delete the policy "',o.PolicyName,'"? This action cannot be undone.']})]}),e.jsxs(E,{children:[e.jsx(O,{children:"Cancel"}),e.jsx(S,{disabled:s.isPending,onClick:D,children:s.isPending?"Deleting...":"Delete"})]})]})})]}):e.jsxs(e.Fragment,{children:[e.jsx(p,{to:"/iam/list-policies",children:"Back to policies"}),e.jsx("p",{className:"text-muted-foreground",children:"Policy not found."})]})}export{G as component};
|
||||
import{c as f,j as e,av as j,u as P,aw as h,r as v,ax as g,B as N,i as b}from"./index.js";import{u}from"./useSuspenseQuery.js";import{B as p}from"./back-link.js";import{D as C}from"./delete-confirmation-dialog.js";import{D as l,a as n}from"./detail-row.js";import{E as w}from"./error-banner.js";import{P as A}from"./page-heading.js";import{h as I}from"./iam.js";import{T as B}from"./trash-2.js";import"./alert-dialog.js";function R(r){const t=f.c(4),{document:a}=r;let s;try{let i;t[0]!==a?(i=JSON.stringify(JSON.parse(a),null,2),t[0]=a,t[1]=i):i=t[1],s=i}catch{s=a}let o;return t[2]!==s?(o=e.jsx("pre",{className:"overflow-auto rounded-md border bg-muted p-4 font-mono text-sm",children:s}),t[2]=s,t[3]=o):o=t[3],o}function J(){const{policyArn:r}=j.useParams(),t=decodeURIComponent(r),a=P(),{data:s}=u(h(t)),o=s.Policy,i=I(),[y,c]=v.useState(!1),x=o?.DefaultVersionId??"v1",{data:m}=u(g(t,x)),d=m?.PolicyVersion?.Document?decodeURIComponent(m.PolicyVersion.Document):null,D=async()=>{try{await i.mutateAsync(t),a({to:"/iam/list-policies"})}finally{c(!1)}};return o?e.jsxs(e.Fragment,{children:[e.jsx(p,{to:"/iam/list-policies",children:"Back to policies"}),i.error&&e.jsx(w,{error:i.error,msg:"Failed to delete policy"}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(A,{actions:e.jsxs(N,{onClick:()=>c(!0),size:"sm",variant:"destructive",children:[e.jsx(B,{className:"size-4"}),"Delete"]}),subtitle:"IAM Policy Details",title:o.PolicyName??""}),e.jsxs(l,{children:[e.jsx(l.Header,{children:"Policy Information"}),e.jsxs(l.Content,{children:[e.jsx(n,{label:"Policy Name",value:o.PolicyName}),e.jsx(n,{label:"Policy ID",value:o.PolicyId}),e.jsx(n,{label:"ARN",value:o.Arn}),e.jsx(n,{label:"Path",value:o.Path}),e.jsx(n,{label:"Description",value:o.Description||"-"}),e.jsx(n,{label:"Created",value:b(o.CreateDate)})]})]}),d&&e.jsxs(l,{children:[e.jsx(l.Header,{children:"Policy Document"}),e.jsx("div",{className:"p-4",children:e.jsx(R,{document:d})})]})]}),e.jsx(C,{description:`Are you sure you want to delete the policy "${o.PolicyName}"? This action cannot be undone.`,isPending:i.isPending,onConfirm:D,onOpenChange:c,open:y,title:"Delete Policy"})]}):e.jsxs(e.Fragment,{children:[e.jsx(p,{to:"/iam/list-policies",children:"Back to policies"}),e.jsx("p",{className:"text-muted-foreground",children:"Policy not found."})]})}export{J as component};
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{c as g,z,j as t,L as M}from"./index.js";import{D as T,a}from"./detail-row.js";function C(s){const e=g.c(58),{image:l,showExtendedDetails:P}=s,i=P===void 0?!1:P;let E;e[0]!==l.CreationDate?(E=z(l.CreationDate),e[0]=l.CreationDate,e[1]=E):E=e[1];const R=E,S=i?"AMI Information":"AMI Details";let o;e[2]!==S?(o=t.jsx(T.Header,{children:S}),e[2]=S,e[3]=o):o=e[3];let r;e[4]!==l.ImageId||e[5]!==i?(r=l.ImageId&&!i?t.jsx(M,{className:"text-primary hover:underline",params:{id:l.ImageId},to:"/ec2/describe-images/$id",children:l.ImageId}):l.ImageId,e[4]=l.ImageId,e[5]=i,e[6]=r):r=e[6];let c;e[7]!==r?(c=t.jsx(a,{label:"AMI ID",value:r}),e[7]=r,e[8]=c):c=e[8];let n;e[9]!==l.Name?(n=t.jsx(a,{label:"AMI Name",value:l.Name}),e[9]=l.Name,e[10]=n):n=e[10];let u;e[11]!==l.Description?(u=t.jsx(a,{label:"Description",value:l.Description}),e[11]=l.Description,e[12]=u):u=e[12];let m;e[13]!==l.Architecture?(m=t.jsx(a,{label:"Architecture",value:l.Architecture}),e[13]=l.Architecture,e[14]=m):m=e[14];let v;e[15]!==l.VirtualizationType?(v=t.jsx(a,{label:"Virtualization Type",value:l.VirtualizationType}),e[15]=l.VirtualizationType,e[16]=v):v=e[16];const A=l.Platform||"Linux";let D;e[17]!==A?(D=t.jsx(a,{label:"Platform",value:A}),e[17]=A,e[18]=D):D=e[18];let d;e[19]!==l.PlatformDetails?(d=t.jsx(a,{label:"Platform Details",value:l.PlatformDetails}),e[19]=l.PlatformDetails,e[20]=d):d=e[20];let x;e[21]!==l.ImageType?(x=t.jsx(a,{label:"Image Type",value:l.ImageType}),e[21]=l.ImageType,e[22]=x):x=e[22];let b;e[23]!==l.RootDeviceType?(b=t.jsx(a,{label:"Root Device Type",value:l.RootDeviceType}),e[23]=l.RootDeviceType,e[24]=b):b=e[24];let j;e[25]!==l.RootDeviceName?(j=t.jsx(a,{label:"Root Device Name",value:l.RootDeviceName}),e[25]=l.RootDeviceName,e[26]=j):j=e[26];let f;e[27]!==l.OwnerId?(f=t.jsx(a,{label:"Owner",value:l.OwnerId}),e[27]=l.OwnerId,e[28]=f):f=e[28];let I;e[29]!==l.State?(I=t.jsx(a,{label:"State",value:l.State}),e[29]=l.State,e[30]=I):I=e[30];let h;e[31]!==R||e[32]!==l.Public||e[33]!==i?(h=i&&t.jsxs(t.Fragment,{children:[t.jsx(a,{label:"Creation Date",value:R}),t.jsx(a,{label:"Public",value:l.Public?"Yes":"No"})]}),e[31]=R,e[32]=l.Public,e[33]=i,e[34]=h):h=e[34];let p;e[35]!==v||e[36]!==D||e[37]!==d||e[38]!==x||e[39]!==b||e[40]!==j||e[41]!==f||e[42]!==I||e[43]!==h||e[44]!==c||e[45]!==n||e[46]!==u||e[47]!==m?(p=t.jsxs(T.Content,{children:[c,n,u,m,v,D,d,x,b,j,f,I,h]}),e[35]=v,e[36]=D,e[37]=d,e[38]=x,e[39]=b,e[40]=j,e[41]=f,e[42]=I,e[43]=h,e[44]=c,e[45]=n,e[46]=u,e[47]=m,e[48]=p):p=e[48];let N;e[49]!==p||e[50]!==o?(N=t.jsxs(T,{children:[o,p]}),e[49]=p,e[50]=o,e[51]=N):N=e[51];let y;e[52]!==l.BlockDeviceMappings||e[53]!==i?(y=i&&l.BlockDeviceMappings&&l.BlockDeviceMappings.length>0&&l.BlockDeviceMappings.map(k),e[52]=l.BlockDeviceMappings,e[53]=i,e[54]=y):y=e[54];let V;return e[55]!==N||e[56]!==y?(V=t.jsxs(t.Fragment,{children:[N,y]}),e[55]=N,e[56]=y,e[57]=V):V=e[57],V}function k(s){return t.jsxs(T,{children:[t.jsxs(T.Header,{children:["Block Device: ",s.DeviceName]}),t.jsxs(T.Content,{children:[t.jsx(a,{label:"Device Name",value:s.DeviceName}),s.Ebs&&t.jsxs(t.Fragment,{children:[t.jsx(a,{label:"Volume Size",value:s.Ebs.VolumeSize?`${s.Ebs.VolumeSize} GB`:void 0}),t.jsx(a,{label:"Volume Type",value:s.Ebs.VolumeType}),t.jsx(a,{label:"Delete On Termination",value:s.Ebs.DeleteOnTermination?"Yes":"No"}),t.jsx(a,{label:"Encrypted",value:s.Ebs.Encrypted?"Yes":"No"}),s.Ebs.SnapshotId&&t.jsx(a,{label:"Snapshot ID",value:t.jsx(M,{className:"text-primary hover:underline",params:{id:s.Ebs.SnapshotId},to:"/ec2/describe-snapshots/$id",children:s.Ebs.SnapshotId})})]}),s.VirtualName&&t.jsx(a,{label:"Virtual Name",value:s.VirtualName})]})]},s.DeviceName)}export{C as A};
|
||||
import{c as g,i as k,j as t,L as M}from"./index.js";import{D as T,a}from"./detail-row.js";function C(s){const e=g.c(58),{image:l,showExtendedDetails:P}=s,i=P===void 0?!1:P;let E;e[0]!==l.CreationDate?(E=k(l.CreationDate),e[0]=l.CreationDate,e[1]=E):E=e[1];const R=E,S=i?"AMI Information":"AMI Details";let o;e[2]!==S?(o=t.jsx(T.Header,{children:S}),e[2]=S,e[3]=o):o=e[3];let r;e[4]!==l.ImageId||e[5]!==i?(r=l.ImageId&&!i?t.jsx(M,{className:"text-primary hover:underline",params:{id:l.ImageId},to:"/ec2/describe-images/$id",children:l.ImageId}):l.ImageId,e[4]=l.ImageId,e[5]=i,e[6]=r):r=e[6];let c;e[7]!==r?(c=t.jsx(a,{label:"AMI ID",value:r}),e[7]=r,e[8]=c):c=e[8];let n;e[9]!==l.Name?(n=t.jsx(a,{label:"AMI Name",value:l.Name}),e[9]=l.Name,e[10]=n):n=e[10];let u;e[11]!==l.Description?(u=t.jsx(a,{label:"Description",value:l.Description}),e[11]=l.Description,e[12]=u):u=e[12];let m;e[13]!==l.Architecture?(m=t.jsx(a,{label:"Architecture",value:l.Architecture}),e[13]=l.Architecture,e[14]=m):m=e[14];let v;e[15]!==l.VirtualizationType?(v=t.jsx(a,{label:"Virtualization Type",value:l.VirtualizationType}),e[15]=l.VirtualizationType,e[16]=v):v=e[16];const A=l.Platform||"Linux";let D;e[17]!==A?(D=t.jsx(a,{label:"Platform",value:A}),e[17]=A,e[18]=D):D=e[18];let d;e[19]!==l.PlatformDetails?(d=t.jsx(a,{label:"Platform Details",value:l.PlatformDetails}),e[19]=l.PlatformDetails,e[20]=d):d=e[20];let x;e[21]!==l.ImageType?(x=t.jsx(a,{label:"Image Type",value:l.ImageType}),e[21]=l.ImageType,e[22]=x):x=e[22];let b;e[23]!==l.RootDeviceType?(b=t.jsx(a,{label:"Root Device Type",value:l.RootDeviceType}),e[23]=l.RootDeviceType,e[24]=b):b=e[24];let j;e[25]!==l.RootDeviceName?(j=t.jsx(a,{label:"Root Device Name",value:l.RootDeviceName}),e[25]=l.RootDeviceName,e[26]=j):j=e[26];let f;e[27]!==l.OwnerId?(f=t.jsx(a,{label:"Owner",value:l.OwnerId}),e[27]=l.OwnerId,e[28]=f):f=e[28];let I;e[29]!==l.State?(I=t.jsx(a,{label:"State",value:l.State}),e[29]=l.State,e[30]=I):I=e[30];let h;e[31]!==R||e[32]!==l.Public||e[33]!==i?(h=i&&t.jsxs(t.Fragment,{children:[t.jsx(a,{label:"Creation Date",value:R}),t.jsx(a,{label:"Public",value:l.Public?"Yes":"No"})]}),e[31]=R,e[32]=l.Public,e[33]=i,e[34]=h):h=e[34];let p;e[35]!==v||e[36]!==D||e[37]!==d||e[38]!==x||e[39]!==b||e[40]!==j||e[41]!==f||e[42]!==I||e[43]!==h||e[44]!==c||e[45]!==n||e[46]!==u||e[47]!==m?(p=t.jsxs(T.Content,{children:[c,n,u,m,v,D,d,x,b,j,f,I,h]}),e[35]=v,e[36]=D,e[37]=d,e[38]=x,e[39]=b,e[40]=j,e[41]=f,e[42]=I,e[43]=h,e[44]=c,e[45]=n,e[46]=u,e[47]=m,e[48]=p):p=e[48];let N;e[49]!==p||e[50]!==o?(N=t.jsxs(T,{children:[o,p]}),e[49]=p,e[50]=o,e[51]=N):N=e[51];let y;e[52]!==l.BlockDeviceMappings||e[53]!==i?(y=i&&l.BlockDeviceMappings&&l.BlockDeviceMappings.length>0&&l.BlockDeviceMappings.map(w),e[52]=l.BlockDeviceMappings,e[53]=i,e[54]=y):y=e[54];let V;return e[55]!==N||e[56]!==y?(V=t.jsxs(t.Fragment,{children:[N,y]}),e[55]=N,e[56]=y,e[57]=V):V=e[57],V}function w(s){return t.jsxs(T,{children:[t.jsxs(T.Header,{children:["Block Device: ",s.DeviceName]}),t.jsxs(T.Content,{children:[t.jsx(a,{label:"Device Name",value:s.DeviceName}),s.Ebs&&t.jsxs(t.Fragment,{children:[t.jsx(a,{label:"Volume Size",value:s.Ebs.VolumeSize?`${s.Ebs.VolumeSize} GB`:void 0}),t.jsx(a,{label:"Volume Type",value:s.Ebs.VolumeType}),t.jsx(a,{label:"Delete On Termination",value:s.Ebs.DeleteOnTermination?"Yes":"No"}),t.jsx(a,{label:"Encrypted",value:s.Ebs.Encrypted?"Yes":"No"}),s.Ebs.SnapshotId&&t.jsx(a,{label:"Snapshot ID",value:t.jsx(M,{className:"text-primary hover:underline",params:{id:s.Ebs.SnapshotId},to:"/ec2/describe-snapshots/$id",children:s.Ebs.SnapshotId})})]}),s.VirtualName&&t.jsx(a,{label:"Virtual Name",value:s.VirtualName})]})]},s.DeviceName)}export{C as A};
|
||||
|
||||
@@ -1 +1 @@
|
||||
import{o as M,i as $,c as I,u as R,j as t,B as E}from"./index.js";import{a as A,u as H}from"./zod.js";import{B as L}from"./back-link.js";import{E as O}from"./error-banner.js";import{P as T}from"./page-heading.js";import{F as q,a as D,b as G}from"./field.js";import{I as J}from"./input.js";import{u as K}from"./s3.js";const Q=M({bucketName:$().min(3,"Bucket name must be at least 3 characters").max(63,"Bucket name must be at most 63 characters").regex(/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/,"Must start and end with a lowercase letter or number").regex(/^[a-z0-9.-]+$/,"Only lowercase letters, numbers, hyphens, and periods allowed").refine(e=>!e.includes(".."),"Must not contain consecutive periods").refine(e=>!(e.includes(".-")||e.includes("-.")),"Must not contain adjacent period and hyphen")});function se(){const e=I.c(40),r=R(),s=K();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={resolver:A(Q)},e[0]=p):p=e[0];const{handleSubmit:y,register:N,formState:P}=H(p),{errors:x,isSubmitting:S}=P;let h;e[1]!==s||e[2]!==r?(h=async z=>{await s.mutateAsync(z),r({to:"/s3/ls"})},e[1]=s,e[2]=r,e[3]=h):h=e[3];const F=h;let k,j;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(L,{to:"/s3/ls",children:"Back to buckets"}),j=t.jsx(T,{title:"Create Bucket"}),e[4]=k,e[5]=j):(k=e[4],j=e[5]);let a;e[6]!==s.error?(a=s.error&&t.jsx(O,{error:s.error,msg:"Failed to create bucket"}),e[6]=s.error,e[7]=a):a=e[7];let i;e[8]!==y||e[9]!==F?(i=y(F),e[8]=y,e[9]=F,e[10]=i):i=e[10];let g;e[11]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(D,{children:t.jsx("label",{htmlFor:"bucketName",children:"Bucket Name"})}),e[11]=g):g=e[11];const v=!!x.bucketName;let l;e[12]!==N?(l=N("bucketName"),e[12]=N,e[13]=l):l=e[13];let n;e[14]!==v||e[15]!==l?(n=t.jsx(J,{"aria-invalid":v,id:"bucketName",placeholder:"my-bucket",type:"text",...l}),e[14]=v,e[15]=l,e[16]=n):n=e[16];let o;e[17]!==x.bucketName?(o=t.jsx(q,{errors:[x.bucketName]}),e[17]=x.bucketName,e[18]=o):o=e[18];let c;e[19]!==n||e[20]!==o?(c=t.jsxs(G,{children:[g,n,o]}),e[19]=n,e[20]=o,e[21]=c):c=e[21];const C=S||s.isPending;let m;e[22]!==r?(m=()=>r({to:"/s3/ls"}),e[22]=r,e[23]=m):m=e[23];let u;e[24]!==C||e[25]!==m?(u=t.jsx(E,{disabled:C,onClick:m,type:"button",variant:"outline",children:"Cancel"}),e[24]=C,e[25]=m,e[26]=u):u=e[26];const w=S||s.isPending,_=S||s.isPending?"Creating…":"Create Bucket";let d;e[27]!==w||e[28]!==_?(d=t.jsx(E,{disabled:w,type:"submit",children:_}),e[27]=w,e[28]=_,e[29]=d):d=e[29];let f;e[30]!==u||e[31]!==d?(f=t.jsxs("div",{className:"flex gap-2",children:[u,d]}),e[30]=u,e[31]=d,e[32]=f):f=e[32];let b;e[33]!==c||e[34]!==f||e[35]!==i?(b=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:i,children:[c,f]}),e[33]=c,e[34]=f,e[35]=i,e[36]=b):b=e[36];let B;return e[37]!==b||e[38]!==a?(B=t.jsxs(t.Fragment,{children:[k,j,a,b]}),e[37]=b,e[38]=a,e[39]=B):B=e[39],B}export{se as component};
|
||||
import{o as C,k as P,c as _,u as v,j as t}from"./index.js";import{a as E,u as z}from"./zod.js";import{B as M}from"./back-link.js";import{E as L}from"./error-banner.js";import{F as $}from"./form-actions.js";import{P as A}from"./page-heading.js";import{F as I,a as R,b as H}from"./field.js";import{I as O}from"./input.js";import{u as T}from"./s3.js";const q=C({bucketName:P().min(3,"Bucket name must be at least 3 characters").max(63,"Bucket name must be at most 63 characters").regex(/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/,"Must start and end with a lowercase letter or number").regex(/^[a-z0-9.-]+$/,"Only lowercase letters, numbers, hyphens, and periods allowed").refine(e=>!e.includes(".."),"Must not contain consecutive periods").refine(e=>!(e.includes(".-")||e.includes("-.")),"Must not contain adjacent period and hyphen")});function Y(){const e=_.c(35),r=v(),s=T();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f={resolver:E(q)},e[0]=f):f=e[0];const{handleSubmit:j,register:B,formState:S}=z(f),{errors:b,isSubmitting:y}=S;let p;e[1]!==s||e[2]!==r?(p=async w=>{await s.mutateAsync(w),r({to:"/s3/ls"})},e[1]=s,e[2]=r,e[3]=p):p=e[3];const N=p;let k,x;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(M,{to:"/s3/ls",children:"Back to buckets"}),x=t.jsx(A,{title:"Create Bucket"}),e[4]=k,e[5]=x):(k=e[4],x=e[5]);let a;e[6]!==s.error?(a=s.error&&t.jsx(L,{error:s.error,msg:"Failed to create bucket"}),e[6]=s.error,e[7]=a):a=e[7];let i;e[8]!==j||e[9]!==N?(i=j(N),e[8]=j,e[9]=N,e[10]=i):i=e[10];let h;e[11]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(R,{children:t.jsx("label",{htmlFor:"bucketName",children:"Bucket Name"})}),e[11]=h):h=e[11];const F=!!b.bucketName;let o;e[12]!==B?(o=B("bucketName"),e[12]=B,e[13]=o):o=e[13];let n;e[14]!==F||e[15]!==o?(n=t.jsx(O,{"aria-invalid":F,id:"bucketName",placeholder:"my-bucket",type:"text",...o}),e[14]=F,e[15]=o,e[16]=n):n=e[16];let c;e[17]!==b.bucketName?(c=t.jsx(I,{errors:[b.bucketName]}),e[17]=b.bucketName,e[18]=c):c=e[18];let l;e[19]!==n||e[20]!==c?(l=t.jsxs(H,{children:[h,n,c]}),e[19]=n,e[20]=c,e[21]=l):l=e[21];let m;e[22]!==r?(m=()=>r({to:"/s3/ls"}),e[22]=r,e[23]=m):m=e[23];let u;e[24]!==s.isPending||e[25]!==y||e[26]!==m?(u=t.jsx($,{isPending:s.isPending,isSubmitting:y,onCancel:m,pendingLabel:"Creating\\u2026",submitLabel:"Create Bucket"}),e[24]=s.isPending,e[25]=y,e[26]=m,e[27]=u):u=e[27];let d;e[28]!==l||e[29]!==u||e[30]!==i?(d=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:i,children:[l,u]}),e[28]=l,e[29]=u,e[30]=i,e[31]=d):d=e[31];let g;return e[32]!==d||e[33]!==a?(g=t.jsxs(t.Fragment,{children:[k,x,a,d]}),e[32]=d,e[33]=a,e[34]=g):g=e[34],g}export{Y as component};
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{c as G,u as K,j as t,B as Y}from"./index.js";import{a as Q,u as W}from"./zod.js";import{B as X}from"./back-link.js";import{E as Z}from"./error-banner.js";import{P as ee}from"./page-heading.js";import{F as U,a as V,b as H}from"./field.js";import{I as $}from"./input.js";import{T as te}from"./textarea.js";import{a as ie}from"./iam.js";import{a as le}from"./iam2.js";const oe=JSON.stringify({Version:"2012-10-17",Statement:[{Effect:"Allow",Action:"*",Resource:"*"}]},null,2);function ue(){const e=G.c(63),s=K(),l=ie();let _;e[0]===Symbol.for("react.memo_cache_sentinel")?(_={resolver:Q(le),defaultValues:{policyDocument:oe}},e[0]=_):_=e[0];const{handleSubmit:k,register:o,formState:q}=W(_),{errors:i,isSubmitting:w}=q;let F;e[1]!==l||e[2]!==s?(F=async z=>{await l.mutateAsync(z),s({to:"/iam/list-policies"})},e[1]=l,e[2]=s,e[3]=F):F=e[3];const O=F;let C,E;e[4]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(X,{to:"/iam/list-policies",children:"Back to policies"}),E=t.jsx(ee,{title:"Create Policy"}),e[4]=C,e[5]=E):(C=e[4],E=e[5]);let r;e[6]!==l.error?(r=l.error&&t.jsx(Z,{error:l.error,msg:"Failed to create policy"}),e[6]=l.error,e[7]=r):r=e[7];let c;e[8]!==k||e[9]!==O?(c=k(O),e[8]=k,e[9]=O,e[10]=c):c=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(V,{children:t.jsx("label",{htmlFor:"policyName",children:"Policy Name"})}),e[11]=v):v=e[11];const I=!!i.policyName;let a;e[12]!==o?(a=o("policyName"),e[12]=o,e[13]=a):a=e[13];let n;e[14]!==I||e[15]!==a?(n=t.jsx($,{"aria-invalid":I,id:"policyName",placeholder:"my-policy...",...a}),e[14]=I,e[15]=a,e[16]=n):n=e[16];let m;e[17]!==i.policyName?(m=t.jsx(U,{errors:[i.policyName]}),e[17]=i.policyName,e[18]=m):m=e[18];let p;e[19]!==n||e[20]!==m?(p=t.jsxs(H,{children:[v,n,m]}),e[19]=n,e[20]=m,e[21]=p):p=e[21];let B;e[22]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx(V,{children:t.jsx("label",{htmlFor:"description",children:"Description (optional)"})}),e[22]=B):B=e[22];let f;e[23]!==o?(f=o("description"),e[23]=o,e[24]=f):f=e[24];let d;e[25]!==f?(d=t.jsx($,{id:"description",placeholder:"A brief description of this policy...",...f}),e[25]=f,e[26]=d):d=e[26];let y;e[27]!==i.description?(y=t.jsx(U,{errors:[i.description]}),e[27]=i.description,e[28]=y):y=e[28];let u;e[29]!==d||e[30]!==y?(u=t.jsxs(H,{children:[B,d,y]}),e[29]=d,e[30]=y,e[31]=u):u=e[31];let A;e[32]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(V,{children:t.jsx("label",{htmlFor:"policyDocument",children:"Policy Document (JSON)"})}),e[32]=A):A=e[32];const L=!!i.policyDocument;let x;e[33]!==o?(x=o("policyDocument"),e[33]=o,e[34]=x):x=e[34];let h;e[35]!==L||e[36]!==x?(h=t.jsx(te,{"aria-invalid":L,className:"font-mono text-sm",id:"policyDocument",rows:15,...x}),e[35]=L,e[36]=x,e[37]=h):h=e[37];let j;e[38]!==i.policyDocument?(j=t.jsx(U,{errors:[i.policyDocument]}),e[38]=i.policyDocument,e[39]=j):j=e[39];let b;e[40]!==h||e[41]!==j?(b=t.jsxs(H,{children:[A,h,j]}),e[40]=h,e[41]=j,e[42]=b):b=e[42];const R=w||l.isPending;let N;e[43]!==s?(N=()=>s({to:"/iam/list-policies"}),e[43]=s,e[44]=N):N=e[44];let g;e[45]!==R||e[46]!==N?(g=t.jsx(Y,{disabled:R,onClick:N,type:"button",variant:"outline",children:"Cancel"}),e[45]=R,e[46]=N,e[47]=g):g=e[47];const J=w||l.isPending,M=w||l.isPending?"Creating...":"Create Policy";let S;e[48]!==J||e[49]!==M?(S=t.jsx(Y,{disabled:J,type:"submit",children:M}),e[48]=J,e[49]=M,e[50]=S):S=e[50];let P;e[51]!==g||e[52]!==S?(P=t.jsxs("div",{className:"flex gap-2",children:[g,S]}),e[51]=g,e[52]=S,e[53]=P):P=e[53];let D;e[54]!==p||e[55]!==u||e[56]!==b||e[57]!==P||e[58]!==c?(D=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:c,children:[p,u,b,P]}),e[54]=p,e[55]=u,e[56]=b,e[57]=P,e[58]=c,e[59]=D):D=e[59];let T;return e[60]!==D||e[61]!==r?(T=t.jsxs(t.Fragment,{children:[C,E,r,D]}),e[60]=D,e[61]=r,e[62]=T):T=e[62],T}export{ue as component};
|
||||
import{c as V,u as H,j as t}from"./index.js";import{a as Y,u as $}from"./zod.js";import{B as q}from"./back-link.js";import{E as z}from"./error-banner.js";import{F as G}from"./form-actions.js";import{P as K}from"./page-heading.js";import{F as k,a as I,b as R}from"./field.js";import{I as J}from"./input.js";import{T as Q}from"./textarea.js";import{a as W}from"./iam.js";import{a as X}from"./iam2.js";const Z=JSON.stringify({Version:"2012-10-17",Statement:[{Effect:"Allow",Action:"*",Resource:"*"}]},null,2);function pe(){const e=V.c(58),s=H(),o=W();let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S={resolver:Y(X),defaultValues:{policyDocument:Z}},e[0]=S):S=e[0];const{handleSubmit:L,register:l,formState:M}=$(S),{errors:i,isSubmitting:T}=M;let F;e[1]!==o||e[2]!==s?(F=async U=>{await o.mutateAsync(U),s({to:"/iam/list-policies"})},e[1]=o,e[2]=s,e[3]=F):F=e[3];const w=F;let D,_;e[4]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(q,{to:"/iam/list-policies",children:"Back to policies"}),_=t.jsx(K,{title:"Create Policy"}),e[4]=D,e[5]=_):(D=e[4],_=e[5]);let r;e[6]!==o.error?(r=o.error&&t.jsx(z,{error:o.error,msg:"Failed to create policy"}),e[6]=o.error,e[7]=r):r=e[7];let c;e[8]!==L||e[9]!==w?(c=L(w),e[8]=L,e[9]=w,e[10]=c):c=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(I,{children:t.jsx("label",{htmlFor:"policyName",children:"Policy Name"})}),e[11]=C):C=e[11];const B=!!i.policyName;let a;e[12]!==l?(a=l("policyName"),e[12]=l,e[13]=a):a=e[13];let n;e[14]!==B||e[15]!==a?(n=t.jsx(J,{"aria-invalid":B,id:"policyName",placeholder:"my-policy...",...a}),e[14]=B,e[15]=a,e[16]=n):n=e[16];let m;e[17]!==i.policyName?(m=t.jsx(k,{errors:[i.policyName]}),e[17]=i.policyName,e[18]=m):m=e[18];let p;e[19]!==n||e[20]!==m?(p=t.jsxs(R,{children:[C,n,m]}),e[19]=n,e[20]=m,e[21]=p):p=e[21];let E;e[22]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(I,{children:t.jsx("label",{htmlFor:"description",children:"Description (optional)"})}),e[22]=E):E=e[22];let f;e[23]!==l?(f=l("description"),e[23]=l,e[24]=f):f=e[24];let d;e[25]!==f?(d=t.jsx(J,{id:"description",placeholder:"A brief description of this policy...",...f}),e[25]=f,e[26]=d):d=e[26];let y;e[27]!==i.description?(y=t.jsx(k,{errors:[i.description]}),e[27]=i.description,e[28]=y):y=e[28];let u;e[29]!==d||e[30]!==y?(u=t.jsxs(R,{children:[E,d,y]}),e[29]=d,e[30]=y,e[31]=u):u=e[31];let A;e[32]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(I,{children:t.jsx("label",{htmlFor:"policyDocument",children:"Policy Document (JSON)"})}),e[32]=A):A=e[32];const O=!!i.policyDocument;let x;e[33]!==l?(x=l("policyDocument"),e[33]=l,e[34]=x):x=e[34];let h;e[35]!==O||e[36]!==x?(h=t.jsx(Q,{"aria-invalid":O,className:"font-mono text-sm",id:"policyDocument",rows:15,...x}),e[35]=O,e[36]=x,e[37]=h):h=e[37];let j;e[38]!==i.policyDocument?(j=t.jsx(k,{errors:[i.policyDocument]}),e[38]=i.policyDocument,e[39]=j):j=e[39];let b;e[40]!==h||e[41]!==j?(b=t.jsxs(R,{children:[A,h,j]}),e[40]=h,e[41]=j,e[42]=b):b=e[42];let g;e[43]!==s?(g=()=>s({to:"/iam/list-policies"}),e[43]=s,e[44]=g):g=e[44];let N;e[45]!==o.isPending||e[46]!==T||e[47]!==g?(N=t.jsx(G,{isPending:o.isPending,isSubmitting:T,onCancel:g,pendingLabel:"Creating...",submitLabel:"Create Policy"}),e[45]=o.isPending,e[46]=T,e[47]=g,e[48]=N):N=e[48];let P;e[49]!==p||e[50]!==u||e[51]!==b||e[52]!==N||e[53]!==c?(P=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:c,children:[p,u,b,N]}),e[49]=p,e[50]=u,e[51]=b,e[52]=N,e[53]=c,e[54]=P):P=e[54];let v;return e[55]!==P||e[56]!==r?(v=t.jsxs(t.Fragment,{children:[D,_,r,P]}),e[55]=P,e[56]=r,e[57]=v):v=e[57],v}export{pe as component};
|
||||
|
||||
@@ -1 +1 @@
|
||||
import{c as q,u as J,m as K,R as U,j as t,B as G}from"./index.js";import{a as W,u as X,C as Y}from"./zod.js";import{u as Z}from"./useSuspenseQuery.js";import{B as ee}from"./back-link.js";import{E as te}from"./error-banner.js";import{P as se}from"./page-heading.js";import{F as le,b as H,a as L}from"./field.js";import{S as oe,a as re,b as ie,c as ae,d as ne}from"./select.js";import{T as ce}from"./textarea.js";import{c as me}from"./ec2.js";import{d as de}from"./ec22.js";import"./check.js";function ye(){const e=q.c(51),l=J(),{data:B}=Z(K),s=me();let j;e[0]!==B.Volumes?(j=B.Volumes??[],e[0]=B.Volumes,e[1]=j):j=e[1];const b=j,{volumeId:M}=U.useSearch(),E=M??b[0]?.VolumeId??"";let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=W(de),e[2]=v):v=e[2];let I;e[3]!==E?(I={resolver:v,defaultValues:{volumeId:E,description:""}},e[3]=E,e[4]=I):I=e[4];const{control:P,handleSubmit:k,register:N,formState:O}=X(I),{errors:o,isSubmitting:R}=O;let g;e[5]!==s||e[6]!==l?(g=async z=>{await s.mutateAsync(z),l({to:"/ec2/describe-snapshots"})},e[5]=s,e[6]=l,e[7]=g):g=e[7];const T=g;let V,C;e[8]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(ee,{to:"/ec2/describe-snapshots",children:"Back to snapshots"}),C=t.jsx(se,{title:"Create Snapshot"}),e[8]=V,e[9]=C):(V=e[8],C=e[9]);let r;e[10]!==s.error?(r=s.error&&t.jsx(te,{error:s.error,msg:"Failed to create snapshot"}),e[10]=s.error,e[11]=r):r=e[11];let i;e[12]!==k||e[13]!==T?(i=k(T),e[12]=k,e[13]=T,e[14]=i):i=e[14];let y;e[15]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(L,{children:t.jsx("label",{htmlFor:"volumeId",children:"Volume"})}),e[15]=y):y=e[15];let a;e[16]!==o.volumeId||e[17]!==b?(a=z=>{const{field:A}=z;return t.jsxs(oe,{onValueChange:$=>A.onChange($),value:A.value??"",children:[t.jsx(re,{"aria-invalid":!!o.volumeId,className:"w-full",id:"volumeId",children:t.jsx(ie,{})}),t.jsx(ae,{children:b.map(ue)})]})},e[16]=o.volumeId,e[17]=b,e[18]=a):a=e[18];let n;e[19]!==P||e[20]!==a?(n=t.jsx(Y,{control:P,name:"volumeId",render:a}),e[19]=P,e[20]=a,e[21]=n):n=e[21];let c;e[22]!==o.volumeId?(c=t.jsx(le,{errors:[o.volumeId]}),e[22]=o.volumeId,e[23]=c):c=e[23];let m;e[24]!==n||e[25]!==c?(m=t.jsxs(H,{children:[y,n,c]}),e[24]=n,e[25]=c,e[26]=m):m=e[26];let F;e[27]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(L,{children:t.jsx("label",{htmlFor:"description",children:"Description (optional)"})}),e[27]=F):F=e[27];let d;e[28]!==N?(d=N("description"),e[28]=N,e[29]=d):d=e[29];let u;e[30]!==d?(u=t.jsxs(H,{children:[F,t.jsx(ce,{id:"description",placeholder:"Snapshot description",...d})]}),e[30]=d,e[31]=u):u=e[31];const w=R||s.isPending;let f;e[32]!==l?(f=()=>l({to:"/ec2/describe-snapshots"}),e[32]=l,e[33]=f):f=e[33];let p;e[34]!==w||e[35]!==f?(p=t.jsx(G,{disabled:w,onClick:f,type:"button",variant:"outline",children:"Cancel"}),e[34]=w,e[35]=f,e[36]=p):p=e[36];const D=R||s.isPending,Q=R||s.isPending?"Creating…":"Create Snapshot";let h;e[37]!==D||e[38]!==Q?(h=t.jsx(G,{disabled:D,type:"submit",children:Q}),e[37]=D,e[38]=Q,e[39]=h):h=e[39];let x;e[40]!==p||e[41]!==h?(x=t.jsxs("div",{className:"flex gap-2",children:[p,h]}),e[40]=p,e[41]=h,e[42]=x):x=e[42];let S;e[43]!==m||e[44]!==u||e[45]!==x||e[46]!==i?(S=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:i,children:[m,u,x]}),e[43]=m,e[44]=u,e[45]=x,e[46]=i,e[47]=S):S=e[47];let _;return e[48]!==S||e[49]!==r?(_=t.jsxs(t.Fragment,{children:[V,C,r,S]}),e[48]=S,e[49]=r,e[50]=_):_=e[50],_}function ue(e){return t.jsxs(ne,{value:e.VolumeId??"",children:[e.VolumeId," (",e.Size," GiB)"]},e.VolumeId)}export{ye as component};
|
||||
import{c as z,u as G,n as H,R as M,j as t}from"./index.js";import{a as O,u as $,C as q}from"./zod.js";import{u as J}from"./useSuspenseQuery.js";import{B as K}from"./back-link.js";import{E as U}from"./error-banner.js";import{F as W}from"./form-actions.js";import{P as X}from"./page-heading.js";import{F as Y,b as L,a as N}from"./field.js";import{S as Z,a as ee,b as te,c as se,d as oe}from"./select.js";import{T as re}from"./textarea.js";import{c as le}from"./ec2.js";import{d as ie}from"./ec22.js";import"./check.js";function Ie(){const e=z.c(46),o=G(),{data:y}=J(H),s=le();let x;e[0]!==y.Volumes?(x=y.Volumes??[],e[0]=y.Volumes,e[1]=x):x=e[1];const S=x,{volumeId:A}=M.useSearch(),_=A??S[0]?.VolumeId??"";let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=O(ie),e[2]=j):j=e[2];let b;e[3]!==_?(b={resolver:j,defaultValues:{volumeId:_,description:""}},e[3]=_,e[4]=b):b=e[4];const{control:P,handleSubmit:B,register:E,formState:D}=$(b),{errors:r,isSubmitting:R}=D;let g;e[5]!==s||e[6]!==o?(g=async k=>{await s.mutateAsync(k),o({to:"/ec2/describe-snapshots"})},e[5]=s,e[6]=o,e[7]=g):g=e[7];const T=g;let I,v;e[8]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(K,{to:"/ec2/describe-snapshots",children:"Back to snapshots"}),v=t.jsx(X,{title:"Create Snapshot"}),e[8]=I,e[9]=v):(I=e[8],v=e[9]);let l;e[10]!==s.error?(l=s.error&&t.jsx(U,{error:s.error,msg:"Failed to create snapshot"}),e[10]=s.error,e[11]=l):l=e[11];let i;e[12]!==B||e[13]!==T?(i=B(T),e[12]=B,e[13]=T,e[14]=i):i=e[14];let V;e[15]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx(N,{children:t.jsx("label",{htmlFor:"volumeId",children:"Volume"})}),e[15]=V):V=e[15];let a;e[16]!==r.volumeId||e[17]!==S?(a=k=>{const{field:w}=k;return t.jsxs(Z,{onValueChange:Q=>w.onChange(Q),value:w.value??"",children:[t.jsx(ee,{"aria-invalid":!!r.volumeId,className:"w-full",id:"volumeId",children:t.jsx(te,{})}),t.jsx(se,{children:S.map(ae)})]})},e[16]=r.volumeId,e[17]=S,e[18]=a):a=e[18];let n;e[19]!==P||e[20]!==a?(n=t.jsx(q,{control:P,name:"volumeId",render:a}),e[19]=P,e[20]=a,e[21]=n):n=e[21];let m;e[22]!==r.volumeId?(m=t.jsx(Y,{errors:[r.volumeId]}),e[22]=r.volumeId,e[23]=m):m=e[23];let c;e[24]!==n||e[25]!==m?(c=t.jsxs(L,{children:[V,n,m]}),e[24]=n,e[25]=m,e[26]=c):c=e[26];let C;e[27]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(N,{children:t.jsx("label",{htmlFor:"description",children:"Description (optional)"})}),e[27]=C):C=e[27];let d;e[28]!==E?(d=E("description"),e[28]=E,e[29]=d):d=e[29];let u;e[30]!==d?(u=t.jsxs(L,{children:[C,t.jsx(re,{id:"description",placeholder:"Snapshot description",...d})]}),e[30]=d,e[31]=u):u=e[31];let f;e[32]!==o?(f=()=>o({to:"/ec2/describe-snapshots"}),e[32]=o,e[33]=f):f=e[33];let p;e[34]!==s.isPending||e[35]!==R||e[36]!==f?(p=t.jsx(W,{isPending:s.isPending,isSubmitting:R,onCancel:f,pendingLabel:"Creating\\u2026",submitLabel:"Create Snapshot"}),e[34]=s.isPending,e[35]=R,e[36]=f,e[37]=p):p=e[37];let h;e[38]!==c||e[39]!==u||e[40]!==p||e[41]!==i?(h=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:i,children:[c,u,p]}),e[38]=c,e[39]=u,e[40]=p,e[41]=i,e[42]=h):h=e[42];let F;return e[43]!==h||e[44]!==l?(F=t.jsxs(t.Fragment,{children:[I,v,l,h]}),e[43]=h,e[44]=l,e[45]=F):F=e[45],F}function ae(e){return t.jsxs(oe,{value:e.VolumeId??"",children:[e.VolumeId," (",e.Size," GiB)"]},e.VolumeId)}export{Ie as component};
|
||||
|
||||
@@ -1 +1 @@
|
||||
import{c as oe,u as ce,l as de,k as me,j as t,B as Y}from"./index.js";import{a as ue,u as fe,C as ee}from"./zod.js";import{u as te}from"./useSuspenseQuery.js";import{B as pe}from"./back-link.js";import{E as be}from"./error-banner.js";import{P as xe}from"./page-heading.js";import{F as se,a as U,b as W}from"./field.js";import{I as he}from"./input.js";import{S as le,a as ie,b as ne,c as re,d as X}from"./select.js";import{b as je}from"./ec2.js";import{b as ve}from"./ec22.js";import"./check.js";function Ee(){const e=oe.c(66),s=ce(),{data:Q}=te(de),{data:R}=te(me),l=je();let k;e[0]!==Q.Vpcs?(k=Q.Vpcs??[],e[0]=Q.Vpcs,e[1]=k):k=e[1];const V=k;let _;e[2]!==R.AvailabilityZones?(_=R.AvailabilityZones??[],e[2]=R.AvailabilityZones,e[3]=_):_=e[3];const T=_;let Z;e[4]===Symbol.for("react.memo_cache_sentinel")?(Z=ue(ve),e[4]=Z):Z=e[4];const O=V[0]?.VpcId??"";let F;e[5]!==O?(F={resolver:Z,defaultValues:{vpcId:O,cidrBlock:"10.0.1.0/24",availabilityZone:""}},e[5]=O,e[6]=F):F=e[6];const{control:r,handleSubmit:H,register:K,formState:ae}=fe(F),{errors:i,isSubmitting:L}=ae;let N;e[7]!==l||e[8]!==s?(N=async B=>{const n=(await l.mutateAsync(B)).Subnet?.SubnetId;s(n?{to:"/ec2/describe-subnets/$id",params:{id:n}}:{to:"/ec2/describe-subnets"})},e[7]=l,e[8]=s,e[9]=N):N=e[9];const M=N;let A,P;e[10]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(pe,{to:"/ec2/describe-subnets",children:"Back to Subnets"}),P=t.jsx(xe,{title:"Create Subnet"}),e[10]=A,e[11]=P):(A=e[10],P=e[11]);let a;e[12]!==l.error?(a=l.error&&t.jsx(be,{error:l.error,msg:"Failed to create subnet"}),e[12]=l.error,e[13]=a):a=e[13];let o;e[14]!==H||e[15]!==M?(o=H(M),e[14]=H,e[15]=M,e[16]=o):o=e[16];let $;e[17]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(U,{children:t.jsx("label",{htmlFor:"vpcId",children:"VPC"})}),e[17]=$):$=e[17];let c;e[18]!==i.vpcId||e[19]!==V?(c=B=>{const{field:C}=B;return t.jsxs(le,{onValueChange:n=>C.onChange(n),value:C.value??"",children:[t.jsx(ie,{"aria-invalid":!!i.vpcId,className:"w-full",id:"vpcId",children:t.jsx(ne,{})}),t.jsx(re,{children:V.map(ye)})]})},e[18]=i.vpcId,e[19]=V,e[20]=c):c=e[20];let d;e[21]!==r||e[22]!==c?(d=t.jsx(ee,{control:r,name:"vpcId",render:c}),e[21]=r,e[22]=c,e[23]=d):d=e[23];let m;e[24]!==i.vpcId?(m=t.jsx(se,{errors:[i.vpcId]}),e[24]=i.vpcId,e[25]=m):m=e[25];let u;e[26]!==d||e[27]!==m?(u=t.jsxs(W,{children:[$,d,m]}),e[26]=d,e[27]=m,e[28]=u):u=e[28];let E;e[29]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(U,{children:t.jsx("label",{htmlFor:"cidrBlock",children:"CIDR Block"})}),e[29]=E):E=e[29];const q=!!i.cidrBlock;let f;e[30]!==K?(f=K("cidrBlock"),e[30]=K,e[31]=f):f=e[31];let p;e[32]!==q||e[33]!==f?(p=t.jsx(he,{"aria-invalid":q,id:"cidrBlock",placeholder:"10.0.1.0/24",...f}),e[32]=q,e[33]=f,e[34]=p):p=e[34];let b;e[35]!==i.cidrBlock?(b=t.jsx(se,{errors:[i.cidrBlock]}),e[35]=i.cidrBlock,e[36]=b):b=e[36];let x;e[37]!==p||e[38]!==b?(x=t.jsxs(W,{children:[E,p,b]}),e[37]=p,e[38]=b,e[39]=x):x=e[39];let w;e[40]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(U,{children:t.jsx("label",{htmlFor:"availabilityZone",children:"Availability Zone (optional)"})}),e[40]=w):w=e[40];let h;e[41]!==T?(h=B=>{const{field:C}=B;return t.jsxs(le,{onValueChange:n=>C.onChange(n==="none"?"":n),value:C.value||"none",children:[t.jsx(ie,{className:"w-full",id:"availabilityZone",children:t.jsx(ne,{})}),t.jsxs(re,{children:[t.jsx(X,{value:"none",children:"none"}),T.map(Se)]})]})},e[41]=T,e[42]=h):h=e[42];let j;e[43]!==r||e[44]!==h?(j=t.jsxs(W,{children:[w,t.jsx(ee,{control:r,name:"availabilityZone",render:h})]}),e[43]=r,e[44]=h,e[45]=j):j=e[45];const z=L||l.isPending;let v;e[46]!==s?(v=()=>s({to:"/ec2/describe-subnets"}),e[46]=s,e[47]=v):v=e[47];let S;e[48]!==z||e[49]!==v?(S=t.jsx(Y,{disabled:z,onClick:v,type:"button",variant:"outline",children:"Cancel"}),e[48]=z,e[49]=v,e[50]=S):S=e[50];const G=L||l.isPending,J=L||l.isPending?"Creating…":"Create Subnet";let y;e[51]!==G||e[52]!==J?(y=t.jsx(Y,{disabled:G,type:"submit",children:J}),e[51]=G,e[52]=J,e[53]=y):y=e[53];let I;e[54]!==S||e[55]!==y?(I=t.jsxs("div",{className:"flex gap-2",children:[S,y]}),e[54]=S,e[55]=y,e[56]=I):I=e[56];let g;e[57]!==o||e[58]!==u||e[59]!==x||e[60]!==j||e[61]!==I?(g=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:o,children:[u,x,j,I]}),e[57]=o,e[58]=u,e[59]=x,e[60]=j,e[61]=I,e[62]=g):g=e[62];let D;return e[63]!==g||e[64]!==a?(D=t.jsxs(t.Fragment,{children:[A,P,a,g]}),e[63]=g,e[64]=a,e[65]=D):D=e[65],D}function Se(e){return t.jsx(X,{value:e.ZoneName??"",children:e.ZoneName},e.ZoneName)}function ye(e){const s=e.Tags?.find(Ie)?.Value;return t.jsx(X,{value:e.VpcId??"",children:s?`${e.VpcId} (${s})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}function Ie(e){return e.Key==="Name"}export{Ee as component};
|
||||
import{c as se,u as le,m as ie,l as re,j as t}from"./index.js";import{a as ne,u as ae,C as G}from"./zod.js";import{u as J}from"./useSuspenseQuery.js";import{B as oe}from"./back-link.js";import{E as ce}from"./error-banner.js";import{F as de}from"./form-actions.js";import{P as me}from"./page-heading.js";import{F as U,a as M,b as q}from"./field.js";import{I as ue}from"./input.js";import{S as W,a as X,b as Y,c as ee,d as z}from"./select.js";import{b as fe}from"./ec2.js";import{b as pe}from"./ec22.js";import"./check.js";function Ne(){const e=se.c(61),s=le(),{data:w}=J(ie),{data:D}=J(re),l=fe();let C;e[0]!==w.Vpcs?(C=w.Vpcs??[],e[0]=w.Vpcs,e[1]=C):C=e[1];const V=C;let B;e[2]!==D.AvailabilityZones?(B=D.AvailabilityZones??[],e[2]=D.AvailabilityZones,e[3]=B):B=e[3];const L=B;let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=ne(pe),e[4]=k):k=e[4];const Q=V[0]?.VpcId??"";let _;e[5]!==Q?(_={resolver:k,defaultValues:{vpcId:Q,cidrBlock:"10.0.1.0/24",availabilityZone:""}},e[5]=Q,e[6]=_):_=e[6];const{control:n,handleSubmit:R,register:T,formState:te}=ae(_),{errors:i,isSubmitting:O}=te;let F;e[7]!==l||e[8]!==s?(F=async I=>{const r=(await l.mutateAsync(I)).Subnet?.SubnetId;s(r?{to:"/ec2/describe-subnets/$id",params:{id:r}}:{to:"/ec2/describe-subnets"})},e[7]=l,e[8]=s,e[9]=F):F=e[9];const H=F;let Z,N;e[10]===Symbol.for("react.memo_cache_sentinel")?(Z=t.jsx(oe,{to:"/ec2/describe-subnets",children:"Back to Subnets"}),N=t.jsx(me,{title:"Create Subnet"}),e[10]=Z,e[11]=N):(Z=e[10],N=e[11]);let a;e[12]!==l.error?(a=l.error&&t.jsx(ce,{error:l.error,msg:"Failed to create subnet"}),e[12]=l.error,e[13]=a):a=e[13];let o;e[14]!==R||e[15]!==H?(o=R(H),e[14]=R,e[15]=H,e[16]=o):o=e[16];let A;e[17]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(M,{children:t.jsx("label",{htmlFor:"vpcId",children:"VPC"})}),e[17]=A):A=e[17];let c;e[18]!==i.vpcId||e[19]!==V?(c=I=>{const{field:y}=I;return t.jsxs(W,{onValueChange:r=>y.onChange(r),value:y.value??"",children:[t.jsx(X,{"aria-invalid":!!i.vpcId,className:"w-full",id:"vpcId",children:t.jsx(Y,{})}),t.jsx(ee,{children:V.map(xe)})]})},e[18]=i.vpcId,e[19]=V,e[20]=c):c=e[20];let d;e[21]!==n||e[22]!==c?(d=t.jsx(G,{control:n,name:"vpcId",render:c}),e[21]=n,e[22]=c,e[23]=d):d=e[23];let m;e[24]!==i.vpcId?(m=t.jsx(U,{errors:[i.vpcId]}),e[24]=i.vpcId,e[25]=m):m=e[25];let u;e[26]!==d||e[27]!==m?(u=t.jsxs(q,{children:[A,d,m]}),e[26]=d,e[27]=m,e[28]=u):u=e[28];let P;e[29]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(M,{children:t.jsx("label",{htmlFor:"cidrBlock",children:"CIDR Block"})}),e[29]=P):P=e[29];const K=!!i.cidrBlock;let f;e[30]!==T?(f=T("cidrBlock"),e[30]=T,e[31]=f):f=e[31];let p;e[32]!==K||e[33]!==f?(p=t.jsx(ue,{"aria-invalid":K,id:"cidrBlock",placeholder:"10.0.1.0/24",...f}),e[32]=K,e[33]=f,e[34]=p):p=e[34];let b;e[35]!==i.cidrBlock?(b=t.jsx(U,{errors:[i.cidrBlock]}),e[35]=i.cidrBlock,e[36]=b):b=e[36];let x;e[37]!==p||e[38]!==b?(x=t.jsxs(q,{children:[P,p,b]}),e[37]=p,e[38]=b,e[39]=x):x=e[39];let $;e[40]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(M,{children:t.jsx("label",{htmlFor:"availabilityZone",children:"Availability Zone (optional)"})}),e[40]=$):$=e[40];let h;e[41]!==L?(h=I=>{const{field:y}=I;return t.jsxs(W,{onValueChange:r=>y.onChange(r==="none"?"":r),value:y.value||"none",children:[t.jsx(X,{className:"w-full",id:"availabilityZone",children:t.jsx(Y,{})}),t.jsxs(ee,{children:[t.jsx(z,{value:"none",children:"none"}),L.map(be)]})]})},e[41]=L,e[42]=h):h=e[42];let j;e[43]!==n||e[44]!==h?(j=t.jsxs(q,{children:[$,t.jsx(G,{control:n,name:"availabilityZone",render:h})]}),e[43]=n,e[44]=h,e[45]=j):j=e[45];let v;e[46]!==s?(v=()=>s({to:"/ec2/describe-subnets"}),e[46]=s,e[47]=v):v=e[47];let S;e[48]!==l.isPending||e[49]!==O||e[50]!==v?(S=t.jsx(de,{isPending:l.isPending,isSubmitting:O,onCancel:v,pendingLabel:"Creating\\u2026",submitLabel:"Create Subnet"}),e[48]=l.isPending,e[49]=O,e[50]=v,e[51]=S):S=e[51];let g;e[52]!==o||e[53]!==u||e[54]!==x||e[55]!==j||e[56]!==S?(g=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:o,children:[u,x,j,S]}),e[52]=o,e[53]=u,e[54]=x,e[55]=j,e[56]=S,e[57]=g):g=e[57];let E;return e[58]!==g||e[59]!==a?(E=t.jsxs(t.Fragment,{children:[Z,N,a,g]}),e[58]=g,e[59]=a,e[60]=E):E=e[60],E}function be(e){return t.jsx(z,{value:e.ZoneName??"",children:e.ZoneName},e.ZoneName)}function xe(e){const s=e.Tags?.find(he)?.Value;return t.jsx(z,{value:e.VpcId??"",children:s?`${e.VpcId} (${s})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}function he(e){return e.Key==="Name"}export{Ne as component};
|
||||
|
||||
@@ -1 +1 @@
|
||||
import{c as z,u as D,j as t,B as A}from"./index.js";import{a as G,u as J}from"./zod.js";import{B as K}from"./back-link.js";import{E as O}from"./error-banner.js";import{P as Q}from"./page-heading.js";import{F as H,a as L,b as M}from"./field.js";import{I as T}from"./input.js";import{u as V}from"./iam.js";import{c as W}from"./iam2.js";function ae(){const e=z.c(51),l=D(),s=V();let y;e[0]===Symbol.for("react.memo_cache_sentinel")?(y={resolver:G(W)},e[0]=y):y=e[0];const{handleSubmit:P,register:i,formState:$}=J(y),{errors:r,isSubmitting:U}=$;let S;e[1]!==s||e[2]!==l?(S=async q=>{await s.mutateAsync(q),l({to:"/iam/list-users"})},e[1]=s,e[2]=l,e[3]=S):S=e[3];const E=S;let F,_;e[4]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(K,{to:"/iam/list-users",children:"Back to users"}),_=t.jsx(Q,{title:"Create User"}),e[4]=F,e[5]=_):(F=e[4],_=e[5]);let a;e[6]!==s.error?(a=s.error&&t.jsx(O,{error:s.error,msg:"Failed to create user"}),e[6]=s.error,e[7]=a):a=e[7];let o;e[8]!==P||e[9]!==E?(o=P(E),e[8]=P,e[9]=E,e[10]=o):o=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(L,{children:t.jsx("label",{htmlFor:"userName",children:"User Name"})}),e[11]=C):C=e[11];const k=!!r.userName;let n;e[12]!==i?(n=i("userName"),e[12]=i,e[13]=n):n=e[13];let m;e[14]!==k||e[15]!==n?(m=t.jsx(T,{"aria-invalid":k,id:"userName",placeholder:"my-user...",...n}),e[14]=k,e[15]=n,e[16]=m):m=e[16];let c;e[17]!==r.userName?(c=t.jsx(H,{errors:[r.userName]}),e[17]=r.userName,e[18]=c):c=e[18];let f;e[19]!==m||e[20]!==c?(f=t.jsxs(M,{children:[C,m,c]}),e[19]=m,e[20]=c,e[21]=f):f=e[21];let v;e[22]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(L,{children:t.jsx("label",{htmlFor:"path",children:"Path (optional)"})}),e[22]=v):v=e[22];let u;e[23]!==i?(u=i("path"),e[23]=i,e[24]=u):u=e[24];let d;e[25]!==u?(d=t.jsx(T,{id:"path",placeholder:"/",...u}),e[25]=u,e[26]=d):d=e[26];let h;e[27]!==r.path?(h=t.jsx(H,{errors:[r.path]}),e[27]=r.path,e[28]=h):h=e[28];let p;e[29]!==d||e[30]!==h?(p=t.jsxs(M,{children:[v,d,h]}),e[29]=d,e[30]=h,e[31]=p):p=e[31];const w=U||s.isPending;let x;e[32]!==l?(x=()=>l({to:"/iam/list-users"}),e[32]=l,e[33]=x):x=e[33];let j;e[34]!==w||e[35]!==x?(j=t.jsx(A,{disabled:w,onClick:x,type:"button",variant:"outline",children:"Cancel"}),e[34]=w,e[35]=x,e[36]=j):j=e[36];const I=U||s.isPending,R=U||s.isPending?"Creating...":"Create User";let b;e[37]!==I||e[38]!==R?(b=t.jsx(A,{disabled:I,type:"submit",children:R}),e[37]=I,e[38]=R,e[39]=b):b=e[39];let g;e[40]!==j||e[41]!==b?(g=t.jsxs("div",{className:"flex gap-2",children:[j,b]}),e[40]=j,e[41]=b,e[42]=g):g=e[42];let N;e[43]!==f||e[44]!==p||e[45]!==g||e[46]!==o?(N=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:o,children:[f,p,g]}),e[43]=f,e[44]=p,e[45]=g,e[46]=o,e[47]=N):N=e[47];let B;return e[48]!==N||e[49]!==a?(B=t.jsxs(t.Fragment,{children:[F,_,a,N]}),e[48]=N,e[49]=a,e[50]=B):B=e[50],B}export{ae as component};
|
||||
import{c as R,u as H,j as t}from"./index.js";import{a as M,u as T}from"./zod.js";import{B as $}from"./back-link.js";import{E as q}from"./error-banner.js";import{F as z}from"./form-actions.js";import{P as D}from"./page-heading.js";import{F as B,a as k,b as L}from"./field.js";import{I as w}from"./input.js";import{u as G}from"./iam.js";import{c as J}from"./iam2.js";function re(){const e=R.c(46),i=H(),r=G();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={resolver:M(J)},e[0]=g):g=e[0];const{handleSubmit:C,register:a,formState:A}=T(g),{errors:s,isSubmitting:U}=A;let F;e[1]!==r||e[2]!==i?(F=async I=>{await r.mutateAsync(I),i({to:"/iam/list-users"})},e[1]=r,e[2]=i,e[3]=F):F=e[3];const E=F;let N,S;e[4]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx($,{to:"/iam/list-users",children:"Back to users"}),S=t.jsx(D,{title:"Create User"}),e[4]=N,e[5]=S):(N=e[4],S=e[5]);let l;e[6]!==r.error?(l=r.error&&t.jsx(q,{error:r.error,msg:"Failed to create user"}),e[6]=r.error,e[7]=l):l=e[7];let o;e[8]!==C||e[9]!==E?(o=C(E),e[8]=C,e[9]=E,e[10]=o):o=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(k,{children:t.jsx("label",{htmlFor:"userName",children:"User Name"})}),e[11]=y):y=e[11];const v=!!s.userName;let m;e[12]!==a?(m=a("userName"),e[12]=a,e[13]=m):m=e[13];let n;e[14]!==v||e[15]!==m?(n=t.jsx(w,{"aria-invalid":v,id:"userName",placeholder:"my-user...",...m}),e[14]=v,e[15]=m,e[16]=n):n=e[16];let c;e[17]!==s.userName?(c=t.jsx(B,{errors:[s.userName]}),e[17]=s.userName,e[18]=c):c=e[18];let f;e[19]!==n||e[20]!==c?(f=t.jsxs(L,{children:[y,n,c]}),e[19]=n,e[20]=c,e[21]=f):f=e[21];let _;e[22]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(k,{children:t.jsx("label",{htmlFor:"path",children:"Path (optional)"})}),e[22]=_):_=e[22];let u;e[23]!==a?(u=a("path"),e[23]=a,e[24]=u):u=e[24];let p;e[25]!==u?(p=t.jsx(w,{id:"path",placeholder:"/",...u}),e[25]=u,e[26]=p):p=e[26];let h;e[27]!==s.path?(h=t.jsx(B,{errors:[s.path]}),e[27]=s.path,e[28]=h):h=e[28];let d;e[29]!==p||e[30]!==h?(d=t.jsxs(L,{children:[_,p,h]}),e[29]=p,e[30]=h,e[31]=d):d=e[31];let x;e[32]!==i?(x=()=>i({to:"/iam/list-users"}),e[32]=i,e[33]=x):x=e[33];let j;e[34]!==r.isPending||e[35]!==U||e[36]!==x?(j=t.jsx(z,{isPending:r.isPending,isSubmitting:U,onCancel:x,pendingLabel:"Creating...",submitLabel:"Create User"}),e[34]=r.isPending,e[35]=U,e[36]=x,e[37]=j):j=e[37];let b;e[38]!==f||e[39]!==d||e[40]!==j||e[41]!==o?(b=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:o,children:[f,d,j]}),e[38]=f,e[39]=d,e[40]=j,e[41]=o,e[42]=b):b=e[42];let P;return e[43]!==b||e[44]!==l?(P=t.jsxs(t.Fragment,{children:[N,S,l,b]}),e[43]=b,e[44]=l,e[45]=P):P=e[45],P}export{re as component};
|
||||
|
||||
@@ -1 +1 @@
|
||||
import{c as K,u as U,k as W,j as t,B as L}from"./index.js";import{a as X,u as Y,C as ee}from"./zod.js";import{u as te}from"./useSuspenseQuery.js";import{B as ie}from"./back-link.js";import{E as le}from"./error-banner.js";import{P as ae}from"./page-heading.js";import{F as M,a as O,b as $}from"./field.js";import{I as se}from"./input.js";import{S as re,a as oe,b as ne,c as me,d as ce}from"./select.js";import{a as ue}from"./ec2.js";import{a as fe}from"./ec22.js";import"./check.js";function Fe(){const e=K.c(57),a=U(),{data:V}=te(W),i=ue();let j;e[0]!==V.AvailabilityZones?(j=V.AvailabilityZones??[],e[0]=V.AvailabilityZones,e[1]=j):j=e[1];const Z=j,B=Z[0]?.ZoneName??"";let S;e[2]===Symbol.for("react.memo_cache_sentinel")?(S=X(fe),e[2]=S):S=e[2];let g;e[3]!==B?(g={resolver:S,defaultValues:{size:1,availabilityZone:B}},e[3]=B,e[4]=g):g=e[4];const{control:k,handleSubmit:E,register:P,formState:q}=Y(g),{errors:l,isSubmitting:w}=q;let C;e[5]!==i||e[6]!==a?(C=async G=>{await i.mutateAsync(G),a({to:"/ec2/describe-volumes"})},e[5]=i,e[6]=a,e[7]=C):C=e[7];const I=C;let z,F;e[8]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(ie,{to:"/ec2/describe-volumes",children:"Back to volumes"}),F=t.jsx(ae,{title:"Create Volume"}),e[8]=z,e[9]=F):(z=e[8],F=e[9]);let s;e[10]!==i.error?(s=i.error&&t.jsx(le,{error:i.error,msg:"Failed to create volume"}),e[10]=i.error,e[11]=s):s=e[11];let r;e[12]!==E||e[13]!==I?(r=E(I),e[12]=E,e[13]=I,e[14]=r):r=e[14];let N;e[15]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(O,{children:t.jsx("label",{htmlFor:"size",children:"Size (GiB)"})}),e[15]=N):N=e[15];const Q=!!l.size;let o;e[16]!==P?(o=P("size",{valueAsNumber:!0}),e[16]=P,e[17]=o):o=e[17];let n;e[18]!==Q||e[19]!==o?(n=t.jsx(se,{"aria-invalid":Q,id:"size",max:16384,min:1,type:"number",...o}),e[18]=Q,e[19]=o,e[20]=n):n=e[20];let m;e[21]!==l.size?(m=t.jsx(M,{errors:[l.size]}),e[21]=l.size,e[22]=m):m=e[22];let c;e[23]!==n||e[24]!==m?(c=t.jsxs($,{children:[N,n,m]}),e[23]=n,e[24]=m,e[25]=c):c=e[25];let _;e[26]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(O,{children:t.jsx("label",{htmlFor:"availabilityZone",children:"Availability Zone"})}),e[26]=_):_=e[26];let u;e[27]!==Z||e[28]!==l.availabilityZone?(u=G=>{const{field:H}=G;return t.jsxs(re,{onValueChange:J=>H.onChange(J),value:H.value??"",children:[t.jsx(oe,{"aria-invalid":!!l.availabilityZone,className:"w-full",id:"availabilityZone",children:t.jsx(ne,{})}),t.jsx(me,{children:Z.map(de)})]})},e[27]=Z,e[28]=l.availabilityZone,e[29]=u):u=e[29];let f;e[30]!==k||e[31]!==u?(f=t.jsx(ee,{control:k,name:"availabilityZone",render:u}),e[30]=k,e[31]=u,e[32]=f):f=e[32];let d;e[33]!==l.availabilityZone?(d=t.jsx(M,{errors:[l.availabilityZone]}),e[33]=l.availabilityZone,e[34]=d):d=e[34];let b;e[35]!==f||e[36]!==d?(b=t.jsxs($,{children:[_,f,d]}),e[35]=f,e[36]=d,e[37]=b):b=e[37];const R=w||i.isPending;let v;e[38]!==a?(v=()=>a({to:"/ec2/describe-volumes"}),e[38]=a,e[39]=v):v=e[39];let x;e[40]!==R||e[41]!==v?(x=t.jsx(L,{disabled:R,onClick:v,type:"button",variant:"outline",children:"Cancel"}),e[40]=R,e[41]=v,e[42]=x):x=e[42];const T=w||i.isPending,D=w||i.isPending?"Creating…":"Create Volume";let y;e[43]!==T||e[44]!==D?(y=t.jsx(L,{disabled:T,type:"submit",children:D}),e[43]=T,e[44]=D,e[45]=y):y=e[45];let p;e[46]!==x||e[47]!==y?(p=t.jsxs("div",{className:"flex gap-2",children:[x,y]}),e[46]=x,e[47]=y,e[48]=p):p=e[48];let h;e[49]!==c||e[50]!==b||e[51]!==p||e[52]!==r?(h=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:r,children:[c,b,p]}),e[49]=c,e[50]=b,e[51]=p,e[52]=r,e[53]=h):h=e[53];let A;return e[54]!==h||e[55]!==s?(A=t.jsxs(t.Fragment,{children:[z,F,s,h]}),e[54]=h,e[55]=s,e[56]=A):A=e[56],A}function de(e){return t.jsx(ce,{value:e.ZoneName??"",children:e.ZoneName},e.ZoneName)}export{Fe as component};
|
||||
import{c as H,u as M,l as O,j as i}from"./index.js";import{a as $,u as q,C as J}from"./zod.js";import{u as K}from"./useSuspenseQuery.js";import{B as U}from"./back-link.js";import{E as W}from"./error-banner.js";import{F as X}from"./form-actions.js";import{P as Y}from"./page-heading.js";import{F as Q,a as R,b as T}from"./field.js";import{I as ee}from"./input.js";import{S as ie,a as te,b as le,c as ae,d as se}from"./select.js";import{a as re}from"./ec2.js";import{a as oe}from"./ec22.js";import"./check.js";function ge(){const e=H.c(52),a=M(),{data:_}=K(O),t=re();let y;e[0]!==_.AvailabilityZones?(y=_.AvailabilityZones??[],e[0]=_.AvailabilityZones,e[1]=y):y=e[1];const h=y,N=h[0]?.ZoneName??"";let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j=$(oe),e[2]=j):j=e[2];let Z;e[3]!==N?(Z={resolver:j,defaultValues:{size:1,availabilityZone:N}},e[3]=N,e[4]=Z):Z=e[4];const{control:V,handleSubmit:P,register:B,formState:D}=q(Z),{errors:l,isSubmitting:E}=D;let g;e[5]!==t||e[6]!==a?(g=async I=>{await t.mutateAsync(I),a({to:"/ec2/describe-volumes"})},e[5]=t,e[6]=a,e[7]=g):g=e[7];const k=g;let S,C;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=i.jsx(U,{to:"/ec2/describe-volumes",children:"Back to volumes"}),C=i.jsx(Y,{title:"Create Volume"}),e[8]=S,e[9]=C):(S=e[8],C=e[9]);let s;e[10]!==t.error?(s=t.error&&i.jsx(W,{error:t.error,msg:"Failed to create volume"}),e[10]=t.error,e[11]=s):s=e[11];let r;e[12]!==P||e[13]!==k?(r=P(k),e[12]=P,e[13]=k,e[14]=r):r=e[14];let F;e[15]===Symbol.for("react.memo_cache_sentinel")?(F=i.jsx(R,{children:i.jsx("label",{htmlFor:"size",children:"Size (GiB)"})}),e[15]=F):F=e[15];const w=!!l.size;let o;e[16]!==B?(o=B("size",{valueAsNumber:!0}),e[16]=B,e[17]=o):o=e[17];let n;e[18]!==w||e[19]!==o?(n=i.jsx(ee,{"aria-invalid":w,id:"size",max:16384,min:1,type:"number",...o}),e[18]=w,e[19]=o,e[20]=n):n=e[20];let m;e[21]!==l.size?(m=i.jsx(Q,{errors:[l.size]}),e[21]=l.size,e[22]=m):m=e[22];let c;e[23]!==n||e[24]!==m?(c=i.jsxs(T,{children:[F,n,m]}),e[23]=n,e[24]=m,e[25]=c):c=e[25];let z;e[26]===Symbol.for("react.memo_cache_sentinel")?(z=i.jsx(R,{children:i.jsx("label",{htmlFor:"availabilityZone",children:"Availability Zone"})}),e[26]=z):z=e[26];let u;e[27]!==h||e[28]!==l.availabilityZone?(u=I=>{const{field:L}=I;return i.jsxs(ie,{onValueChange:G=>L.onChange(G),value:L.value??"",children:[i.jsx(te,{"aria-invalid":!!l.availabilityZone,className:"w-full",id:"availabilityZone",children:i.jsx(le,{})}),i.jsx(ae,{children:h.map(ne)})]})},e[27]=h,e[28]=l.availabilityZone,e[29]=u):u=e[29];let f;e[30]!==V||e[31]!==u?(f=i.jsx(J,{control:V,name:"availabilityZone",render:u}),e[30]=V,e[31]=u,e[32]=f):f=e[32];let d;e[33]!==l.availabilityZone?(d=i.jsx(Q,{errors:[l.availabilityZone]}),e[33]=l.availabilityZone,e[34]=d):d=e[34];let b;e[35]!==f||e[36]!==d?(b=i.jsxs(T,{children:[z,f,d]}),e[35]=f,e[36]=d,e[37]=b):b=e[37];let v;e[38]!==a?(v=()=>a({to:"/ec2/describe-volumes"}),e[38]=a,e[39]=v):v=e[39];let x;e[40]!==t.isPending||e[41]!==E||e[42]!==v?(x=i.jsx(X,{isPending:t.isPending,isSubmitting:E,onCancel:v,pendingLabel:"Creating\\u2026",submitLabel:"Create Volume"}),e[40]=t.isPending,e[41]=E,e[42]=v,e[43]=x):x=e[43];let p;e[44]!==c||e[45]!==b||e[46]!==x||e[47]!==r?(p=i.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:r,children:[c,b,x]}),e[44]=c,e[45]=b,e[46]=x,e[47]=r,e[48]=p):p=e[48];let A;return e[49]!==p||e[50]!==s?(A=i.jsxs(i.Fragment,{children:[S,C,s,p]}),e[49]=p,e[50]=s,e[51]=A):A=e[51],A}function ne(e){return i.jsx(se,{value:e.ZoneName??"",children:e.ZoneName},e.ZoneName)}export{ge as component};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{c as M,u as T,j as t,B as w}from"./index.js";import{a as q,u as z}from"./zod.js";import{B as G}from"./back-link.js";import{E as J}from"./error-banner.js";import{P as K}from"./page-heading.js";import{F as O,b as $,a as A}from"./field.js";import{I as D}from"./input.js";import{u as Q}from"./ec2.js";import{c as U}from"./ec22.js";function ce(){const e=M.c(46),r=T(),s=Q();let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:q(U),defaultValues:{cidrBlock:"10.0.0.0/16",name:""}},e[0]=j):j=e[0];const{handleSubmit:V,register:l,formState:H}=z(j),{errors:B,isSubmitting:F}=H;let g;e[1]!==s||e[2]!==r?(g=async L=>{const R=(await s.mutateAsync(L)).Vpc?.VpcId;r(R?{to:"/ec2/describe-vpcs/$id",params:{id:R}}:{to:"/ec2/describe-vpcs"})},e[1]=s,e[2]=r,e[3]=g):g=e[3];const P=g;let k,v;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(G,{to:"/ec2/describe-vpcs",children:"Back to VPCs"}),v=t.jsx(K,{title:"Create VPC"}),e[4]=k,e[5]=v):(k=e[4],v=e[5]);let i;e[6]!==s.error?(i=s.error&&t.jsx(J,{error:s.error,msg:"Failed to create VPC"}),e[6]=s.error,e[7]=i):i=e[7];let c;e[8]!==V||e[9]!==P?(c=V(P),e[8]=V,e[9]=P,e[10]=c):c=e[10];let C;e[11]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(A,{children:t.jsx("label",{htmlFor:"cidrBlock",children:"CIDR Block"})}),e[11]=C):C=e[11];const _=!!B.cidrBlock;let o;e[12]!==l?(o=l("cidrBlock"),e[12]=l,e[13]=o):o=e[13];let a;e[14]!==_||e[15]!==o?(a=t.jsx(D,{"aria-invalid":_,id:"cidrBlock",placeholder:"10.0.0.0/16",...o}),e[14]=_,e[15]=o,e[16]=a):a=e[16];let n;e[17]!==B.cidrBlock?(n=t.jsx(O,{errors:[B.cidrBlock]}),e[17]=B.cidrBlock,e[18]=n):n=e[18];let m;e[19]!==a||e[20]!==n?(m=t.jsxs($,{children:[C,a,n]}),e[19]=a,e[20]=n,e[21]=m):m=e[21];let y;e[22]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(A,{children:t.jsx("label",{htmlFor:"name",children:"Name (optional)"})}),e[22]=y):y=e[22];let d;e[23]!==l?(d=l("name"),e[23]=l,e[24]=d):d=e[24];let f;e[25]!==d?(f=t.jsxs($,{children:[y,t.jsx(D,{id:"name",placeholder:"my-vpc",...d})]}),e[25]=d,e[26]=f):f=e[26];const E=F||s.isPending;let p;e[27]!==r?(p=()=>r({to:"/ec2/describe-vpcs"}),e[27]=r,e[28]=p):p=e[28];let u;e[29]!==E||e[30]!==p?(u=t.jsx(w,{disabled:E,onClick:p,type:"button",variant:"outline",children:"Cancel"}),e[29]=E,e[30]=p,e[31]=u):u=e[31];const I=F||s.isPending,N=F||s.isPending?"Creating…":"Create VPC";let x;e[32]!==I||e[33]!==N?(x=t.jsx(w,{disabled:I,type:"submit",children:N}),e[32]=I,e[33]=N,e[34]=x):x=e[34];let h;e[35]!==u||e[36]!==x?(h=t.jsxs("div",{className:"flex gap-2",children:[u,x]}),e[35]=u,e[36]=x,e[37]=h):h=e[37];let b;e[38]!==m||e[39]!==f||e[40]!==h||e[41]!==c?(b=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:c,children:[m,f,h]}),e[38]=m,e[39]=f,e[40]=h,e[41]=c,e[42]=b):b=e[42];let S;return e[43]!==b||e[44]!==i?(S=t.jsxs(t.Fragment,{children:[k,v,i,b]}),e[43]=b,e[44]=i,e[45]=S):S=e[45],S}export{ce as component};
|
||||
import{c as R,u as w,j as t}from"./index.js";import{a as A,u as $}from"./zod.js";import{B as D}from"./back-link.js";import{E as H}from"./error-banner.js";import{F as M}from"./form-actions.js";import{P as T}from"./page-heading.js";import{F as q,b as _,a as E}from"./field.js";import{I}from"./input.js";import{u as z}from"./ec2.js";import{c as G}from"./ec22.js";function re(){const e=R.c(41),s=w(),r=z();let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={resolver:A(G),defaultValues:{cidrBlock:"10.0.0.0/16",name:""}},e[0]=h):h=e[0];const{handleSubmit:v,register:i,formState:L}=$(h),{errors:b,isSubmitting:P}=L;let j;e[1]!==r||e[2]!==s?(j=async N=>{const y=(await r.mutateAsync(N)).Vpc?.VpcId;s(y?{to:"/ec2/describe-vpcs/$id",params:{id:y}}:{to:"/ec2/describe-vpcs"})},e[1]=r,e[2]=s,e[3]=j):j=e[3];const S=j;let g,B;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(D,{to:"/ec2/describe-vpcs",children:"Back to VPCs"}),B=t.jsx(T,{title:"Create VPC"}),e[4]=g,e[5]=B):(g=e[4],B=e[5]);let l;e[6]!==r.error?(l=r.error&&t.jsx(H,{error:r.error,msg:"Failed to create VPC"}),e[6]=r.error,e[7]=l):l=e[7];let o;e[8]!==v||e[9]!==S?(o=v(S),e[8]=v,e[9]=S,e[10]=o):o=e[10];let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(E,{children:t.jsx("label",{htmlFor:"cidrBlock",children:"CIDR Block"})}),e[11]=k):k=e[11];const V=!!b.cidrBlock;let c;e[12]!==i?(c=i("cidrBlock"),e[12]=i,e[13]=c):c=e[13];let a;e[14]!==V||e[15]!==c?(a=t.jsx(I,{"aria-invalid":V,id:"cidrBlock",placeholder:"10.0.0.0/16",...c}),e[14]=V,e[15]=c,e[16]=a):a=e[16];let n;e[17]!==b.cidrBlock?(n=t.jsx(q,{errors:[b.cidrBlock]}),e[17]=b.cidrBlock,e[18]=n):n=e[18];let m;e[19]!==a||e[20]!==n?(m=t.jsxs(_,{children:[k,a,n]}),e[19]=a,e[20]=n,e[21]=m):m=e[21];let C;e[22]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(E,{children:t.jsx("label",{htmlFor:"name",children:"Name (optional)"})}),e[22]=C):C=e[22];let d;e[23]!==i?(d=i("name"),e[23]=i,e[24]=d):d=e[24];let f;e[25]!==d?(f=t.jsxs(_,{children:[C,t.jsx(I,{id:"name",placeholder:"my-vpc",...d})]}),e[25]=d,e[26]=f):f=e[26];let p;e[27]!==s?(p=()=>s({to:"/ec2/describe-vpcs"}),e[27]=s,e[28]=p):p=e[28];let u;e[29]!==r.isPending||e[30]!==P||e[31]!==p?(u=t.jsx(M,{isPending:r.isPending,isSubmitting:P,onCancel:p,pendingLabel:"Creating\\u2026",submitLabel:"Create VPC"}),e[29]=r.isPending,e[30]=P,e[31]=p,e[32]=u):u=e[32];let x;e[33]!==m||e[34]!==f||e[35]!==u||e[36]!==o?(x=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:o,children:[m,f,u]}),e[33]=m,e[34]=f,e[35]=u,e[36]=o,e[37]=x):x=e[37];let F;return e[38]!==x||e[39]!==l?(F=t.jsxs(t.Fragment,{children:[g,B,l,x]}),e[38]=x,e[39]=l,e[40]=F):F=e[40],F}export{re as component};
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
import{c as j,j as l}from"./index.js";import{a as p,c as A,b as C,e as u,d as b,h as E,f as R,g as _}from"./alert-dialog.js";function F(h){const e=j.c(19),{open:d,onOpenChange:f,title:D,description:g,isPending:r,onConfirm:m}=h;let t;e[0]!==D?(t=l.jsx(p,{children:D}),e[0]=D,e[1]=t):t=e[1];let i;e[2]!==g?(i=l.jsx(A,{children:g}),e[2]=g,e[3]=i):i=e[3];let s;e[4]!==t||e[5]!==i?(s=l.jsxs(C,{children:[t,i]}),e[4]=t,e[5]=i,e[6]=s):s=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=l.jsx(u,{children:"Cancel"}),e[7]=a):a=e[7];const x=r?"Deleting…":"Delete";let n;e[8]!==r||e[9]!==m||e[10]!==x?(n=l.jsxs(b,{children:[a,l.jsx(E,{disabled:r,onClick:m,children:x})]}),e[8]=r,e[9]=m,e[10]=x,e[11]=n):n=e[11];let o;e[12]!==s||e[13]!==n?(o=l.jsxs(R,{children:[s,n]}),e[12]=s,e[13]=n,e[14]=o):o=e[14];let c;return e[15]!==f||e[16]!==d||e[17]!==o?(c=l.jsx(_,{onOpenChange:f,open:d,children:o}),e[15]=f,e[16]=d,e[17]=o,e[18]=c):c=e[18],c}export{F as D};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{o as i,i as e,aN as a,aO as s,aP as t}from"./index.js";const r=i({imageId:e("Please select an Image"),instanceType:e("Please select an instance type"),keyName:e("Please select a key pair"),subnetId:e().optional(),count:s("Instance count must be a whole number").min(1,"Instance count must be at least 1")}),c=i({keyName:e().min(1,"Key name is required").max(255,"Key name must be 255 characters or less").regex(/^[\w\s._\-:/()#,@[\]+=&;{}!$*]+$/,"Key name contains invalid characters")}),m=i({keyName:e().min(1,"Key name is required").max(255,"Key name must be 255 characters or less").regex(/^[\w\s._\-:/()#,@[\]+=&;{}!$*]+$/,"Key name contains invalid characters"),publicKeyMaterial:e().min(1,"Public key is required").refine(n=>n.trim().length>0,"Public key cannot be empty")}),l=i({size:a().int("Size must be a whole number").min(1,"Size must be at least 1 GiB").max(16384,"Size must be at most 16384 GiB"),availabilityZone:e().min(1,"Availability zone is required")}),u=i({size:a().int("Size must be a whole number").min(1,"Size must be at least 1 GiB")}),d=i({volumeId:e().min(1,"Volume is required"),description:e().optional()});i({sourceSnapshotId:e().min(1,"Source snapshot is required"),sourceRegion:e().min(1,"Source region is required"),description:e().optional()});i({volumeId:e().min(1,"Volume is required"),instanceId:e().min(1,"Instance is required"),device:e().optional()});i({volumeId:e().min(1,"Volume is required"),instanceId:e().optional(),force:t().optional()});i({instanceType:e().min(1,"Instance type is required")});i({name:e().min(1,"Name is required"),description:e().optional()});const b=i({vpcId:e().min(1,"VPC is required"),cidrBlock:e().min(1,"CIDR block is required").regex(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}$/,"Must be a valid CIDR block (e.g. 10.0.1.0/24)"),availabilityZone:e().optional()}),p=i({cidrBlock:e().min(1,"CIDR block is required").regex(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}$/,"Must be a valid CIDR block (e.g. 10.0.0.0/16)"),name:e().optional()});export{l as a,b,p as c,d,c as e,r as f,m as i,u as m};
|
||||
import{o as i,k as e,aN as a,aO as s,aP as t}from"./index.js";const r=i({imageId:e("Please select an Image"),instanceType:e("Please select an instance type"),keyName:e("Please select a key pair"),subnetId:e().optional(),count:s("Instance count must be a whole number").min(1,"Instance count must be at least 1")}),c=i({keyName:e().min(1,"Key name is required").max(255,"Key name must be 255 characters or less").regex(/^[\w\s._\-:/()#,@[\]+=&;{}!$*]+$/,"Key name contains invalid characters")}),m=i({keyName:e().min(1,"Key name is required").max(255,"Key name must be 255 characters or less").regex(/^[\w\s._\-:/()#,@[\]+=&;{}!$*]+$/,"Key name contains invalid characters"),publicKeyMaterial:e().min(1,"Public key is required").refine(n=>n.trim().length>0,"Public key cannot be empty")}),l=i({size:a().int("Size must be a whole number").min(1,"Size must be at least 1 GiB").max(16384,"Size must be at most 16384 GiB"),availabilityZone:e().min(1,"Availability zone is required")}),u=i({size:a().int("Size must be a whole number").min(1,"Size must be at least 1 GiB")}),d=i({volumeId:e().min(1,"Volume is required"),description:e().optional()});i({sourceSnapshotId:e().min(1,"Source snapshot is required"),sourceRegion:e().min(1,"Source region is required"),description:e().optional()});i({volumeId:e().min(1,"Volume is required"),instanceId:e().min(1,"Instance is required"),device:e().optional()});i({volumeId:e().min(1,"Volume is required"),instanceId:e().optional(),force:t().optional()});i({instanceType:e().min(1,"Instance type is required")});i({name:e().min(1,"Name is required"),description:e().optional()});const b=i({vpcId:e().min(1,"VPC is required"),cidrBlock:e().min(1,"CIDR block is required").regex(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}$/,"Must be a valid CIDR block (e.g. 10.0.1.0/24)"),availabilityZone:e().optional()}),p=i({cidrBlock:e().min(1,"CIDR block is required").regex(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}$/,"Must be a valid CIDR block (e.g. 10.0.0.0/16)"),name:e().optional()});export{l as a,b,p as c,d,c as e,r as f,m as i,u as m};
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
import{c as x,j as c,B as a}from"./index.js";function f(r){const t=x.c(9),{isSubmitting:m,isPending:u,onCancel:l,submitLabel:p,pendingLabel:d}=r,e=m||u;let n;t[0]!==e||t[1]!==l?(n=c.jsx(a,{disabled:e,onClick:l,type:"button",variant:"outline",children:"Cancel"}),t[0]=e,t[1]=l,t[2]=n):n=t[2];const o=e?d:p;let s;t[3]!==e||t[4]!==o?(s=c.jsx(a,{disabled:e,type:"submit",children:o}),t[3]=e,t[4]=o,t[5]=s):s=t[5];let i;return t[6]!==n||t[7]!==s?(i=c.jsxs("div",{className:"flex gap-2",children:[n,s]}),t[6]=n,t[7]=s,t[8]=i):i=t[8],i}export{f as F};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{o as r,i as e}from"./index.js";const c=r({userName:e().min(1,"User name is required").max(64,"User name must be 64 characters or less").regex(/^[\w+=,.@-]+$/,"User name contains invalid characters"),path:e().optional()}),i=r({policyName:e().min(1,"Policy name is required").max(128,"Policy name must be 128 characters or less"),description:e().optional(),policyDocument:e().min(1,"Policy document is required").refine(a=>{try{return JSON.parse(a),!0}catch{return!1}},{message:"Policy document must be valid JSON"})});export{i as a,c};
|
||||
import{o as r,k as e}from"./index.js";const c=r({userName:e().min(1,"User name is required").max(64,"User name must be 64 characters or less").regex(/^[\w+=,.@-]+$/,"User name contains invalid characters"),path:e().optional()}),i=r({policyName:e().min(1,"Policy name is required").max(128,"Policy name must be 128 characters or less"),description:e().optional(),policyDocument:e().min(1,"Policy document is required").refine(a=>{try{return JSON.parse(a),!0}catch{return!1}},{message:"Policy document must be valid JSON"})});export{i as a,c};
|
||||
|
||||
@@ -1 +1 @@
|
||||
import{c as O,u as $,j as t,B as H}from"./index.js";import{a as q,u as G}from"./zod.js";import{B as J}from"./back-link.js";import{E as U}from"./error-banner.js";import{P as V}from"./page-heading.js";import{F as Q,a as R,b as z}from"./field.js";import{I as W}from"./input.js";import{T as X}from"./textarea.js";import{d as Y}from"./ec2.js";import{i as Z}from"./ec22.js";function me(){const e=O.c(53),s=$(),i=Y();let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g={resolver:q(Z)},e[0]=g):g=e[0];const{handleSubmit:_,register:l,formState:D}=G(g),{errors:r,isSubmitting:M}=D;let A;e[1]!==i||e[2]!==s?(A=async L=>{await i.mutateAsync(L),s({to:"/ec2/describe-key-pairs"})},e[1]=i,e[2]=s,e[3]=A):A=e[3];const v=A;let K,N;e[4]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(J,{to:"/ec2/describe-key-pairs",children:"Back to key pairs"}),N=t.jsx(V,{title:"Import Key Pair"}),e[4]=K,e[5]=N):(K=e[4],N=e[5]);let a;e[6]!==i.error?(a=i.error&&t.jsx(U,{error:i.error,msg:"Failed to import key pair"}),e[6]=i.error,e[7]=a):a=e[7];let o;e[8]!==_||e[9]!==v?(o=_(v),e[8]=_,e[9]=v,e[10]=o):o=e[10];let P;e[11]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(R,{children:t.jsx("label",{htmlFor:"keyName",children:"Key Pair Name"})}),e[11]=P):P=e[11];const I=!!r.keyName;let c;e[12]!==l?(c=l("keyName"),e[12]=l,e[13]=c):c=e[13];let n;e[14]!==I||e[15]!==c?(n=t.jsx(W,{"aria-invalid":I,id:"keyName",placeholder:"my-key-pair…",...c}),e[14]=I,e[15]=c,e[16]=n):n=e[16];let m;e[17]!==r.keyName?(m=t.jsx(Q,{errors:[r.keyName]}),e[17]=r.keyName,e[18]=m):m=e[18];let p;e[19]!==n||e[20]!==m?(p=t.jsxs(z,{children:[P,n,m]}),e[19]=n,e[20]=m,e[21]=p):p=e[21];let S,B;e[22]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(R,{children:t.jsx("label",{htmlFor:"publicKeyMaterial",children:"Public Key"})}),B=t.jsx("p",{className:"text-muted-foreground text-xs",id:"publicKey-description",children:"Paste your OpenSSH public key (e.g. the contents of id_rsa.pub)"}),e[22]=S,e[23]=B):(S=e[22],B=e[23]);const E=!!r.publicKeyMaterial;let d;e[24]!==l?(d=l("publicKeyMaterial"),e[24]=l,e[25]=d):d=e[25];let f;e[26]!==E||e[27]!==d?(f=t.jsx(X,{"aria-invalid":E,id:"publicKeyMaterial",placeholder:"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC…",rows:8,...d}),e[26]=E,e[27]=d,e[28]=f):f=e[28];let y;e[29]!==r.publicKeyMaterial?(y=t.jsx(Q,{errors:[r.publicKeyMaterial]}),e[29]=r.publicKeyMaterial,e[30]=y):y=e[30];let u;e[31]!==f||e[32]!==y?(u=t.jsxs(z,{children:[S,B,f,y]}),e[31]=f,e[32]=y,e[33]=u):u=e[33];const C=M||i.isPending;let x;e[34]!==s?(x=()=>s({to:"/ec2/describe-key-pairs"}),e[34]=s,e[35]=x):x=e[35];let b;e[36]!==C||e[37]!==x?(b=t.jsx(H,{disabled:C,onClick:x,type:"button",variant:"outline",children:"Cancel"}),e[36]=C,e[37]=x,e[38]=b):b=e[38];const w=M||i.isPending,T=M||i.isPending?"Importing…":"Import Key Pair";let h;e[39]!==w||e[40]!==T?(h=t.jsx(H,{disabled:w,type:"submit",children:T}),e[39]=w,e[40]=T,e[41]=h):h=e[41];let j;e[42]!==b||e[43]!==h?(j=t.jsxs("div",{className:"flex gap-2",children:[b,h]}),e[42]=b,e[43]=h,e[44]=j):j=e[44];let k;e[45]!==p||e[46]!==u||e[47]!==j||e[48]!==o?(k=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:o,children:[p,u,j]}),e[45]=p,e[46]=u,e[47]=j,e[48]=o,e[49]=k):k=e[49];let F;return e[50]!==k||e[51]!==a?(F=t.jsxs(t.Fragment,{children:[K,N,a,k]}),e[50]=k,e[51]=a,e[52]=F):F=e[52],F}export{me as component};
|
||||
import{c as T,u as H,j as t}from"./index.js";import{a as Q,u as R}from"./zod.js";import{B as z}from"./back-link.js";import{E as D}from"./error-banner.js";import{F as O}from"./form-actions.js";import{P as $}from"./page-heading.js";import{F as E,a as v,b as w}from"./field.js";import{I as q}from"./input.js";import{T as G}from"./textarea.js";import{d as J}from"./ec2.js";import{i as U}from"./ec22.js";function le(){const e=T.c(48),s=H(),r=J();let j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j={resolver:Q(U)},e[0]=j):j=e[0];const{handleSubmit:F,register:a,formState:C}=R(j),{errors:i,isSubmitting:_}=C;let k;e[1]!==r||e[2]!==s?(k=async L=>{await r.mutateAsync(L),s({to:"/ec2/describe-key-pairs"})},e[1]=r,e[2]=s,e[3]=k):k=e[3];const M=k;let g,A;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(z,{to:"/ec2/describe-key-pairs",children:"Back to key pairs"}),A=t.jsx($,{title:"Import Key Pair"}),e[4]=g,e[5]=A):(g=e[4],A=e[5]);let l;e[6]!==r.error?(l=r.error&&t.jsx(D,{error:r.error,msg:"Failed to import key pair"}),e[6]=r.error,e[7]=l):l=e[7];let o;e[8]!==F||e[9]!==M?(o=F(M),e[8]=F,e[9]=M,e[10]=o):o=e[10];let K;e[11]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(v,{children:t.jsx("label",{htmlFor:"keyName",children:"Key Pair Name"})}),e[11]=K):K=e[11];const B=!!i.keyName;let m;e[12]!==a?(m=a("keyName"),e[12]=a,e[13]=m):m=e[13];let n;e[14]!==B||e[15]!==m?(n=t.jsx(q,{"aria-invalid":B,id:"keyName",placeholder:"my-key-pair…",...m}),e[14]=B,e[15]=m,e[16]=n):n=e[16];let c;e[17]!==i.keyName?(c=t.jsx(E,{errors:[i.keyName]}),e[17]=i.keyName,e[18]=c):c=e[18];let p;e[19]!==n||e[20]!==c?(p=t.jsxs(w,{children:[K,n,c]}),e[19]=n,e[20]=c,e[21]=p):p=e[21];let P,N;e[22]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(v,{children:t.jsx("label",{htmlFor:"publicKeyMaterial",children:"Public Key"})}),N=t.jsx("p",{className:"text-muted-foreground text-xs",id:"publicKey-description",children:"Paste your OpenSSH public key (e.g. the contents of id_rsa.pub)"}),e[22]=P,e[23]=N):(P=e[22],N=e[23]);const I=!!i.publicKeyMaterial;let f;e[24]!==a?(f=a("publicKeyMaterial"),e[24]=a,e[25]=f):f=e[25];let y;e[26]!==I||e[27]!==f?(y=t.jsx(G,{"aria-invalid":I,id:"publicKeyMaterial",placeholder:"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC…",rows:8,...f}),e[26]=I,e[27]=f,e[28]=y):y=e[28];let d;e[29]!==i.publicKeyMaterial?(d=t.jsx(E,{errors:[i.publicKeyMaterial]}),e[29]=i.publicKeyMaterial,e[30]=d):d=e[30];let u;e[31]!==y||e[32]!==d?(u=t.jsxs(w,{children:[P,N,y,d]}),e[31]=y,e[32]=d,e[33]=u):u=e[33];let b;e[34]!==s?(b=()=>s({to:"/ec2/describe-key-pairs"}),e[34]=s,e[35]=b):b=e[35];let x;e[36]!==r.isPending||e[37]!==_||e[38]!==b?(x=t.jsx(O,{isPending:r.isPending,isSubmitting:_,onCancel:b,pendingLabel:"Importing…",submitLabel:"Import Key Pair"}),e[36]=r.isPending,e[37]=_,e[38]=b,e[39]=x):x=e[39];let h;e[40]!==p||e[41]!==u||e[42]!==x||e[43]!==o?(h=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:o,children:[p,u,x]}),e[40]=p,e[41]=u,e[42]=x,e[43]=o,e[44]=h):h=e[44];let S;return e[45]!==h||e[46]!==l?(S=t.jsxs(t.Fragment,{children:[g,A,l,h]}),e[45]=h,e[46]=l,e[47]=S):S=e[47],S}export{le as component};
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+17
-17
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{c as o,t as c,j as t,L as u,B as m}from"./index.js";import{u as l}from"./useSuspenseQuery.js";import{L as d}from"./list-card.js";import{P as p}from"./page-heading.js";import{S}from"./state-badge.js";function $(){const e=o.c(5),{data:s}=l(c);let n;e[0]!==s.Subnets?(n=s.Subnets||[],e[0]=s.Subnets,e[1]=n):n=e[1];const a=n;let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(p,{actions:t.jsx(u,{to:"/ec2/create-subnet",children:t.jsx(m,{children:"Create Subnet"})}),title:"Subnets"}),e[2]=r):r=e[2];let i;return e[3]!==a?(i=t.jsxs(t.Fragment,{children:[r,a.length>0?t.jsx("div",{className:"space-y-4",children:a.map(f)}):t.jsx("p",{className:"text-muted-foreground",children:"No subnets found."})]}),e[3]=a,e[4]=i):i=e[4],i}function f(e){if(!e.SubnetId)return null;const s=e.Tags?.find(b)?.Value;return t.jsx(d,{badge:t.jsx(S,{state:e.State}),params:{id:e.SubnetId},subtitle:`${e.CidrBlock??""} • ${e.AvailabilityZone??""}`,title:s?`${e.SubnetId} (${s})`:e.SubnetId,to:"/ec2/describe-subnets/$id"},e.SubnetId)}function b(e){return e.Key==="Name"}export{$ as component};
|
||||
import{c as o,v as c,j as t,L as u,B as m}from"./index.js";import{u as l}from"./useSuspenseQuery.js";import{L as d}from"./list-card.js";import{P as p}from"./page-heading.js";import{S}from"./state-badge.js";function $(){const e=o.c(5),{data:s}=l(c);let n;e[0]!==s.Subnets?(n=s.Subnets||[],e[0]=s.Subnets,e[1]=n):n=e[1];const a=n;let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(p,{actions:t.jsx(u,{to:"/ec2/create-subnet",children:t.jsx(m,{children:"Create Subnet"})}),title:"Subnets"}),e[2]=r):r=e[2];let i;return e[3]!==a?(i=t.jsxs(t.Fragment,{children:[r,a.length>0?t.jsx("div",{className:"space-y-4",children:a.map(f)}):t.jsx("p",{className:"text-muted-foreground",children:"No subnets found."})]}),e[3]=a,e[4]=i):i=e[4],i}function f(e){if(!e.SubnetId)return null;const s=e.Tags?.find(b)?.Value;return t.jsx(d,{badge:t.jsx(S,{state:e.State}),params:{id:e.SubnetId},subtitle:`${e.CidrBlock??""} • ${e.AvailabilityZone??""}`,title:s?`${e.SubnetId} (${s})`:e.SubnetId,to:"/ec2/describe-subnets/$id"},e.SubnetId)}function b(e){return e.Key==="Name"}export{$ as component};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{c as m,p as l,j as t,L as n,B as c}from"./index.js";import{u as p}from"./useSuspenseQuery.js";import{L as d}from"./list-card.js";import{P as y}from"./page-heading.js";function P(){const e=m.c(4),{data:s}=p(l);let r;if(e[0]!==s.KeyPairs){const a=(s.KeyPairs||[]).toSorted(f);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(n,{to:"/ec2/import-key-pair",children:t.jsx(c,{variant:"outline",children:"Import Key Pair"})}),e[2]=i):i=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(y,{actions:t.jsxs("div",{className:"flex gap-2",children:[i,t.jsx(n,{to:"/ec2/create-key-pair",children:t.jsx(c,{children:"Create Key Pair"})})]}),title:"EC2 Key Pairs"}),e[3]=o):o=e[3],r=t.jsxs(t.Fragment,{children:[o,a.length>0?t.jsx("div",{className:"space-y-4",children:a.map(u)}):t.jsx("p",{className:"text-muted-foreground",children:"No key pairs found."})]}),e[0]=s.KeyPairs,e[1]=r}else r=e[1];return r}function u(e){return e.KeyPairId?t.jsx(d,{params:{id:e.KeyPairId},subtitle:`${e.KeyPairId} • ${e.KeyType}`,title:e.KeyName??"",to:"/ec2/describe-key-pairs/$id"},e.KeyPairId):null}function f(e,s){const r=e.KeyName?.toLowerCase()??"",a=s.KeyName?.toLowerCase()??"";return r.localeCompare(a)}export{P as component};
|
||||
import{c as m,q as l,j as t,L as n,B as c}from"./index.js";import{u as p}from"./useSuspenseQuery.js";import{L as d}from"./list-card.js";import{P as y}from"./page-heading.js";function P(){const e=m.c(4),{data:s}=p(l);let r;if(e[0]!==s.KeyPairs){const a=(s.KeyPairs||[]).toSorted(f);let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(n,{to:"/ec2/import-key-pair",children:t.jsx(c,{variant:"outline",children:"Import Key Pair"})}),e[2]=i):i=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(y,{actions:t.jsxs("div",{className:"flex gap-2",children:[i,t.jsx(n,{to:"/ec2/create-key-pair",children:t.jsx(c,{children:"Create Key Pair"})})]}),title:"EC2 Key Pairs"}),e[3]=o):o=e[3],r=t.jsxs(t.Fragment,{children:[o,a.length>0?t.jsx("div",{className:"space-y-4",children:a.map(u)}):t.jsx("p",{className:"text-muted-foreground",children:"No key pairs found."})]}),e[0]=s.KeyPairs,e[1]=r}else r=e[1];return r}function u(e){return e.KeyPairId?t.jsx(d,{params:{id:e.KeyPairId},subtitle:`${e.KeyPairId} • ${e.KeyType}`,title:e.KeyName??"",to:"/ec2/describe-key-pairs/$id"},e.KeyPairId):null}function f(e,s){const r=e.KeyName?.toLowerCase()??"",a=s.KeyName?.toLowerCase()??"";return r.localeCompare(a)}export{P as component};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{c as n,n as i,j as t}from"./index.js";import{u as c}from"./useSuspenseQuery.js";import{L as l}from"./list-card.js";import{P as d}from"./page-heading.js";import{S as p}from"./state-badge.js";function h(){const e=n.c(5),{data:o}=c(i);let s;e[0]!==o.Images?(s=o.Images||[],e[0]=o.Images,e[1]=s):s=e[1];const a=s;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(d,{title:"EC2 Images"}),e[2]=m):m=e[2];let r;return e[3]!==a?(r=t.jsxs(t.Fragment,{children:[m,a.length>0?t.jsx("div",{className:"space-y-4",children:a.map(u)}):t.jsx("p",{className:"text-muted-foreground",children:"No images found."})]}),e[3]=a,e[4]=r):r=e[4],r}function u(e){return e.ImageId?t.jsx(l,{badge:t.jsx(p,{state:e.State}),params:{id:e.ImageId},subtitle:e.Name,title:e.ImageId,to:"/ec2/describe-images/$id"},e.ImageId):null}export{h as component};
|
||||
import{c as n,p as i,j as t}from"./index.js";import{u as c}from"./useSuspenseQuery.js";import{L as l}from"./list-card.js";import{P as d}from"./page-heading.js";import{S as p}from"./state-badge.js";function h(){const e=n.c(5),{data:o}=c(i);let s;e[0]!==o.Images?(s=o.Images||[],e[0]=o.Images,e[1]=s):s=e[1];const a=s;let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(d,{title:"EC2 Images"}),e[2]=m):m=e[2];let r;return e[3]!==a?(r=t.jsxs(t.Fragment,{children:[m,a.length>0?t.jsx("div",{className:"space-y-4",children:a.map(u)}):t.jsx("p",{className:"text-muted-foreground",children:"No images found."})]}),e[3]=a,e[4]=r):r=e[4],r}function u(e){return e.ImageId?t.jsx(l,{badge:t.jsx(p,{state:e.State}),params:{id:e.ImageId},subtitle:e.Name,title:e.ImageId,to:"/ec2/describe-images/$id"},e.ImageId):null}export{h as component};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{c as i,h as c,j as t,L as m,B as u}from"./index.js";import{u as l}from"./useSuspenseQuery.js";import{L as p}from"./list-card.js";import{P as d}from"./page-heading.js";function k(){const e=i.c(5),{data:n}=l(c);let s;e[0]!==n.Buckets?(s=n.Buckets||[],e[0]=n.Buckets,e[1]=s):s=e[1];const a=s;let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(d,{actions:t.jsx(m,{to:"/s3/create-bucket",children:t.jsx(u,{children:"Create Bucket"})}),title:"S3 Buckets"}),e[2]=r):r=e[2];let o;return e[3]!==a?(o=t.jsxs(t.Fragment,{children:[r,a.length>0?t.jsx("div",{className:"space-y-4",children:a.map(f)}):t.jsx("p",{className:"text-muted-foreground",children:"No buckets found."})]}),e[3]=a,e[4]=o):o=e[4],o}function f(e){return e.Name?t.jsx(p,{params:{bucket:e.Name},subtitle:e.CreationDate?`Created: ${e.CreationDate.toLocaleString()}`:void 0,title:e.Name,to:"/s3/ls/$bucket"},e.Name):null}export{k as component};
|
||||
import{c as i,h as c,j as t,i as m,L as u,B as l}from"./index.js";import{u as p}from"./useSuspenseQuery.js";import{L as d}from"./list-card.js";import{P as f}from"./page-heading.js";function N(){const e=i.c(5),{data:n}=p(c);let s;e[0]!==n.Buckets?(s=n.Buckets||[],e[0]=n.Buckets,e[1]=s):s=e[1];const a=s;let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(f,{actions:t.jsx(u,{to:"/s3/create-bucket",children:t.jsx(l,{children:"Create Bucket"})}),title:"S3 Buckets"}),e[2]=r):r=e[2];let o;return e[3]!==a?(o=t.jsxs(t.Fragment,{children:[r,a.length>0?t.jsx("div",{className:"space-y-4",children:a.map(x)}):t.jsx("p",{className:"text-muted-foreground",children:"No buckets found."})]}),e[3]=a,e[4]=o):o=e[4],o}function x(e){return e.Name?t.jsx(d,{params:{bucket:e.Name},subtitle:e.CreationDate?`Created: ${m(e.CreationDate)}`:void 0,title:e.Name,to:"/s3/ls/$bucket"},e.Name):null}export{N as component};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{c as b,v as y,j as s,w as k,x as N}from"./index.js";import{u as B}from"./useSuspenseQuery.js";import{B as O}from"./back-link.js";import{E as C}from"./error-banner.js";import{P as v}from"./page-heading.js";import{a as F}from"./s3.js";import{U as K,F as E,O as U}from"./upload-button.js";import"./alert-dialog.js";import"./download.js";import"./trash-2.js";function T(){const e=b.c(31),{bucket:t}=y.useParams();let x;e[0]!==t?(x=N(t),e[0]=t,e[1]=x):x=e[1];const{data:i}=B(x),r=F();let p;e[2]!==i.Contents?(p=i.Contents||[],e[2]=i.Contents,e[3]=p):p=e[3];const o=p;let h;e[4]!==i.CommonPrefixes?(h=i.CommonPrefixes||[],e[4]=i.CommonPrefixes,e[5]=h):h=e[5];const l=h;let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(O,{to:"/s3/ls",children:"Back to buckets"}),e[6]=g):g=e[6];let a;e[7]!==t||e[8]!==r.isPending||e[9]!==r.mutateAsync?(a=s.jsx(K,{bucket:t,isPending:r.isPending,onUpload:r.mutateAsync}),e[7]=t,e[8]=r.isPending,e[9]=r.mutateAsync,e[10]=a):a=e[10];let m;e[11]!==t||e[12]!==a?(m=s.jsx(v,{actions:a,title:t}),e[11]=t,e[12]=a,e[13]=m):m=e[13];let c;e[14]!==r.error?(c=r.error&&s.jsx(C,{error:r.error,msg:"Failed to upload object"}),e[14]=r.error,e[15]=c):c=e[15];let u;e[16]!==t||e[17]!==l?(u=l.length>0&&s.jsxs("div",{className:"mb-6",children:[s.jsx("h2",{className:"mb-3 font-semibold text-lg",children:"Folders"}),s.jsx("div",{className:"space-y-2",children:l.map(n=>{if(!n.Prefix)return null;const P=k(n.Prefix);return s.jsx(E,{bucketName:t,folderName:P,fullPrefix:n.Prefix},n.Prefix)})})]}),e[16]=t,e[17]=l,e[18]=u):u=e[18];let f;e[19]!==t||e[20]!==o?(f=o.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("h2",{className:"mb-3 font-semibold text-lg",children:"Objects"}),o.map(n=>n.Key?s.jsx(U,{bucketName:t,displayName:n.Key,fullKey:n.Key,object:n},n.Key):null)]}),e[19]=t,e[20]=o,e[21]=f):f=e[21];let d;e[22]!==l.length||e[23]!==o.length?(d=o.length===0&&l.length===0&&s.jsx("p",{className:"text-muted-foreground",children:"No objects found in this bucket."}),e[22]=l.length,e[23]=o.length,e[24]=d):d=e[24];let j;return e[25]!==m||e[26]!==c||e[27]!==u||e[28]!==f||e[29]!==d?(j=s.jsxs(s.Fragment,{children:[g,m,c,u,f,d]}),e[25]=m,e[26]=c,e[27]=u,e[28]=f,e[29]=d,e[30]=j):j=e[30],j}export{T as component};
|
||||
import{c as b,w as y,j as s,x as k,y as N}from"./index.js";import{u as B}from"./useSuspenseQuery.js";import{B as O}from"./back-link.js";import{E as C}from"./error-banner.js";import{P as F}from"./page-heading.js";import{a as K}from"./s3.js";import{U as v,F as E,O as U}from"./upload-button.js";import"./delete-confirmation-dialog.js";import"./alert-dialog.js";import"./download.js";import"./trash-2.js";function $(){const e=b.c(31),{bucket:t}=y.useParams();let x;e[0]!==t?(x=N(t),e[0]=t,e[1]=x):x=e[1];const{data:i}=B(x),r=K();let p;e[2]!==i.Contents?(p=i.Contents||[],e[2]=i.Contents,e[3]=p):p=e[3];const n=p;let h;e[4]!==i.CommonPrefixes?(h=i.CommonPrefixes||[],e[4]=i.CommonPrefixes,e[5]=h):h=e[5];const l=h;let g;e[6]===Symbol.for("react.memo_cache_sentinel")?(g=s.jsx(O,{to:"/s3/ls",children:"Back to buckets"}),e[6]=g):g=e[6];let a;e[7]!==t||e[8]!==r.isPending||e[9]!==r.mutateAsync?(a=s.jsx(v,{bucket:t,isPending:r.isPending,onUpload:r.mutateAsync}),e[7]=t,e[8]=r.isPending,e[9]=r.mutateAsync,e[10]=a):a=e[10];let m;e[11]!==t||e[12]!==a?(m=s.jsx(F,{actions:a,title:t}),e[11]=t,e[12]=a,e[13]=m):m=e[13];let c;e[14]!==r.error?(c=r.error&&s.jsx(C,{error:r.error,msg:"Failed to upload object"}),e[14]=r.error,e[15]=c):c=e[15];let u;e[16]!==t||e[17]!==l?(u=l.length>0&&s.jsxs("div",{className:"mb-6",children:[s.jsx("h2",{className:"mb-3 font-semibold text-lg",children:"Folders"}),s.jsx("div",{className:"space-y-2",children:l.map(o=>{if(!o.Prefix)return null;const P=k(o.Prefix);return s.jsx(E,{bucketName:t,folderName:P,fullPrefix:o.Prefix},o.Prefix)})})]}),e[16]=t,e[17]=l,e[18]=u):u=e[18];let f;e[19]!==t||e[20]!==n?(f=n.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("h2",{className:"mb-3 font-semibold text-lg",children:"Objects"}),n.map(o=>o.Key?s.jsx(U,{bucketName:t,displayName:o.Key,fullKey:o.Key,object:o},o.Key):null)]}),e[19]=t,e[20]=n,e[21]=f):f=e[21];let d;e[22]!==l.length||e[23]!==n.length?(d=n.length===0&&l.length===0&&s.jsx("p",{className:"text-muted-foreground",children:"No objects found in this bucket."}),e[22]=l.length,e[23]=n.length,e[24]=d):d=e[24];let j;return e[25]!==m||e[26]!==c||e[27]!==u||e[28]!==f||e[29]!==d?(j=s.jsxs(s.Fragment,{children:[g,m,c,u,f,d]}),e[25]=m,e[26]=c,e[27]=u,e[28]=f,e[29]=d,e[30]=j):j=e[30],j}export{$ as component};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{c as m,y as n,j as s,z as i,L as c,B as l}from"./index.js";import{u}from"./useSuspenseQuery.js";import{L as p}from"./list-card.js";import{P as d}from"./page-heading.js";function C(){const e=m.c(3),{data:r}=u(n);let t;if(e[0]!==r.Users){const a=(r.Users||[]).toSorted(U);let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(d,{actions:s.jsx(c,{to:"/iam/create-user",children:s.jsx(l,{children:"Create User"})}),title:"IAM Users"}),e[2]=o):o=e[2],t=s.jsxs(s.Fragment,{children:[o,a.length>0?s.jsx("div",{className:"space-y-4",children:a.map(f)}):s.jsx("p",{className:"text-muted-foreground",children:"No IAM users found."})]}),e[0]=r.Users,e[1]=t}else t=e[1];return t}function f(e){return e.UserName?s.jsx(p,{params:{userName:e.UserName},subtitle:`${e.UserId} • ${e.Path??"/"} • Created ${i(e.CreateDate)}`,title:e.UserName,to:"/iam/list-users/$userName"},e.UserName):null}function U(e,r){const t=e.UserName?.toLowerCase()??"",a=r.UserName?.toLowerCase()??"";return t.localeCompare(a)}export{C as component};
|
||||
import{c as m,z as n,j as s,i,L as c,B as l}from"./index.js";import{u}from"./useSuspenseQuery.js";import{L as p}from"./list-card.js";import{P as d}from"./page-heading.js";function C(){const e=m.c(3),{data:r}=u(n);let t;if(e[0]!==r.Users){const a=(r.Users||[]).toSorted(U);let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(d,{actions:s.jsx(c,{to:"/iam/create-user",children:s.jsx(l,{children:"Create User"})}),title:"IAM Users"}),e[2]=o):o=e[2],t=s.jsxs(s.Fragment,{children:[o,a.length>0?s.jsx("div",{className:"space-y-4",children:a.map(f)}):s.jsx("p",{className:"text-muted-foreground",children:"No IAM users found."})]}),e[0]=r.Users,e[1]=t}else t=e[1];return t}function f(e){return e.UserName?s.jsx(p,{params:{userName:e.UserName},subtitle:`${e.UserId} • ${e.Path??"/"} • Created ${i(e.CreateDate)}`,title:e.UserName,to:"/iam/list-users/$userName"},e.UserName):null}function U(e,r){const t=e.UserName?.toLowerCase()??"",a=r.UserName?.toLowerCase()??"";return t.localeCompare(a)}export{C as component};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{c as n,A as a,j as t,z as c,L as m,B as l}from"./index.js";import{u as p}from"./useSuspenseQuery.js";import{L as u}from"./list-card.js";import{P as d}from"./page-heading.js";function h(){const e=n.c(3),{data:s}=p(a);let o;if(e[0]!==s.Policies){const i=(s.Policies||[]).toSorted(x);let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(d,{actions:t.jsx(m,{to:"/iam/create-policy",children:t.jsx(l,{children:"Create Policy"})}),title:"IAM Policies"}),e[2]=r):r=e[2],o=t.jsxs(t.Fragment,{children:[r,i.length>0?t.jsx("div",{className:"space-y-4",children:i.map(f)}):t.jsx("p",{className:"text-muted-foreground",children:"No IAM policies found."})]}),e[0]=s.Policies,e[1]=o}else o=e[1];return o}function f(e){return e.Arn?t.jsx(u,{params:{policyArn:encodeURIComponent(e.Arn)},subtitle:`${e.Arn} • Created ${c(e.CreateDate)}`,title:e.PolicyName??"",to:"/iam/list-policies/$policyArn"},e.Arn):null}function x(e,s){const o=e.PolicyName?.toLowerCase()??"",i=s.PolicyName?.toLowerCase()??"";return o.localeCompare(i)}export{h as component};
|
||||
import{c as n,A as a,j as t,i as c,L as m,B as l}from"./index.js";import{u as p}from"./useSuspenseQuery.js";import{L as u}from"./list-card.js";import{P as d}from"./page-heading.js";function h(){const e=n.c(3),{data:i}=p(a);let o;if(e[0]!==i.Policies){const s=(i.Policies||[]).toSorted(x);let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(d,{actions:t.jsx(m,{to:"/iam/create-policy",children:t.jsx(l,{children:"Create Policy"})}),title:"IAM Policies"}),e[2]=r):r=e[2],o=t.jsxs(t.Fragment,{children:[r,s.length>0?t.jsx("div",{className:"space-y-4",children:s.map(f)}):t.jsx("p",{className:"text-muted-foreground",children:"No IAM policies found."})]}),e[0]=i.Policies,e[1]=o}else o=e[1];return o}function f(e){return e.Arn?t.jsx(u,{params:{policyArn:encodeURIComponent(e.Arn)},subtitle:`${e.Arn} • Created ${c(e.CreateDate)}`,title:e.PolicyName??"",to:"/iam/list-policies/$policyArn"},e.Arn):null}function x(e,i){const o=e.PolicyName?.toLowerCase()??"",s=i.PolicyName?.toLowerCase()??"";return o.localeCompare(s)}export{h as component};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{c,l as i,j as t,L as m,B as l}from"./index.js";import{u as d}from"./useSuspenseQuery.js";import{L as p}from"./list-card.js";import{P as u}from"./page-heading.js";import{S as f}from"./state-badge.js";function I(){const e=c.c(5),{data:s}=d(i);let r;e[0]!==s.Vpcs?(r=s.Vpcs||[],e[0]=s.Vpcs,e[1]=r):r=e[1];const a=r;let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{actions:t.jsx(m,{to:"/ec2/create-vpc",children:t.jsx(l,{children:"Create VPC"})}),title:"VPCs"}),e[2]=n):n=e[2];let o;return e[3]!==a?(o=t.jsxs(t.Fragment,{children:[n,a.length>0?t.jsx("div",{className:"space-y-4",children:a.map(V)}):t.jsx("p",{className:"text-muted-foreground",children:"No VPCs found."})]}),e[3]=a,e[4]=o):o=e[4],o}function V(e){if(!e.VpcId)return null;const s=e.Tags?.find(x)?.Value;return t.jsx(p,{badge:t.jsx(f,{state:e.State}),params:{id:e.VpcId},subtitle:e.CidrBlock??"",title:s?`${e.VpcId} (${s})`:e.VpcId,to:"/ec2/describe-vpcs/$id"},e.VpcId)}function x(e){return e.Key==="Name"}export{I as component};
|
||||
import{c,m as i,j as t,L as m,B as d}from"./index.js";import{u as l}from"./useSuspenseQuery.js";import{L as p}from"./list-card.js";import{P as u}from"./page-heading.js";import{S as f}from"./state-badge.js";function I(){const e=c.c(5),{data:s}=l(i);let r;e[0]!==s.Vpcs?(r=s.Vpcs||[],e[0]=s.Vpcs,e[1]=r):r=e[1];const a=r;let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(u,{actions:t.jsx(m,{to:"/ec2/create-vpc",children:t.jsx(d,{children:"Create VPC"})}),title:"VPCs"}),e[2]=n):n=e[2];let o;return e[3]!==a?(o=t.jsxs(t.Fragment,{children:[n,a.length>0?t.jsx("div",{className:"space-y-4",children:a.map(V)}):t.jsx("p",{className:"text-muted-foreground",children:"No VPCs found."})]}),e[3]=a,e[4]=o):o=e[4],o}function V(e){if(!e.VpcId)return null;const s=e.Tags?.find(x)?.Value;return t.jsx(p,{badge:t.jsx(f,{state:e.State}),params:{id:e.VpcId},subtitle:e.CidrBlock??"",title:s?`${e.VpcId} (${s})`:e.VpcId,to:"/ec2/describe-vpcs/$id"},e.VpcId)}function x(e){return e.Key==="Name"}export{I as component};
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{c as i,m as l,j as t,L as n,B as u}from"./index.js";import{u as c}from"./useSuspenseQuery.js";import{L as d}from"./list-card.js";import{P as p}from"./page-heading.js";import{S as f}from"./state-badge.js";function y(){const e=i.c(5),{data:a}=c(l);let s;e[0]!==a.Volumes?(s=a.Volumes||[],e[0]=a.Volumes,e[1]=s):s=e[1];const o=s;let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(p,{actions:t.jsx(n,{to:"/ec2/create-volume",children:t.jsx(u,{children:"Create Volume"})}),title:"EC2 Volumes"}),e[2]=r):r=e[2];let m;return e[3]!==o?(m=t.jsxs(t.Fragment,{children:[r,o.length>0?t.jsx("div",{className:"space-y-4",children:o.map(x)}):t.jsx("p",{className:"text-muted-foreground",children:"No volumes found."})]}),e[3]=o,e[4]=m):m=e[4],m}function x(e){return e.VolumeId?t.jsx(d,{badge:t.jsx(f,{state:e.State}),params:{id:e.VolumeId},subtitle:`${e.Size} GiB • ${e.VolumeType}`,title:e.VolumeId,to:"/ec2/describe-volumes/$id"},e.VolumeId):null}export{y as component};
|
||||
import{c as m,n,j as t,L as l,B as u}from"./index.js";import{u as c}from"./useSuspenseQuery.js";import{L as d}from"./list-card.js";import{P as p}from"./page-heading.js";import{S as f}from"./state-badge.js";function y(){const e=m.c(5),{data:i}=c(n);let s;e[0]!==i.Volumes?(s=i.Volumes||[],e[0]=i.Volumes,e[1]=s):s=e[1];const o=s;let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(p,{actions:t.jsx(l,{to:"/ec2/create-volume",children:t.jsx(u,{children:"Create Volume"})}),title:"EC2 Volumes"}),e[2]=r):r=e[2];let a;return e[3]!==o?(a=t.jsxs(t.Fragment,{children:[r,o.length>0?t.jsx("div",{className:"space-y-4",children:o.map(x)}):t.jsx("p",{className:"text-muted-foreground",children:"No volumes found."})]}),e[3]=o,e[4]=a):a=e[4],a}function x(e){return e.VolumeId?t.jsx(d,{badge:t.jsx(f,{state:e.State}),params:{id:e.VolumeId},subtitle:`${e.Size} GiB • ${e.VolumeType}`,title:e.VolumeId,to:"/ec2/describe-volumes/$id"},e.VolumeId):null}export{y as component};
|
||||
|
||||
@@ -1 +1 @@
|
||||
import{u as $,n as q,p as R,q as U,t as H,j as e,B as C}from"./index.js";import{u as L,a as M,C as x}from"./zod.js";import{u as h}from"./useSuspenseQuery.js";import{B as W}from"./back-link.js";import{E as S}from"./error-banner.js";import{P as z}from"./page-heading.js";import{b as c,a as l,F as j}from"./field.js";import{I as G}from"./input.js";import{S as p,a as y,b as I,c as g,d as o}from"./select.js";import{f as J}from"./ec2.js";import{f as X}from"./ec22.js";import"./check.js";function oe(){const f=$(),{data:T}=h(q),{data:F}=h(R),{data:k}=h(U),{data:P}=h(H),r=J(),b=T.Images??[],N=F.KeyPairs??[],w=P.Subnets??[],d=k.InstanceTypes?.reduce((n,a)=>{const s=a.InstanceType;return s&&(n[s]=(n[s]||0)+1),n},{})??{},i=Object.keys(d).sort(),K=b[0]?.ImageId,B=N[0]?.KeyName,V=i.find(n=>n.endsWith(".nano"))??i[0],{control:m,handleSubmit:A,register:E,watch:O,formState:{errors:t,isSubmitting:v}}=L({resolver:M(X.refine(n=>n.count<=(d[n.instanceType]??1),{message:"Cannot exceed available capacity",path:["count"]})),defaultValues:{count:1,imageId:K??"",keyName:B??"",instanceType:V??""}}),u=O("instanceType"),Q=u?d[u]??1:1,D=async n=>{await r.mutateAsync(n),f({to:"/ec2/describe-instances"})};return e.jsxs(e.Fragment,{children:[e.jsx(W,{to:"/ec2/describe-instances",children:"Back to instances"}),e.jsx(z,{title:"Run EC2 Instances"}),i.length===0&&e.jsx(S,{msg:"No compute available. No new instances can be created until compute is available."}),r.error&&e.jsx(S,{error:r.error,msg:"Failed to create instance"}),e.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:A(D),children:[e.jsxs(c,{children:[e.jsx(l,{children:e.jsx("label",{htmlFor:"imageId",children:"Image"})}),e.jsx(x,{control:m,name:"imageId",render:({field:n})=>{const a=b.find(s=>s.ImageId===n.value);return e.jsxs(p,{onValueChange:s=>n.onChange(s),value:n.value??"",children:[e.jsx(y,{"aria-invalid":!!t.imageId,className:"w-full",id:"imageId",children:e.jsx(I,{children:a?`${a.Name||"Unnamed"} (${a.Architecture})`:""})}),e.jsx(g,{children:b.map(s=>e.jsxs(o,{value:s.ImageId??"",children:[s.Name||"Unnamed"," (",s.Architecture,")"]},s.ImageId))})]})}}),e.jsx(j,{errors:[t.imageId]})]}),e.jsxs(c,{children:[e.jsx(l,{children:e.jsx("label",{htmlFor:"instanceType",children:"Instance Type"})}),e.jsx(x,{control:m,name:"instanceType",render:({field:n})=>e.jsxs(p,{onValueChange:a=>n.onChange(a),value:n.value?n.value:"",children:[e.jsx(y,{"aria-invalid":!!t.instanceType,className:"w-full",id:"instanceType",children:e.jsx(I,{})}),e.jsx(g,{children:i.map(a=>e.jsxs(o,{value:a,children:[a," (",d[a]," available)"]},a))})]})}),e.jsx(j,{errors:[t.instanceType]})]}),e.jsxs(c,{children:[e.jsx(l,{children:e.jsx("label",{htmlFor:"keyName",children:"Key Pair"})}),e.jsx(x,{control:m,name:"keyName",render:({field:n})=>e.jsxs(p,{onValueChange:a=>n.onChange(a),value:n.value?n.value:"",children:[e.jsx(y,{"aria-invalid":!!t.keyName,className:"w-full",id:"keyName",children:e.jsx(I,{})}),e.jsx(g,{children:N.map(a=>e.jsx(o,{value:a.KeyName??"",children:a.KeyName},a.KeyPairId))})]})}),e.jsx(j,{errors:[t.keyName]})]}),e.jsxs(c,{children:[e.jsx(l,{children:e.jsx("label",{htmlFor:"subnetId",children:"Subnet"})}),e.jsx(x,{control:m,name:"subnetId",render:({field:n})=>e.jsxs(p,{onValueChange:a=>n.onChange(a==="none"?void 0:a),value:n.value??"none",children:[e.jsx(y,{className:"w-full",id:"subnetId",children:e.jsx(I,{})}),e.jsxs(g,{children:[e.jsx(o,{value:"none",children:"none"}),w.map(a=>e.jsx(o,{value:a.SubnetId??"",children:a.SubnetId},a.SubnetId))]})]})})]}),e.jsxs(c,{children:[e.jsx(l,{children:e.jsx("label",{htmlFor:"count",children:"Number of Instances"})}),e.jsx(G,{"aria-describedby":"count-description","aria-invalid":!!t.count,id:"count",type:"number",...E("count",{valueAsNumber:!0})}),e.jsx("p",{className:"text-muted-foreground text-xs",id:"count-description",children:u&&`Available capacity for ${u}: ${Q}`}),e.jsx(j,{errors:[t.count]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(C,{disabled:v||r.isPending,onClick:()=>f({to:"/ec2/describe-instances"}),type:"button",variant:"outline",children:"Cancel"}),e.jsx(C,{disabled:v||r.isPending||i.length===0,type:"submit",children:v||r.isPending?"Creating…":"Create Instance"})]})]})]})}export{oe as component};
|
||||
import{u as $,p as q,q as R,t as U,v as H,j as e,B as C}from"./index.js";import{u as L,a as M,C as x}from"./zod.js";import{u as h}from"./useSuspenseQuery.js";import{B as W}from"./back-link.js";import{E as S}from"./error-banner.js";import{P as z}from"./page-heading.js";import{b as c,a as l,F as j}from"./field.js";import{I as G}from"./input.js";import{S as p,a as y,b as I,c as g,d as o}from"./select.js";import{f as J}from"./ec2.js";import{f as X}from"./ec22.js";import"./check.js";function oe(){const f=$(),{data:T}=h(q),{data:F}=h(R),{data:k}=h(U),{data:P}=h(H),r=J(),b=T.Images??[],N=F.KeyPairs??[],w=P.Subnets??[],d=k.InstanceTypes?.reduce((n,a)=>{const s=a.InstanceType;return s&&(n[s]=(n[s]||0)+1),n},{})??{},i=Object.keys(d).sort(),K=b[0]?.ImageId,B=N[0]?.KeyName,V=i.find(n=>n.endsWith(".nano"))??i[0],{control:m,handleSubmit:A,register:E,watch:O,formState:{errors:t,isSubmitting:v}}=L({resolver:M(X.refine(n=>n.count<=(d[n.instanceType]??1),{message:"Cannot exceed available capacity",path:["count"]})),defaultValues:{count:1,imageId:K??"",keyName:B??"",instanceType:V??""}}),u=O("instanceType"),Q=u?d[u]??1:1,D=async n=>{await r.mutateAsync(n),f({to:"/ec2/describe-instances"})};return e.jsxs(e.Fragment,{children:[e.jsx(W,{to:"/ec2/describe-instances",children:"Back to instances"}),e.jsx(z,{title:"Run EC2 Instances"}),i.length===0&&e.jsx(S,{msg:"No compute available. No new instances can be created until compute is available."}),r.error&&e.jsx(S,{error:r.error,msg:"Failed to create instance"}),e.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:A(D),children:[e.jsxs(c,{children:[e.jsx(l,{children:e.jsx("label",{htmlFor:"imageId",children:"Image"})}),e.jsx(x,{control:m,name:"imageId",render:({field:n})=>{const a=b.find(s=>s.ImageId===n.value);return e.jsxs(p,{onValueChange:s=>n.onChange(s),value:n.value??"",children:[e.jsx(y,{"aria-invalid":!!t.imageId,className:"w-full",id:"imageId",children:e.jsx(I,{children:a?`${a.Name||"Unnamed"} (${a.Architecture})`:""})}),e.jsx(g,{children:b.map(s=>e.jsxs(o,{value:s.ImageId??"",children:[s.Name||"Unnamed"," (",s.Architecture,")"]},s.ImageId))})]})}}),e.jsx(j,{errors:[t.imageId]})]}),e.jsxs(c,{children:[e.jsx(l,{children:e.jsx("label",{htmlFor:"instanceType",children:"Instance Type"})}),e.jsx(x,{control:m,name:"instanceType",render:({field:n})=>e.jsxs(p,{onValueChange:a=>n.onChange(a),value:n.value?n.value:"",children:[e.jsx(y,{"aria-invalid":!!t.instanceType,className:"w-full",id:"instanceType",children:e.jsx(I,{})}),e.jsx(g,{children:i.map(a=>e.jsxs(o,{value:a,children:[a," (",d[a]," available)"]},a))})]})}),e.jsx(j,{errors:[t.instanceType]})]}),e.jsxs(c,{children:[e.jsx(l,{children:e.jsx("label",{htmlFor:"keyName",children:"Key Pair"})}),e.jsx(x,{control:m,name:"keyName",render:({field:n})=>e.jsxs(p,{onValueChange:a=>n.onChange(a),value:n.value?n.value:"",children:[e.jsx(y,{"aria-invalid":!!t.keyName,className:"w-full",id:"keyName",children:e.jsx(I,{})}),e.jsx(g,{children:N.map(a=>e.jsx(o,{value:a.KeyName??"",children:a.KeyName},a.KeyPairId))})]})}),e.jsx(j,{errors:[t.keyName]})]}),e.jsxs(c,{children:[e.jsx(l,{children:e.jsx("label",{htmlFor:"subnetId",children:"Subnet"})}),e.jsx(x,{control:m,name:"subnetId",render:({field:n})=>e.jsxs(p,{onValueChange:a=>n.onChange(a==="none"?void 0:a),value:n.value??"none",children:[e.jsx(y,{className:"w-full",id:"subnetId",children:e.jsx(I,{})}),e.jsxs(g,{children:[e.jsx(o,{value:"none",children:"none"}),w.map(a=>e.jsx(o,{value:a.SubnetId??"",children:a.SubnetId},a.SubnetId))]})]})})]}),e.jsxs(c,{children:[e.jsx(l,{children:e.jsx("label",{htmlFor:"count",children:"Number of Instances"})}),e.jsx(G,{"aria-describedby":"count-description","aria-invalid":!!t.count,id:"count",type:"number",...E("count",{valueAsNumber:!0})}),e.jsx("p",{className:"text-muted-foreground text-xs",id:"count-description",children:u&&`Available capacity for ${u}: ${Q}`}),e.jsx(j,{errors:[t.count]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(C,{disabled:v||r.isPending,onClick:()=>f({to:"/ec2/describe-instances"}),type:"button",variant:"outline",children:"Cancel"}),e.jsx(C,{disabled:v||r.isPending||i.length===0,type:"submit",children:v||r.isPending?"Creating…":"Create Instance"})]})]})]})}export{oe as component};
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
import{J as e}from"./index.js";const a=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],o=e("triangle-alert",a);export{o as T};
|
||||
@@ -1 +1 @@
|
||||
import{J as u,K as g,M as j,N as b,P as y,Q as k,S as C,c as w,j as e,L as v,r as f,T as N,U as D,B as A}from"./index.js";import{E as M}from"./error-banner.js";import{g as S,f as R,b as E,a as L,c as O,d as z,e as B,h as $}from"./alert-dialog.js";import{g as F,b as P,c as U}from"./s3.js";import{D as T}from"./download.js";import{T as _}from"./trash-2.js";const H=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],I=u("file",H);const K=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],q=u("folder",K);const G=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],V=u("upload",G),W=l=>(t,a)=>async r=>{const n=await t(r),{response:s}=n;if(g.isInstance(s)&&s.headers.expires){s.headers.expiresstring=s.headers.expires;try{j(s.headers.expires)}catch(o){a.logger?.warn(`AWS SDK Warning for ${a.clientName}::${a.commandName} response parsing (${s.headers.expires}): ${o}`),delete s.headers.expires}}return n},J={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},Q=l=>({applyToStack:t=>{t.addRelativeTo(W(),J)}});class Z extends b.classBuilder().ep({...y,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(t,a,r,n){return[k(r,t.getEndpointParameterInstructions()),F(r,{requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC64NVME","CRC32","CRC32C","SHA256","SHA1"]}),P(r),Q()]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").sc(C).build(){}function re(l){const t=w.c(9),{folderName:a,fullPrefix:r,bucketName:n}=l;let s;t[0]!==n||t[1]!==r?(s={bucket:n,_splat:r},t[0]=n,t[1]=r,t[2]=s):s=t[2];let o;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(q,{className:"size-5 text-muted-foreground"}),t[3]=o):o=t[3];let i;t[4]!==a?(i=e.jsx("span",{className:"font-medium",children:a}),t[4]=a,t[5]=i):i=t[5];let c;return t[6]!==s||t[7]!==i?(c=e.jsxs(v,{className:"flex items-center gap-3 rounded-lg border bg-card p-4 transition-colors hover:bg-accent",params:s,to:"/s3/ls/$bucket/$",children:[o,i]}),t[6]=s,t[7]=i,t[8]=c):c=t[8],c}function ne({object:l,bucketName:t,displayName:a,fullKey:r}){const[n,s]=f.useState(!1),o=U();async function i(){try{const m=new Z({Bucket:t,Key:r}),p=await D().send(m);if(p.Body){const x=await p.Body.transformToByteArray(),h=URL.createObjectURL(new Blob([x])),d=document.createElement("a");d.href=h,d.download=a,document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(h)}}catch{throw new Error("Failed to download object")}}async function c(){try{await o.mutateAsync({bucket:t,key:r})}finally{s(!1)}}return e.jsxs("div",{children:[o.error&&e.jsx(M,{error:o.error,msg:"Failed to delete object"}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border bg-card p-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(I,{className:"size-5 text-muted-foreground"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium",children:a}),l.LastModified&&e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Last Modified: ",l.LastModified.toLocaleString()]})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"text-muted-foreground text-sm",children:N(l.Size||0)}),e.jsx("button",{className:"rounded-md p-2 transition-colors hover:bg-accent",onClick:i,type:"button",children:e.jsx(T,{className:"size-4"})}),e.jsx("button",{className:"rounded-md p-2 text-destructive transition-colors hover:bg-accent",onClick:()=>s(!0),type:"button",children:e.jsx(_,{className:"size-4"})})]}),e.jsx(S,{onOpenChange:s,open:n,children:e.jsxs(R,{children:[e.jsxs(E,{children:[e.jsx(L,{children:"Delete Object"}),e.jsxs(O,{children:["Are you sure you want to delete ",e.jsx("strong",{children:a}),"? This action cannot be undone."]})]}),e.jsxs(z,{children:[e.jsx(B,{children:"Cancel"}),e.jsx($,{className:"bg-destructive hover:bg-destructive/90",onClick:c,children:o.isPending?"Deleting…":"Delete"})]})]})})]})]},l.Key)}function oe({bucket:l,prefix:t="",isPending:a,onUpload:r}){const n=f.useRef(null);async function s(o){const i=o.target.files;if(!(!i||i.length===0))try{await Promise.all(Array.from(i).map(c=>{const m=`${t}${c.name}`;return r({bucket:l,key:m,file:c})}))}finally{n.current&&(n.current.value="")}}return e.jsxs(e.Fragment,{children:[e.jsx("input",{accept:"*/*","aria-label":"Choose files to upload",className:"hidden",multiple:!0,onChange:s,ref:n,type:"file"}),e.jsxs(A,{disabled:a,onClick:()=>n.current?.click(),size:"sm",children:[e.jsx(V,{className:"mr-2 size-4"}),a?"Uploading…":"Upload Files"]})]})}export{re as F,ne as O,oe as U};
|
||||
import{J as u,K as g,M as j,N as b,P as y,Q as k,S as C,c as w,j as t,L as N,r as h,i as v,T as M,U as S,B as D}from"./index.js";import{D as R}from"./delete-confirmation-dialog.js";import{E}from"./error-banner.js";import{g as L,b as O,c as z}from"./s3.js";import{D as B}from"./download.js";import{T as P}from"./trash-2.js";const $=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],A=u("file",$);const F=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],U=u("folder",F);const T=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],_=u("upload",T),I=c=>(e,a)=>async n=>{const r=await e(n),{response:s}=r;if(g.isInstance(s)&&s.headers.expires){s.headers.expiresstring=s.headers.expires;try{j(s.headers.expires)}catch(o){a.logger?.warn(`AWS SDK Warning for ${a.clientName}::${a.commandName} response parsing (${s.headers.expires}): ${o}`),delete s.headers.expires}}return r},H={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},K=c=>({applyToStack:e=>{e.addRelativeTo(I(),H)}});class q extends b.classBuilder().ep({...y,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(e,a,n,r){return[k(n,e.getEndpointParameterInstructions()),L(n,{requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC64NVME","CRC32","CRC32C","SHA256","SHA1"]}),O(n),K()]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").sc(C).build(){}function X(c){const e=w.c(9),{folderName:a,fullPrefix:n,bucketName:r}=c;let s;e[0]!==r||e[1]!==n?(s={bucket:r,_splat:n},e[0]=r,e[1]=n,e[2]=s):s=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(U,{className:"size-5 text-muted-foreground"}),e[3]=o):o=e[3];let i;e[4]!==a?(i=t.jsx("span",{className:"font-medium",children:a}),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==i?(l=t.jsxs(N,{className:"flex items-center gap-3 rounded-lg border bg-card p-4 transition-colors hover:bg-accent",params:s,to:"/s3/ls/$bucket/$",children:[o,i]}),e[6]=s,e[7]=i,e[8]=l):l=e[8],l}function Y({object:c,bucketName:e,displayName:a,fullKey:n}){const[r,s]=h.useState(!1),o=z();async function i(){try{const m=new q({Bucket:e,Key:n}),p=await S().send(m);if(p.Body){const x=await p.Body.transformToByteArray(),f=URL.createObjectURL(new Blob([x])),d=document.createElement("a");d.href=f,d.download=a,document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(f)}}catch{throw new Error("Failed to download object")}}async function l(){try{await o.mutateAsync({bucket:e,key:n})}finally{s(!1)}}return t.jsxs("div",{children:[o.error&&t.jsx(E,{error:o.error,msg:"Failed to delete object"}),t.jsxs("div",{className:"flex items-center justify-between rounded-lg border bg-card p-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(A,{className:"size-5 text-muted-foreground"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium",children:a}),c.LastModified&&t.jsxs("p",{className:"text-muted-foreground text-sm",children:["Last Modified: ",v(c.LastModified)]})]})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"text-muted-foreground text-sm",children:M(c.Size||0)}),t.jsx("button",{className:"rounded-md p-2 transition-colors hover:bg-accent",onClick:i,type:"button",children:t.jsx(B,{className:"size-4"})}),t.jsx("button",{className:"rounded-md p-2 text-destructive transition-colors hover:bg-accent",onClick:()=>s(!0),type:"button",children:t.jsx(P,{className:"size-4"})})]}),t.jsx(R,{description:t.jsxs(t.Fragment,{children:["Are you sure you want to delete ",t.jsx("strong",{children:a}),"? This action cannot be undone."]}),isPending:o.isPending,onConfirm:l,onOpenChange:s,open:r,title:"Delete Object"})]})]},c.Key)}function ee({bucket:c,prefix:e="",isPending:a,onUpload:n}){const r=h.useRef(null);async function s(o){const i=o.target.files;if(!(!i||i.length===0))try{await Promise.all(Array.from(i).map(l=>{const m=`${e}${l.name}`;return n({bucket:c,key:m,file:l})}))}finally{r.current&&(r.current.value="")}}return t.jsxs(t.Fragment,{children:[t.jsx("input",{accept:"*/*","aria-label":"Choose files to upload",className:"hidden",multiple:!0,onChange:s,ref:r,type:"file"}),t.jsxs(D,{disabled:a,onClick:()=>r.current?.click(),size:"sm",children:[t.jsx(_,{className:"mr-2 size-4"}),a?"Uploading…":"Upload Files"]})]})}export{X as F,Y as O,ee as U};
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
import{J as p,c as m,r as s}from"./index.js";const f=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],y=p("triangle-alert",f),d=2e3;function T(){const e=m.c(5),[n,i]=s.useState(!1),t=s.useRef(null);let r,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>()=>{t.current&&clearTimeout(t.current)},o=[],e[0]=r,e[1]=o):(r=e[0],o=e[1]),s.useEffect(r,o);let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=async u=>{await navigator.clipboard.writeText(u),i(!0),t.current&&clearTimeout(t.current),t.current=setTimeout(()=>i(!1),d)},e[2]=c):c=e[2];const l=c;let a;return e[3]!==n?(a={copied:n,copy:l},e[3]=n,e[4]=a):a=e[4],a}export{y as T,T as u};
|
||||
@@ -4,7 +4,7 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --port 3000",
|
||||
"build": "vite build && tsc",
|
||||
"build": "vite build && tsgo",
|
||||
"preview": "vite preview",
|
||||
"check": "biome check",
|
||||
"fix": "biome check --fix"
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import type { ReactNode } from "react"
|
||||
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog"
|
||||
|
||||
interface DeleteConfirmationDialogProps {
|
||||
open: boolean
|
||||
onOpenChange: (open: boolean) => void
|
||||
title: string
|
||||
description: ReactNode
|
||||
isPending: boolean
|
||||
onConfirm: () => void
|
||||
}
|
||||
|
||||
export function DeleteConfirmationDialog({
|
||||
open,
|
||||
onOpenChange,
|
||||
title,
|
||||
description,
|
||||
isPending,
|
||||
onConfirm,
|
||||
}: DeleteConfirmationDialogProps) {
|
||||
return (
|
||||
<AlertDialog onOpenChange={onOpenChange} open={open}>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>{title}</AlertDialogTitle>
|
||||
<AlertDialogDescription>{description}</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction disabled={isPending} onClick={onConfirm}>
|
||||
{isPending ? "Deleting\u2026" : "Delete"}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import { Button } from "@/components/ui/button"
|
||||
|
||||
interface FormActionsProps {
|
||||
isSubmitting: boolean
|
||||
isPending: boolean
|
||||
onCancel: () => void
|
||||
submitLabel: string
|
||||
pendingLabel: string
|
||||
}
|
||||
|
||||
export function FormActions({
|
||||
isSubmitting,
|
||||
isPending,
|
||||
onCancel,
|
||||
submitLabel,
|
||||
pendingLabel,
|
||||
}: FormActionsProps) {
|
||||
const disabled = isSubmitting || isPending
|
||||
return (
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
disabled={disabled}
|
||||
onClick={onCancel}
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button disabled={disabled} type="submit">
|
||||
{disabled ? pendingLabel : submitLabel}
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { useEffect, useRef, useState } from "react"
|
||||
|
||||
const COPY_FEEDBACK_DURATION_MS = 2000
|
||||
|
||||
export function useCopyToClipboard() {
|
||||
const [copied, setCopied] = useState(false)
|
||||
const timerRef = useRef<ReturnType<typeof setTimeout>>(null)
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (timerRef.current) {
|
||||
clearTimeout(timerRef.current)
|
||||
}
|
||||
}
|
||||
}, [])
|
||||
|
||||
const copy = async (text: string) => {
|
||||
await navigator.clipboard.writeText(text)
|
||||
setCopied(true)
|
||||
if (timerRef.current) {
|
||||
clearTimeout(timerRef.current)
|
||||
}
|
||||
timerRef.current = setTimeout(
|
||||
() => setCopied(false),
|
||||
COPY_FEEDBACK_DURATION_MS,
|
||||
)
|
||||
}
|
||||
|
||||
return { copied, copy }
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import { S3Client } from "@aws-sdk/client-s3"
|
||||
|
||||
import { getCredentials } from "./auth"
|
||||
|
||||
const AWS_REGION = "ap-southeast-2"
|
||||
const awsEndpoint = `${window.location.protocol}//${window.location.hostname}:9999`
|
||||
const s3Endpoint = `${window.location.protocol}//${window.location.hostname}:8443`
|
||||
|
||||
@@ -20,7 +21,7 @@ export function getEc2Client(): EC2Client {
|
||||
}
|
||||
ec2Client = new EC2Client({
|
||||
endpoint: awsEndpoint,
|
||||
region: "ap-southeast-2",
|
||||
region: AWS_REGION,
|
||||
credentials: {
|
||||
accessKeyId: credentials.accessKeyId,
|
||||
secretAccessKey: credentials.secretAccessKey,
|
||||
@@ -38,7 +39,7 @@ export function getIamClient(): IAMClient {
|
||||
}
|
||||
iamClient = new IAMClient({
|
||||
endpoint: awsEndpoint,
|
||||
region: "ap-southeast-2",
|
||||
region: AWS_REGION,
|
||||
credentials: {
|
||||
accessKeyId: credentials.accessKeyId,
|
||||
secretAccessKey: credentials.secretAccessKey,
|
||||
@@ -56,7 +57,7 @@ export function getS3Client(): S3Client {
|
||||
}
|
||||
s3Client = new S3Client({
|
||||
endpoint: s3Endpoint,
|
||||
region: "ap-southeast-2",
|
||||
region: AWS_REGION,
|
||||
credentials: {
|
||||
accessKeyId: credentials.accessKeyId,
|
||||
secretAccessKey: credentials.secretAccessKey,
|
||||
|
||||
@@ -16,21 +16,17 @@ export function useUploadObject() {
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async ({ bucket, key, file }: UploadObjectParams) => {
|
||||
try {
|
||||
const upload = new Upload({
|
||||
client: getS3Client(),
|
||||
params: {
|
||||
Bucket: bucket,
|
||||
Key: key,
|
||||
Body: file,
|
||||
ContentType: file.type,
|
||||
},
|
||||
})
|
||||
const upload = new Upload({
|
||||
client: getS3Client(),
|
||||
params: {
|
||||
Bucket: bucket,
|
||||
Key: key,
|
||||
Body: file,
|
||||
ContentType: file.type,
|
||||
},
|
||||
})
|
||||
|
||||
return await upload.done()
|
||||
} catch {
|
||||
throw new Error("Failed to upload object")
|
||||
}
|
||||
return await upload.done()
|
||||
},
|
||||
onSuccess: (_, variables) => {
|
||||
queryClient.invalidateQueries({
|
||||
@@ -44,16 +40,12 @@ export function useCreateBucket() {
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async ({ bucketName }: CreateBucketFormData) => {
|
||||
try {
|
||||
const command = new CreateBucketCommand({
|
||||
Bucket: bucketName,
|
||||
})
|
||||
mutationFn: ({ bucketName }: CreateBucketFormData) => {
|
||||
const command = new CreateBucketCommand({
|
||||
Bucket: bucketName,
|
||||
})
|
||||
|
||||
return await getS3Client().send(command)
|
||||
} catch {
|
||||
throw new Error("Failed to create bucket")
|
||||
}
|
||||
return getS3Client().send(command)
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({
|
||||
@@ -67,17 +59,13 @@ export function useDeleteObject() {
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async ({ bucket, key }: { bucket: string; key: string }) => {
|
||||
try {
|
||||
const command = new DeleteObjectCommand({
|
||||
Bucket: bucket,
|
||||
Key: key,
|
||||
})
|
||||
mutationFn: ({ bucket, key }: { bucket: string; key: string }) => {
|
||||
const command = new DeleteObjectCommand({
|
||||
Bucket: bucket,
|
||||
Key: key,
|
||||
})
|
||||
|
||||
return await getS3Client().send(command)
|
||||
} catch {
|
||||
throw new Error("Failed to delete object")
|
||||
}
|
||||
return getS3Client().send(command)
|
||||
},
|
||||
onSuccess: (_, variables) => {
|
||||
queryClient.invalidateQueries({
|
||||
|
||||
@@ -5,13 +5,9 @@ import { getS3Client } from "@/lib/awsClient"
|
||||
|
||||
export const s3BucketsQueryOptions = queryOptions({
|
||||
queryKey: ["s3", "buckets"],
|
||||
queryFn: async () => {
|
||||
try {
|
||||
const command = new ListBucketsCommand({})
|
||||
return await getS3Client().send(command)
|
||||
} catch {
|
||||
throw new Error("Failed to fetch S3 buckets")
|
||||
}
|
||||
queryFn: () => {
|
||||
const command = new ListBucketsCommand({})
|
||||
return getS3Client().send(command)
|
||||
},
|
||||
})
|
||||
|
||||
@@ -21,16 +17,12 @@ export const s3BucketObjectsQueryOptions = (
|
||||
) =>
|
||||
queryOptions({
|
||||
queryKey: ["s3", "buckets", bucketName, "objects", prefix ?? ""],
|
||||
queryFn: async () => {
|
||||
try {
|
||||
const command = new ListObjectsV2Command({
|
||||
Bucket: bucketName,
|
||||
Prefix: prefix,
|
||||
Delimiter: "/",
|
||||
})
|
||||
return await getS3Client().send(command)
|
||||
} catch {
|
||||
throw new Error("Failed to fetch S3 bucket objects")
|
||||
}
|
||||
queryFn: () => {
|
||||
const command = new ListObjectsV2Command({
|
||||
Bucket: bucketName,
|
||||
Prefix: prefix,
|
||||
Delimiter: "/",
|
||||
})
|
||||
return getS3Client().send(command)
|
||||
},
|
||||
})
|
||||
|
||||
+4
-6
@@ -46,14 +46,12 @@ export const Route = createFileRoute(
|
||||
"/_auth/ec2/(instances)/describe-instances/$id",
|
||||
)({
|
||||
loader: async ({ context, params }) => {
|
||||
const instanceData = await context.queryClient.ensureQueryData(
|
||||
ec2InstanceQueryOptions(params.id),
|
||||
)
|
||||
const imageId = instanceData.Reservations?.[0]?.Instances?.[0]?.ImageId
|
||||
await Promise.all([
|
||||
context.queryClient.ensureQueryData(ec2ImageQueryOptions(imageId)),
|
||||
const [instanceData] = await Promise.all([
|
||||
context.queryClient.ensureQueryData(ec2InstanceQueryOptions(params.id)),
|
||||
context.queryClient.ensureQueryData(ec2InstanceTypesQueryOptions),
|
||||
])
|
||||
const imageId = instanceData.Reservations?.[0]?.Instances?.[0]?.ImageId
|
||||
await context.queryClient.ensureQueryData(ec2ImageQueryOptions(imageId))
|
||||
return instanceData
|
||||
},
|
||||
head: ({ loaderData }) => ({
|
||||
|
||||
@@ -5,8 +5,8 @@ import { useForm } from "react-hook-form"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import { FormActions } from "@/components/form-actions"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Field, FieldError, FieldTitle } from "@/components/ui/field"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { useCreateKeyPair } from "@/mutations/ec2"
|
||||
@@ -80,24 +80,13 @@ function CreateKeyPair() {
|
||||
</Field>
|
||||
|
||||
{/* Actions */}
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
onClick={() => navigate({ to: "/ec2/describe-key-pairs" })}
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
type="submit"
|
||||
>
|
||||
{isSubmitting || createMutation.isPending
|
||||
? "Creating…"
|
||||
: "Create Key Pair"}
|
||||
</Button>
|
||||
</div>
|
||||
<FormActions
|
||||
isPending={createMutation.isPending}
|
||||
isSubmitting={isSubmitting}
|
||||
onCancel={() => navigate({ to: "/ec2/describe-key-pairs" })}
|
||||
pendingLabel="Creating…"
|
||||
submitLabel="Create Key Pair"
|
||||
/>
|
||||
</form>
|
||||
|
||||
{/* Private Key Modal */}
|
||||
|
||||
+9
-32
@@ -4,20 +4,11 @@ import { Trash2 } from "lucide-react"
|
||||
import { useState } from "react"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { DeleteConfirmationDialog } from "@/components/delete-confirmation-dialog"
|
||||
import { DetailCard } from "@/components/detail-card"
|
||||
import { DetailRow } from "@/components/detail-row"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { formatDateTime } from "@/lib/utils"
|
||||
import { useDeleteKeyPair } from "@/mutations/ec2"
|
||||
@@ -125,28 +116,14 @@ function KeyPairDetail() {
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Delete Confirmation Dialog */}
|
||||
<AlertDialog onOpenChange={setShowDeleteDialog} open={showDeleteDialog}>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Delete Key Pair</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
Are you sure you want to delete the key pair "{keyPair.KeyName}"?
|
||||
This action cannot be undone. Any instances using this key pair
|
||||
will no longer be able to be accessed with it.
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
disabled={deleteMutation.isPending}
|
||||
onClick={handleDelete}
|
||||
>
|
||||
{deleteMutation.isPending ? "Deleting…" : "Delete"}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
<DeleteConfirmationDialog
|
||||
description={`Are you sure you want to delete the key pair "${keyPair.KeyName}"? This action cannot be undone. Any instances using this key pair will no longer be able to be accessed with it.`}
|
||||
isPending={deleteMutation.isPending}
|
||||
onConfirm={handleDelete}
|
||||
onOpenChange={setShowDeleteDialog}
|
||||
open={showDeleteDialog}
|
||||
title="Delete Key Pair"
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ import { useForm } from "react-hook-form"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import { FormActions } from "@/components/form-actions"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Field, FieldError, FieldTitle } from "@/components/ui/field"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { Textarea } from "@/components/ui/textarea"
|
||||
@@ -90,24 +90,13 @@ function ImportKeyPair() {
|
||||
</Field>
|
||||
|
||||
{/* Actions */}
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
disabled={isSubmitting || importMutation.isPending}
|
||||
onClick={() => navigate({ to: "/ec2/describe-key-pairs" })}
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
disabled={isSubmitting || importMutation.isPending}
|
||||
type="submit"
|
||||
>
|
||||
{isSubmitting || importMutation.isPending
|
||||
? "Importing…"
|
||||
: "Import Key Pair"}
|
||||
</Button>
|
||||
</div>
|
||||
<FormActions
|
||||
isPending={importMutation.isPending}
|
||||
isSubmitting={isSubmitting}
|
||||
onCancel={() => navigate({ to: "/ec2/describe-key-pairs" })}
|
||||
pendingLabel="Importing…"
|
||||
submitLabel="Import Key Pair"
|
||||
/>
|
||||
</form>
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -9,8 +9,8 @@ import { Controller, useForm } from "react-hook-form"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import { FormActions } from "@/components/form-actions"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Field, FieldError, FieldTitle } from "@/components/ui/field"
|
||||
import {
|
||||
Select,
|
||||
@@ -128,24 +128,13 @@ function CreateSnapshot() {
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
onClick={() => navigate({ to: "/ec2/describe-snapshots" })}
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
type="submit"
|
||||
>
|
||||
{isSubmitting || createMutation.isPending
|
||||
? "Creating\u2026"
|
||||
: "Create Snapshot"}
|
||||
</Button>
|
||||
</div>
|
||||
<FormActions
|
||||
isPending={createMutation.isPending}
|
||||
isSubmitting={isSubmitting}
|
||||
onCancel={() => navigate({ to: "/ec2/describe-snapshots" })}
|
||||
pendingLabel="Creating\u2026"
|
||||
submitLabel="Create Snapshot"
|
||||
/>
|
||||
</form>
|
||||
</>
|
||||
)
|
||||
|
||||
+9
-20
@@ -4,6 +4,7 @@ import { Copy, Trash2 } from "lucide-react"
|
||||
import { useState } from "react"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { DeleteConfirmationDialog } from "@/components/delete-confirmation-dialog"
|
||||
import { DetailCard } from "@/components/detail-card"
|
||||
import { DetailRow } from "@/components/detail-row"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
@@ -174,26 +175,14 @@ function SnapshotDetail() {
|
||||
</DetailCard>
|
||||
</div>
|
||||
|
||||
<AlertDialog onOpenChange={setShowDeleteDialog} open={showDeleteDialog}>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Delete Snapshot</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
Are you sure you want to delete the snapshot "
|
||||
{snapshot.SnapshotId}"? This action cannot be undone.
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
disabled={deleteMutation.isPending}
|
||||
onClick={handleDelete}
|
||||
>
|
||||
{deleteMutation.isPending ? "Deleting\u2026" : "Delete"}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
<DeleteConfirmationDialog
|
||||
description={`Are you sure you want to delete the snapshot "${snapshot.SnapshotId}"? This action cannot be undone.`}
|
||||
isPending={deleteMutation.isPending}
|
||||
onConfirm={handleDelete}
|
||||
onOpenChange={setShowDeleteDialog}
|
||||
open={showDeleteDialog}
|
||||
title="Delete Snapshot"
|
||||
/>
|
||||
|
||||
<AlertDialog onOpenChange={setShowCopyDialog} open={showCopyDialog}>
|
||||
<AlertDialogContent>
|
||||
|
||||
@@ -5,8 +5,8 @@ import { Controller, useForm } from "react-hook-form"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import { FormActions } from "@/components/form-actions"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Field, FieldError, FieldTitle } from "@/components/ui/field"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import {
|
||||
@@ -169,24 +169,13 @@ function CreateSubnet() {
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
onClick={() => navigate({ to: "/ec2/describe-subnets" })}
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
type="submit"
|
||||
>
|
||||
{isSubmitting || createMutation.isPending
|
||||
? "Creating\u2026"
|
||||
: "Create Subnet"}
|
||||
</Button>
|
||||
</div>
|
||||
<FormActions
|
||||
isPending={createMutation.isPending}
|
||||
isSubmitting={isSubmitting}
|
||||
onCancel={() => navigate({ to: "/ec2/describe-subnets" })}
|
||||
pendingLabel="Creating\u2026"
|
||||
submitLabel="Create Subnet"
|
||||
/>
|
||||
</form>
|
||||
</>
|
||||
)
|
||||
|
||||
+9
-30
@@ -4,21 +4,12 @@ import { Trash2 } from "lucide-react"
|
||||
import { useState } from "react"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { DeleteConfirmationDialog } from "@/components/delete-confirmation-dialog"
|
||||
import { DetailCard } from "@/components/detail-card"
|
||||
import { DetailRow } from "@/components/detail-row"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import { StateBadge } from "@/components/state-badge"
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { useDeleteSubnet } from "@/mutations/ec2"
|
||||
import { ec2SubnetQueryOptions } from "@/queries/ec2"
|
||||
@@ -139,26 +130,14 @@ function SubnetDetail() {
|
||||
</DetailCard>
|
||||
</div>
|
||||
|
||||
<AlertDialog onOpenChange={setShowDeleteDialog} open={showDeleteDialog}>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Delete Subnet</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
Are you sure you want to delete the subnet "{subnet.SubnetId}"?
|
||||
This action cannot be undone.
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
disabled={deleteMutation.isPending}
|
||||
onClick={handleDelete}
|
||||
>
|
||||
{deleteMutation.isPending ? "Deleting\u2026" : "Delete"}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
<DeleteConfirmationDialog
|
||||
description={`Are you sure you want to delete the subnet "${subnet.SubnetId}"? This action cannot be undone.`}
|
||||
isPending={deleteMutation.isPending}
|
||||
onConfirm={handleDelete}
|
||||
onOpenChange={setShowDeleteDialog}
|
||||
open={showDeleteDialog}
|
||||
title="Delete Subnet"
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ import { Controller, useForm } from "react-hook-form"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import { FormActions } from "@/components/form-actions"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Field, FieldError, FieldTitle } from "@/components/ui/field"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import {
|
||||
@@ -121,24 +121,13 @@ function CreateVolume() {
|
||||
<FieldError errors={[errors.availabilityZone]} />
|
||||
</Field>
|
||||
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
onClick={() => navigate({ to: "/ec2/describe-volumes" })}
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
type="submit"
|
||||
>
|
||||
{isSubmitting || createMutation.isPending
|
||||
? "Creating\u2026"
|
||||
: "Create Volume"}
|
||||
</Button>
|
||||
</div>
|
||||
<FormActions
|
||||
isPending={createMutation.isPending}
|
||||
isSubmitting={isSubmitting}
|
||||
onCancel={() => navigate({ to: "/ec2/describe-volumes" })}
|
||||
pendingLabel="Creating\u2026"
|
||||
submitLabel="Create Volume"
|
||||
/>
|
||||
</form>
|
||||
</>
|
||||
)
|
||||
|
||||
+7
-21
@@ -4,6 +4,7 @@ import { Camera, Link2, Link2Off, Trash2 } from "lucide-react"
|
||||
import { useState } from "react"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { DeleteConfirmationDialog } from "@/components/delete-confirmation-dialog"
|
||||
import { DetailCard } from "@/components/detail-card"
|
||||
import { DetailRow } from "@/components/detail-row"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
@@ -275,33 +276,18 @@ function VolumeDetail() {
|
||||
)}
|
||||
</div>
|
||||
|
||||
<AlertDialog
|
||||
<DeleteConfirmationDialog
|
||||
description={`Are you sure you want to delete the volume "${volume.VolumeId}"? This action cannot be undone.`}
|
||||
isPending={deleteMutation.isPending}
|
||||
onConfirm={handleDelete}
|
||||
onOpenChange={(open) => {
|
||||
if (!open) {
|
||||
closeDialog()
|
||||
}
|
||||
}}
|
||||
open={activeDialog === "delete"}
|
||||
>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Delete Volume</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
Are you sure you want to delete the volume "{volume.VolumeId}"?
|
||||
This action cannot be undone.
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
disabled={deleteMutation.isPending}
|
||||
onClick={handleDelete}
|
||||
>
|
||||
{deleteMutation.isPending ? "Deleting\u2026" : "Delete"}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
title="Delete Volume"
|
||||
/>
|
||||
|
||||
<AlertDialog
|
||||
onOpenChange={(open) => {
|
||||
|
||||
+13
-24
@@ -5,8 +5,8 @@ import { useForm } from "react-hook-form"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import { FormActions } from "@/components/form-actions"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Field, FieldError, FieldTitle } from "@/components/ui/field"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { useModifyVolume } from "@/mutations/ec2"
|
||||
@@ -107,29 +107,18 @@ function ModifyVolume() {
|
||||
<FieldError errors={[errors.size]} />
|
||||
</Field>
|
||||
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
disabled={isSubmitting || modifyMutation.isPending}
|
||||
onClick={() =>
|
||||
navigate({
|
||||
to: "/ec2/describe-volumes/$id",
|
||||
params: { id: volumeId },
|
||||
})
|
||||
}
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
disabled={isSubmitting || modifyMutation.isPending}
|
||||
type="submit"
|
||||
>
|
||||
{isSubmitting || modifyMutation.isPending
|
||||
? "Resizing\u2026"
|
||||
: "Resize Volume"}
|
||||
</Button>
|
||||
</div>
|
||||
<FormActions
|
||||
isPending={modifyMutation.isPending}
|
||||
isSubmitting={isSubmitting}
|
||||
onCancel={() =>
|
||||
navigate({
|
||||
to: "/ec2/describe-volumes/$id",
|
||||
params: { id: volumeId },
|
||||
})
|
||||
}
|
||||
pendingLabel="Resizing\u2026"
|
||||
submitLabel="Resize Volume"
|
||||
/>
|
||||
</form>
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -4,8 +4,8 @@ import { useForm } from "react-hook-form"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import { FormActions } from "@/components/form-actions"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Field, FieldError, FieldTitle } from "@/components/ui/field"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { useCreateVpc } from "@/mutations/ec2"
|
||||
@@ -79,24 +79,13 @@ function CreateVpc() {
|
||||
<Input id="name" placeholder="my-vpc" {...register("name")} />
|
||||
</Field>
|
||||
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
onClick={() => navigate({ to: "/ec2/describe-vpcs" })}
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
type="submit"
|
||||
>
|
||||
{isSubmitting || createMutation.isPending
|
||||
? "Creating\u2026"
|
||||
: "Create VPC"}
|
||||
</Button>
|
||||
</div>
|
||||
<FormActions
|
||||
isPending={createMutation.isPending}
|
||||
isSubmitting={isSubmitting}
|
||||
onCancel={() => navigate({ to: "/ec2/describe-vpcs" })}
|
||||
pendingLabel="Creating\u2026"
|
||||
submitLabel="Create VPC"
|
||||
/>
|
||||
</form>
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -5,21 +5,12 @@ import { Trash2 } from "lucide-react"
|
||||
import { useState } from "react"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { DeleteConfirmationDialog } from "@/components/delete-confirmation-dialog"
|
||||
import { DetailCard } from "@/components/detail-card"
|
||||
import { DetailRow } from "@/components/detail-row"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import { StateBadge } from "@/components/state-badge"
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { useDeleteVpc } from "@/mutations/ec2"
|
||||
import { ec2SubnetsQueryOptions, ec2VpcQueryOptions } from "@/queries/ec2"
|
||||
@@ -152,27 +143,14 @@ function VpcDetail() {
|
||||
)}
|
||||
</div>
|
||||
|
||||
<AlertDialog onOpenChange={setShowDeleteDialog} open={showDeleteDialog}>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Delete VPC</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
Are you sure you want to delete the VPC "{vpc.VpcId}"? This action
|
||||
cannot be undone. The VPC must have no associated subnets or
|
||||
internet gateways.
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
disabled={deleteMutation.isPending}
|
||||
onClick={handleDelete}
|
||||
>
|
||||
{deleteMutation.isPending ? "Deleting\u2026" : "Delete"}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
<DeleteConfirmationDialog
|
||||
description={`Are you sure you want to delete the VPC "${vpc.VpcId}"? This action cannot be undone. The VPC must have no associated subnets or internet gateways.`}
|
||||
isPending={deleteMutation.isPending}
|
||||
onConfirm={handleDelete}
|
||||
onOpenChange={setShowDeleteDialog}
|
||||
open={showDeleteDialog}
|
||||
title="Delete VPC"
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
+3
-11
@@ -1,6 +1,5 @@
|
||||
import { useNavigate } from "@tanstack/react-router"
|
||||
import { AlertTriangle, Check, Download } from "lucide-react"
|
||||
import { useState } from "react"
|
||||
|
||||
import {
|
||||
AlertDialog,
|
||||
@@ -14,8 +13,7 @@ import {
|
||||
} from "@/components/ui/alert-dialog"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Textarea } from "@/components/ui/textarea"
|
||||
|
||||
const COPY_FEEDBACK_DURATION_MS = 2000
|
||||
import { useCopyToClipboard } from "@/hooks/use-copy-to-clipboard"
|
||||
|
||||
interface PrivateKeyModalProps {
|
||||
open: boolean
|
||||
@@ -29,13 +27,7 @@ export function PrivateKeyModal({
|
||||
keyMaterial,
|
||||
}: PrivateKeyModalProps) {
|
||||
const navigate = useNavigate()
|
||||
const [copied, setCopied] = useState(false)
|
||||
|
||||
const handleCopy = async () => {
|
||||
await navigator.clipboard.writeText(keyMaterial)
|
||||
setCopied(true)
|
||||
setTimeout(() => setCopied(false), COPY_FEEDBACK_DURATION_MS)
|
||||
}
|
||||
const { copied, copy } = useCopyToClipboard()
|
||||
|
||||
const handleDownload = () => {
|
||||
const blob = new Blob([keyMaterial], { type: "text/plain" })
|
||||
@@ -77,7 +69,7 @@ export function PrivateKeyModal({
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
className="flex-1"
|
||||
onClick={handleCopy}
|
||||
onClick={() => copy(keyMaterial)}
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
|
||||
@@ -4,8 +4,8 @@ import { useForm } from "react-hook-form"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import { FormActions } from "@/components/form-actions"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Field, FieldError, FieldTitle } from "@/components/ui/field"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { Textarea } from "@/components/ui/textarea"
|
||||
@@ -106,24 +106,13 @@ function CreatePolicy() {
|
||||
<FieldError errors={[errors.policyDocument]} />
|
||||
</Field>
|
||||
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
onClick={() => navigate({ to: "/iam/list-policies" })}
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
type="submit"
|
||||
>
|
||||
{isSubmitting || createMutation.isPending
|
||||
? "Creating..."
|
||||
: "Create Policy"}
|
||||
</Button>
|
||||
</div>
|
||||
<FormActions
|
||||
isPending={createMutation.isPending}
|
||||
isSubmitting={isSubmitting}
|
||||
onCancel={() => navigate({ to: "/iam/list-policies" })}
|
||||
pendingLabel="Creating..."
|
||||
submitLabel="Create Policy"
|
||||
/>
|
||||
</form>
|
||||
</>
|
||||
)
|
||||
|
||||
+9
-30
@@ -4,20 +4,11 @@ import { Trash2 } from "lucide-react"
|
||||
import { useState } from "react"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { DeleteConfirmationDialog } from "@/components/delete-confirmation-dialog"
|
||||
import { DetailCard } from "@/components/detail-card"
|
||||
import { DetailRow } from "@/components/detail-row"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { formatDateTime } from "@/lib/utils"
|
||||
import { useDeletePolicy } from "@/mutations/iam"
|
||||
@@ -143,26 +134,14 @@ function PolicyDetail() {
|
||||
)}
|
||||
</div>
|
||||
|
||||
<AlertDialog onOpenChange={setShowDeleteDialog} open={showDeleteDialog}>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Delete Policy</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
Are you sure you want to delete the policy "{policy.PolicyName}"?
|
||||
This action cannot be undone.
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
disabled={deleteMutation.isPending}
|
||||
onClick={handleDelete}
|
||||
>
|
||||
{deleteMutation.isPending ? "Deleting..." : "Delete"}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
<DeleteConfirmationDialog
|
||||
description={`Are you sure you want to delete the policy "${policy.PolicyName}"? This action cannot be undone.`}
|
||||
isPending={deleteMutation.isPending}
|
||||
onConfirm={handleDelete}
|
||||
onOpenChange={setShowDeleteDialog}
|
||||
open={showDeleteDialog}
|
||||
title="Delete Policy"
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ import { useForm } from "react-hook-form"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import { FormActions } from "@/components/form-actions"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Field, FieldError, FieldTitle } from "@/components/ui/field"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { useCreateUser } from "@/mutations/iam"
|
||||
@@ -66,24 +66,13 @@ function CreateUser() {
|
||||
<FieldError errors={[errors.path]} />
|
||||
</Field>
|
||||
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
onClick={() => navigate({ to: "/iam/list-users" })}
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
type="submit"
|
||||
>
|
||||
{isSubmitting || createMutation.isPending
|
||||
? "Creating..."
|
||||
: "Create User"}
|
||||
</Button>
|
||||
</div>
|
||||
<FormActions
|
||||
isPending={createMutation.isPending}
|
||||
isSubmitting={isSubmitting}
|
||||
onCancel={() => navigate({ to: "/iam/list-users" })}
|
||||
pendingLabel="Creating..."
|
||||
submitLabel="Create User"
|
||||
/>
|
||||
</form>
|
||||
</>
|
||||
)
|
||||
|
||||
+9
-32
@@ -5,21 +5,12 @@ import { Trash2 } from "lucide-react"
|
||||
import { useState } from "react"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { DeleteConfirmationDialog } from "@/components/delete-confirmation-dialog"
|
||||
import { DetailCard } from "@/components/detail-card"
|
||||
import { DetailRow } from "@/components/detail-row"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import { StateBadge } from "@/components/state-badge"
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { formatDateTime } from "@/lib/utils"
|
||||
import {
|
||||
@@ -372,28 +363,14 @@ function UserDetail() {
|
||||
</DetailCard>
|
||||
</div>
|
||||
|
||||
{/* Delete Confirmation Dialog */}
|
||||
<AlertDialog onOpenChange={setShowDeleteDialog} open={showDeleteDialog}>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Delete User</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
Are you sure you want to delete the user "{userName}"? This action
|
||||
cannot be undone. You must detach all policies and delete all
|
||||
access keys first.
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
disabled={deleteMutation.isPending}
|
||||
onClick={handleDelete}
|
||||
>
|
||||
{deleteMutation.isPending ? "Deleting..." : "Delete"}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
<DeleteConfirmationDialog
|
||||
description={`Are you sure you want to delete the user "${userName}"? This action cannot be undone. You must detach all policies and delete all access keys first.`}
|
||||
isPending={deleteMutation.isPending}
|
||||
onConfirm={handleDelete}
|
||||
onOpenChange={setShowDeleteDialog}
|
||||
open={showDeleteDialog}
|
||||
title="Delete User"
|
||||
/>
|
||||
|
||||
{/* Access Key Secret Modal */}
|
||||
{newAccessKey && (
|
||||
|
||||
+7
-27
@@ -1,5 +1,4 @@
|
||||
import { AlertTriangle, Check } from "lucide-react"
|
||||
import { useEffect, useRef, useState } from "react"
|
||||
|
||||
import {
|
||||
AlertDialog,
|
||||
@@ -12,8 +11,7 @@ import {
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog"
|
||||
import { Button } from "@/components/ui/button"
|
||||
|
||||
const COPY_FEEDBACK_DURATION_MS = 2000
|
||||
import { useCopyToClipboard } from "@/hooks/use-copy-to-clipboard"
|
||||
|
||||
interface AccessKeyModalProps {
|
||||
onClose: () => void
|
||||
@@ -26,29 +24,7 @@ export function AccessKeyModal({
|
||||
accessKeyId,
|
||||
secretAccessKey,
|
||||
}: AccessKeyModalProps) {
|
||||
const [copied, setCopied] = useState(false)
|
||||
const timerRef = useRef<ReturnType<typeof setTimeout>>(null)
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
if (timerRef.current) {
|
||||
clearTimeout(timerRef.current)
|
||||
}
|
||||
}
|
||||
}, [])
|
||||
|
||||
const handleCopy = async () => {
|
||||
const text = `Access Key ID: ${accessKeyId}\nSecret Access Key: ${secretAccessKey}`
|
||||
await navigator.clipboard.writeText(text)
|
||||
setCopied(true)
|
||||
if (timerRef.current) {
|
||||
clearTimeout(timerRef.current)
|
||||
}
|
||||
timerRef.current = setTimeout(
|
||||
() => setCopied(false),
|
||||
COPY_FEEDBACK_DURATION_MS,
|
||||
)
|
||||
}
|
||||
const { copied, copy } = useCopyToClipboard()
|
||||
|
||||
return (
|
||||
<AlertDialog open>
|
||||
@@ -78,7 +54,11 @@ export function AccessKeyModal({
|
||||
|
||||
<Button
|
||||
className="w-full"
|
||||
onClick={handleCopy}
|
||||
onClick={() =>
|
||||
copy(
|
||||
`Access Key ID: ${accessKeyId}\nSecret Access Key: ${secretAccessKey}`,
|
||||
)
|
||||
}
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
|
||||
@@ -4,8 +4,8 @@ import { useForm } from "react-hook-form"
|
||||
|
||||
import { BackLink } from "@/components/back-link"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import { FormActions } from "@/components/form-actions"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Field, FieldError, FieldTitle } from "@/components/ui/field"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { useCreateBucket } from "@/mutations/s3"
|
||||
@@ -67,24 +67,13 @@ function CreateBucket() {
|
||||
<FieldError errors={[errors.bucketName]} />
|
||||
</Field>
|
||||
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
onClick={() => navigate({ to: "/s3/ls" })}
|
||||
type="button"
|
||||
variant="outline"
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
disabled={isSubmitting || createMutation.isPending}
|
||||
type="submit"
|
||||
>
|
||||
{isSubmitting || createMutation.isPending
|
||||
? "Creating\u2026"
|
||||
: "Create Bucket"}
|
||||
</Button>
|
||||
</div>
|
||||
<FormActions
|
||||
isPending={createMutation.isPending}
|
||||
isSubmitting={isSubmitting}
|
||||
onCancel={() => navigate({ to: "/s3/ls" })}
|
||||
pendingLabel="Creating\u2026"
|
||||
submitLabel="Create Bucket"
|
||||
/>
|
||||
</form>
|
||||
</>
|
||||
)
|
||||
|
||||
+16
-32
@@ -3,19 +3,10 @@ import { GetObjectCommand } from "@aws-sdk/client-s3"
|
||||
import { Download, File, Trash2 } from "lucide-react"
|
||||
import { useState } from "react"
|
||||
|
||||
import { DeleteConfirmationDialog } from "@/components/delete-confirmation-dialog"
|
||||
import { ErrorBanner } from "@/components/error-banner"
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog"
|
||||
import { getS3Client } from "@/lib/awsClient"
|
||||
import { formatSize } from "@/lib/utils"
|
||||
import { formatDateTime, formatSize } from "@/lib/utils"
|
||||
import { useDeleteObject } from "@/mutations/s3"
|
||||
|
||||
interface ObjectListItemProps {
|
||||
@@ -85,7 +76,7 @@ export function ObjectListItem({
|
||||
<h3 className="font-medium">{displayName}</h3>
|
||||
{object.LastModified && (
|
||||
<p className="text-muted-foreground text-sm">
|
||||
Last Modified: {object.LastModified.toLocaleString()}
|
||||
Last Modified: {formatDateTime(object.LastModified)}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
@@ -110,26 +101,19 @@ export function ObjectListItem({
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<AlertDialog onOpenChange={setShowDeleteDialog} open={showDeleteDialog}>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>Delete Object</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
Are you sure you want to delete <strong>{displayName}</strong>?
|
||||
This action cannot be undone.
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
||||
<AlertDialogAction
|
||||
className="bg-destructive hover:bg-destructive/90"
|
||||
onClick={handleDelete}
|
||||
>
|
||||
{deleteMutation.isPending ? "Deleting…" : "Delete"}
|
||||
</AlertDialogAction>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
<DeleteConfirmationDialog
|
||||
description={
|
||||
<>
|
||||
Are you sure you want to delete <strong>{displayName}</strong>?
|
||||
This action cannot be undone.
|
||||
</>
|
||||
}
|
||||
isPending={deleteMutation.isPending}
|
||||
onConfirm={handleDelete}
|
||||
onOpenChange={setShowDeleteDialog}
|
||||
open={showDeleteDialog}
|
||||
title="Delete Object"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -5,6 +5,7 @@ import { createFileRoute, Link } from "@tanstack/react-router"
|
||||
import { ListCard } from "@/components/list-card"
|
||||
import { PageHeading } from "@/components/page-heading"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { formatDateTime } from "@/lib/utils"
|
||||
import { s3BucketsQueryOptions } from "@/queries/s3"
|
||||
|
||||
export const Route = createFileRoute("/_auth/s3/ls/")({
|
||||
@@ -49,7 +50,7 @@ function Buckets() {
|
||||
params={{ bucket: bucket.Name }}
|
||||
subtitle={
|
||||
bucket.CreationDate
|
||||
? `Created: ${bucket.CreationDate.toLocaleString()}`
|
||||
? `Created: ${formatDateTime(bucket.CreationDate)}`
|
||||
: undefined
|
||||
}
|
||||
title={bucket.Name}
|
||||
|
||||
Reference in New Issue
Block a user