feat: frontend performance

This commit is contained in:
Julian Sommer
2026-03-10 10:31:59 +10:00
parent 404b3d6246
commit 015dbbc272
55 changed files with 142 additions and 138 deletions
+1 -1
View File
@@ -1 +1 @@
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};
import{c as B,G as $,H as C,z as F,j as s,y as K,I as b,J 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=C(v||""),{data:m}=E(F(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 f;e[4]!==P?(f=s.jsx(O,{to:P,children:"Back"}),e[4]=P,e[5]=f):f=e[5];let x;e[6]!==n||e[7]!==r||e[8]!==a.isPending||e[9]!==a.mutateAsync?(x=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]=x):x=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:[f,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))}),x]})}),h,g,j,N]})}export{V as component};
+1 -1
View File
@@ -1 +1 @@
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};
import{aK as D,u as b,aL as f,w as v,r as g,j as e,n as I,B as C,L as V}from"./index.js";import{u as d}from"./useSuspenseQuery.js";import{B as u}from"./back-link.js";import{D as S}from"./delete-confirmation-dialog.js";import{D as n,a as t}from"./detail-row.js";import{E as y}from"./error-banner.js";import{P}from"./page-heading.js";import{S as B}from"./state-badge.js";import{g as k}from"./ec2.js";import{T as w}from"./trash-2.js";import"./alert-dialog.js";function z(){const{id:l}=D.useParams(),m=b(),{data:p}=d(f(l)),{data:x}=d(v),s=p.Vpcs?.[0],r=k(),[j,o]=g.useState(!1),i=x.Subnets?.filter(a=>a.VpcId===l)??[],h=async()=>{try{await r.mutateAsync(l),m({to:"/ec2/describe-vpcs"})}finally{o(!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=I(s.Tags);return e.jsxs(e.Fragment,{children:[e.jsx(u,{to:"/ec2/describe-vpcs",children:"Back to VPCs"}),r.error&&e.jsx(y,{error:r.error,msg:"Failed to delete VPC"}),e.jsxs("div",{className:"space-y-6",children:[e.jsx(P,{actions:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(C,{onClick:()=>o(!0),size:"sm",variant:"destructive",children:[e.jsx(w,{className:"size-4"}),"Delete"]}),e.jsx(B,{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(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})]})]}),i.length>0&&e.jsxs(n,{children:[e.jsxs(n.Header,{children:["Subnets (",i.length,")"]}),i.map(a=>a.SubnetId?e.jsxs(n.Content,{children:[e.jsx(t,{label:"Subnet ID",value:e.jsx(V,{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(S,{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:o,open:j,title:"Delete VPC"})]})}export{z as component};
+1 -1
View File
@@ -1 +1 @@
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};
import{c as G,aM as L,u as C,j as s,aN 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 M}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=G.c(53),{id:B}=L.useParams(),l=C();let v;e[0]!==B?(v=Q(B),e[0]=B,e[1]=v):v=e[1];const{data:_}=T(v),I=_.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:A}=O(y),{errors:F,isSubmitting:E}=A;if(!t){let o;return e[9]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsxs(s.Fragment,{children:[s.jsx(M,{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(M,{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 N;return e[48]!==j||e[49]!==n||e[50]!==c||e[51]!==u?(N=s.jsxs(s.Fragment,{children:[n,c,u,j]}),e[48]=j,e[49]=n,e[50]=c,e[51]=u,e[52]=N):N=e[52],N}export{ue as component};
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
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};
import{cY as b,u as p,cZ as x,r as j,j as e,n as S,B as f,L as h}from"./index.js";import{u as D}from"./useSuspenseQuery.js";import{B as l}from"./back-link.js";import{D as g}from"./delete-confirmation-dialog.js";import{D as o,a as s}from"./detail-row.js";import{E as v}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 Z(){const{id:r}=b.useParams(),u=p(),{data:c}=D(x(r)),t=c.Subnets?.[0],a=C(),[d,n]=j.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=S(t.Tags);return e.jsxs(e.Fragment,{children:[e.jsx(l,{to:"/ec2/describe-subnets",children:"Back to Subnets"}),a.error&&e.jsx(v,{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(f,{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(g,{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{Z as component};
+1 -1
View File
@@ -1 +1 @@
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};
import{K as w,c_ 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 $,c as H,d as M,e as Q,h as _}from"./alert-dialog.js";import{b as G,a as K}from"./field.js";import{I as Y}from"./input.js";import{m as q,n as J}from"./ec2.js";import{T as U}from"./trash-2.js";const W=[["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"}]],X=w("copy",W);function he(){const{id:n}=k.useParams(),j=N(),{data:D}=u(B(n)),{data:y}=u(P),s=D.Snapshots?.[0],a=q(),o=J(),[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(U,{className:"size-4"}),"Delete"]}),e.jsxs(m,{disabled:!h,onClick:()=>r(!0),size:"sm",variant:"outline",children:[e.jsx(X,{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($,{children:"Copy Snapshot"}),e.jsx(H,{children:"Create a copy of this snapshot in the current region."})]}),e.jsxs(G,{children:[e.jsx(K,{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(M,{children:[e.jsx(Q,{children:"Cancel"}),e.jsx(_,{disabled:o.isPending,onClick:b,children:o.isPending?"Copying…":"Copy Snapshot"})]})]})})]})}export{he as component};
+1 -1
View File
@@ -1 +1 @@
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};
import{d0 as p,u as x,d1 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};
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
import{c as f,d4 as u,j as t,d3 as p}from"./index.js";import{u as x}from"./useSuspenseQuery.js";import{B as d}from"./back-link.js";import{P as I}from"./page-heading.js";import{S as j}from"./state-badge.js";import{A as h}from"./ami-details.js";import"./detail-row.js";function _(){const e=f.c(14),{id:n}=u.useParams();let o;e[0]!==n?(o=p(n),e[0]=n,e[1]=o):o=e[1];const{data:g}=x(o),s=g?.Images?.[0];if(!s?.ImageId){let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs(t.Fragment,{children:[t.jsx(d,{to:"/ec2/describe-images",children:"Back to images"}),t.jsx("p",{className:"text-muted-foreground",children:"Image not found."})]}),e[2]=l):l=e[2],l}let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(d,{to:"/ec2/describe-images",children:"Back to images"}),e[3]=r):r=e[3];let a;e[4]!==s.State?(a=t.jsx(j,{state:s.State}),e[4]=s.State,e[5]=a):a=e[5];let i;e[6]!==s.ImageId||e[7]!==a?(i=t.jsx(I,{actions:a,subtitle:"EC2 Image Details",title:s.ImageId}),e[6]=s.ImageId,e[7]=a,e[8]=i):i=e[8];let m;e[9]!==s?(m=t.jsx(h,{image:s,showExtendedDetails:!0}),e[9]=s,e[10]=m):m=e[10];let c;return e[11]!==i||e[12]!==m?(c=t.jsxs(t.Fragment,{children:[r,t.jsxs("div",{className:"space-y-6",children:[i,m]})]}),e[11]=i,e[12]=m,e[13]=c):c=e[13],c}export{_ as component};
import{c as f,d5 as u,j as t,d4 as p}from"./index.js";import{u as x}from"./useSuspenseQuery.js";import{B as d}from"./back-link.js";import{P as I}from"./page-heading.js";import{S as j}from"./state-badge.js";import{A as h}from"./ami-details.js";import"./detail-row.js";function _(){const e=f.c(14),{id:n}=u.useParams();let o;e[0]!==n?(o=p(n),e[0]=n,e[1]=o):o=e[1];const{data:g}=x(o),s=g?.Images?.[0];if(!s?.ImageId){let l;return e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs(t.Fragment,{children:[t.jsx(d,{to:"/ec2/describe-images",children:"Back to images"}),t.jsx("p",{className:"text-muted-foreground",children:"Image not found."})]}),e[2]=l):l=e[2],l}let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(d,{to:"/ec2/describe-images",children:"Back to images"}),e[3]=r):r=e[3];let a;e[4]!==s.State?(a=t.jsx(j,{state:s.State}),e[4]=s.State,e[5]=a):a=e[5];let i;e[6]!==s.ImageId||e[7]!==a?(i=t.jsx(I,{actions:a,subtitle:"EC2 Image Details",title:s.ImageId}),e[6]=s.ImageId,e[7]=a,e[8]=i):i=e[8];let m;e[9]!==s?(m=t.jsx(h,{image:s,showExtendedDetails:!0}),e[9]=s,e[10]=m):m=e[10];let c;return e[11]!==i||e[12]!==m?(c=t.jsxs(t.Fragment,{children:[r,t.jsxs("div",{className:"space-y-6",children:[i,m]})]}),e[11]=i,e[12]=m,e[13]=c):c=e[13],c}export{_ as component};
+1 -1
View File
@@ -1 +1 @@
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};
import{c as f,j as e,aw as j,u as P,ax as h,r as g,ay as v,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]=g.useState(!1),x=o?.DefaultVersionId??"v1",{data:m}=u(v(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};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
import{J as o,c as r,j as l,L as a}from"./index.js";const m=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],x=o("arrow-left",m);function p(i){const e=r.c(7);let s,t;e[0]!==i?({children:s,...t}=i,e[0]=i,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx(x,{className:"size-4"}),e[3]=n):n=e[3];let c;return e[4]!==s||e[5]!==t?(c=l.jsxs(a,{className:"mb-6 inline-flex items-center gap-2 text-sm",...t,children:[n,s]}),e[4]=s,e[5]=t,e[6]=c):c=e[6],c}export{p as B};
import{K as o,c as r,j as l,L as a}from"./index.js";const m=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],x=o("arrow-left",m);function p(i){const e=r.c(7);let s,t;e[0]!==i?({children:s,...t}=i,e[0]=i,e[1]=s,e[2]=t):(s=e[1],t=e[2]);let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=l.jsx(x,{className:"size-4"}),e[3]=n):n=e[3];let c;return e[4]!==s||e[5]!==t?(c=l.jsxs(a,{className:"mb-6 inline-flex items-center gap-2 text-sm",...t,children:[n,s]}),e[4]=s,e[5]=t,e[6]=c):c=e[6],c}export{p as B};
+1 -1
View File
@@ -1 +1 @@
import{J as c}from"./index.js";const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t=c("check",e);export{t as C};
import{K as c}from"./index.js";const e=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],t=c("check",e);export{t as C};
@@ -1 +1 @@
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};
import{c as z,u as G,p 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 p;e[32]!==o?(p=()=>o({to:"/ec2/describe-snapshots"}),e[32]=o,e[33]=p):p=e[33];let f;e[34]!==s.isPending||e[35]!==R||e[36]!==p?(f=t.jsx(W,{isPending:s.isPending,isSubmitting:R,onCancel:p,pendingLabel:"Creating\\u2026",submitLabel:"Create Snapshot"}),e[34]=s.isPending,e[35]=R,e[36]=p,e[37]=f):f=e[37];let h;e[38]!==c||e[39]!==u||e[40]!==f||e[41]!==i?(h=t.jsxs("form",{className:"max-w-4xl space-y-6",onSubmit:i,children:[c,u,f]}),e[38]=c,e[39]=u,e[40]=f,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
View File
@@ -1 +1 @@
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};
import{c as se,u as le,m as ie,l as re,j as t,n as ne}from"./index.js";import{a as ae,u as oe,C as J}from"./zod.js";import{u as K}from"./useSuspenseQuery.js";import{B as ce}from"./back-link.js";import{E as de}from"./error-banner.js";import{F as me}from"./form-actions.js";import{P as ue}from"./page-heading.js";import{F as U,a as q,b as z}from"./field.js";import{I as fe}from"./input.js";import{S as W,a as X,b as Y,c as ee,d as G}from"./select.js";import{b as pe}from"./ec2.js";import{b as be}from"./ec22.js";import"./check.js";function Ne(){const e=se.c(61),s=le(),{data:w}=K(ie),{data:T}=K(re),l=pe();let C;e[0]!==w.Vpcs?(C=w.Vpcs??[],e[0]=w.Vpcs,e[1]=C):C=e[1];const B=C;let V;e[2]!==T.AvailabilityZones?(V=T.AvailabilityZones??[],e[2]=T.AvailabilityZones,e[3]=V):V=e[3];const D=V;let k;e[4]===Symbol.for("react.memo_cache_sentinel")?(k=ae(be),e[4]=k):k=e[4];const L=B[0]?.VpcId??"";let F;e[5]!==L?(F={resolver:k,defaultValues:{vpcId:L,cidrBlock:"10.0.1.0/24",availabilityZone:""}},e[5]=L,e[6]=F):F=e[6];const{control:n,handleSubmit:Q,register:R,formState:te}=oe(F),{errors:i,isSubmitting:O}=te;let Z;e[7]!==l||e[8]!==s?(Z=async y=>{const r=(await l.mutateAsync(y)).Subnet?.SubnetId;s(r?{to:"/ec2/describe-subnets/$id",params:{id:r}}:{to:"/ec2/describe-subnets"})},e[7]=l,e[8]=s,e[9]=Z):Z=e[9];const H=Z;let _,N;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(ce,{to:"/ec2/describe-subnets",children:"Back to Subnets"}),N=t.jsx(ue,{title:"Create Subnet"}),e[10]=_,e[11]=N):(_=e[10],N=e[11]);let a;e[12]!==l.error?(a=l.error&&t.jsx(de,{error:l.error,msg:"Failed to create subnet"}),e[12]=l.error,e[13]=a):a=e[13];let o;e[14]!==Q||e[15]!==H?(o=Q(H),e[14]=Q,e[15]=H,e[16]=o):o=e[16];let A;e[17]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(q,{children:t.jsx("label",{htmlFor:"vpcId",children:"VPC"})}),e[17]=A):A=e[17];let c;e[18]!==i.vpcId||e[19]!==B?(c=y=>{const{field:I}=y;return t.jsxs(W,{onValueChange:r=>I.onChange(r),value:I.value??"",children:[t.jsx(X,{"aria-invalid":!!i.vpcId,className:"w-full",id:"vpcId",children:t.jsx(Y,{})}),t.jsx(ee,{children:B.map(he)})]})},e[18]=i.vpcId,e[19]=B,e[20]=c):c=e[20];let d;e[21]!==n||e[22]!==c?(d=t.jsx(J,{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(z,{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(q,{children:t.jsx("label",{htmlFor:"cidrBlock",children:"CIDR Block"})}),e[29]=P):P=e[29];const M=!!i.cidrBlock;let f;e[30]!==R?(f=R("cidrBlock"),e[30]=R,e[31]=f):f=e[31];let p;e[32]!==M||e[33]!==f?(p=t.jsx(fe,{"aria-invalid":M,id:"cidrBlock",placeholder:"10.0.1.0/24",...f}),e[32]=M,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(z,{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(q,{children:t.jsx("label",{htmlFor:"availabilityZone",children:"Availability Zone (optional)"})}),e[40]=$):$=e[40];let h;e[41]!==D?(h=y=>{const{field:I}=y;return t.jsxs(W,{onValueChange:r=>I.onChange(r==="none"?"":r),value:I.value||"none",children:[t.jsx(X,{className:"w-full",id:"availabilityZone",children:t.jsx(Y,{})}),t.jsxs(ee,{children:[t.jsx(G,{value:"none",children:"none"}),D.map(xe)]})]})},e[41]=D,e[42]=h):h=e[42];let j;e[43]!==n||e[44]!==h?(j=t.jsxs(z,{children:[$,t.jsx(J,{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(me,{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:[_,N,a,g]}),e[58]=g,e[59]=a,e[60]=E):E=e[60],E}function xe(e){return t.jsx(G,{value:e.ZoneName??"",children:e.ZoneName},e.ZoneName)}function he(e){const s=ne(e.Tags);return t.jsx(G,{value:e.VpcId??"",children:s?`${e.VpcId} (${s})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}export{Ne as component};
+1 -1
View File
@@ -1 +1 @@
import{J as o}from"./index.js";const a=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],e=o("download",a);export{e as D};
import{K as o}from"./index.js";const a=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],e=o("download",a);export{e as D};
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
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};
import{o as i,k as e,aO as a,aP as o,aQ as c}from"./index.js";const n=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}$/,t=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({imageId:e("Please select an Image"),instanceType:e("Please select an instance type"),keyName:e("Please select a key pair"),subnetId:e().optional(),count:o("Instance count must be a whole number").min(1,"Instance count must be at least 1")}),l=i({keyName:t}),u=i({keyName:t,publicKeyMaterial:e().min(1,"Public key is required").refine(s=>s.trim().length>0,"Public key cannot be empty")}),d=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")}),b=i({size:a().int("Size must be a whole number").min(1,"Size must be at least 1 GiB")}),p=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:c().optional()});i({instanceType:e().min(1,"Instance type is required")});i({name:e().min(1,"Name is required"),description:e().optional()});const y=i({vpcId:e().min(1,"VPC is required"),cidrBlock:e().min(1,"CIDR block is required").regex(n,"Must be a valid CIDR block (e.g. 10.0.1.0/24)"),availabilityZone:e().optional()}),I=i({cidrBlock:e().min(1,"CIDR block is required").regex(n,"Must be a valid CIDR block (e.g. 10.0.0.0/16)"),name:e().optional()});export{d as a,y as b,I as c,p as d,l as e,m as f,u as i,b as m};
+1 -1
View File
@@ -1 +1 @@
import{ba as d,bd as m,bp as c,bq as b,bn as l,aq as p,r as h,bf as v,bo as f,c as y,j as u}from"./index.js";var x=class extends d{#e;#i=void 0;#t;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#e.defaultMutationOptions(e),m(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),t?.mutationKey&&this.options.mutationKey&&c(t.mutationKey)!==c(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(e){this.#r(),this.#o(e)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(e,t){return this.#s=t,this.#t?.removeObserver(this),this.#t=this.#e.getMutationCache().build(this.#e,this.options),this.#t.addObserver(this),this.#t.execute(e)}#r(){const e=this.#t?.state??b();this.#i={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#o(e){l.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#i.variables,r=this.#i.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#s.onSuccess?.(e.data,t,r,s)}catch(i){Promise.reject(i)}try{this.#s.onSettled?.(e.data,null,t,r,s)}catch(i){Promise.reject(i)}}else if(e?.type==="error"){try{this.#s.onError?.(e.error,t,r,s)}catch(i){Promise.reject(i)}try{this.#s.onSettled?.(void 0,e.error,t,r,s)}catch(i){Promise.reject(i)}}}this.listeners.forEach(t=>{t(this.#i)})})}};function E(e,t){const r=p(),[s]=h.useState(()=>new x(r,e));h.useEffect(()=>{s.setOptions(e)},[s,e]);const i=h.useSyncExternalStore(h.useCallback(o=>s.subscribe(l.batchCalls(o)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),n=h.useCallback((o,a)=>{s.mutate(o,a).catch(v)},[s]);if(i.error&&f(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:n,mutateAsync:i.mutate}}function g(e){const t=y.c(7),{msg:r,error:s}=e;let i;s&&(i=s.name!=="Error"?s.name:s.message);let n;t[0]!==r?(n=r&&u.jsx("h2",{className:"text-destructive text-sm",children:r}),t[0]=r,t[1]=n):n=t[1];let o;t[2]!==i?(o=i&&u.jsx("p",{className:"text-destructive text-sm",children:i}),t[2]=i,t[3]=o):o=t[3];let a;return t[4]!==n||t[5]!==o?(a=u.jsxs("div",{className:"mb-6 max-w-4xl rounded-md border border-destructive bg-destructive/10 p-4",children:[n,o]}),t[4]=n,t[5]=o,t[6]=a):a=t[6],a}export{g as E,E as u};
import{bb as d,be as m,bq as c,br as b,bo as l,ar as p,r as h,bg as v,bp as f,c as y,j as u}from"./index.js";var x=class extends d{#e;#i=void 0;#t;#s;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#e.defaultMutationOptions(e),m(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),t?.mutationKey&&this.options.mutationKey&&c(t.mutationKey)!==c(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(e){this.#r(),this.#o(e)}getCurrentResult(){return this.#i}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#o()}mutate(e,t){return this.#s=t,this.#t?.removeObserver(this),this.#t=this.#e.getMutationCache().build(this.#e,this.options),this.#t.addObserver(this),this.#t.execute(e)}#r(){const e=this.#t?.state??b();this.#i={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#o(e){l.batch(()=>{if(this.#s&&this.hasListeners()){const t=this.#i.variables,r=this.#i.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#s.onSuccess?.(e.data,t,r,s)}catch(i){Promise.reject(i)}try{this.#s.onSettled?.(e.data,null,t,r,s)}catch(i){Promise.reject(i)}}else if(e?.type==="error"){try{this.#s.onError?.(e.error,t,r,s)}catch(i){Promise.reject(i)}try{this.#s.onSettled?.(void 0,e.error,t,r,s)}catch(i){Promise.reject(i)}}}this.listeners.forEach(t=>{t(this.#i)})})}};function g(e,t){const r=p(),[s]=h.useState(()=>new x(r,e));h.useEffect(()=>{s.setOptions(e)},[s,e]);const i=h.useSyncExternalStore(h.useCallback(o=>s.subscribe(l.batchCalls(o)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),n=h.useCallback((o,a)=>{s.mutate(o,a).catch(v)},[s]);if(i.error&&f(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:n,mutateAsync:i.mutate}}function E(e){const t=y.c(7),{msg:r,error:s}=e;let i;s&&(i=s.name!=="Error"?s.name:s.message);let n;t[0]!==r?(n=r&&u.jsx("h2",{className:"text-destructive text-sm",children:r}),t[0]=r,t[1]=n):n=t[1];let o;t[2]!==i?(o=i&&u.jsx("p",{className:"text-destructive text-sm",children:i}),t[2]=i,t[3]=o):o=t[3];let a;return t[4]!==n||t[5]!==o?(a=u.jsxs("div",{className:"mb-6 max-w-4xl rounded-md border border-destructive bg-destructive/10 p-4",children:[n,o]}),t[4]=n,t[5]=o,t[6]=a):a=t[6],a}export{E,g as u};
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
import{N as a,ay as i,Q as o,az as d,aA as y,aB as C,aC as p,aD as A,aE as f,aF as P,aG as I,aH as U,c as r,aq as u,aI as l}from"./index.js";import{u as m}from"./error-banner.js";class K extends a.classBuilder().ep(i).m(function(t,n,s,c){return[o(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","AttachUserPolicy",{}).n("IAMClient","AttachUserPolicyCommand").sc(d).build(){}class D extends a.classBuilder().ep(i).m(function(t,n,s,c){return[o(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","CreateAccessKey",{}).n("IAMClient","CreateAccessKeyCommand").sc(y).build(){}class g extends a.classBuilder().ep(i).m(function(t,n,s,c){return[o(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","CreatePolicy",{}).n("IAMClient","CreatePolicyCommand").sc(C).build(){}class q extends a.classBuilder().ep(i).m(function(t,n,s,c){return[o(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","CreateUser",{}).n("IAMClient","CreateUserCommand").sc(p).build(){}class M extends a.classBuilder().ep(i).m(function(t,n,s,c){return[o(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","DeleteAccessKey",{}).n("IAMClient","DeleteAccessKeyCommand").sc(A).build(){}class S extends a.classBuilder().ep(i).m(function(t,n,s,c){return[o(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","DeletePolicy",{}).n("IAMClient","DeletePolicyCommand").sc(f).build(){}class $ extends a.classBuilder().ep(i).m(function(t,n,s,c){return[o(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","DeleteUser",{}).n("IAMClient","DeleteUserCommand").sc(P).build(){}class h extends a.classBuilder().ep(i).m(function(t,n,s,c){return[o(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","DetachUserPolicy",{}).n("IAMClient","DetachUserPolicyCommand").sc(I).build(){}class N extends a.classBuilder().ep(i).m(function(t,n,s,c){return[o(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","UpdateAccessKey",{}).n("IAMClient","UpdateAccessKeyCommand").sc(U).build(){}function k(){const e=r.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:E,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","users"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function E(e){const t=new q({UserName:e.userName,Path:e.path||void 0});return l().send(t)}function z(){const e=r.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:v,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","users"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function v(e){const t=new $({UserName:e});return l().send(t)}function G(){const e=r.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:x,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","access-keys"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function x(e){const t=new D({UserName:e});return l().send(t)}function H(){const e=r.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:Q,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","access-keys"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function Q(e){const{userName:t,accessKeyId:n}=e,s=new M({UserName:t,AccessKeyId:n});return l().send(s)}function R(){const e=r.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:b,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","access-keys"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function b(e){const{userName:t,accessKeyId:n,status:s}=e,c=new N({UserName:t,AccessKeyId:n,Status:s});return l().send(c)}function j(){const e=r.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:B,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","policies"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function B(e){const t=new g({PolicyName:e.policyName,Description:e.description||void 0,PolicyDocument:e.policyDocument});return l().send(t)}function J(){const e=r.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:F,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","policies"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function F(e){const t=new S({PolicyArn:e});return l().send(t)}function L(){const e=r.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:w,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","attached-user-policies"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function w(e){const{userName:t,policyArn:n}=e,s=new K({UserName:t,PolicyArn:n});return l().send(s)}function O(){const e=r.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:V,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","attached-user-policies"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function V(e){const{userName:t,policyArn:n}=e,s=new h({UserName:t,PolicyArn:n});return l().send(s)}export{j as a,z as b,G as c,H as d,R as e,L as f,O as g,J as h,k as u};
import{P as a,az as i,S as r,aA as d,aB as y,aC as C,aD as p,aE as A,aF as f,aG as P,aH as I,aI as U,c as o,ar as u,aJ as l}from"./index.js";import{u as m}from"./error-banner.js";class K extends a.classBuilder().ep(i).m(function(t,n,s,c){return[r(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","AttachUserPolicy",{}).n("IAMClient","AttachUserPolicyCommand").sc(d).build(){}class D extends a.classBuilder().ep(i).m(function(t,n,s,c){return[r(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","CreateAccessKey",{}).n("IAMClient","CreateAccessKeyCommand").sc(y).build(){}class g extends a.classBuilder().ep(i).m(function(t,n,s,c){return[r(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","CreatePolicy",{}).n("IAMClient","CreatePolicyCommand").sc(C).build(){}class S extends a.classBuilder().ep(i).m(function(t,n,s,c){return[r(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","CreateUser",{}).n("IAMClient","CreateUserCommand").sc(p).build(){}class M extends a.classBuilder().ep(i).m(function(t,n,s,c){return[r(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","DeleteAccessKey",{}).n("IAMClient","DeleteAccessKeyCommand").sc(A).build(){}class q extends a.classBuilder().ep(i).m(function(t,n,s,c){return[r(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","DeletePolicy",{}).n("IAMClient","DeletePolicyCommand").sc(f).build(){}class $ extends a.classBuilder().ep(i).m(function(t,n,s,c){return[r(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","DeleteUser",{}).n("IAMClient","DeleteUserCommand").sc(P).build(){}class h extends a.classBuilder().ep(i).m(function(t,n,s,c){return[r(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","DetachUserPolicy",{}).n("IAMClient","DetachUserPolicyCommand").sc(I).build(){}class N extends a.classBuilder().ep(i).m(function(t,n,s,c){return[r(s,t.getEndpointParameterInstructions())]}).s("AWSIdentityManagementV20100508","UpdateAccessKey",{}).n("IAMClient","UpdateAccessKeyCommand").sc(U).build(){}function k(){const e=o.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:E,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","users"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function E(e){const t=new S({UserName:e.userName,Path:e.path||void 0});return l().send(t)}function z(){const e=o.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:v,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","users"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function v(e){const t=new $({UserName:e});return l().send(t)}function G(){const e=o.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:x,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","access-keys"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function x(e){const t=new D({UserName:e});return l().send(t)}function H(){const e=o.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:b,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","access-keys"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function b(e){const{userName:t,accessKeyId:n}=e,s=new M({UserName:t,AccessKeyId:n});return l().send(s)}function J(){const e=o.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:B,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","access-keys"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function B(e){const{userName:t,accessKeyId:n,status:s}=e,c=new N({UserName:t,AccessKeyId:n,Status:s});return l().send(c)}function R(){const e=o.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:F,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","policies"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function F(e){const t=new g({PolicyName:e.policyName,Description:e.description||void 0,PolicyDocument:e.policyDocument});return l().send(t)}function j(){const e=o.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:Q,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","policies"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function Q(e){const t=new q({PolicyArn:e});return l().send(t)}function L(){const e=o.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:w,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","attached-user-policies"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function w(e){const{userName:t,policyArn:n}=e,s=new K({UserName:t,PolicyArn:n});return l().send(s)}function O(){const e=o.c(2),t=u();let n;return e[0]!==t?(n={mutationFn:V,onSuccess:()=>{t.invalidateQueries({queryKey:["iam","attached-user-policies"]})}},e[0]=t,e[1]=n):n=e[1],m(n)}function V(e){const{userName:t,policyArn:n}=e,s=new h({UserName:t,PolicyArn:n});return l().send(s)}export{R as a,z as b,G as c,H as d,J as e,L as f,O as g,j as h,k as u};
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
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};
import{c as o,w as c,j as t,n as m,L as u,B as l}from"./index.js";import{u as d}from"./useSuspenseQuery.js";import{L as p}from"./list-card.js";import{P as S}from"./page-heading.js";import{S as f}from"./state-badge.js";function y(){const e=o.c(5),{data:s}=d(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(S,{actions:t.jsx(u,{to:"/ec2/create-subnet",children:t.jsx(l,{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(b)}):t.jsx("p",{className:"text-muted-foreground",children:"No subnets found."})]}),e[3]=a,e[4]=i):i=e[4],i}function b(e){if(!e.SubnetId)return null;const s=m(e.Tags);return t.jsx(p,{badge:t.jsx(f,{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)}export{y as component};
+1 -1
View File
@@ -1 +1 @@
import{c as i,C as c,j as e,L as m,B as p}from"./index.js";import{u as l}from"./useSuspenseQuery.js";import{L as d}from"./list-card.js";import{P as u}from"./page-heading.js";import{S}from"./state-badge.js";function b(){const t=i.c(5),{data:r}=l(c);let s;t[0]!==r.Snapshots?(s=r.Snapshots||[],t[0]=r.Snapshots,t[1]=s):s=t[1];const o=s;let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx(u,{actions:e.jsx(m,{to:"/ec2/create-snapshot",children:e.jsx(p,{children:"Create Snapshot"})}),title:"EC2 Snapshots"}),t[2]=a):a=t[2];let n;return t[3]!==o?(n=e.jsxs(e.Fragment,{children:[a,o.length>0?e.jsx("div",{className:"space-y-4",children:o.map(h)}):e.jsx("p",{className:"text-muted-foreground",children:"No snapshots found."})]}),t[3]=o,t[4]=n):n=t[4],n}function h(t){return t.SnapshotId?e.jsx(d,{badge:e.jsx(S,{state:t.State}),params:{id:t.SnapshotId},subtitle:`${t.VolumeSize} GiB • ${t.VolumeId}`,title:t.SnapshotId,to:"/ec2/describe-snapshots/$id"},t.SnapshotId):null}export{b as component};
import{c as i,E as c,j as e,L as m,B as p}from"./index.js";import{u as l}from"./useSuspenseQuery.js";import{L as d}from"./list-card.js";import{P as u}from"./page-heading.js";import{S}from"./state-badge.js";function b(){const t=i.c(5),{data:r}=l(c);let s;t[0]!==r.Snapshots?(s=r.Snapshots||[],t[0]=r.Snapshots,t[1]=s):s=t[1];const o=s;let a;t[2]===Symbol.for("react.memo_cache_sentinel")?(a=e.jsx(u,{actions:e.jsx(m,{to:"/ec2/create-snapshot",children:e.jsx(p,{children:"Create Snapshot"})}),title:"EC2 Snapshots"}),t[2]=a):a=t[2];let n;return t[3]!==o?(n=e.jsxs(e.Fragment,{children:[a,o.length>0?e.jsx("div",{className:"space-y-4",children:o.map(h)}):e.jsx("p",{className:"text-muted-foreground",children:"No snapshots found."})]}),t[3]=o,t[4]=n):n=t[4],n}function h(t){return t.SnapshotId?e.jsx(d,{badge:e.jsx(S,{state:t.State}),params:{id:t.SnapshotId},subtitle:`${t.VolumeSize} GiB • ${t.VolumeId}`,title:t.SnapshotId,to:"/ec2/describe-snapshots/$id"},t.SnapshotId):null}export{b as component};
+1 -1
View File
@@ -1 +1 @@
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};
import{c as m,t 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
View File
@@ -1 +1 @@
import{c as u,E as f,j as t,L as I,B as x}from"./index.js";import{u as g}from"./useSuspenseQuery.js";import{L as h}from"./list-card.js";import{P as j}from"./page-heading.js";import{S}from"./state-badge.js";function L(){const e=u.c(5),{data:o}=g(f);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={running:0,pending:1,stopping:2,"shutting-down":3,stopped:4,terminated:5},e[0]=s):s=e[0];const c=s;let n;if(e[1]!==o.Reservations){let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=(m,l)=>{const d=c[m.State?.Name??""]??6,p=c[l.State?.Name??""]??6;return d!==p?d-p:(m.InstanceId??"").localeCompare(l.InstanceId??"")},e[3]=a):a=e[3];const i=(o.Reservations?.flatMap(_)||[]).toSorted(a);let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(j,{actions:t.jsx(I,{to:"/ec2/run-instances",children:t.jsx(x,{children:"Run Instances"})}),title:"EC2 Instances"}),e[4]=r):r=e[4],n=t.jsxs(t.Fragment,{children:[r,i.length>0?t.jsx("div",{className:"space-y-4",children:i.map(y)}):t.jsx("p",{className:"text-muted-foreground",children:"No instances found."})]}),e[1]=o.Reservations,e[2]=n}else n=e[2];return n}function y(e){return e.InstanceId?t.jsx(h,{badge:t.jsx(S,{state:e.State?.Name}),params:{id:e.InstanceId},subtitle:`${e.InstanceType} • ${e.ImageId}`,title:e.InstanceId,to:"/ec2/describe-instances/$id"},e.InstanceId):null}function _(e){return e.Instances||[]}export{L as component};
import{c as i,F as c,j as e,L as m,B as d}from"./index.js";import{u as p}from"./useSuspenseQuery.js";import{L as u}from"./list-card.js";import{P as l}from"./page-heading.js";import{S as I}from"./state-badge.js";const o={running:0,pending:1,stopping:2,"shutting-down":3,stopped:4,terminated:5};function R(){const t=i.c(3),{data:s}=p(c);let n;if(t[0]!==s.Reservations){const a=(s.Reservations?.flatMap(g)||[]).toSorted(x);let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=e.jsx(l,{actions:e.jsx(m,{to:"/ec2/run-instances",children:e.jsx(d,{children:"Run Instances"})}),title:"EC2 Instances"}),t[2]=r):r=t[2],n=e.jsxs(e.Fragment,{children:[r,a.length>0?e.jsx("div",{className:"space-y-4",children:a.map(f)}):e.jsx("p",{className:"text-muted-foreground",children:"No instances found."})]}),t[0]=s.Reservations,t[1]=n}else n=t[1];return n}function f(t){return t.InstanceId?e.jsx(u,{badge:e.jsx(I,{state:t.State?.Name}),params:{id:t.InstanceId},subtitle:`${t.InstanceType} • ${t.ImageId}`,title:t.InstanceId,to:"/ec2/describe-instances/$id"},t.InstanceId):null}function x(t,s){const n=o[t.State?.Name??""]??6,a=o[s.State?.Name??""]??6;return n!==a?n-a:(t.InstanceId??"").localeCompare(s.InstanceId??"")}function g(t){return t.Instances||[]}export{R as component};
+1 -1
View File
@@ -1 +1 @@
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};
import{c as n,q 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
View File
@@ -1 +1 @@
import{d5 as z,d6 as x}from"./index.js";class T{marshaller;serializer;deserializer;serdeContext;defaultContentType;constructor({marshaller:i,serializer:n,deserializer:o,serdeContext:c,defaultContentType:d}){this.marshaller=i,this.serializer=n,this.deserializer=o,this.serdeContext=c,this.defaultContentType=d}async serializeEventStream({eventStream:i,requestSchema:n,initialRequest:o}){const c=this.marshaller,d=n.getEventStreamMember(),p=n.getMemberSchema(d),y=this.serializer,f=this.defaultContentType,h=Symbol("initialRequestMarker"),S={async*[Symbol.asyncIterator](){if(o){const r={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:f}};y.write(n,o);const t=y.flush();yield{[h]:!0,headers:r,body:t}}for await(const r of i)yield r}};return c.serialize(S,r=>{if(r[h])return{headers:r.headers,body:r.body};const t=Object.keys(r).find(s=>s!=="__type")??"",{additionalHeaders:e,body:a,eventType:l,explicitPayloadContentType:m}=this.writeEventBody(t,p,r);return{headers:{":event-type":{type:"string",value:l},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:m??f},...e},body:a}})}async deserializeEventStream({response:i,responseSchema:n,initialResponseContainer:o}){const c=this.marshaller,d=n.getEventStreamMember(),y=n.getMemberSchema(d).getMemberSchemas(),f=Symbol("initialResponseMarker"),h=c.deserialize(i.body,async t=>{const e=Object.keys(t).find(l=>l!=="__type")??"",a=t[e].body;if(e==="initial-response"){const l=await this.deserializer.read(n,a);return delete l[d],{[f]:!0,...l}}else if(e in y){const l=y[e];if(l.isStructSchema()){const m={};let u=!1;for(const[s,g]of l.structIterator()){const{eventHeader:v,eventPayload:w}=g.getMergedTraits();if(u=u||!!(v||w),w)g.isBlobSchema()?m[s]=a:g.isStringSchema()?m[s]=(this.serdeContext?.utf8Encoder??z)(a):g.isStructSchema()&&(m[s]=await this.deserializer.read(g,a));else if(v){const b=t[e].headers[s]?.value;b!=null&&(g.isNumericSchema()?b&&typeof b=="object"&&"bytes"in b?m[s]=BigInt(b.toString()):m[s]=Number(b):m[s]=b)}}if(u)return{[e]:m};if(a.byteLength===0)return{[e]:{}}}return{[e]:await this.deserializer.read(l,a)}}else return{$unknown:t}}),S=h[Symbol.asyncIterator](),r=await S.next();if(r.done)return h;if(r.value?.[f]){if(!n)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(const[t,e]of Object.entries(r.value))o[t]=e}return{async*[Symbol.asyncIterator](){for(r?.value?.[f]||(yield r.value);;){const{done:t,value:e}=await S.next();if(t)break;yield e}}}}writeEventBody(i,n,o){const c=this.serializer;let d=i,p=null,y;const f=n.getSchema()[4].includes(i),h={};if(f){const t=n.getMemberSchema(i);if(t.isStructSchema()){for(const[e,a]of t.structIterator()){const{eventHeader:l,eventPayload:m}=a.getMergedTraits();if(m)p=e;else if(l){const u=o[i][e];let s="binary";a.isNumericSchema()?(-2)**31<=u&&u<=2**31-1?s="integer":s="long":a.isTimestampSchema()?s="timestamp":a.isStringSchema()?s="string":a.isBooleanSchema()&&(s="boolean"),u!=null&&(h[e]={type:s,value:u},delete o[i][e])}}if(p!==null){const e=t.getMemberSchema(p);e.isBlobSchema()?y="application/octet-stream":e.isStringSchema()&&(y="text/plain"),c.write(e,o[i][p])}else c.write(t,o[i])}else if(t.isUnitSchema())c.write(t,{});else throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}else{const[t,e]=o[i];d=t,c.write(15,e)}const S=c.flush();return{body:typeof S=="string"?(this.serdeContext?.utf8Decoder??x)(S):S,eventType:d,explicitPayloadContentType:y,additionalHeaders:h}}}export{T as EventStreamSerde};
import{d6 as z,d7 as x}from"./index.js";class T{marshaller;serializer;deserializer;serdeContext;defaultContentType;constructor({marshaller:i,serializer:n,deserializer:o,serdeContext:c,defaultContentType:d}){this.marshaller=i,this.serializer=n,this.deserializer=o,this.serdeContext=c,this.defaultContentType=d}async serializeEventStream({eventStream:i,requestSchema:n,initialRequest:o}){const c=this.marshaller,d=n.getEventStreamMember(),p=n.getMemberSchema(d),y=this.serializer,f=this.defaultContentType,h=Symbol("initialRequestMarker"),S={async*[Symbol.asyncIterator](){if(o){const r={":event-type":{type:"string",value:"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:f}};y.write(n,o);const t=y.flush();yield{[h]:!0,headers:r,body:t}}for await(const r of i)yield r}};return c.serialize(S,r=>{if(r[h])return{headers:r.headers,body:r.body};const t=Object.keys(r).find(s=>s!=="__type")??"",{additionalHeaders:e,body:a,eventType:l,explicitPayloadContentType:m}=this.writeEventBody(t,p,r);return{headers:{":event-type":{type:"string",value:l},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:m??f},...e},body:a}})}async deserializeEventStream({response:i,responseSchema:n,initialResponseContainer:o}){const c=this.marshaller,d=n.getEventStreamMember(),y=n.getMemberSchema(d).getMemberSchemas(),f=Symbol("initialResponseMarker"),h=c.deserialize(i.body,async t=>{const e=Object.keys(t).find(l=>l!=="__type")??"",a=t[e].body;if(e==="initial-response"){const l=await this.deserializer.read(n,a);return delete l[d],{[f]:!0,...l}}else if(e in y){const l=y[e];if(l.isStructSchema()){const m={};let u=!1;for(const[s,g]of l.structIterator()){const{eventHeader:v,eventPayload:w}=g.getMergedTraits();if(u=u||!!(v||w),w)g.isBlobSchema()?m[s]=a:g.isStringSchema()?m[s]=(this.serdeContext?.utf8Encoder??z)(a):g.isStructSchema()&&(m[s]=await this.deserializer.read(g,a));else if(v){const b=t[e].headers[s]?.value;b!=null&&(g.isNumericSchema()?b&&typeof b=="object"&&"bytes"in b?m[s]=BigInt(b.toString()):m[s]=Number(b):m[s]=b)}}if(u)return{[e]:m};if(a.byteLength===0)return{[e]:{}}}return{[e]:await this.deserializer.read(l,a)}}else return{$unknown:t}}),S=h[Symbol.asyncIterator](),r=await S.next();if(r.done)return h;if(r.value?.[f]){if(!n)throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(const[t,e]of Object.entries(r.value))o[t]=e}return{async*[Symbol.asyncIterator](){for(r?.value?.[f]||(yield r.value);;){const{done:t,value:e}=await S.next();if(t)break;yield e}}}}writeEventBody(i,n,o){const c=this.serializer;let d=i,p=null,y;const f=n.getSchema()[4].includes(i),h={};if(f){const t=n.getMemberSchema(i);if(t.isStructSchema()){for(const[e,a]of t.structIterator()){const{eventHeader:l,eventPayload:m}=a.getMergedTraits();if(m)p=e;else if(l){const u=o[i][e];let s="binary";a.isNumericSchema()?(-2)**31<=u&&u<=2**31-1?s="integer":s="long":a.isTimestampSchema()?s="timestamp":a.isStringSchema()?s="string":a.isBooleanSchema()&&(s="boolean"),u!=null&&(h[e]={type:s,value:u},delete o[i][e])}}if(p!==null){const e=t.getMemberSchema(p);e.isBlobSchema()?y="application/octet-stream":e.isStringSchema()&&(y="text/plain"),c.write(e,o[i][p])}else c.write(t,o[i])}else if(t.isUnitSchema())c.write(t,{});else throw new Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}else{const[t,e]=o[i];d=t,c.write(15,e)}const S=c.flush();return{body:typeof S=="string"?(this.serdeContext?.utf8Decoder??x)(S):S,eventType:d,explicitPayloadContentType:y,additionalHeaders:h}}}export{T as EventStreamSerde};
+1 -1
View File
@@ -1 +1 @@
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};
import{c as b,x as y,j as s,y as k,z 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
View File
@@ -1 +1 @@
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};
import{c as m,A 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
View File
@@ -1 +1 @@
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};
import{c as n,C 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
View File
@@ -1 +1 @@
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};
import{c,m as i,j as t,n as m,L as d,B as l}from"./index.js";import{u as p}from"./useSuspenseQuery.js";import{L as u}from"./list-card.js";import{P as f}from"./page-heading.js";import{S as x}from"./state-badge.js";function P(){const e=c.c(5),{data:s}=p(i);let a;e[0]!==s.Vpcs?(a=s.Vpcs||[],e[0]=s.Vpcs,e[1]=a):a=e[1];const r=a;let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(f,{actions:t.jsx(d,{to:"/ec2/create-vpc",children:t.jsx(l,{children:"Create VPC"})}),title:"VPCs"}),e[2]=n):n=e[2];let o;return e[3]!==r?(o=t.jsxs(t.Fragment,{children:[n,r.length>0?t.jsx("div",{className:"space-y-4",children:r.map(V)}):t.jsx("p",{className:"text-muted-foreground",children:"No VPCs found."})]}),e[3]=r,e[4]=o):o=e[4],o}function V(e){if(!e.VpcId)return null;const s=m(e.Tags);return t.jsx(u,{badge:t.jsx(x,{state:e.State}),params:{id:e.VpcId},subtitle:e.CidrBlock??"",title:s?`${e.VpcId} (${s})`:e.VpcId,to:"/ec2/describe-vpcs/$id"},e.VpcId)}export{P as component};
+1 -1
View File
@@ -1 +1 @@
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};
import{c as m,p 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=m.c(5),{data:i}=c(l);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(n,{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
View File
@@ -1 +1 @@
import{r as b,b1 as h,b5 as U,b6 as $,b7 as A,b8 as K,b9 as S,j as F,c as q,a as z}from"./index.js";import{u as G,d as H,e as J,f as O,g as Q,h as W}from"./field.js";const X=b.forwardRef(function(e,a){const{render:r,className:l,id:i,name:o,value:s,disabled:I=!1,onValueChange:w,defaultValue:v,autoFocus:f=!1,...V}=e,{state:D,name:N,disabled:P,setTouched:g,setDirty:T,validityData:j,setFocused:d,setFilled:c,validationMode:k,validation:n}=G(),x=P||I,R=N??o,L={...D,disabled:x},{labelId:M}=H(),y=J({id:i});h(()=>{const t=s!=null;n.inputRef.current?.value||t&&s!==""?c(!0):t&&s===""&&c(!1)},[n.inputRef,c,s]);const p=b.useRef(null);h(()=>{f&&p.current===U($(p.current))&&d(!0)},[f,d]);const[B]=O({controlled:s,default:v,name:"FieldControl",state:"value"}),C=s!==void 0,E=C?B:void 0;return Q({id:y,name:R,commit:n.commit,value:E,getValue:()=>n.inputRef.current?.value,controlRef:n.inputRef}),A("input",e,{ref:[a,p],state:L,props:[{id:y,disabled:x,name:R,ref:n.inputRef,"aria-labelledby":M,autoFocus:f,...C?{value:E}:{defaultValue:v},onChange(t){const m=t.currentTarget.value;w?.(m,K(S,t.nativeEvent)),T(m!==j.initialValue),c(m!=="")},onFocus(){d(!0)},onBlur(t){g(!0),d(!1),k==="onBlur"&&n.commit(t.currentTarget.value)},onKeyDown(t){t.currentTarget.tagName==="INPUT"&&t.key==="Enter"&&(g(!0),n.commit(t.currentTarget.value))}},n.getInputValidationProps(),V],stateAttributesMapping:W})}),Y=b.forwardRef(function(e,a){return F.jsx(X,{ref:a,...e})});function te(u){const e=q.c(10);let a,r,l;e[0]!==u?({className:a,type:l,...r}=u,e[0]=u,e[1]=a,e[2]=r,e[3]=l):(a=e[1],r=e[2],l=e[3]);let i;e[4]!==a?(i=z("h-7 w-full min-w-0 rounded-md border border-input bg-input/20 px-2 py-0.5 text-sm outline-none transition-colors file:inline-flex file:h-6 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-xs/relaxed placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",a),e[4]=a,e[5]=i):i=e[5];let o;return e[6]!==r||e[7]!==i||e[8]!==l?(o=F.jsx(Y,{className:i,"data-slot":"input",type:l,...r}),e[6]=r,e[7]=i,e[8]=l,e[9]=o):o=e[9],o}export{te as I};
import{r as b,b2 as h,b6 as U,b7 as $,b8 as A,b9 as K,ba as S,j as F,c as q,a as z}from"./index.js";import{u as G,d as H,e as J,f as O,g as Q,h as W}from"./field.js";const X=b.forwardRef(function(e,a){const{render:r,className:l,id:i,name:o,value:s,disabled:I=!1,onValueChange:w,defaultValue:v,autoFocus:f=!1,...V}=e,{state:D,name:N,disabled:P,setTouched:g,setDirty:T,validityData:j,setFocused:d,setFilled:c,validationMode:k,validation:n}=G(),x=P||I,R=N??o,L={...D,disabled:x},{labelId:M}=H(),y=J({id:i});h(()=>{const t=s!=null;n.inputRef.current?.value||t&&s!==""?c(!0):t&&s===""&&c(!1)},[n.inputRef,c,s]);const p=b.useRef(null);h(()=>{f&&p.current===U($(p.current))&&d(!0)},[f,d]);const[B]=O({controlled:s,default:v,name:"FieldControl",state:"value"}),C=s!==void 0,E=C?B:void 0;return Q({id:y,name:R,commit:n.commit,value:E,getValue:()=>n.inputRef.current?.value,controlRef:n.inputRef}),A("input",e,{ref:[a,p],state:L,props:[{id:y,disabled:x,name:R,ref:n.inputRef,"aria-labelledby":M,autoFocus:f,...C?{value:E}:{defaultValue:v},onChange(t){const m=t.currentTarget.value;w?.(m,K(S,t.nativeEvent)),T(m!==j.initialValue),c(m!=="")},onFocus(){d(!0)},onBlur(t){g(!0),d(!1),k==="onBlur"&&n.commit(t.currentTarget.value)},onKeyDown(t){t.currentTarget.tagName==="INPUT"&&t.key==="Enter"&&(g(!0),n.commit(t.currentTarget.value))}},n.getInputValidationProps(),V],stateAttributesMapping:W})}),Y=b.forwardRef(function(e,a){return F.jsx(X,{ref:a,...e})});function te(u){const e=q.c(10);let a,r,l;e[0]!==u?({className:a,type:l,...r}=u,e[0]=u,e[1]=a,e[2]=r,e[3]=l):(a=e[1],r=e[2],l=e[3]);let i;e[4]!==a?(i=z("h-7 w-full min-w-0 rounded-md border border-input bg-input/20 px-2 py-0.5 text-sm outline-none transition-colors file:inline-flex file:h-6 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-xs/relaxed placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",a),e[4]=a,e[5]=i):i=e[5];let o;return e[6]!==r||e[7]!==i||e[8]!==l?(o=F.jsx(Y,{className:i,"data-slot":"input",type:l,...r}),e[6]=r,e[7]=i,e[8]=l,e[9]=o):o=e[9],o}export{te as I};
+1 -1
View File
@@ -1 +1 @@
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};
import{u as $,q,t as R,v as U,w 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:w}=h(H),r=J(),b=T.Images??[],N=F.KeyPairs??[],P=w.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"}),P.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};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
import{c as g,j as i}from"./index.js";function s(d){const t=g.c(3),{state:e}=d;let r="bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-100";e==="running"||e==="available"||e==="completed"||e==="Active"?r="bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100":e==="stopped"||e==="error"?r="bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-100":e==="pending"||e==="shutting-down"||e==="stopping"?r="bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100":e==="terminated"&&(r="bg-zinc-100 text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400");const n=`rounded-full px-2 py-1 text-xs ${r}`;let a;return t[0]!==e||t[1]!==n?(a=i.jsx("div",{className:n,children:e}),t[0]=e,t[1]=n,t[2]=a):a=t[2],a}export{s as S};
import{c as d,a,j as g}from"./index.js";const l=["running","available","completed","Active"],o=["stopped","error"],c=["pending","shutting-down","stopping"];function s(t){return t&&l.includes(t)?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100":t&&o.includes(t)?"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-100":t&&c.includes(t)?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100":t==="terminated"?"bg-zinc-100 text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400":"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-100"}function u(t){const e=d.c(5),{state:r}=t;let n;e[0]!==r?(n=a("rounded-full px-2 py-1 text-xs",s(r)),e[0]=r,e[1]=n):n=e[1];let i;return e[2]!==r||e[3]!==n?(i=g.jsx("div",{className:n,children:r}),e[2]=r,e[3]=n,e[4]=i):i=e[4],i}export{u as S};
+1 -1
View File
@@ -1 +1 @@
import{J as a}from"./index.js";const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],o=a("trash-2",t);export{o as T};
import{K as a}from"./index.js";const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],o=a("trash-2",t);export{o as T};
+1 -1
View File
@@ -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 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};
import{K as u,M as g,N as j,P as b,Q as y,S as k,T as C,c as w,j as t,L as N,r as h,i as v,U as M,V 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 V 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 V({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};
@@ -1 +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};
import{K 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};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,29 +1,29 @@
export function StateBadge({ state }: { state: string | undefined }) {
let className =
"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-100"
import { cn } from "@/lib/utils"
if (
state === "running" ||
state === "available" ||
state === "completed" ||
state === "Active"
) {
className =
"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100"
} else if (state === "stopped" || state === "error") {
className = "bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-100"
} else if (
state === "pending" ||
state === "shutting-down" ||
state === "stopping"
) {
className =
"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100"
} else if (state === "terminated") {
className = "bg-zinc-100 text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400"
const SUCCESS_STATES = ["running", "available", "completed", "Active"]
const ERROR_STATES = ["stopped", "error"]
const WARNING_STATES = ["pending", "shutting-down", "stopping"]
function getStateClass(state: string | undefined): string {
if (state && SUCCESS_STATES.includes(state)) {
return "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100"
}
if (state && ERROR_STATES.includes(state)) {
return "bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-100"
}
if (state && WARNING_STATES.includes(state)) {
return "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100"
}
if (state === "terminated") {
return "bg-zinc-100 text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400"
}
return "bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-100"
}
export function StateBadge({ state }: { state: string | undefined }) {
return (
<div className={`rounded-full px-2 py-1 text-xs ${className}`}>{state}</div>
<div className={cn("rounded-full px-2 py-1 text-xs", getStateClass(state))}>
{state}
</div>
)
}
@@ -2,15 +2,15 @@ import { useSyncExternalStore } from "react"
const MOBILE_BREAKPOINT = 768
const MEDIA_QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`
const mql = window.matchMedia(MEDIA_QUERY)
function subscribe(callback: () => void): () => void {
const mql = window.matchMedia(MEDIA_QUERY)
mql.addEventListener("change", callback)
return () => mql.removeEventListener("change", callback)
}
function getSnapshot(): boolean {
return window.matchMedia(MEDIA_QUERY).matches
return mql.matches
}
export function useIsMobile(): boolean {
+19 -10
View File
@@ -5,28 +5,37 @@ export function cn(...inputs: ClassValue[]): string {
return twMerge(clsx(inputs))
}
const dateFormatter = new Intl.DateTimeFormat(undefined, {
year: "numeric",
month: "long",
day: "numeric",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
})
export function formatDateTime(date: Date | string | undefined): string {
if (!date) {
return "Unknown"
}
return new Date(date).toLocaleString(undefined, {
year: "numeric",
month: "long",
day: "numeric",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
})
return dateFormatter.format(new Date(date))
}
const SIZE_UNITS = ["B", "KB", "MB", "GB", "TB"]
export function formatSize(bytes: number): string {
if (bytes === 0) {
return "0 B"
}
const sizes = ["B", "KB", "MB", "GB", "TB"]
const i = Math.floor(Math.log(bytes) / Math.log(1024))
return `${(bytes / 1024 ** i).toFixed(2)} ${sizes[i]}`
return `${(bytes / 1024 ** i).toFixed(2)} ${SIZE_UNITS[i]}`
}
export function getNameTag(
tags?: { Key?: string; Value?: string }[],
): string | undefined {
return tags?.find((t) => t.Key === "Name")?.Value
}
const TRAILING_SLASH_REGEX = /\/$/
@@ -24,18 +24,17 @@ export const Route = createFileRoute(
component: Ec2,
})
function Ec2() {
// useInitialSidebar(false)
const { data } = useSuspenseQuery(ec2InstancesQueryOptions)
const statePriority: Record<string, number> = {
running: 0,
pending: 1,
stopping: 2,
"shutting-down": 3,
stopped: 4,
terminated: 5,
}
const statePriority: Record<string, number> = {
running: 0,
pending: 1,
stopping: 2,
"shutting-down": 3,
stopped: 4,
terminated: 5,
}
function Ec2() {
const { data } = useSuspenseQuery(ec2InstancesQueryOptions)
const instances = (
data.Reservations?.flatMap(
@@ -16,6 +16,7 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
import { getNameTag } from "@/lib/utils"
import { useCreateSubnet } from "@/mutations/ec2"
import {
ec2AvailabilityZonesQueryOptions,
@@ -108,7 +109,7 @@ function CreateSubnet() {
</SelectTrigger>
<SelectContent>
{vpcs.map((vpc) => {
const name = vpc.Tags?.find((t) => t.Key === "Name")?.Value
const name = getNameTag(vpc.Tags)
return (
<SelectItem key={vpc.VpcId} value={vpc.VpcId ?? ""}>
{name
@@ -11,6 +11,7 @@ import { ErrorBanner } from "@/components/error-banner"
import { PageHeading } from "@/components/page-heading"
import { StateBadge } from "@/components/state-badge"
import { Button } from "@/components/ui/button"
import { getNameTag } from "@/lib/utils"
import { useDeleteSubnet } from "@/mutations/ec2"
import { ec2SubnetQueryOptions } from "@/queries/ec2"
@@ -56,7 +57,7 @@ function SubnetDetail() {
)
}
const name = subnet.Tags?.find((t) => t.Key === "Name")?.Value
const name = getNameTag(subnet.Tags)
return (
<>
@@ -6,6 +6,7 @@ import { ListCard } from "@/components/list-card"
import { PageHeading } from "@/components/page-heading"
import { StateBadge } from "@/components/state-badge"
import { Button } from "@/components/ui/button"
import { getNameTag } from "@/lib/utils"
import { ec2SubnetsQueryOptions } from "@/queries/ec2"
export const Route = createFileRoute("/_auth/ec2/(subnet)/describe-subnets/")({
@@ -44,7 +45,7 @@ function Subnets() {
if (!subnet.SubnetId) {
return null
}
const name = subnet.Tags?.find((t) => t.Key === "Name")?.Value
const name = getNameTag(subnet.Tags)
return (
<ListCard
badge={<StateBadge state={subnet.State} />}
@@ -12,6 +12,7 @@ import { ErrorBanner } from "@/components/error-banner"
import { PageHeading } from "@/components/page-heading"
import { StateBadge } from "@/components/state-badge"
import { Button } from "@/components/ui/button"
import { getNameTag } from "@/lib/utils"
import { useDeleteVpc } from "@/mutations/ec2"
import { ec2SubnetsQueryOptions, ec2VpcQueryOptions } from "@/queries/ec2"
@@ -62,7 +63,7 @@ function VpcDetail() {
)
}
const name = vpc.Tags?.find((t) => t.Key === "Name")?.Value
const name = getNameTag(vpc.Tags)
return (
<>
@@ -6,6 +6,7 @@ import { ListCard } from "@/components/list-card"
import { PageHeading } from "@/components/page-heading"
import { StateBadge } from "@/components/state-badge"
import { Button } from "@/components/ui/button"
import { getNameTag } from "@/lib/utils"
import { ec2VpcsQueryOptions } from "@/queries/ec2"
export const Route = createFileRoute("/_auth/ec2/(vpc)/describe-vpcs/")({
@@ -44,7 +45,7 @@ function Vpcs() {
if (!vpc.VpcId) {
return null
}
const name = vpc.Tags?.find((t) => t.Key === "Name")?.Value
const name = getNameTag(vpc.Tags)
return (
<ListCard
badge={<StateBadge state={vpc.State} />}
@@ -9,12 +9,12 @@ import {
useTerminateInstance,
} from "@/mutations/ec2"
const TRANSITIONING_STATES = [
const TRANSITIONING_STATES = new Set([
"pending",
"stopping",
"shutting-down",
"terminated",
]
])
interface InstanceActionsProps {
instanceId: string
@@ -27,7 +27,7 @@ export function InstanceActions({ instanceId, state }: InstanceActionsProps) {
const rebootMutation = useRebootInstance()
const terminateMutation = useTerminateInstance()
const isTransitioning = TRANSITIONING_STATES.includes(state || "")
const isTransitioning = TRANSITIONING_STATES.has(state || "")
if (isTransitioning && state !== "terminated") {
return (
+15 -24
View File
@@ -1,5 +1,16 @@
import { z } from "zod"
const CIDR_REGEX = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}$/
const keyNameField = z
.string()
.min(1, "Key name is required")
.max(255, "Key name must be 255 characters or less")
.regex(
/^[\w\s._\-:/()#,@[\]+=&;{}!$*]+$/,
"Key name contains invalid characters",
)
export const createInstanceSchema = z.object({
imageId: z.string("Please select an Image"),
instanceType: z.string("Please select an instance type"),
@@ -15,27 +26,13 @@ export type CreateInstanceFormData = z.infer<typeof createInstanceSchema>
export type CreateInstanceParams = CreateInstanceFormData
export const createKeyPairSchema = z.object({
keyName: z
.string()
.min(1, "Key name is required")
.max(255, "Key name must be 255 characters or less")
.regex(
/^[\w\s._\-:/()#,@[\]+=&;{}!$*]+$/,
"Key name contains invalid characters",
),
keyName: keyNameField,
})
export type CreateKeyPairData = z.infer<typeof createKeyPairSchema>
export const importKeyPairSchema = z.object({
keyName: z
.string()
.min(1, "Key name is required")
.max(255, "Key name must be 255 characters or less")
.regex(
/^[\w\s._\-:/()#,@[\]+=&;{}!$*]+$/,
"Key name contains invalid characters",
),
keyName: keyNameField,
publicKeyMaterial: z
.string()
.min(1, "Public key is required")
@@ -119,10 +116,7 @@ export const createSubnetSchema = z.object({
cidrBlock: z
.string()
.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)",
),
.regex(CIDR_REGEX, "Must be a valid CIDR block (e.g. 10.0.1.0/24)"),
availabilityZone: z.string().optional(),
})
@@ -132,10 +126,7 @@ export const createVpcSchema = z.object({
cidrBlock: z
.string()
.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)",
),
.regex(CIDR_REGEX, "Must be a valid CIDR block (e.g. 10.0.0.0/16)"),
name: z.string().optional(),
})