diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_clusterName3.js b/spinifex/services/spinifexui/frontend/dist/assets/_clusterName3.js index a7a1350d4..f933d177e 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_clusterName3.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_clusterName3.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./link.js";import{t as s}from"./useNavigate.js";import{t as c}from"./back-link.js";import{t as l}from"./trash-2.js";import{t as u}from"./button.js";import{t as d}from"./input.js";import{a as f,t as p}from"./field.js";import{a as m,i as h,l as g,n as _,o as v,r as y,s as b,t as x}from"./alert-dialog.js";import{O as S,c as C,p as w,w as T}from"./ec2.js";import{i as E,r as D,s as O,t as ee}from"./ecs.js";import{i as k,l as A,o as j,r as M,u as N}from"./ecs2.js";import{t as te}from"./error-banner.js";import{t as P}from"./gpu-instance-type-select.js";import{t as F}from"./page-heading.js";import{t as I}from"./_clusterName2.js";import{t as L}from"./delete-confirmation-dialog.js";import{n as R,t as z}from"./detail-row.js";import{t as B}from"./state-badge.js";import{i as V,n as ne,r as H,t as re}from"./tabs.js";var U=r(),W=e(n(),1),G=t(),K=`h-7 w-full rounded-md border border-input bg-input/20 px-2 text-sm`;function q({clusterName:e,open:t,onOpenChange:n}){let r=j(),{data:a}=i(S),{data:o}=i(T),{data:s}=i(w),{data:c}=i(C),l=a?.Subnets??[],u=o?.SecurityGroups??[],E=s?.KeyPairs??[],D=c?.InstanceTypes??[],[O,ee]=(0,W.useState)(`t3.small`),[k,A]=(0,W.useState)(1),[M,N]=(0,W.useState)(``),[F,I]=(0,W.useState)(``),[L,R]=(0,W.useState)(``);function z(e){e||(ee(`t3.small`),A(1),N(``),I(``),R(``),r.reset()),n(e)}async function B(){try{await r.mutateAsync({Cluster:e,InstanceType:O||void 0,Count:k,SubnetID:M,SecurityGroupID:F,KeyName:L||void 0}),z(!1)}catch{}}let V=r.isPending||M===``||F===``;return(0,G.jsx)(x,{onOpenChange:z,open:t,children:(0,G.jsxs)(h,{className:`max-h-[85vh] overflow-y-auto`,children:[(0,G.jsxs)(b,{children:[(0,G.jsx)(g,{children:`Provision EC2 capacity`}),(0,G.jsxs)(m,{children:[`Launch container instances into cluster “`,e,`”. They register automatically once booted.`]})]}),(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(p,{children:[(0,G.jsx)(f,{children:(0,G.jsx)(`label`,{htmlFor:`provision-instance-type`,children:`Instance type`})}),(0,G.jsx)(P,{id:`provision-instance-type`,instanceTypes:D,onValueChange:ee,value:O})]}),(0,G.jsxs)(p,{children:[(0,G.jsx)(f,{children:(0,G.jsx)(`label`,{htmlFor:`provision-count`,children:`Count`})}),(0,G.jsx)(d,{id:`provision-count`,max:10,min:1,onChange:e=>A(Number(e.target.value)),type:`number`,value:k})]}),(0,G.jsxs)(p,{children:[(0,G.jsx)(f,{children:(0,G.jsx)(`label`,{htmlFor:`provision-subnet`,children:`Subnet`})}),(0,G.jsxs)(`select`,{className:K,id:`provision-subnet`,onChange:e=>N(e.target.value),value:M,children:[(0,G.jsx)(`option`,{value:``,children:`Select a subnet`}),l.map(e=>(0,G.jsxs)(`option`,{value:e.SubnetId??``,children:[e.SubnetId,` (`,e.CidrBlock,e.AvailabilityZone?`, ${e.AvailabilityZone}`:``,`)`]},e.SubnetId))]})]}),(0,G.jsxs)(p,{children:[(0,G.jsx)(f,{children:(0,G.jsx)(`label`,{htmlFor:`provision-sg`,children:`Security group`})}),(0,G.jsxs)(`select`,{className:K,id:`provision-sg`,onChange:e=>I(e.target.value),value:F,children:[(0,G.jsx)(`option`,{value:``,children:`Select a security group`}),u.map(e=>(0,G.jsxs)(`option`,{value:e.GroupId??``,children:[e.GroupId,` (`,e.GroupName,`)`]},e.GroupId))]})]}),(0,G.jsxs)(p,{children:[(0,G.jsx)(f,{children:(0,G.jsx)(`label`,{htmlFor:`provision-key`,children:`Key pair`})}),(0,G.jsxs)(`select`,{className:K,id:`provision-key`,onChange:e=>R(e.target.value),value:L,children:[(0,G.jsx)(`option`,{value:``,children:`None`}),E.map(e=>(0,G.jsx)(`option`,{value:e.KeyName??``,children:e.KeyName},e.KeyPairId))]})]})]}),r.error&&(0,G.jsx)(te,{error:r.error instanceof Error?r.error:void 0,msg:`Failed to provision capacity.`}),(0,G.jsxs)(v,{children:[(0,G.jsx)(y,{children:`Cancel`}),(0,G.jsx)(_,{disabled:V,onClick:e=>{e.preventDefault(),B()},children:r.isPending?`Provisioning…`:`Provision`})]})]})})}var J={drain:`Drain`,activate:`Activate`,deregister:`Deregister`},Y={drain:`Draining force-stops the service-owned tasks on this instance so it can be retired.`,activate:`This returns the instance to ACTIVE so the scheduler can place tasks on it again.`,deregister:`This force-removes the container instance record. Any tasks it still holds are stopped.`};function ie(e){let t=(0,U.c)(28),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=D(n),t[0]=n,t[1]=r);let{data:i}=a(r),o=N(),s=k(),[c,l]=(0,W.useState)(null),[d,f]=(0,W.useState)(!1),p;t[2]!==n||t[3]!==s||t[4]!==c||t[5]!==o?(p=function(){if(!c)return;let e=()=>l(null);if(c.action===`deregister`){s.mutate({cluster:n,containerInstance:c.arn},{onSuccess:e});return}o.mutate({cluster:n,containerInstance:c.arn,status:c.action===`drain`?`DRAINING`:`ACTIVE`},{onSuccess:e})},t[2]=n,t[3]=s,t[4]=c,t[5]=o,t[6]=p):p=t[6];let m=p,h=o.isError||s.isError,g=o.error??s.error,_=o.isPending||s.isPending,v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,G.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,G.jsx)(u,{onClick:()=>f(!0),size:`sm`,children:`Provision EC2 capacity`})}),t[7]=v):v=t[7];let y;t[8]!==g||t[9]!==h?(y=h&&(0,G.jsx)(te,{error:g instanceof Error?g:void 0,msg:`Container instance action failed.`}),t[8]=g,t[9]=h,t[10]=y):y=t[10];let b;t[11]===i?b=t[12]:(b=i.length===0?(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:`No container instances found.`}):(0,G.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`EC2 Instance`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Running`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Pending`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,G.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,G.jsx)(`tbody`,{children:i.map(e=>{let t=e.containerInstanceArn??``,n=e.status===`DRAINING`;return(0,G.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.ec2InstanceId}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:(0,G.jsx)(B,{state:e.status})}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:e.runningTasksCount??0}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:e.pendingTasksCount??0}),(0,G.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,G.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,G.jsx)(u,{"aria-label":n?`Activate container instance`:`Drain container instance`,onClick:()=>l({arn:t,action:n?`activate`:`drain`}),size:`sm`,variant:`outline`,children:n?`Activate`:`Drain`}),(0,G.jsx)(u,{onClick:()=>l({arn:t,action:`deregister`}),size:`sm`,variant:`destructive`,children:`Deregister`})]})})]},t)})})]})}),t[11]=i,t[12]=b);let x;t[13]!==n||t[14]!==d?(x=(0,G.jsx)(q,{clusterName:n,onOpenChange:f,open:d}),t[13]=n,t[14]=d,t[15]=x):x=t[15];let S=c?J[c.action]:`Confirm`,C=c?Y[c.action]:``,w;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>!e&&l(null),t[16]=w):w=t[16];let T=c!==null,E;t[17]!==m||t[18]!==_||t[19]!==T||t[20]!==S||t[21]!==C?(E=(0,G.jsx)(L,{confirmLabel:S,description:C,isPending:_,onConfirm:m,onOpenChange:w,open:T,title:`Container instance`}),t[17]=m,t[18]=_,t[19]=T,t[20]=S,t[21]=C,t[22]=E):E=t[22];let O;return t[23]!==E||t[24]!==y||t[25]!==b||t[26]!==x?(O=(0,G.jsxs)(G.Fragment,{children:[v,y,b,x,E]}),t[23]=E,t[24]=y,t[25]=b,t[26]=x,t[27]=O):O=t[27],O}function X(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function ae(e){let t=(0,U.c)(13),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=E(n),t[0]=n,t[1]=r);let{data:i}=a(r),s;t[2]===n?s=t[3]:(s={cluster:n},t[2]=n,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,G.jsx)(u,{size:`sm`,children:`Create service`}),t[4]=c):c=t[4];let l;t[5]===s?l=t[6]:(l=(0,G.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,G.jsx)(o,{search:s,to:`/ecs/create-service`,children:c})}),t[5]=s,t[6]=l);let d;t[7]!==n||t[8]!==i?(d=i.length===0?(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:`No services found.`}):(0,G.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Desired`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Running`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Pending`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Task Definition`})]})}),(0,G.jsx)(`tbody`,{children:i.map(e=>(0,G.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,G.jsx)(o,{className:`underline`,params:{clusterName:n,serviceName:e.serviceName??``},to:`/ecs/list-clusters/$clusterName/services/$serviceName`,children:e.serviceName})}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:(0,G.jsx)(B,{state:e.status})}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:e.desiredCount??0}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:e.runningCount??0}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:e.pendingCount??0}),(0,G.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:X(e.taskDefinition)})]},e.serviceArn??e.serviceName))})]})}),t[7]=n,t[8]=i,t[9]=d):d=t[9];let f;return t[10]!==l||t[11]!==d?(f=(0,G.jsxs)(G.Fragment,{children:[l,d]}),t[10]=l,t[11]=d,t[12]=f):f=t[12],f}function Z(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function oe(e){let t=(0,U.c)(27),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=O(n),t[0]=n,t[1]=r);let{data:i}=a(r),s=A(),[c,l]=(0,W.useState)(null),d;t[2]!==n||t[3]!==c||t[4]!==s?(d=function(){c&&s.mutate({cluster:n,task:c},{onSuccess:()=>l(null)})},t[2]=n,t[3]=c,t[4]=s,t[5]=d):d=t[5];let f=d,p;t[6]===n?p=t[7]:(p={cluster:n},t[6]=n,t[7]=p);let m;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,G.jsx)(u,{size:`sm`,children:`Run task`}),t[8]=m):m=t[8];let h;t[9]===p?h=t[10]:(h=(0,G.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,G.jsx)(o,{search:p,to:`/ecs/run-task`,children:m})}),t[9]=p,t[10]=h);let g;t[11]!==s.error||t[12]!==s.isError?(g=s.isError&&(0,G.jsx)(te,{error:s.error instanceof Error?s.error:void 0,msg:`Failed to stop task.`}),t[11]=s.error,t[12]=s.isError,t[13]=g):g=t[13];let _;t[14]!==n||t[15]!==i?(_=i.length===0?(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:`No tasks found.`}):(0,G.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Task`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Last Status`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Desired Status`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Group`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,G.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,G.jsx)(`tbody`,{children:i.map(e=>{let t=Z(e.taskArn),r=e.lastStatus!==`STOPPED`;return(0,G.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:(0,G.jsx)(o,{className:`underline`,params:{clusterName:n,taskId:t},to:`/ecs/list-clusters/$clusterName/tasks/$taskId`,children:t})}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:(0,G.jsx)(B,{state:e.lastStatus})}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:e.desiredStatus}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:e.group}),(0,G.jsx)(`td`,{className:`px-4 py-2 text-right`,children:r&&(0,G.jsx)(u,{onClick:()=>l(e.taskArn??t),size:`sm`,variant:`destructive`,children:`Stop`})})]},t)})})]})}),t[14]=n,t[15]=i,t[16]=_):_=t[16];let v;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>!e&&l(null),t[17]=v):v=t[17];let y=c!==null,b;t[18]!==f||t[19]!==s.isPending||t[20]!==y?(b=(0,G.jsx)(L,{confirmLabel:`Stop task`,description:`This stops the task and releases its ENI and reserved capacity.`,isPending:s.isPending,onConfirm:f,onOpenChange:v,open:y,pendingLabel:`Stopping…`,title:`Stop task`}),t[18]=f,t[19]=s.isPending,t[20]=y,t[21]=b):b=t[21];let x;return t[22]!==b||t[23]!==h||t[24]!==g||t[25]!==_?(x=(0,G.jsxs)(G.Fragment,{children:[h,g,_,b]}),t[22]=b,t[23]=h,t[24]=g,t[25]=_,t[26]=x):x=t[26],x}function Q(e){let t=(0,U.c)(70),{clusterName:n}=e,r=s(),[i,o]=(0,W.useState)(!1),d;t[0]===n?d=t[1]:(d=ee(n),t[0]=n,t[1]=d);let{data:f}=a(d),p=M(),m;t[2]!==n||t[3]!==p||t[4]!==r?(m=function(){p.mutate(n,{onSuccess:()=>{r({to:`/ecs/list-clusters`})}})},t[2]=n,t[3]=p,t[4]=r,t[5]=m):m=t[5];let h=m;if(!f){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(c,{to:`/ecs/list-clusters`,children:`Clusters`}),t[6]=e):e=t[6];let r;t[7]===n?r=t[8]:(r=(0,G.jsx)(F,{subtitle:`Cluster Details`,title:n}),t[7]=n,t[8]=r);let i;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:`Cluster not found.`}),t[9]=i):i=t[9];let a;return t[10]===r?a=t[11]:(a=(0,G.jsxs)(G.Fragment,{children:[e,r,i]}),t[10]=r,t[11]=a),a}let g;t[12]===f.tags?g=t[13]:(g=f.tags??[],t[12]=f.tags,t[13]=g);let _=g,v;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,G.jsx)(c,{to:`/ecs/list-clusters`,children:`Clusters`}),t[14]=v):v=t[14];let y;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>o(!0),t[15]=y):y=t[15];let b;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,G.jsxs)(u,{onClick:y,size:`sm`,variant:`destructive`,children:[(0,G.jsx)(l,{className:`size-4`}),`Delete`]}),t[16]=b):b=t[16];let x;t[17]===f.status?x=t[18]:(x=(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[b,(0,G.jsx)(B,{state:f.status})]}),t[17]=f.status,t[18]=x);let S;t[19]!==n||t[20]!==x?(S=(0,G.jsx)(F,{actions:x,subtitle:`Cluster Details`,title:n}),t[19]=n,t[20]=x,t[21]=S):S=t[21];let C;t[22]!==p.error||t[23]!==p.isError?(C=p.isError&&(0,G.jsx)(te,{error:p.error instanceof Error?p.error:void 0,msg:`Failed to delete cluster.`}),t[22]=p.error,t[23]=p.isError,t[24]=C):C=t[24];let w;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,G.jsx)(R.Header,{children:`Overview`}),t[25]=w):w=t[25];let T;t[26]===f.clusterArn?T=t[27]:(T=(0,G.jsx)(z,{label:`ARN`,value:f.clusterArn}),t[26]=f.clusterArn,t[27]=T);let E;t[28]===f.status?E=t[29]:(E=(0,G.jsx)(z,{label:`Status`,value:f.status}),t[28]=f.status,t[29]=E);let D=String(f.activeServicesCount??0),O;t[30]===D?O=t[31]:(O=(0,G.jsx)(z,{label:`Active services`,value:D}),t[30]=D,t[31]=O);let k=String(f.runningTasksCount??0),A;t[32]===k?A=t[33]:(A=(0,G.jsx)(z,{label:`Running tasks`,value:k}),t[32]=k,t[33]=A);let j=String(f.pendingTasksCount??0),N;t[34]===j?N=t[35]:(N=(0,G.jsx)(z,{label:`Pending tasks`,value:j}),t[34]=j,t[35]=N);let P=String(f.registeredContainerInstancesCount??0),I;t[36]===P?I=t[37]:(I=(0,G.jsx)(z,{label:`Registered instances`,value:P}),t[36]=P,t[37]=I);let K;t[38]!==T||t[39]!==E||t[40]!==O||t[41]!==A||t[42]!==N||t[43]!==I?(K=(0,G.jsxs)(R,{children:[w,(0,G.jsxs)(R.Content,{children:[T,E,O,A,N,I]})]}),t[38]=T,t[39]=E,t[40]=O,t[41]=A,t[42]=N,t[43]=I,t[44]=K):K=t[44];let q;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,G.jsxs)(ne,{children:[(0,G.jsx)(V,{value:`services`,children:`Services`}),(0,G.jsx)(V,{value:`tasks`,children:`Tasks`}),(0,G.jsx)(V,{value:`infrastructure`,children:`Infrastructure`}),(0,G.jsx)(V,{value:`tags`,children:`Tags`})]}),t[45]=q):q=t[45];let J;t[46]===n?J=t[47]:(J=(0,G.jsx)(H,{value:`services`,children:(0,G.jsx)(ae,{clusterName:n})}),t[46]=n,t[47]=J);let Y;t[48]===n?Y=t[49]:(Y=(0,G.jsx)(H,{value:`tasks`,children:(0,G.jsx)(oe,{clusterName:n})}),t[48]=n,t[49]=Y);let X;t[50]===n?X=t[51]:(X=(0,G.jsx)(H,{value:`infrastructure`,children:(0,G.jsx)(ie,{clusterName:n})}),t[50]=n,t[51]=X);let Z;t[52]===_?Z=t[53]:(Z=(0,G.jsx)(H,{value:`tags`,children:_.length===0?(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:`No tags.`}):(0,G.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Key`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Value`})]})}),(0,G.jsx)(`tbody`,{children:_.map(se)})]})})}),t[52]=_,t[53]=Z);let Q;t[54]!==J||t[55]!==Y||t[56]!==X||t[57]!==Z?(Q=(0,G.jsxs)(re,{className:`mt-6`,defaultValue:`services`,children:[q,J,Y,X,Z]}),t[54]=J,t[55]=Y,t[56]=X,t[57]=Z,t[58]=Q):Q=t[58];let ce=`This permanently deletes cluster "${n}" and force-stops every task it holds. This cannot be undone.`,$;t[59]!==p.isPending||t[60]!==h||t[61]!==i||t[62]!==ce?($=(0,G.jsx)(L,{description:ce,isPending:p.isPending,onConfirm:h,onOpenChange:o,open:i,title:`Delete cluster`}),t[59]=p.isPending,t[60]=h,t[61]=i,t[62]=ce,t[63]=$):$=t[63];let le;return t[64]!==K||t[65]!==Q||t[66]!==$||t[67]!==S||t[68]!==C?(le=(0,G.jsxs)(G.Fragment,{children:[v,S,C,K,Q,$]}),t[64]=K,t[65]=Q,t[66]=$,t[67]=S,t[68]=C,t[69]=le):le=t[69],le}function se(e){return(0,G.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.key}),(0,G.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.value})]},e.key)}function ce(){let e=(0,U.c)(2),{clusterName:t}=I.useParams(),n;return e[0]===t?n=e[1]:(n=(0,G.jsx)(Q,{clusterName:t}),e[0]=t,e[1]=n),n}export{ce as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useQuery.js";import{t as a}from"./useSuspenseQuery.js";import{t as o}from"./link.js";import{t as s}from"./useNavigate.js";import{t as c}from"./back-link.js";import{t as l}from"./trash-2.js";import{t as u}from"./button.js";import{t as d}from"./input.js";import{a as f,t as p}from"./field.js";import{a as m,i as h,l as g,n as _,o as v,r as y,s as b,t as x}from"./alert-dialog.js";import{O as S,c as C,p as w,w as T}from"./ec2.js";import{i as E,r as D,s as O,t as ee}from"./ecs.js";import{i as k,l as A,o as j,r as M,u as N}from"./ecs2.js";import{t as te}from"./error-banner.js";import{t as P}from"./gpu-instance-type-select.js";import{t as F}from"./page-heading.js";import{t as I}from"./_clusterName2.js";import{t as L}from"./delete-confirmation-dialog.js";import{n as R,t as z}from"./detail-row.js";import{t as B}from"./state-badge.js";import{i as V,n as ne,r as H,t as re}from"./tabs.js";var U=r(),W=e(n(),1),G=t(),K=`h-7 w-full rounded-md border border-input bg-input/20 px-2 text-sm`;function q({clusterName:e,open:t,onOpenChange:n}){let r=j(),{data:a}=i(S),{data:o}=i(T),{data:s}=i(w),{data:c}=i(C),l=a?.Subnets??[],u=o?.SecurityGroups??[],E=s?.KeyPairs??[],D=c?.InstanceTypes??[],[O,ee]=(0,W.useState)(`t3.small`),[k,A]=(0,W.useState)(1),[M,N]=(0,W.useState)(``),[F,I]=(0,W.useState)(``),[L,R]=(0,W.useState)(``);function z(e){e||(ee(`t3.small`),A(1),N(``),I(``),R(``),r.reset()),n(e)}async function B(){try{await r.mutateAsync({Cluster:e,InstanceType:O||void 0,Count:k,SubnetID:M,SecurityGroupID:F,KeyName:L||void 0}),z(!1)}catch{}}let V=r.isPending||M===``||F===``;return(0,G.jsx)(x,{onOpenChange:z,open:t,children:(0,G.jsxs)(h,{className:`max-h-[85vh] overflow-y-auto`,children:[(0,G.jsxs)(b,{children:[(0,G.jsx)(g,{children:`Provision EC2 capacity`}),(0,G.jsxs)(m,{children:[`Launch container instances into cluster “`,e,`”. They register automatically once booted.`]})]}),(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(p,{children:[(0,G.jsx)(f,{children:(0,G.jsx)(`label`,{htmlFor:`provision-instance-type`,children:`Instance type`})}),(0,G.jsx)(P,{id:`provision-instance-type`,instanceTypes:D,onValueChange:ee,value:O})]}),(0,G.jsxs)(p,{children:[(0,G.jsx)(f,{children:(0,G.jsx)(`label`,{htmlFor:`provision-count`,children:`Count`})}),(0,G.jsx)(d,{id:`provision-count`,max:10,min:1,onChange:e=>A(Number(e.target.value)),type:`number`,value:k})]}),(0,G.jsxs)(p,{children:[(0,G.jsx)(f,{children:(0,G.jsx)(`label`,{htmlFor:`provision-subnet`,children:`Subnet`})}),(0,G.jsxs)(`select`,{className:K,id:`provision-subnet`,onChange:e=>N(e.target.value),value:M,children:[(0,G.jsx)(`option`,{value:``,children:`Select a subnet`}),l.map(e=>(0,G.jsxs)(`option`,{value:e.SubnetId??``,children:[e.SubnetId,` (`,e.CidrBlock,e.AvailabilityZone?`, ${e.AvailabilityZone}`:``,`)`]},e.SubnetId))]})]}),(0,G.jsxs)(p,{children:[(0,G.jsx)(f,{children:(0,G.jsx)(`label`,{htmlFor:`provision-sg`,children:`Security group`})}),(0,G.jsxs)(`select`,{className:K,id:`provision-sg`,onChange:e=>I(e.target.value),value:F,children:[(0,G.jsx)(`option`,{value:``,children:`Select a security group`}),u.map(e=>(0,G.jsxs)(`option`,{value:e.GroupId??``,children:[e.GroupId,` (`,e.GroupName,`)`]},e.GroupId))]})]}),(0,G.jsxs)(p,{children:[(0,G.jsx)(f,{children:(0,G.jsx)(`label`,{htmlFor:`provision-key`,children:`Key pair`})}),(0,G.jsxs)(`select`,{className:K,id:`provision-key`,onChange:e=>R(e.target.value),value:L,children:[(0,G.jsx)(`option`,{value:``,children:`None`}),E.map(e=>(0,G.jsx)(`option`,{value:e.KeyName??``,children:e.KeyName},e.KeyPairId))]})]})]}),r.error&&(0,G.jsx)(te,{error:r.error instanceof Error?r.error:void 0,msg:`Failed to provision capacity.`}),(0,G.jsxs)(v,{children:[(0,G.jsx)(y,{children:`Cancel`}),(0,G.jsx)(_,{disabled:V,onClick:e=>{e.preventDefault(),B()},children:r.isPending?`Provisioning…`:`Provision`})]})]})})}var J={drain:`Drain`,activate:`Activate`,deregister:`Deregister`},Y={drain:`Draining force-stops the service-owned tasks on this instance so it can be retired.`,activate:`This returns the instance to ACTIVE so the scheduler can place tasks on it again.`,deregister:`This force-removes the container instance record. Any tasks it still holds are stopped.`};function ie(e){let t=(0,U.c)(28),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=D(n),t[0]=n,t[1]=r);let{data:i}=a(r),o=N(),s=k(),[c,l]=(0,W.useState)(null),[d,f]=(0,W.useState)(!1),p;t[2]!==n||t[3]!==s||t[4]!==c||t[5]!==o?(p=function(){if(!c)return;let e=()=>l(null);if(c.action===`deregister`){s.mutate({cluster:n,containerInstance:c.arn},{onSuccess:e});return}o.mutate({cluster:n,containerInstance:c.arn,status:c.action===`drain`?`DRAINING`:`ACTIVE`},{onSuccess:e})},t[2]=n,t[3]=s,t[4]=c,t[5]=o,t[6]=p):p=t[6];let m=p,h=o.isError||s.isError,g=o.error??s.error,_=o.isPending||s.isPending,v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,G.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,G.jsx)(u,{onClick:()=>f(!0),size:`sm`,children:`Provision EC2 capacity`})}),t[7]=v):v=t[7];let y;t[8]!==g||t[9]!==h?(y=h&&(0,G.jsx)(te,{error:g instanceof Error?g:void 0,msg:`Container instance action failed.`}),t[8]=g,t[9]=h,t[10]=y):y=t[10];let b;t[11]===i?b=t[12]:(b=i.length===0?(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:`No container instances found.`}):(0,G.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`EC2 Instance`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Running`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Pending`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,G.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,G.jsx)(`tbody`,{children:i.map(e=>{let t=e.containerInstanceArn??``,n=e.status===`DRAINING`;return(0,G.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.ec2InstanceId}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:(0,G.jsx)(B,{state:e.status})}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:e.runningTasksCount??0}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:e.pendingTasksCount??0}),(0,G.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,G.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,G.jsx)(u,{"aria-label":n?`Activate container instance`:`Drain container instance`,onClick:()=>l({arn:t,action:n?`activate`:`drain`}),size:`sm`,variant:`outline`,children:n?`Activate`:`Drain`}),(0,G.jsx)(u,{onClick:()=>l({arn:t,action:`deregister`}),size:`sm`,variant:`destructive`,children:`Deregister`})]})})]},t)})})]})}),t[11]=i,t[12]=b);let x;t[13]!==n||t[14]!==d?(x=(0,G.jsx)(q,{clusterName:n,onOpenChange:f,open:d}),t[13]=n,t[14]=d,t[15]=x):x=t[15];let S=c?J[c.action]:`Confirm`,C=c?Y[c.action]:``,w;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>!e&&l(null),t[16]=w):w=t[16];let T=c!==null,E;t[17]!==m||t[18]!==_||t[19]!==T||t[20]!==S||t[21]!==C?(E=(0,G.jsx)(L,{confirmLabel:S,description:C,isPending:_,onConfirm:m,onOpenChange:w,open:T,title:`Container instance`}),t[17]=m,t[18]=_,t[19]=T,t[20]=S,t[21]=C,t[22]=E):E=t[22];let O;return t[23]!==E||t[24]!==y||t[25]!==b||t[26]!==x?(O=(0,G.jsxs)(G.Fragment,{children:[v,y,b,x,E]}),t[23]=E,t[24]=y,t[25]=b,t[26]=x,t[27]=O):O=t[27],O}function X(e){return e?.split(`/`).at(-1)??``}function ae(e){let t=(0,U.c)(13),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=E(n),t[0]=n,t[1]=r);let{data:i}=a(r),s;t[2]===n?s=t[3]:(s={cluster:n},t[2]=n,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,G.jsx)(u,{size:`sm`,children:`Create service`}),t[4]=c):c=t[4];let l;t[5]===s?l=t[6]:(l=(0,G.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,G.jsx)(o,{search:s,to:`/ecs/create-service`,children:c})}),t[5]=s,t[6]=l);let d;t[7]!==n||t[8]!==i?(d=i.length===0?(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:`No services found.`}):(0,G.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Desired`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Running`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Pending`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Task Definition`})]})}),(0,G.jsx)(`tbody`,{children:i.map(e=>(0,G.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,G.jsx)(o,{className:`underline`,params:{clusterName:n,serviceName:e.serviceName??``},to:`/ecs/list-clusters/$clusterName/services/$serviceName`,children:e.serviceName})}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:(0,G.jsx)(B,{state:e.status})}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:e.desiredCount??0}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:e.runningCount??0}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:e.pendingCount??0}),(0,G.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:X(e.taskDefinition)})]},e.serviceArn??e.serviceName))})]})}),t[7]=n,t[8]=i,t[9]=d):d=t[9];let f;return t[10]!==l||t[11]!==d?(f=(0,G.jsxs)(G.Fragment,{children:[l,d]}),t[10]=l,t[11]=d,t[12]=f):f=t[12],f}function Z(e){return e?.split(`/`).at(-1)??``}function oe(e){let t=(0,U.c)(27),{clusterName:n}=e,r;t[0]===n?r=t[1]:(r=O(n),t[0]=n,t[1]=r);let{data:i}=a(r),s=A(),[c,l]=(0,W.useState)(null),d;t[2]!==n||t[3]!==c||t[4]!==s?(d=function(){c&&s.mutate({cluster:n,task:c},{onSuccess:()=>l(null)})},t[2]=n,t[3]=c,t[4]=s,t[5]=d):d=t[5];let f=d,p;t[6]===n?p=t[7]:(p={cluster:n},t[6]=n,t[7]=p);let m;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,G.jsx)(u,{size:`sm`,children:`Run task`}),t[8]=m):m=t[8];let h;t[9]===p?h=t[10]:(h=(0,G.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,G.jsx)(o,{search:p,to:`/ecs/run-task`,children:m})}),t[9]=p,t[10]=h);let g;t[11]!==s.error||t[12]!==s.isError?(g=s.isError&&(0,G.jsx)(te,{error:s.error instanceof Error?s.error:void 0,msg:`Failed to stop task.`}),t[11]=s.error,t[12]=s.isError,t[13]=g):g=t[13];let _;t[14]!==n||t[15]!==i?(_=i.length===0?(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:`No tasks found.`}):(0,G.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Task`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Last Status`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Desired Status`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Group`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,G.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,G.jsx)(`tbody`,{children:i.map(e=>{let t=Z(e.taskArn),r=e.lastStatus!==`STOPPED`;return(0,G.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:(0,G.jsx)(o,{className:`underline`,params:{clusterName:n,taskId:t},to:`/ecs/list-clusters/$clusterName/tasks/$taskId`,children:t})}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:(0,G.jsx)(B,{state:e.lastStatus})}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:e.desiredStatus}),(0,G.jsx)(`td`,{className:`px-4 py-2`,children:e.group}),(0,G.jsx)(`td`,{className:`px-4 py-2 text-right`,children:r&&(0,G.jsx)(u,{onClick:()=>l(e.taskArn??t),size:`sm`,variant:`destructive`,children:`Stop`})})]},t)})})]})}),t[14]=n,t[15]=i,t[16]=_):_=t[16];let v;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>!e&&l(null),t[17]=v):v=t[17];let y=c!==null,b;t[18]!==f||t[19]!==s.isPending||t[20]!==y?(b=(0,G.jsx)(L,{confirmLabel:`Stop task`,description:`This stops the task and releases its ENI and reserved capacity.`,isPending:s.isPending,onConfirm:f,onOpenChange:v,open:y,pendingLabel:`Stopping…`,title:`Stop task`}),t[18]=f,t[19]=s.isPending,t[20]=y,t[21]=b):b=t[21];let x;return t[22]!==b||t[23]!==h||t[24]!==g||t[25]!==_?(x=(0,G.jsxs)(G.Fragment,{children:[h,g,_,b]}),t[22]=b,t[23]=h,t[24]=g,t[25]=_,t[26]=x):x=t[26],x}function Q(e){let t=(0,U.c)(70),{clusterName:n}=e,r=s(),[i,o]=(0,W.useState)(!1),d;t[0]===n?d=t[1]:(d=ee(n),t[0]=n,t[1]=d);let{data:f}=a(d),p=M(),m;t[2]!==n||t[3]!==p||t[4]!==r?(m=function(){p.mutate(n,{onSuccess:()=>{r({to:`/ecs/list-clusters`})}})},t[2]=n,t[3]=p,t[4]=r,t[5]=m):m=t[5];let h=m;if(!f){let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(c,{to:`/ecs/list-clusters`,children:`Clusters`}),t[6]=e):e=t[6];let r;t[7]===n?r=t[8]:(r=(0,G.jsx)(F,{subtitle:`Cluster Details`,title:n}),t[7]=n,t[8]=r);let i;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:`Cluster not found.`}),t[9]=i):i=t[9];let a;return t[10]===r?a=t[11]:(a=(0,G.jsxs)(G.Fragment,{children:[e,r,i]}),t[10]=r,t[11]=a),a}let g;t[12]===f.tags?g=t[13]:(g=f.tags??[],t[12]=f.tags,t[13]=g);let _=g,v;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,G.jsx)(c,{to:`/ecs/list-clusters`,children:`Clusters`}),t[14]=v):v=t[14];let y;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>o(!0),t[15]=y):y=t[15];let b;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,G.jsxs)(u,{onClick:y,size:`sm`,variant:`destructive`,children:[(0,G.jsx)(l,{className:`size-4`}),`Delete`]}),t[16]=b):b=t[16];let x;t[17]===f.status?x=t[18]:(x=(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[b,(0,G.jsx)(B,{state:f.status})]}),t[17]=f.status,t[18]=x);let S;t[19]!==n||t[20]!==x?(S=(0,G.jsx)(F,{actions:x,subtitle:`Cluster Details`,title:n}),t[19]=n,t[20]=x,t[21]=S):S=t[21];let C;t[22]!==p.error||t[23]!==p.isError?(C=p.isError&&(0,G.jsx)(te,{error:p.error instanceof Error?p.error:void 0,msg:`Failed to delete cluster.`}),t[22]=p.error,t[23]=p.isError,t[24]=C):C=t[24];let w;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,G.jsx)(R.Header,{children:`Overview`}),t[25]=w):w=t[25];let T;t[26]===f.clusterArn?T=t[27]:(T=(0,G.jsx)(z,{label:`ARN`,value:f.clusterArn}),t[26]=f.clusterArn,t[27]=T);let E;t[28]===f.status?E=t[29]:(E=(0,G.jsx)(z,{label:`Status`,value:f.status}),t[28]=f.status,t[29]=E);let D=String(f.activeServicesCount??0),O;t[30]===D?O=t[31]:(O=(0,G.jsx)(z,{label:`Active services`,value:D}),t[30]=D,t[31]=O);let k=String(f.runningTasksCount??0),A;t[32]===k?A=t[33]:(A=(0,G.jsx)(z,{label:`Running tasks`,value:k}),t[32]=k,t[33]=A);let j=String(f.pendingTasksCount??0),N;t[34]===j?N=t[35]:(N=(0,G.jsx)(z,{label:`Pending tasks`,value:j}),t[34]=j,t[35]=N);let P=String(f.registeredContainerInstancesCount??0),I;t[36]===P?I=t[37]:(I=(0,G.jsx)(z,{label:`Registered instances`,value:P}),t[36]=P,t[37]=I);let K;t[38]!==T||t[39]!==E||t[40]!==O||t[41]!==A||t[42]!==N||t[43]!==I?(K=(0,G.jsxs)(R,{children:[w,(0,G.jsxs)(R.Content,{children:[T,E,O,A,N,I]})]}),t[38]=T,t[39]=E,t[40]=O,t[41]=A,t[42]=N,t[43]=I,t[44]=K):K=t[44];let q;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,G.jsxs)(ne,{children:[(0,G.jsx)(V,{value:`services`,children:`Services`}),(0,G.jsx)(V,{value:`tasks`,children:`Tasks`}),(0,G.jsx)(V,{value:`infrastructure`,children:`Infrastructure`}),(0,G.jsx)(V,{value:`tags`,children:`Tags`})]}),t[45]=q):q=t[45];let J;t[46]===n?J=t[47]:(J=(0,G.jsx)(H,{value:`services`,children:(0,G.jsx)(ae,{clusterName:n})}),t[46]=n,t[47]=J);let Y;t[48]===n?Y=t[49]:(Y=(0,G.jsx)(H,{value:`tasks`,children:(0,G.jsx)(oe,{clusterName:n})}),t[48]=n,t[49]=Y);let X;t[50]===n?X=t[51]:(X=(0,G.jsx)(H,{value:`infrastructure`,children:(0,G.jsx)(ie,{clusterName:n})}),t[50]=n,t[51]=X);let Z;t[52]===_?Z=t[53]:(Z=(0,G.jsx)(H,{value:`tags`,children:_.length===0?(0,G.jsx)(`p`,{className:`text-muted-foreground`,children:`No tags.`}):(0,G.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,G.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Key`}),(0,G.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Value`})]})}),(0,G.jsx)(`tbody`,{children:_.map(se)})]})})}),t[52]=_,t[53]=Z);let Q;t[54]!==J||t[55]!==Y||t[56]!==X||t[57]!==Z?(Q=(0,G.jsxs)(re,{className:`mt-6`,defaultValue:`services`,children:[q,J,Y,X,Z]}),t[54]=J,t[55]=Y,t[56]=X,t[57]=Z,t[58]=Q):Q=t[58];let ce=`This permanently deletes cluster "${n}" and force-stops every task it holds. This cannot be undone.`,$;t[59]!==p.isPending||t[60]!==h||t[61]!==i||t[62]!==ce?($=(0,G.jsx)(L,{description:ce,isPending:p.isPending,onConfirm:h,onOpenChange:o,open:i,title:`Delete cluster`}),t[59]=p.isPending,t[60]=h,t[61]=i,t[62]=ce,t[63]=$):$=t[63];let le;return t[64]!==K||t[65]!==Q||t[66]!==$||t[67]!==S||t[68]!==C?(le=(0,G.jsxs)(G.Fragment,{children:[v,S,C,K,Q,$]}),t[64]=K,t[65]=Q,t[66]=$,t[67]=S,t[68]=C,t[69]=le):le=t[69],le}function se(e){return(0,G.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,G.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.key}),(0,G.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.value})]},e.key)}function ce(){let e=(0,U.c)(2),{clusterName:t}=I.useParams(),n;return e[0]===t?n=e[1]:(n=(0,G.jsx)(Q,{clusterName:t}),e[0]=t,e[1]=n),n}export{ce as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_serviceName2.js b/spinifex/services/spinifexui/frontend/dist/assets/_serviceName2.js index 726f3d497..652b94470 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_serviceName2.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_serviceName2.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./link.js";import{t as i}from"./back-link.js";import{i as a,s as o}from"./ecs.js";import{t as s}from"./page-heading.js";import{t as c}from"./_serviceName.js";import{n as l,t as u}from"./detail-row.js";import{t as d}from"./state-badge.js";var f=t(),p=e();function m(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function h(e,t){return(e.attachments??[]).find(e=>e.type===`ElasticNetworkInterface`)?.details?.find(e=>e.name===t)?.value}function g(e){let t=(0,f.c)(69),{clusterName:c,serviceName:g}=e,b;t[0]===c?b=t[1]:(b=a(c),t[0]=c,t[1]=b);let{data:x}=n(b),S;t[2]===c?S=t[3]:(S=o(c),t[2]=c,t[3]=S);let{data:C}=n(S),w,T,E,D,O,k,A,j,M,N;if(t[4]!==c||t[5]!==g||t[6]!==x||t[7]!==C){E=Symbol.for(`react.early_return_sentinel`);bb0:{let e;t[18]===g?e=t[19]:(e=e=>e.serviceName===g,t[18]=g,t[19]=e);let n=x.find(e);if(!n){let e;t[20]===c?e=t[21]:(e={clusterName:c},t[20]=c,t[21]=e);let n;t[22]!==c||t[23]!==e?(n=(0,p.jsx)(i,{params:e,to:`/ecs/list-clusters/$clusterName`,children:c}),t[22]=c,t[23]=e,t[24]=n):n=t[24];let r;t[25]===g?r=t[26]:(r=(0,p.jsx)(s,{subtitle:`Service Details`,title:g}),t[25]=g,t[26]=r);let a;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,p.jsx)(`p`,{className:`text-muted-foreground`,children:`Service not found.`}),t[27]=a):a=t[27];let o;t[28]!==n||t[29]!==r?(o=(0,p.jsxs)(p.Fragment,{children:[n,r,a]}),t[28]=n,t[29]=r,t[30]=o):o=t[30],E=o;break bb0}let a=n.loadBalancers??[],o;t[31]===g?o=t[32]:(o=e=>e.group===`service:${g}`,t[31]=g,t[32]=o);let f=C.filter(o),b=n.deployments??[],S=n.events??[],P;t[33]===c?P=t[34]:(P={clusterName:c},t[33]=c,t[34]=P),t[35]!==c||t[36]!==P?(A=(0,p.jsx)(i,{params:P,to:`/ecs/list-clusters/$clusterName`,children:c}),t[35]=c,t[36]=P,t[37]=A):A=t[37],j=(0,p.jsx)(s,{actions:(0,p.jsx)(d,{state:n.status}),subtitle:`Service Details`,title:g});let F;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,p.jsx)(l.Header,{children:`Configuration`}),t[38]=F):F=t[38];let I=String(n.desiredCount??0),L;t[39]===I?L=t[40]:(L=(0,p.jsx)(u,{label:`Desired count`,value:I}),t[39]=I,t[40]=L);let R=String(n.runningCount??0),z;t[41]===R?z=t[42]:(z=(0,p.jsx)(u,{label:`Running count`,value:R}),t[41]=R,t[42]=z);let B=String(n.pendingCount??0),V;t[43]===B?V=t[44]:(V=(0,p.jsx)(u,{label:`Pending count`,value:B}),t[43]=B,t[44]=V);let H=(0,p.jsxs)(l.Content,{children:[(0,p.jsx)(u,{label:`Status`,value:(0,p.jsx)(d,{state:n.status})}),L,z,V,(0,p.jsx)(u,{label:`Task definition`,value:m(n.taskDefinition)}),(0,p.jsx)(u,{label:`Launch type`,value:n.launchType}),(0,p.jsx)(u,{label:`Scheduling strategy`,value:n.schedulingStrategy})]});t[45]===H?M=t[46]:(M=(0,p.jsxs)(l,{children:[F,H]}),t[45]=H,t[46]=M);let U;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,p.jsx)(`h2`,{className:`mb-2 font-semibold`,children:`Load balancers`}),t[47]=U):U=t[47];let W=a.length===0?(0,p.jsx)(`p`,{className:`text-muted-foreground`,children:`None`}):(0,p.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,p.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Target Group`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Container`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Port`})]})}),(0,p.jsx)(`tbody`,{children:a.map(y)})]})});t[48]===W?N=t[49]:(N=(0,p.jsxs)(`div`,{className:`mt-6`,children:[U,W]}),t[48]=W,t[49]=N);let G;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,p.jsx)(`h2`,{className:`mb-2 font-semibold`,children:`Tasks`}),t[50]=G):G=t[50];let K=f.length===0?(0,p.jsx)(`p`,{className:`text-muted-foreground`,children:`No tasks found.`}):(0,p.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,p.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Task`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Last Status`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Private IP`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Public IP`})]})}),(0,p.jsx)(`tbody`,{children:f.map(e=>{let t=m(e.taskArn);return(0,p.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,p.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:(0,p.jsx)(r,{className:`underline`,params:{clusterName:c,taskId:t},to:`/ecs/list-clusters/$clusterName/tasks/$taskId`,children:t})}),(0,p.jsx)(`td`,{className:`px-4 py-2`,children:(0,p.jsx)(d,{state:e.lastStatus})}),(0,p.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:h(e,`privateIPv4Address`)??`—`}),(0,p.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:h(e,`publicIPv4Address`)??`—`})]},t)})})]})});t[51]===K?w=t[52]:(w=(0,p.jsxs)(`div`,{className:`mt-6`,children:[G,K]}),t[51]=K,t[52]=w);let q;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,p.jsx)(`h2`,{className:`mb-2 font-semibold`,children:`Deployments`}),t[53]=q):q=t[53];let J=b.length===0?(0,p.jsx)(`p`,{className:`text-muted-foreground`,children:`None`}):(0,p.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,p.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Task Definition`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Desired`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Running`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Pending`})]})}),(0,p.jsx)(`tbody`,{children:b.map(v)})]})});t[54]===J?T=t[55]:(T=(0,p.jsxs)(`div`,{className:`mt-6`,children:[q,J]}),t[54]=J,t[55]=T),D=`mt-6`,t[56]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,p.jsx)(`h2`,{className:`mb-2 font-semibold`,children:`Events`}),t[56]=O):O=t[56],k=S.length===0?(0,p.jsx)(`p`,{className:`text-muted-foreground`,children:`None`}):(0,p.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,p.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Time`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Message`})]})}),(0,p.jsx)(`tbody`,{children:S.map(_)})]})})}t[4]=c,t[5]=g,t[6]=x,t[7]=C,t[8]=w,t[9]=T,t[10]=E,t[11]=D,t[12]=O,t[13]=k,t[14]=A,t[15]=j,t[16]=M,t[17]=N}else w=t[8],T=t[9],E=t[10],D=t[11],O=t[12],k=t[13],A=t[14],j=t[15],M=t[16],N=t[17];if(E!==Symbol.for(`react.early_return_sentinel`))return E;let P;t[57]!==D||t[58]!==O||t[59]!==k?(P=(0,p.jsxs)(`div`,{className:D,children:[O,k]}),t[57]=D,t[58]=O,t[59]=k,t[60]=P):P=t[60];let F;return t[61]!==w||t[62]!==T||t[63]!==P||t[64]!==A||t[65]!==j||t[66]!==M||t[67]!==N?(F=(0,p.jsxs)(p.Fragment,{children:[A,j,M,N,w,T,P]}),t[61]=w,t[62]=T,t[63]=P,t[64]=A,t[65]=j,t[66]=M,t[67]=N,t[68]=F):F=t[68],F}function _(e){return(0,p.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,p.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.createdAt?new Date(e.createdAt).toISOString():``}),(0,p.jsx)(`td`,{className:`px-4 py-2`,children:e.message})]},e.id)}function v(e){return(0,p.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,p.jsx)(`td`,{className:`px-4 py-2`,children:e.status}),(0,p.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:m(e.taskDefinition)}),(0,p.jsx)(`td`,{className:`px-4 py-2`,children:e.desiredCount??0}),(0,p.jsx)(`td`,{className:`px-4 py-2`,children:e.runningCount??0}),(0,p.jsx)(`td`,{className:`px-4 py-2`,children:e.pendingCount??0})]},e.id)}function y(e){return(0,p.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,p.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:m(e.targetGroupArn)}),(0,p.jsx)(`td`,{className:`px-4 py-2`,children:e.containerName}),(0,p.jsx)(`td`,{className:`px-4 py-2`,children:e.containerPort})]},`${e.targetGroupArn??``}-${e.containerName??``}-${e.containerPort??``}`)}function b(){let e=(0,f.c)(3),{clusterName:t,serviceName:n}=c.useParams(),r;return e[0]!==t||e[1]!==n?(r=(0,p.jsx)(g,{clusterName:t,serviceName:n}),e[0]=t,e[1]=n,e[2]=r):r=e[2],r}export{b as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./link.js";import{t as i}from"./back-link.js";import{i as a,s as o}from"./ecs.js";import{t as s}from"./page-heading.js";import{t as c}from"./_serviceName.js";import{n as l,t as u}from"./detail-row.js";import{t as d}from"./state-badge.js";var f=t(),p=e();function m(e){return e?.split(`/`).at(-1)??``}function h(e,t){return(e.attachments??[]).find(e=>e.type===`ElasticNetworkInterface`)?.details?.find(e=>e.name===t)?.value}function g(e){let t=(0,f.c)(69),{clusterName:c,serviceName:g}=e,b;t[0]===c?b=t[1]:(b=a(c),t[0]=c,t[1]=b);let{data:x}=n(b),S;t[2]===c?S=t[3]:(S=o(c),t[2]=c,t[3]=S);let{data:C}=n(S),w,T,E,D,O,k,A,j,M,N;if(t[4]!==c||t[5]!==g||t[6]!==x||t[7]!==C){E=Symbol.for(`react.early_return_sentinel`);bb0:{let e;t[18]===g?e=t[19]:(e=e=>e.serviceName===g,t[18]=g,t[19]=e);let n=x.find(e);if(!n){let e;t[20]===c?e=t[21]:(e={clusterName:c},t[20]=c,t[21]=e);let n;t[22]!==c||t[23]!==e?(n=(0,p.jsx)(i,{params:e,to:`/ecs/list-clusters/$clusterName`,children:c}),t[22]=c,t[23]=e,t[24]=n):n=t[24];let r;t[25]===g?r=t[26]:(r=(0,p.jsx)(s,{subtitle:`Service Details`,title:g}),t[25]=g,t[26]=r);let a;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,p.jsx)(`p`,{className:`text-muted-foreground`,children:`Service not found.`}),t[27]=a):a=t[27];let o;t[28]!==n||t[29]!==r?(o=(0,p.jsxs)(p.Fragment,{children:[n,r,a]}),t[28]=n,t[29]=r,t[30]=o):o=t[30],E=o;break bb0}let a=n.loadBalancers??[],o;t[31]===g?o=t[32]:(o=e=>e.group===`service:${g}`,t[31]=g,t[32]=o);let f=C.filter(o),b=n.deployments??[],S=n.events??[],P;t[33]===c?P=t[34]:(P={clusterName:c},t[33]=c,t[34]=P),t[35]!==c||t[36]!==P?(A=(0,p.jsx)(i,{params:P,to:`/ecs/list-clusters/$clusterName`,children:c}),t[35]=c,t[36]=P,t[37]=A):A=t[37],j=(0,p.jsx)(s,{actions:(0,p.jsx)(d,{state:n.status}),subtitle:`Service Details`,title:g});let F;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,p.jsx)(l.Header,{children:`Configuration`}),t[38]=F):F=t[38];let I=String(n.desiredCount??0),L;t[39]===I?L=t[40]:(L=(0,p.jsx)(u,{label:`Desired count`,value:I}),t[39]=I,t[40]=L);let R=String(n.runningCount??0),z;t[41]===R?z=t[42]:(z=(0,p.jsx)(u,{label:`Running count`,value:R}),t[41]=R,t[42]=z);let B=String(n.pendingCount??0),V;t[43]===B?V=t[44]:(V=(0,p.jsx)(u,{label:`Pending count`,value:B}),t[43]=B,t[44]=V);let H=(0,p.jsxs)(l.Content,{children:[(0,p.jsx)(u,{label:`Status`,value:(0,p.jsx)(d,{state:n.status})}),L,z,V,(0,p.jsx)(u,{label:`Task definition`,value:m(n.taskDefinition)}),(0,p.jsx)(u,{label:`Launch type`,value:n.launchType}),(0,p.jsx)(u,{label:`Scheduling strategy`,value:n.schedulingStrategy})]});t[45]===H?M=t[46]:(M=(0,p.jsxs)(l,{children:[F,H]}),t[45]=H,t[46]=M);let U;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,p.jsx)(`h2`,{className:`mb-2 font-semibold`,children:`Load balancers`}),t[47]=U):U=t[47];let W=a.length===0?(0,p.jsx)(`p`,{className:`text-muted-foreground`,children:`None`}):(0,p.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,p.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Target Group`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Container`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Port`})]})}),(0,p.jsx)(`tbody`,{children:a.map(y)})]})});t[48]===W?N=t[49]:(N=(0,p.jsxs)(`div`,{className:`mt-6`,children:[U,W]}),t[48]=W,t[49]=N);let G;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,p.jsx)(`h2`,{className:`mb-2 font-semibold`,children:`Tasks`}),t[50]=G):G=t[50];let K=f.length===0?(0,p.jsx)(`p`,{className:`text-muted-foreground`,children:`No tasks found.`}):(0,p.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,p.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Task`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Last Status`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Private IP`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Public IP`})]})}),(0,p.jsx)(`tbody`,{children:f.map(e=>{let t=m(e.taskArn);return(0,p.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,p.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:(0,p.jsx)(r,{className:`underline`,params:{clusterName:c,taskId:t},to:`/ecs/list-clusters/$clusterName/tasks/$taskId`,children:t})}),(0,p.jsx)(`td`,{className:`px-4 py-2`,children:(0,p.jsx)(d,{state:e.lastStatus})}),(0,p.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:h(e,`privateIPv4Address`)??`—`}),(0,p.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:h(e,`publicIPv4Address`)??`—`})]},t)})})]})});t[51]===K?w=t[52]:(w=(0,p.jsxs)(`div`,{className:`mt-6`,children:[G,K]}),t[51]=K,t[52]=w);let q;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,p.jsx)(`h2`,{className:`mb-2 font-semibold`,children:`Deployments`}),t[53]=q):q=t[53];let J=b.length===0?(0,p.jsx)(`p`,{className:`text-muted-foreground`,children:`None`}):(0,p.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,p.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Task Definition`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Desired`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Running`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Pending`})]})}),(0,p.jsx)(`tbody`,{children:b.map(v)})]})});t[54]===J?T=t[55]:(T=(0,p.jsxs)(`div`,{className:`mt-6`,children:[q,J]}),t[54]=J,t[55]=T),D=`mt-6`,t[56]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,p.jsx)(`h2`,{className:`mb-2 font-semibold`,children:`Events`}),t[56]=O):O=t[56],k=S.length===0?(0,p.jsx)(`p`,{className:`text-muted-foreground`,children:`None`}):(0,p.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,p.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,p.jsx)(`thead`,{children:(0,p.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Time`}),(0,p.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Message`})]})}),(0,p.jsx)(`tbody`,{children:S.map(_)})]})})}t[4]=c,t[5]=g,t[6]=x,t[7]=C,t[8]=w,t[9]=T,t[10]=E,t[11]=D,t[12]=O,t[13]=k,t[14]=A,t[15]=j,t[16]=M,t[17]=N}else w=t[8],T=t[9],E=t[10],D=t[11],O=t[12],k=t[13],A=t[14],j=t[15],M=t[16],N=t[17];if(E!==Symbol.for(`react.early_return_sentinel`))return E;let P;t[57]!==D||t[58]!==O||t[59]!==k?(P=(0,p.jsxs)(`div`,{className:D,children:[O,k]}),t[57]=D,t[58]=O,t[59]=k,t[60]=P):P=t[60];let F;return t[61]!==w||t[62]!==T||t[63]!==P||t[64]!==A||t[65]!==j||t[66]!==M||t[67]!==N?(F=(0,p.jsxs)(p.Fragment,{children:[A,j,M,N,w,T,P]}),t[61]=w,t[62]=T,t[63]=P,t[64]=A,t[65]=j,t[66]=M,t[67]=N,t[68]=F):F=t[68],F}function _(e){return(0,p.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,p.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.createdAt?new Date(e.createdAt).toISOString():``}),(0,p.jsx)(`td`,{className:`px-4 py-2`,children:e.message})]},e.id)}function v(e){return(0,p.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,p.jsx)(`td`,{className:`px-4 py-2`,children:e.status}),(0,p.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:m(e.taskDefinition)}),(0,p.jsx)(`td`,{className:`px-4 py-2`,children:e.desiredCount??0}),(0,p.jsx)(`td`,{className:`px-4 py-2`,children:e.runningCount??0}),(0,p.jsx)(`td`,{className:`px-4 py-2`,children:e.pendingCount??0})]},e.id)}function y(e){return(0,p.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,p.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:m(e.targetGroupArn)}),(0,p.jsx)(`td`,{className:`px-4 py-2`,children:e.containerName}),(0,p.jsx)(`td`,{className:`px-4 py-2`,children:e.containerPort})]},`${e.targetGroupArn??``}-${e.containerName??``}-${e.containerPort??``}`)}function b(){let e=(0,f.c)(3),{clusterName:t,serviceName:n}=c.useParams(),r;return e[0]!==t||e[1]!==n?(r=(0,p.jsx)(g,{clusterName:t,serviceName:n}),e[0]=t,e[1]=n,e[2]=r):r=e[2],r}export{b as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/_taskId2.js b/spinifex/services/spinifexui/frontend/dist/assets/_taskId2.js index cc7b16af1..c181af8ba 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/_taskId2.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/_taskId2.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./back-link.js";import{s as i}from"./ecs.js";import{t as a}from"./page-heading.js";import{t as o}from"./_taskId.js";import{n as s,t as c}from"./detail-row.js";import{t as l}from"./state-badge.js";var u=t(),d=e();function f(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function p(e,t){return e?.details?.find(e=>e.name===t)?.value}function m(e){return e?new Date(e).toISOString():``}function h(e){let t=(0,u.c)(48),{clusterName:o,taskId:h}=e,v;t[0]===o?v=t[1]:(v=i(o),t[0]=o,t[1]=v);let{data:y}=n(v),b,x,S,C,w,T,E,D;if(t[2]!==o||t[3]!==h||t[4]!==y){D=Symbol.for(`react.early_return_sentinel`);bb0:{let e;t[13]===h?e=t[14]:(e=e=>(e.taskArn??``).endsWith(h),t[13]=h,t[14]=e);let n=y.find(e);if(!n){let e;t[15]===o?e=t[16]:(e={clusterName:o},t[15]=o,t[16]=e);let n;t[17]!==o||t[18]!==e?(n=(0,d.jsx)(r,{params:e,to:`/ecs/list-clusters/$clusterName`,children:o}),t[17]=o,t[18]=e,t[19]=n):n=t[19];let i;t[20]===h?i=t[21]:(i=(0,d.jsx)(a,{subtitle:`Task Details`,title:h}),t[20]=h,t[21]=i);let s;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Task not found.`}),t[22]=s):s=t[22];let c;t[23]!==n||t[24]!==i?(c=(0,d.jsxs)(d.Fragment,{children:[n,i,s]}),t[23]=n,t[24]=i,t[25]=c):c=t[25],D=c;break bb0}let i=(n.attachments??[]).find(_),u=n.containers??[],v=u.some(g),O;t[26]===o?O=t[27]:(O={clusterName:o},t[26]=o,t[27]=O),t[28]!==o||t[29]!==O?(C=(0,d.jsx)(r,{params:O,to:`/ecs/list-clusters/$clusterName`,children:o}),t[28]=o,t[29]=O,t[30]=C):C=t[30],w=(0,d.jsx)(a,{actions:(0,d.jsx)(l,{state:n.lastStatus}),subtitle:`Task Details`,title:f(n.taskArn)});let k;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,d.jsx)(s.Header,{children:`Configuration`}),t[31]=k):k=t[31];let A=(0,d.jsxs)(s.Content,{children:[(0,d.jsx)(c,{label:`Task ID`,value:f(n.taskArn)}),(0,d.jsx)(c,{label:`Last status`,value:(0,d.jsx)(l,{state:n.lastStatus})}),(0,d.jsx)(c,{label:`Desired status`,value:n.desiredStatus}),(0,d.jsx)(c,{label:`Task definition`,value:f(n.taskDefinitionArn)}),(0,d.jsx)(c,{label:`Launch type`,value:n.launchType}),(0,d.jsx)(c,{label:`Container instance`,value:f(n.containerInstanceArn)}),(0,d.jsx)(c,{label:`Created at`,value:m(n.createdAt)}),(0,d.jsx)(c,{label:`Started at`,value:m(n.startedAt)}),(0,d.jsx)(c,{label:`Stopped at`,value:m(n.stoppedAt)}),n.stoppedReason?(0,d.jsx)(c,{label:`Stopped reason`,value:n.stoppedReason}):null]});t[32]===A?T=t[33]:(T=(0,d.jsxs)(s,{children:[k,A]}),t[32]=A,t[33]=T);let j;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,d.jsx)(s.Header,{children:`Networking`}),t[34]=j):j=t[34];let M=i?(0,d.jsxs)(s.Content,{children:[(0,d.jsx)(c,{label:`ENI ID`,value:p(i,`networkInterfaceId`)}),(0,d.jsx)(c,{label:`Private IP`,value:p(i,`privateIPv4Address`)}),(0,d.jsx)(c,{label:`Public IP`,value:p(i,`publicIPv4Address`)}),(0,d.jsx)(c,{label:`Subnet`,value:p(i,`subnetId`)}),(0,d.jsx)(c,{label:`MAC`,value:p(i,`macAddress`)})]}):(0,d.jsx)(`div`,{className:`p-4`,children:(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Network mode does not assign an ENI.`})});t[35]===M?E=t[36]:(E=(0,d.jsx)(`div`,{className:`mt-6`,children:(0,d.jsxs)(s,{children:[j,M]})}),t[35]=M,t[36]=E),b=`mt-6`,t[37]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,d.jsx)(`h2`,{className:`mb-2 font-semibold`,children:`Containers`}),t[37]=x):x=t[37],S=u.length===0?(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No containers.`}):(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Image`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Health`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Exit Code / Reason`}),v&&(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`GPUs`})]})}),(0,d.jsx)(`tbody`,{children:u.map(e=>(0,d.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,d.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:e.name}),(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.image}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:(0,d.jsx)(l,{state:e.lastStatus})}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.healthStatus}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.exitCode===void 0?e.reason??``:String(e.exitCode)}),v&&(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.gpuIds&&e.gpuIds.length>0?e.gpuIds.join(`, `):`—`})]},e.name??e.containerArn))})]})})}t[2]=o,t[3]=h,t[4]=y,t[5]=b,t[6]=x,t[7]=S,t[8]=C,t[9]=w,t[10]=T,t[11]=E,t[12]=D}else b=t[5],x=t[6],S=t[7],C=t[8],w=t[9],T=t[10],E=t[11],D=t[12];if(D!==Symbol.for(`react.early_return_sentinel`))return D;let O;t[38]!==b||t[39]!==x||t[40]!==S?(O=(0,d.jsxs)(`div`,{className:b,children:[x,S]}),t[38]=b,t[39]=x,t[40]=S,t[41]=O):O=t[41];let k;return t[42]!==O||t[43]!==C||t[44]!==w||t[45]!==T||t[46]!==E?(k=(0,d.jsxs)(d.Fragment,{children:[C,w,T,E,O]}),t[42]=O,t[43]=C,t[44]=w,t[45]=T,t[46]=E,t[47]=k):k=t[47],k}function g(e){return(e.gpuIds?.length??0)>0}function _(e){return e.type===`ElasticNetworkInterface`}function v(){let e=(0,u.c)(3),{clusterName:t,taskId:n}=o.useParams(),r;return e[0]!==t||e[1]!==n?(r=(0,d.jsx)(h,{clusterName:t,taskId:n}),e[0]=t,e[1]=n,e[2]=r):r=e[2],r}export{v as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{t as r}from"./back-link.js";import{s as i}from"./ecs.js";import{t as a}from"./page-heading.js";import{t as o}from"./_taskId.js";import{n as s,t as c}from"./detail-row.js";import{t as l}from"./state-badge.js";var u=t(),d=e();function f(e){return e?.split(`/`).at(-1)??``}function p(e,t){return e?.details?.find(e=>e.name===t)?.value}function m(e){return e?new Date(e).toISOString():``}function h(e){let t=(0,u.c)(48),{clusterName:o,taskId:h}=e,v;t[0]===o?v=t[1]:(v=i(o),t[0]=o,t[1]=v);let{data:y}=n(v),b,x,S,C,w,T,E,D;if(t[2]!==o||t[3]!==h||t[4]!==y){D=Symbol.for(`react.early_return_sentinel`);bb0:{let e;t[13]===h?e=t[14]:(e=e=>(e.taskArn??``).endsWith(h),t[13]=h,t[14]=e);let n=y.find(e);if(!n){let e;t[15]===o?e=t[16]:(e={clusterName:o},t[15]=o,t[16]=e);let n;t[17]!==o||t[18]!==e?(n=(0,d.jsx)(r,{params:e,to:`/ecs/list-clusters/$clusterName`,children:o}),t[17]=o,t[18]=e,t[19]=n):n=t[19];let i;t[20]===h?i=t[21]:(i=(0,d.jsx)(a,{subtitle:`Task Details`,title:h}),t[20]=h,t[21]=i);let s;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Task not found.`}),t[22]=s):s=t[22];let c;t[23]!==n||t[24]!==i?(c=(0,d.jsxs)(d.Fragment,{children:[n,i,s]}),t[23]=n,t[24]=i,t[25]=c):c=t[25],D=c;break bb0}let i=(n.attachments??[]).find(_),u=n.containers??[],v=u.some(g),O;t[26]===o?O=t[27]:(O={clusterName:o},t[26]=o,t[27]=O),t[28]!==o||t[29]!==O?(C=(0,d.jsx)(r,{params:O,to:`/ecs/list-clusters/$clusterName`,children:o}),t[28]=o,t[29]=O,t[30]=C):C=t[30],w=(0,d.jsx)(a,{actions:(0,d.jsx)(l,{state:n.lastStatus}),subtitle:`Task Details`,title:f(n.taskArn)});let k;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,d.jsx)(s.Header,{children:`Configuration`}),t[31]=k):k=t[31];let A=(0,d.jsxs)(s.Content,{children:[(0,d.jsx)(c,{label:`Task ID`,value:f(n.taskArn)}),(0,d.jsx)(c,{label:`Last status`,value:(0,d.jsx)(l,{state:n.lastStatus})}),(0,d.jsx)(c,{label:`Desired status`,value:n.desiredStatus}),(0,d.jsx)(c,{label:`Task definition`,value:f(n.taskDefinitionArn)}),(0,d.jsx)(c,{label:`Launch type`,value:n.launchType}),(0,d.jsx)(c,{label:`Container instance`,value:f(n.containerInstanceArn)}),(0,d.jsx)(c,{label:`Created at`,value:m(n.createdAt)}),(0,d.jsx)(c,{label:`Started at`,value:m(n.startedAt)}),(0,d.jsx)(c,{label:`Stopped at`,value:m(n.stoppedAt)}),n.stoppedReason?(0,d.jsx)(c,{label:`Stopped reason`,value:n.stoppedReason}):null]});t[32]===A?T=t[33]:(T=(0,d.jsxs)(s,{children:[k,A]}),t[32]=A,t[33]=T);let j;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,d.jsx)(s.Header,{children:`Networking`}),t[34]=j):j=t[34];let M=i?(0,d.jsxs)(s.Content,{children:[(0,d.jsx)(c,{label:`ENI ID`,value:p(i,`networkInterfaceId`)}),(0,d.jsx)(c,{label:`Private IP`,value:p(i,`privateIPv4Address`)}),(0,d.jsx)(c,{label:`Public IP`,value:p(i,`publicIPv4Address`)}),(0,d.jsx)(c,{label:`Subnet`,value:p(i,`subnetId`)}),(0,d.jsx)(c,{label:`MAC`,value:p(i,`macAddress`)})]}):(0,d.jsx)(`div`,{className:`p-4`,children:(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Network mode does not assign an ENI.`})});t[35]===M?E=t[36]:(E=(0,d.jsx)(`div`,{className:`mt-6`,children:(0,d.jsxs)(s,{children:[j,M]})}),t[35]=M,t[36]=E),b=`mt-6`,t[37]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,d.jsx)(`h2`,{className:`mb-2 font-semibold`,children:`Containers`}),t[37]=x):x=t[37],S=u.length===0?(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No containers.`}):(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Image`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Status`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Health`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Exit Code / Reason`}),v&&(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`GPUs`})]})}),(0,d.jsx)(`tbody`,{children:u.map(e=>(0,d.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,d.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:e.name}),(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.image}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:(0,d.jsx)(l,{state:e.lastStatus})}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.healthStatus}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.exitCode===void 0?e.reason??``:String(e.exitCode)}),v&&(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.gpuIds&&e.gpuIds.length>0?e.gpuIds.join(`, `):`—`})]},e.name??e.containerArn))})]})})}t[2]=o,t[3]=h,t[4]=y,t[5]=b,t[6]=x,t[7]=S,t[8]=C,t[9]=w,t[10]=T,t[11]=E,t[12]=D}else b=t[5],x=t[6],S=t[7],C=t[8],w=t[9],T=t[10],E=t[11],D=t[12];if(D!==Symbol.for(`react.early_return_sentinel`))return D;let O;t[38]!==b||t[39]!==x||t[40]!==S?(O=(0,d.jsxs)(`div`,{className:b,children:[x,S]}),t[38]=b,t[39]=x,t[40]=S,t[41]=O):O=t[41];let k;return t[42]!==O||t[43]!==C||t[44]!==w||t[45]!==T||t[46]!==E?(k=(0,d.jsxs)(d.Fragment,{children:[C,w,T,E,O]}),t[42]=O,t[43]=C,t[44]=w,t[45]=T,t[46]=E,t[47]=k):k=t[47],k}function g(e){return(e.gpuIds?.length??0)>0}function _(e){return e.type===`ElasticNetworkInterface`}function v(){let e=(0,u.c)(3),{clusterName:t,taskId:n}=o.useParams(),r;return e[0]!==t||e[1]!==n?(r=(0,d.jsx)(h,{clusterName:t,taskId:n}),e[0]=t,e[1]=n,e[2]=r):r=e[2],r}export{v as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/create-service2.js b/spinifex/services/spinifexui/frontend/dist/assets/create-service2.js index 5afdf88f4..889d0cbfa 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/create-service2.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/create-service2.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useQuery.js";import{t as r}from"./useSuspenseQuery.js";import{t as ee}from"./useNavigate.js";import{t as te}from"./back-link.js";import{c as ne,i as re,n as ie,s as ae,t as oe}from"./select.js";import{t as i}from"./input.js";import{a,r as se,t as o}from"./field.js";import{O as ce,w as le}from"./ec2.js";import{a as ue,o as de}from"./ecs.js";import{n as fe}from"./ecs2.js";import{u as pe}from"./elbv22.js";import{a as me,i as he,n as ge,t as _e}from"./zod.js";import{t as ve}from"./error-banner.js";import{t as ye}from"./page-heading.js";import{t as be}from"./form-actions.js";import{t as s}from"./create-service.js";import{n as xe}from"./ecs3.js";var Se=t(),c=e();function Ce(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function l(e){let t=(0,Se.c)(121),{cluster:s}=e,Ce=ee(),l=fe(),{data:Ee}=r(de),{data:De}=r(ce),{data:Oe}=r(le),{data:ke}=r(pe),Ae;t[0]===De.Subnets?Ae=t[1]:(Ae=De.Subnets??[],t[0]=De.Subnets,t[1]=Ae);let je=Ae,Me;t[2]===Oe.SecurityGroups?Me=t[3]:(Me=Oe.SecurityGroups??[],t[2]=Oe.SecurityGroups,t[3]=Me);let Ne=Me,u;t[4]===ke.TargetGroups?u=t[5]:(u=ke.TargetGroups??[],t[4]=ke.TargetGroups,t[5]=u);let Pe=u,d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=_e(xe),t[6]=d):d=t[6];let f,p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],p=[],t[7]=f,t[8]=p):(f=t[7],p=t[8]);let m;t[9]===s?m=t[10]:(m={resolver:d,defaultValues:{cluster:s,serviceName:``,taskDefinition:``,desiredCount:1,subnets:f,securityGroups:p,assignPublicIp:!1,targetGroupArn:``,loadBalancerContainerName:``,loadBalancerContainerPort:``}},t[9]=s,t[10]=m);let{control:h,handleSubmit:Fe,register:g,setValue:Ie,getValues:Le,formState:Re}=he(m),{errors:_,isSubmitting:ze}=Re,v;t[11]===h?v=t[12]:(v={control:h,name:`taskDefinition`},t[11]=h,t[12]=v);let Be=me(v),y;t[13]===Be?y=t[14]:(y=ue(Be),t[13]=Be,t[14]=y);let{data:Ve}=n(y),b=Ve?.networkMode===`awsvpc`,x;t[15]===h?x=t[16]:(x={control:h,name:`subnets`},t[15]=h,t[16]=x);let S=me(x),C;t[17]===h?C=t[18]:(C={control:h,name:`securityGroups`},t[17]=h,t[18]=C);let He=me(C),Ue;t[19]!==Le||t[20]!==Ie?(Ue=(e,t)=>{let n=Le(e);Ie(e,n.includes(t)?n.filter(e=>e!==t):[...n,t],{shouldValidate:!0})},t[19]=Le,t[20]=Ie,t[21]=Ue):Ue=t[21];let We=Ue,Ge;t[22]!==s||t[23]!==Ce?(Ge=function(){Ce({to:`/ecs/list-clusters/$clusterName`,params:{clusterName:s}})},t[22]=s,t[23]=Ce,t[24]=Ge):Ge=t[24];let w=Ge,Ke;t[25]!==b||t[26]!==l||t[27]!==w?(Ke=async function(e){await l.mutateAsync({...e,awsvpc:b}),w()},t[25]=b,t[26]=l,t[27]=w,t[28]=Ke):Ke=t[28];let qe=Ke,Je=b&&S.length===0,T;t[29]===s?T=t[30]:(T={clusterName:s},t[29]=s,t[30]=T);let E;t[31]!==s||t[32]!==T?(E=(0,c.jsx)(te,{params:T,to:`/ecs/list-clusters/$clusterName`,children:s}),t[31]=s,t[32]=T,t[33]=E):E=t[33];let Ye=`Cluster: ${s}`,D;t[34]===Ye?D=t[35]:(D=(0,c.jsx)(ye,{subtitle:Ye,title:`Create Service`}),t[34]=Ye,t[35]=D);let O;t[36]!==l.error||t[37]!==l.isError?(O=l.isError&&(0,c.jsx)(ve,{error:l.error instanceof Error?l.error:void 0,msg:`Failed to create service.`}),t[36]=l.error,t[37]=l.isError,t[38]=O):O=t[38];let k;t[39]!==Fe||t[40]!==qe?(k=Fe(qe),t[39]=Fe,t[40]=qe,t[41]=k):k=t[41];let Xe;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`serviceName`,children:`Service name`})}),t[42]=Xe):Xe=t[42];let A;t[43]===g?A=t[44]:(A=g(`serviceName`),t[43]=g,t[44]=A);let j;t[45]===A?j=t[46]:(j=(0,c.jsx)(i,{id:`serviceName`,placeholder:`api`,...A}),t[45]=A,t[46]=j);let M;t[47]===_.serviceName?M=t[48]:(M=(0,c.jsx)(se,{errors:[_.serviceName]}),t[47]=_.serviceName,t[48]=M);let N;t[49]!==j||t[50]!==M?(N=(0,c.jsxs)(o,{children:[Xe,j,M]}),t[49]=j,t[50]=M,t[51]=N):N=t[51];let Ze;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`taskDefinition`,children:`Task definition`})}),t[52]=Ze):Ze=t[52];let P;t[53]===Ee?P=t[54]:(P=e=>{let{field:t}=e;return(0,c.jsxs)(oe,{onValueChange:t.onChange,value:t.value,children:[(0,c.jsx)(ae,{className:`w-full`,id:`taskDefinition`,children:(0,c.jsx)(ne,{placeholder:`Select a task definition`})}),(0,c.jsx)(ie,{children:Ee.map(Te)})]})},t[53]=Ee,t[54]=P);let F;t[55]!==h||t[56]!==P?(F=(0,c.jsx)(ge,{control:h,name:`taskDefinition`,render:P}),t[55]=h,t[56]=P,t[57]=F):F=t[57];let I;t[58]===_.taskDefinition?I=t[59]:(I=(0,c.jsx)(se,{errors:[_.taskDefinition]}),t[58]=_.taskDefinition,t[59]=I);let L;t[60]!==F||t[61]!==I?(L=(0,c.jsxs)(o,{children:[Ze,F,I]}),t[60]=F,t[61]=I,t[62]=L):L=t[62];let Qe;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`desiredCount`,children:`Desired count`})}),t[63]=Qe):Qe=t[63];let R;t[64]===g?R=t[65]:(R=g(`desiredCount`,{valueAsNumber:!0}),t[64]=g,t[65]=R);let z;t[66]===R?z=t[67]:(z=(0,c.jsx)(i,{id:`desiredCount`,type:`number`,...R}),t[66]=R,t[67]=z);let B;t[68]===_.desiredCount?B=t[69]:(B=(0,c.jsx)(se,{errors:[_.desiredCount]}),t[68]=_.desiredCount,t[69]=B);let V;t[70]!==z||t[71]!==B?(V=(0,c.jsxs)(o,{children:[Qe,z,B]}),t[70]=z,t[71]=B,t[72]=V):V=t[72];let H;t[73]!==b||t[74]!==g||t[75]!==Ne||t[76]!==He||t[77]!==S||t[78]!==je||t[79]!==We?(H=b&&(0,c.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-card p-4`,children:[(0,c.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This task definition uses awsvpc networking. Select at least one subnet.`}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-sm font-medium`,children:`Subnets`}),(0,c.jsx)(`div`,{className:`mt-2 space-y-1`,children:je.map(e=>(0,c.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,c.jsx)(`input`,{checked:S.includes(e.SubnetId??``),onChange:()=>We(`subnets`,e.SubnetId??``),type:`checkbox`}),(0,c.jsxs)(`span`,{className:`font-mono`,children:[e.SubnetId,` (`,e.CidrBlock,`)`]})]},e.SubnetId))})]}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-sm font-medium`,children:`Security groups`}),(0,c.jsx)(`div`,{className:`mt-2 space-y-1`,children:Ne.map(e=>(0,c.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,c.jsx)(`input`,{checked:He.includes(e.GroupId??``),onChange:()=>We(`securityGroups`,e.GroupId??``),type:`checkbox`}),(0,c.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId))})]}),(0,c.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,c.jsx)(`input`,{type:`checkbox`,...g(`assignPublicIp`)}),(0,c.jsx)(`span`,{children:`Assign public IP`})]})]}),t[73]=b,t[74]=g,t[75]=Ne,t[76]=He,t[77]=S,t[78]=je,t[79]=We,t[80]=H):H=t[80];let $e;t[81]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,c.jsx)(`h2`,{className:`font-semibold`,children:`Load balancer (optional)`}),t[81]=$e):$e=t[81];let et;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`targetGroupArn`,children:`Target group`})}),t[82]=et):et=t[82];let U;t[83]===Pe?U=t[84]:(U=e=>{let{field:t}=e;return(0,c.jsxs)(oe,{onValueChange:e=>t.onChange(e===`none`?``:e),value:t.value===``?`none`:t.value,children:[(0,c.jsx)(ae,{className:`w-full`,id:`targetGroupArn`,children:(0,c.jsx)(ne,{})}),(0,c.jsxs)(ie,{children:[(0,c.jsx)(re,{value:`none`,children:`none`}),Pe.map(we)]})]})},t[83]=Pe,t[84]=U);let W;t[85]!==h||t[86]!==U?(W=(0,c.jsxs)(o,{children:[et,(0,c.jsx)(ge,{control:h,name:`targetGroupArn`,render:U})]}),t[85]=h,t[86]=U,t[87]=W):W=t[87];let tt;t[88]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`lbContainerName`,children:`Container name`})}),t[88]=tt):tt=t[88];let G;t[89]===g?G=t[90]:(G=g(`loadBalancerContainerName`),t[89]=g,t[90]=G);let K;t[91]===G?K=t[92]:(K=(0,c.jsxs)(o,{children:[tt,(0,c.jsx)(i,{id:`lbContainerName`,placeholder:`app`,...G})]}),t[91]=G,t[92]=K);let nt;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`lbContainerPort`,children:`Container port`})}),t[93]=nt):nt=t[93];let q;t[94]===g?q=t[95]:(q=g(`loadBalancerContainerPort`),t[94]=g,t[95]=q);let J;t[96]===q?J=t[97]:(J=(0,c.jsxs)(o,{children:[nt,(0,c.jsx)(i,{id:`lbContainerPort`,placeholder:`80`,type:`number`,...q})]}),t[96]=q,t[97]=J);let Y;t[98]!==K||t[99]!==J?(Y=(0,c.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[K,J]}),t[98]=K,t[99]=J,t[100]=Y):Y=t[100];let X;t[101]!==W||t[102]!==Y?(X=(0,c.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-card p-4`,children:[$e,W,Y]}),t[101]=W,t[102]=Y,t[103]=X):X=t[103];let rt=l.isPending||Je,Z;t[104]!==w||t[105]!==ze||t[106]!==rt?(Z=(0,c.jsx)(be,{isPending:rt,isSubmitting:ze,onCancel:w,pendingLabel:`Creating…`,submitLabel:`Create Service`}),t[104]=w,t[105]=ze,t[106]=rt,t[107]=Z):Z=t[107];let Q;t[108]!==k||t[109]!==N||t[110]!==L||t[111]!==V||t[112]!==H||t[113]!==X||t[114]!==Z?(Q=(0,c.jsxs)(`form`,{className:`max-w-2xl space-y-6`,onSubmit:k,children:[N,L,V,H,X,Z]}),t[108]=k,t[109]=N,t[110]=L,t[111]=V,t[112]=H,t[113]=X,t[114]=Z,t[115]=Q):Q=t[115];let $;return t[116]!==E||t[117]!==D||t[118]!==O||t[119]!==Q?($=(0,c.jsxs)(c.Fragment,{children:[E,D,O,Q]}),t[116]=E,t[117]=D,t[118]=O,t[119]=Q,t[120]=$):$=t[120],$}function we(e){return(0,c.jsx)(re,{value:e.TargetGroupArn??``,children:e.TargetGroupName},e.TargetGroupArn)}function Te(e){let t=Ce(e);return(0,c.jsx)(re,{value:t,children:t},e)}function Ee(){let e=(0,Se.c)(2),{cluster:t}=s.useSearch(),n;return e[0]===t?n=e[1]:(n=(0,c.jsx)(l,{cluster:t}),e[0]=t,e[1]=n),n}export{Ee as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useQuery.js";import{t as r}from"./useSuspenseQuery.js";import{t as ee}from"./useNavigate.js";import{t as te}from"./back-link.js";import{c as ne,i as re,n as ie,s as ae,t as oe}from"./select.js";import{t as i}from"./input.js";import{a,r as se,t as o}from"./field.js";import{O as ce,w as le}from"./ec2.js";import{a as ue,o as de}from"./ecs.js";import{n as fe}from"./ecs2.js";import{u as pe}from"./elbv22.js";import{a as me,i as he,n as ge,t as _e}from"./zod.js";import{t as ve}from"./error-banner.js";import{t as ye}from"./page-heading.js";import{t as be}from"./form-actions.js";import{t as s}from"./create-service.js";import{n as xe}from"./ecs3.js";var Se=t(),c=e();function Ce(e){return e.split(`/`).at(-1)??e}function l(e){let t=(0,Se.c)(121),{cluster:s}=e,Ce=ee(),l=fe(),{data:Ee}=r(de),{data:De}=r(ce),{data:Oe}=r(le),{data:ke}=r(pe),Ae;t[0]===De.Subnets?Ae=t[1]:(Ae=De.Subnets??[],t[0]=De.Subnets,t[1]=Ae);let je=Ae,Me;t[2]===Oe.SecurityGroups?Me=t[3]:(Me=Oe.SecurityGroups??[],t[2]=Oe.SecurityGroups,t[3]=Me);let Ne=Me,u;t[4]===ke.TargetGroups?u=t[5]:(u=ke.TargetGroups??[],t[4]=ke.TargetGroups,t[5]=u);let Pe=u,d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=_e(xe),t[6]=d):d=t[6];let f,p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],p=[],t[7]=f,t[8]=p):(f=t[7],p=t[8]);let m;t[9]===s?m=t[10]:(m={resolver:d,defaultValues:{cluster:s,serviceName:``,taskDefinition:``,desiredCount:1,subnets:f,securityGroups:p,assignPublicIp:!1,targetGroupArn:``,loadBalancerContainerName:``,loadBalancerContainerPort:``}},t[9]=s,t[10]=m);let{control:h,handleSubmit:Fe,register:g,setValue:Ie,getValues:Le,formState:Re}=he(m),{errors:_,isSubmitting:ze}=Re,v;t[11]===h?v=t[12]:(v={control:h,name:`taskDefinition`},t[11]=h,t[12]=v);let Be=me(v),y;t[13]===Be?y=t[14]:(y=ue(Be),t[13]=Be,t[14]=y);let{data:Ve}=n(y),b=Ve?.networkMode===`awsvpc`,x;t[15]===h?x=t[16]:(x={control:h,name:`subnets`},t[15]=h,t[16]=x);let S=me(x),C;t[17]===h?C=t[18]:(C={control:h,name:`securityGroups`},t[17]=h,t[18]=C);let He=me(C),Ue;t[19]!==Le||t[20]!==Ie?(Ue=(e,t)=>{let n=Le(e);Ie(e,n.includes(t)?n.filter(e=>e!==t):[...n,t],{shouldValidate:!0})},t[19]=Le,t[20]=Ie,t[21]=Ue):Ue=t[21];let We=Ue,Ge;t[22]!==s||t[23]!==Ce?(Ge=function(){Ce({to:`/ecs/list-clusters/$clusterName`,params:{clusterName:s}})},t[22]=s,t[23]=Ce,t[24]=Ge):Ge=t[24];let w=Ge,Ke;t[25]!==b||t[26]!==l||t[27]!==w?(Ke=async function(e){await l.mutateAsync({...e,awsvpc:b}),w()},t[25]=b,t[26]=l,t[27]=w,t[28]=Ke):Ke=t[28];let qe=Ke,Je=b&&S.length===0,T;t[29]===s?T=t[30]:(T={clusterName:s},t[29]=s,t[30]=T);let E;t[31]!==s||t[32]!==T?(E=(0,c.jsx)(te,{params:T,to:`/ecs/list-clusters/$clusterName`,children:s}),t[31]=s,t[32]=T,t[33]=E):E=t[33];let Ye=`Cluster: ${s}`,D;t[34]===Ye?D=t[35]:(D=(0,c.jsx)(ye,{subtitle:Ye,title:`Create Service`}),t[34]=Ye,t[35]=D);let O;t[36]!==l.error||t[37]!==l.isError?(O=l.isError&&(0,c.jsx)(ve,{error:l.error instanceof Error?l.error:void 0,msg:`Failed to create service.`}),t[36]=l.error,t[37]=l.isError,t[38]=O):O=t[38];let k;t[39]!==Fe||t[40]!==qe?(k=Fe(qe),t[39]=Fe,t[40]=qe,t[41]=k):k=t[41];let Xe;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`serviceName`,children:`Service name`})}),t[42]=Xe):Xe=t[42];let A;t[43]===g?A=t[44]:(A=g(`serviceName`),t[43]=g,t[44]=A);let j;t[45]===A?j=t[46]:(j=(0,c.jsx)(i,{id:`serviceName`,placeholder:`api`,...A}),t[45]=A,t[46]=j);let M;t[47]===_.serviceName?M=t[48]:(M=(0,c.jsx)(se,{errors:[_.serviceName]}),t[47]=_.serviceName,t[48]=M);let N;t[49]!==j||t[50]!==M?(N=(0,c.jsxs)(o,{children:[Xe,j,M]}),t[49]=j,t[50]=M,t[51]=N):N=t[51];let Ze;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`taskDefinition`,children:`Task definition`})}),t[52]=Ze):Ze=t[52];let P;t[53]===Ee?P=t[54]:(P=e=>{let{field:t}=e;return(0,c.jsxs)(oe,{onValueChange:t.onChange,value:t.value,children:[(0,c.jsx)(ae,{className:`w-full`,id:`taskDefinition`,children:(0,c.jsx)(ne,{placeholder:`Select a task definition`})}),(0,c.jsx)(ie,{children:Ee.map(Te)})]})},t[53]=Ee,t[54]=P);let F;t[55]!==h||t[56]!==P?(F=(0,c.jsx)(ge,{control:h,name:`taskDefinition`,render:P}),t[55]=h,t[56]=P,t[57]=F):F=t[57];let I;t[58]===_.taskDefinition?I=t[59]:(I=(0,c.jsx)(se,{errors:[_.taskDefinition]}),t[58]=_.taskDefinition,t[59]=I);let L;t[60]!==F||t[61]!==I?(L=(0,c.jsxs)(o,{children:[Ze,F,I]}),t[60]=F,t[61]=I,t[62]=L):L=t[62];let Qe;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`desiredCount`,children:`Desired count`})}),t[63]=Qe):Qe=t[63];let R;t[64]===g?R=t[65]:(R=g(`desiredCount`,{valueAsNumber:!0}),t[64]=g,t[65]=R);let z;t[66]===R?z=t[67]:(z=(0,c.jsx)(i,{id:`desiredCount`,type:`number`,...R}),t[66]=R,t[67]=z);let B;t[68]===_.desiredCount?B=t[69]:(B=(0,c.jsx)(se,{errors:[_.desiredCount]}),t[68]=_.desiredCount,t[69]=B);let V;t[70]!==z||t[71]!==B?(V=(0,c.jsxs)(o,{children:[Qe,z,B]}),t[70]=z,t[71]=B,t[72]=V):V=t[72];let H;t[73]!==b||t[74]!==g||t[75]!==Ne||t[76]!==He||t[77]!==S||t[78]!==je||t[79]!==We?(H=b&&(0,c.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-card p-4`,children:[(0,c.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This task definition uses awsvpc networking. Select at least one subnet.`}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-sm font-medium`,children:`Subnets`}),(0,c.jsx)(`div`,{className:`mt-2 space-y-1`,children:je.map(e=>(0,c.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,c.jsx)(`input`,{checked:S.includes(e.SubnetId??``),onChange:()=>We(`subnets`,e.SubnetId??``),type:`checkbox`}),(0,c.jsxs)(`span`,{className:`font-mono`,children:[e.SubnetId,` (`,e.CidrBlock,`)`]})]},e.SubnetId))})]}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-sm font-medium`,children:`Security groups`}),(0,c.jsx)(`div`,{className:`mt-2 space-y-1`,children:Ne.map(e=>(0,c.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,c.jsx)(`input`,{checked:He.includes(e.GroupId??``),onChange:()=>We(`securityGroups`,e.GroupId??``),type:`checkbox`}),(0,c.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId))})]}),(0,c.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,c.jsx)(`input`,{type:`checkbox`,...g(`assignPublicIp`)}),(0,c.jsx)(`span`,{children:`Assign public IP`})]})]}),t[73]=b,t[74]=g,t[75]=Ne,t[76]=He,t[77]=S,t[78]=je,t[79]=We,t[80]=H):H=t[80];let $e;t[81]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,c.jsx)(`h2`,{className:`font-semibold`,children:`Load balancer (optional)`}),t[81]=$e):$e=t[81];let et;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`targetGroupArn`,children:`Target group`})}),t[82]=et):et=t[82];let U;t[83]===Pe?U=t[84]:(U=e=>{let{field:t}=e;return(0,c.jsxs)(oe,{onValueChange:e=>t.onChange(e===`none`?``:e),value:t.value===``?`none`:t.value,children:[(0,c.jsx)(ae,{className:`w-full`,id:`targetGroupArn`,children:(0,c.jsx)(ne,{})}),(0,c.jsxs)(ie,{children:[(0,c.jsx)(re,{value:`none`,children:`none`}),Pe.map(we)]})]})},t[83]=Pe,t[84]=U);let W;t[85]!==h||t[86]!==U?(W=(0,c.jsxs)(o,{children:[et,(0,c.jsx)(ge,{control:h,name:`targetGroupArn`,render:U})]}),t[85]=h,t[86]=U,t[87]=W):W=t[87];let tt;t[88]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`lbContainerName`,children:`Container name`})}),t[88]=tt):tt=t[88];let G;t[89]===g?G=t[90]:(G=g(`loadBalancerContainerName`),t[89]=g,t[90]=G);let K;t[91]===G?K=t[92]:(K=(0,c.jsxs)(o,{children:[tt,(0,c.jsx)(i,{id:`lbContainerName`,placeholder:`app`,...G})]}),t[91]=G,t[92]=K);let nt;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,c.jsx)(a,{children:(0,c.jsx)(`label`,{htmlFor:`lbContainerPort`,children:`Container port`})}),t[93]=nt):nt=t[93];let q;t[94]===g?q=t[95]:(q=g(`loadBalancerContainerPort`),t[94]=g,t[95]=q);let J;t[96]===q?J=t[97]:(J=(0,c.jsxs)(o,{children:[nt,(0,c.jsx)(i,{id:`lbContainerPort`,placeholder:`80`,type:`number`,...q})]}),t[96]=q,t[97]=J);let Y;t[98]!==K||t[99]!==J?(Y=(0,c.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[K,J]}),t[98]=K,t[99]=J,t[100]=Y):Y=t[100];let X;t[101]!==W||t[102]!==Y?(X=(0,c.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-card p-4`,children:[$e,W,Y]}),t[101]=W,t[102]=Y,t[103]=X):X=t[103];let rt=l.isPending||Je,Z;t[104]!==w||t[105]!==ze||t[106]!==rt?(Z=(0,c.jsx)(be,{isPending:rt,isSubmitting:ze,onCancel:w,pendingLabel:`Creating…`,submitLabel:`Create Service`}),t[104]=w,t[105]=ze,t[106]=rt,t[107]=Z):Z=t[107];let Q;t[108]!==k||t[109]!==N||t[110]!==L||t[111]!==V||t[112]!==H||t[113]!==X||t[114]!==Z?(Q=(0,c.jsxs)(`form`,{className:`max-w-2xl space-y-6`,onSubmit:k,children:[N,L,V,H,X,Z]}),t[108]=k,t[109]=N,t[110]=L,t[111]=V,t[112]=H,t[113]=X,t[114]=Z,t[115]=Q):Q=t[115];let $;return t[116]!==E||t[117]!==D||t[118]!==O||t[119]!==Q?($=(0,c.jsxs)(c.Fragment,{children:[E,D,O,Q]}),t[116]=E,t[117]=D,t[118]=O,t[119]=Q,t[120]=$):$=t[120],$}function we(e){return(0,c.jsx)(re,{value:e.TargetGroupArn??``,children:e.TargetGroupName},e.TargetGroupArn)}function Te(e){let t=Ce(e);return(0,c.jsx)(re,{value:t,children:t},e)}function Ee(){let e=(0,Se.c)(2),{cluster:t}=s.useSearch(),n;return e[0]===t?n=e[1]:(n=(0,c.jsx)(l,{cluster:t}),e[0]=t,e[1]=n),n}export{Ee as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/run-task2.js b/spinifex/services/spinifexui/frontend/dist/assets/run-task2.js index d2954ef37..28c78357c 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/run-task2.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/run-task2.js @@ -1 +1 @@ -import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useQuery.js";import{t as r}from"./useSuspenseQuery.js";import{t as ee}from"./useNavigate.js";import{t as te}from"./back-link.js";import{c as ne,i,n as re,s as ie,t as ae}from"./select.js";import{t as oe}from"./input.js";import{a as se,r as ce,t as le}from"./field.js";import{O as ue,w as de}from"./ec2.js";import{a as fe,o as pe}from"./ecs.js";import{c as me}from"./ecs2.js";import{a as he,i as ge,n as _e,t as ve}from"./zod.js";import{t as ye}from"./error-banner.js";import{t as be}from"./page-heading.js";import{t as xe}from"./form-actions.js";import{t as a}from"./run-task.js";import{i as Se}from"./ecs3.js";var Ce=t(),o=e();function s(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function c(e){let t=(0,Ce.c)(84),{cluster:i}=e,a=ee(),s=me(),{data:c}=r(pe),{data:l}=r(ue),{data:Te}=r(de),u;t[0]===l.Subnets?u=t[1]:(u=l.Subnets??[],t[0]=l.Subnets,t[1]=u);let Ee=u,d;t[2]===Te.SecurityGroups?d=t[3]:(d=Te.SecurityGroups??[],t[2]=Te.SecurityGroups,t[3]=d);let De=d,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=ve(Se),t[4]=f):f=t[4];let p,m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],m=[],t[5]=p,t[6]=m):(p=t[5],m=t[6]);let h;t[7]===i?h=t[8]:(h={resolver:f,defaultValues:{cluster:i,taskDefinition:``,count:1,subnets:p,securityGroups:m,assignPublicIp:!1}},t[7]=i,t[8]=h);let{control:g,handleSubmit:Oe,register:_,setValue:ke,getValues:v,formState:Ae}=ge(h),{errors:y,isSubmitting:b}=Ae,x;t[9]===g?x=t[10]:(x={control:g,name:`taskDefinition`},t[9]=g,t[10]=x);let S=he(x),C;t[11]===S?C=t[12]:(C=fe(S),t[11]=S,t[12]=C);let{data:je}=n(C),w=je?.networkMode===`awsvpc`,T;t[13]===g?T=t[14]:(T={control:g,name:`subnets`},t[13]=g,t[14]=T);let E=he(T),D;t[15]===g?D=t[16]:(D={control:g,name:`securityGroups`},t[15]=g,t[16]=D);let O=he(D),k;t[17]!==v||t[18]!==ke?(k=(e,t)=>{let n=v(e);ke(e,n.includes(t)?n.filter(e=>e!==t):[...n,t],{shouldValidate:!0})},t[17]=v,t[18]=ke,t[19]=k):k=t[19];let A=k,j;t[20]!==i||t[21]!==a?(j=function(){a({to:`/ecs/list-clusters/$clusterName`,params:{clusterName:i}})},t[20]=i,t[21]=a,t[22]=j):j=t[22];let M=j,N;t[23]!==w||t[24]!==M||t[25]!==s?(N=function(e){s.mutate({cluster:e.cluster,taskDefinition:e.taskDefinition,count:e.count,awsvpc:w,subnets:e.subnets,securityGroups:e.securityGroups,assignPublicIp:e.assignPublicIp},{onSuccess:M})},t[23]=w,t[24]=M,t[25]=s,t[26]=N):N=t[26];let P=N,Me=w&&E.length===0,F;t[27]===i?F=t[28]:(F={clusterName:i},t[27]=i,t[28]=F);let I;t[29]!==i||t[30]!==F?(I=(0,o.jsx)(te,{params:F,to:`/ecs/list-clusters/$clusterName`,children:i}),t[29]=i,t[30]=F,t[31]=I):I=t[31];let Ne=`Cluster: ${i}`,L;t[32]===Ne?L=t[33]:(L=(0,o.jsx)(be,{subtitle:Ne,title:`Run Task`}),t[32]=Ne,t[33]=L);let R;t[34]!==s.error||t[35]!==s.isError?(R=s.isError&&(0,o.jsx)(ye,{error:s.error instanceof Error?s.error:void 0,msg:`Failed to run task.`}),t[34]=s.error,t[35]=s.isError,t[36]=R):R=t[36];let z;t[37]!==Oe||t[38]!==P?(z=Oe(P),t[37]=Oe,t[38]=P,t[39]=z):z=t[39];let B;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,o.jsx)(se,{children:(0,o.jsx)(`label`,{htmlFor:`taskDefinition`,children:`Task definition`})}),t[40]=B):B=t[40];let V;t[41]===c?V=t[42]:(V=e=>{let{field:t}=e;return(0,o.jsxs)(ae,{onValueChange:t.onChange,value:t.value,children:[(0,o.jsx)(ie,{className:`w-full`,id:`taskDefinition`,children:(0,o.jsx)(ne,{placeholder:`Select a task definition`})}),(0,o.jsx)(re,{children:c.map(we)})]})},t[41]=c,t[42]=V);let H;t[43]!==g||t[44]!==V?(H=(0,o.jsx)(_e,{control:g,name:`taskDefinition`,render:V}),t[43]=g,t[44]=V,t[45]=H):H=t[45];let U;t[46]===y.taskDefinition?U=t[47]:(U=(0,o.jsx)(ce,{errors:[y.taskDefinition]}),t[46]=y.taskDefinition,t[47]=U);let W;t[48]!==H||t[49]!==U?(W=(0,o.jsxs)(le,{children:[B,H,U]}),t[48]=H,t[49]=U,t[50]=W):W=t[50];let G;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,o.jsx)(se,{children:(0,o.jsx)(`label`,{htmlFor:`count`,children:`Count`})}),t[51]=G):G=t[51];let K;t[52]===_?K=t[53]:(K=_(`count`,{valueAsNumber:!0}),t[52]=_,t[53]=K);let q;t[54]===K?q=t[55]:(q=(0,o.jsx)(oe,{id:`count`,type:`number`,...K}),t[54]=K,t[55]=q);let J;t[56]===y.count?J=t[57]:(J=(0,o.jsx)(ce,{errors:[y.count]}),t[56]=y.count,t[57]=J);let Y;t[58]!==q||t[59]!==J?(Y=(0,o.jsxs)(le,{children:[G,q,J]}),t[58]=q,t[59]=J,t[60]=Y):Y=t[60];let X;t[61]!==w||t[62]!==_||t[63]!==De||t[64]!==O||t[65]!==E||t[66]!==Ee||t[67]!==A?(X=w&&(0,o.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-card p-4`,children:[(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This task definition uses awsvpc networking. Select at least one subnet.`}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`span`,{className:`text-sm font-medium`,children:`Subnets`}),(0,o.jsx)(`div`,{className:`mt-2 space-y-1`,children:Ee.map(e=>(0,o.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,o.jsx)(`input`,{checked:E.includes(e.SubnetId??``),onChange:()=>A(`subnets`,e.SubnetId??``),type:`checkbox`}),(0,o.jsxs)(`span`,{className:`font-mono`,children:[e.SubnetId,` (`,e.CidrBlock,`)`]})]},e.SubnetId))})]}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`span`,{className:`text-sm font-medium`,children:`Security groups`}),(0,o.jsx)(`div`,{className:`mt-2 space-y-1`,children:De.map(e=>(0,o.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,o.jsx)(`input`,{checked:O.includes(e.GroupId??``),onChange:()=>A(`securityGroups`,e.GroupId??``),type:`checkbox`}),(0,o.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId))})]}),(0,o.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,o.jsx)(`input`,{type:`checkbox`,..._(`assignPublicIp`)}),(0,o.jsx)(`span`,{children:`Assign public IP`})]})]}),t[61]=w,t[62]=_,t[63]=De,t[64]=O,t[65]=E,t[66]=Ee,t[67]=A,t[68]=X):X=t[68];let Pe=s.isPending||Me,Z;t[69]!==M||t[70]!==b||t[71]!==Pe?(Z=(0,o.jsx)(xe,{isPending:Pe,isSubmitting:b,onCancel:M,pendingLabel:`Running…`,submitLabel:`Run Task`}),t[69]=M,t[70]=b,t[71]=Pe,t[72]=Z):Z=t[72];let Q;t[73]!==z||t[74]!==W||t[75]!==Y||t[76]!==X||t[77]!==Z?(Q=(0,o.jsxs)(`form`,{className:`max-w-2xl space-y-6`,onSubmit:z,children:[W,Y,X,Z]}),t[73]=z,t[74]=W,t[75]=Y,t[76]=X,t[77]=Z,t[78]=Q):Q=t[78];let $;return t[79]!==I||t[80]!==L||t[81]!==R||t[82]!==Q?($=(0,o.jsxs)(o.Fragment,{children:[I,L,R,Q]}),t[79]=I,t[80]=L,t[81]=R,t[82]=Q,t[83]=$):$=t[83],$}function we(e){let t=s(e);return(0,o.jsx)(i,{value:t,children:t},e)}function l(){let e=(0,Ce.c)(2),{cluster:t}=a.useSearch(),n;return e[0]===t?n=e[1]:(n=(0,o.jsx)(c,{cluster:t}),e[0]=t,e[1]=n),n}export{l as component}; \ No newline at end of file +import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useQuery.js";import{t as r}from"./useSuspenseQuery.js";import{t as ee}from"./useNavigate.js";import{t as te}from"./back-link.js";import{c as ne,i,n as re,s as ie,t as ae}from"./select.js";import{t as oe}from"./input.js";import{a as se,r as ce,t as le}from"./field.js";import{O as ue,w as de}from"./ec2.js";import{a as fe,o as pe}from"./ecs.js";import{c as me}from"./ecs2.js";import{a as he,i as ge,n as _e,t as ve}from"./zod.js";import{t as ye}from"./error-banner.js";import{t as be}from"./page-heading.js";import{t as xe}from"./form-actions.js";import{t as a}from"./run-task.js";import{i as Se}from"./ecs3.js";var Ce=t(),o=e();function s(e){return e.split(`/`).at(-1)??e}function c(e){let t=(0,Ce.c)(84),{cluster:i}=e,a=ee(),s=me(),{data:c}=r(pe),{data:l}=r(ue),{data:Te}=r(de),u;t[0]===l.Subnets?u=t[1]:(u=l.Subnets??[],t[0]=l.Subnets,t[1]=u);let Ee=u,d;t[2]===Te.SecurityGroups?d=t[3]:(d=Te.SecurityGroups??[],t[2]=Te.SecurityGroups,t[3]=d);let De=d,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=ve(Se),t[4]=f):f=t[4];let p,m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],m=[],t[5]=p,t[6]=m):(p=t[5],m=t[6]);let h;t[7]===i?h=t[8]:(h={resolver:f,defaultValues:{cluster:i,taskDefinition:``,count:1,subnets:p,securityGroups:m,assignPublicIp:!1}},t[7]=i,t[8]=h);let{control:g,handleSubmit:Oe,register:_,setValue:ke,getValues:v,formState:Ae}=ge(h),{errors:y,isSubmitting:b}=Ae,x;t[9]===g?x=t[10]:(x={control:g,name:`taskDefinition`},t[9]=g,t[10]=x);let S=he(x),C;t[11]===S?C=t[12]:(C=fe(S),t[11]=S,t[12]=C);let{data:je}=n(C),w=je?.networkMode===`awsvpc`,T;t[13]===g?T=t[14]:(T={control:g,name:`subnets`},t[13]=g,t[14]=T);let E=he(T),D;t[15]===g?D=t[16]:(D={control:g,name:`securityGroups`},t[15]=g,t[16]=D);let O=he(D),k;t[17]!==v||t[18]!==ke?(k=(e,t)=>{let n=v(e);ke(e,n.includes(t)?n.filter(e=>e!==t):[...n,t],{shouldValidate:!0})},t[17]=v,t[18]=ke,t[19]=k):k=t[19];let A=k,j;t[20]!==i||t[21]!==a?(j=function(){a({to:`/ecs/list-clusters/$clusterName`,params:{clusterName:i}})},t[20]=i,t[21]=a,t[22]=j):j=t[22];let M=j,N;t[23]!==w||t[24]!==M||t[25]!==s?(N=function(e){s.mutate({cluster:e.cluster,taskDefinition:e.taskDefinition,count:e.count,awsvpc:w,subnets:e.subnets,securityGroups:e.securityGroups,assignPublicIp:e.assignPublicIp},{onSuccess:M})},t[23]=w,t[24]=M,t[25]=s,t[26]=N):N=t[26];let P=N,Me=w&&E.length===0,F;t[27]===i?F=t[28]:(F={clusterName:i},t[27]=i,t[28]=F);let I;t[29]!==i||t[30]!==F?(I=(0,o.jsx)(te,{params:F,to:`/ecs/list-clusters/$clusterName`,children:i}),t[29]=i,t[30]=F,t[31]=I):I=t[31];let Ne=`Cluster: ${i}`,L;t[32]===Ne?L=t[33]:(L=(0,o.jsx)(be,{subtitle:Ne,title:`Run Task`}),t[32]=Ne,t[33]=L);let R;t[34]!==s.error||t[35]!==s.isError?(R=s.isError&&(0,o.jsx)(ye,{error:s.error instanceof Error?s.error:void 0,msg:`Failed to run task.`}),t[34]=s.error,t[35]=s.isError,t[36]=R):R=t[36];let z;t[37]!==Oe||t[38]!==P?(z=Oe(P),t[37]=Oe,t[38]=P,t[39]=z):z=t[39];let B;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,o.jsx)(se,{children:(0,o.jsx)(`label`,{htmlFor:`taskDefinition`,children:`Task definition`})}),t[40]=B):B=t[40];let V;t[41]===c?V=t[42]:(V=e=>{let{field:t}=e;return(0,o.jsxs)(ae,{onValueChange:t.onChange,value:t.value,children:[(0,o.jsx)(ie,{className:`w-full`,id:`taskDefinition`,children:(0,o.jsx)(ne,{placeholder:`Select a task definition`})}),(0,o.jsx)(re,{children:c.map(we)})]})},t[41]=c,t[42]=V);let H;t[43]!==g||t[44]!==V?(H=(0,o.jsx)(_e,{control:g,name:`taskDefinition`,render:V}),t[43]=g,t[44]=V,t[45]=H):H=t[45];let U;t[46]===y.taskDefinition?U=t[47]:(U=(0,o.jsx)(ce,{errors:[y.taskDefinition]}),t[46]=y.taskDefinition,t[47]=U);let W;t[48]!==H||t[49]!==U?(W=(0,o.jsxs)(le,{children:[B,H,U]}),t[48]=H,t[49]=U,t[50]=W):W=t[50];let G;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,o.jsx)(se,{children:(0,o.jsx)(`label`,{htmlFor:`count`,children:`Count`})}),t[51]=G):G=t[51];let K;t[52]===_?K=t[53]:(K=_(`count`,{valueAsNumber:!0}),t[52]=_,t[53]=K);let q;t[54]===K?q=t[55]:(q=(0,o.jsx)(oe,{id:`count`,type:`number`,...K}),t[54]=K,t[55]=q);let J;t[56]===y.count?J=t[57]:(J=(0,o.jsx)(ce,{errors:[y.count]}),t[56]=y.count,t[57]=J);let Y;t[58]!==q||t[59]!==J?(Y=(0,o.jsxs)(le,{children:[G,q,J]}),t[58]=q,t[59]=J,t[60]=Y):Y=t[60];let X;t[61]!==w||t[62]!==_||t[63]!==De||t[64]!==O||t[65]!==E||t[66]!==Ee||t[67]!==A?(X=w&&(0,o.jsxs)(`div`,{className:`space-y-4 rounded-lg border bg-card p-4`,children:[(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This task definition uses awsvpc networking. Select at least one subnet.`}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`span`,{className:`text-sm font-medium`,children:`Subnets`}),(0,o.jsx)(`div`,{className:`mt-2 space-y-1`,children:Ee.map(e=>(0,o.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,o.jsx)(`input`,{checked:E.includes(e.SubnetId??``),onChange:()=>A(`subnets`,e.SubnetId??``),type:`checkbox`}),(0,o.jsxs)(`span`,{className:`font-mono`,children:[e.SubnetId,` (`,e.CidrBlock,`)`]})]},e.SubnetId))})]}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`span`,{className:`text-sm font-medium`,children:`Security groups`}),(0,o.jsx)(`div`,{className:`mt-2 space-y-1`,children:De.map(e=>(0,o.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,o.jsx)(`input`,{checked:O.includes(e.GroupId??``),onChange:()=>A(`securityGroups`,e.GroupId??``),type:`checkbox`}),(0,o.jsxs)(`span`,{className:`font-mono`,children:[e.GroupId,` (`,e.GroupName,`)`]})]},e.GroupId))})]}),(0,o.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,o.jsx)(`input`,{type:`checkbox`,..._(`assignPublicIp`)}),(0,o.jsx)(`span`,{children:`Assign public IP`})]})]}),t[61]=w,t[62]=_,t[63]=De,t[64]=O,t[65]=E,t[66]=Ee,t[67]=A,t[68]=X):X=t[68];let Pe=s.isPending||Me,Z;t[69]!==M||t[70]!==b||t[71]!==Pe?(Z=(0,o.jsx)(xe,{isPending:Pe,isSubmitting:b,onCancel:M,pendingLabel:`Running…`,submitLabel:`Run Task`}),t[69]=M,t[70]=b,t[71]=Pe,t[72]=Z):Z=t[72];let Q;t[73]!==z||t[74]!==W||t[75]!==Y||t[76]!==X||t[77]!==Z?(Q=(0,o.jsxs)(`form`,{className:`max-w-2xl space-y-6`,onSubmit:z,children:[W,Y,X,Z]}),t[73]=z,t[74]=W,t[75]=Y,t[76]=X,t[77]=Z,t[78]=Q):Q=t[78];let $;return t[79]!==I||t[80]!==L||t[81]!==R||t[82]!==Q?($=(0,o.jsxs)(o.Fragment,{children:[I,L,R,Q]}),t[79]=I,t[80]=L,t[81]=R,t[82]=Q,t[83]=$):$=t[83],$}function we(e){let t=s(e);return(0,o.jsx)(i,{value:t,children:t},e)}function l(){let e=(0,Ce.c)(2),{cluster:t}=a.useSearch(),n;return e[0]===t?n=e[1]:(n=(0,o.jsx)(c,{cluster:t}),e[0]=t,e[1]=n),n}export{l as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/dist/assets/task-definitions.js b/spinifex/services/spinifexui/frontend/dist/assets/task-definitions.js index d83b449ba..06e53a773 100644 --- a/spinifex/services/spinifexui/frontend/dist/assets/task-definitions.js +++ b/spinifex/services/spinifexui/frontend/dist/assets/task-definitions.js @@ -1 +1 @@ -import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./button.js";import{o as s}from"./ecs.js";import{a as c}from"./ecs2.js";import{t as l}from"./error-banner.js";import{t as u}from"./page-heading.js";import{t as d}from"./delete-confirmation-dialog.js";import{t as f}from"./ecs-section-nav.js";var p=r(),m=e(n(),1),h=t();function g(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function _(e){let t=(0,p.c)(24),{clusterName:n}=e,{data:r}=i(s),u=c(),[f,_]=(0,m.useState)(null),v;t[0]!==u||t[1]!==f?(v=function(){f&&u.mutate(f,{onSuccess:()=>_(null)})},t[0]=u,t[1]=f,t[2]=v):v=t[2];let y=v,b=n??``,x;t[3]===b?x=t[4]:(x={cluster:b},t[3]=b,t[4]=x);let S;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,h.jsx)(o,{size:`sm`,children:`Register task definition`}),t[5]=S):S=t[5];let C;t[6]===x?C=t[7]:(C=(0,h.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,h.jsx)(a,{search:x,to:`/ecs/register-task-definition`,children:S})}),t[6]=x,t[7]=C);let w;t[8]!==u.error||t[9]!==u.isError?(w=u.isError&&(0,h.jsx)(l,{error:u.error instanceof Error?u.error:void 0,msg:`Failed to deregister task definition.`}),t[8]=u.error,t[9]=u.isError,t[10]=w):w=t[10];let T;t[11]===r?T=t[12]:(T=r.length===0?(0,h.jsx)(`p`,{className:`text-muted-foreground`,children:`No task definitions found.`}):(0,h.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,h.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,h.jsx)(`thead`,{children:(0,h.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,h.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Family : Revision`}),(0,h.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,h.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,h.jsx)(`tbody`,{children:r.map(e=>{let t=g(e);return(0,h.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,h.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:t}),(0,h.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,h.jsx)(o,{onClick:()=>_(t),size:`sm`,variant:`destructive`,children:`Deregister`})})]},e)})})]})}),t[11]=r,t[12]=T);let E=`This marks task definition "${f}" INACTIVE. Existing tasks keep running; no new tasks can use it.`,D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>!e&&_(null),t[13]=D):D=t[13];let O=f!==null,k;t[14]!==u.isPending||t[15]!==y||t[16]!==O||t[17]!==E?(k=(0,h.jsx)(d,{confirmLabel:`Deregister`,description:E,isPending:u.isPending,onConfirm:y,onOpenChange:D,open:O,pendingLabel:`Deregistering…`,title:`Deregister task definition`}),t[14]=u.isPending,t[15]=y,t[16]=O,t[17]=E,t[18]=k):k=t[18];let A;return t[19]!==k||t[20]!==C||t[21]!==w||t[22]!==T?(A=(0,h.jsxs)(h.Fragment,{children:[C,w,T,k]}),t[19]=k,t[20]=C,t[21]=w,t[22]=T,t[23]=A):A=t[23],A}function v(){let e=(0,p.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(u,{title:`Task definitions`}),(0,h.jsx)(f,{}),(0,h.jsx)(_,{})]}),e[0]=t):t=e[0],t}var y=v;export{y as component}; \ No newline at end of file +import{a as e,n as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./useSuspenseQuery.js";import{t as a}from"./link.js";import{t as o}from"./button.js";import{o as s}from"./ecs.js";import{a as c}from"./ecs2.js";import{t as l}from"./error-banner.js";import{t as u}from"./page-heading.js";import{t as d}from"./delete-confirmation-dialog.js";import{t as f}from"./ecs-section-nav.js";var p=r(),m=e(n(),1),h=t();function g(e){return e.split(`/`).at(-1)??e}function _(e){let t=(0,p.c)(24),{clusterName:n}=e,{data:r}=i(s),u=c(),[f,_]=(0,m.useState)(null),v;t[0]!==u||t[1]!==f?(v=function(){f&&u.mutate(f,{onSuccess:()=>_(null)})},t[0]=u,t[1]=f,t[2]=v):v=t[2];let y=v,b=n??``,x;t[3]===b?x=t[4]:(x={cluster:b},t[3]=b,t[4]=x);let S;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,h.jsx)(o,{size:`sm`,children:`Register task definition`}),t[5]=S):S=t[5];let C;t[6]===x?C=t[7]:(C=(0,h.jsx)(`div`,{className:`mb-4 flex justify-end`,children:(0,h.jsx)(a,{search:x,to:`/ecs/register-task-definition`,children:S})}),t[6]=x,t[7]=C);let w;t[8]!==u.error||t[9]!==u.isError?(w=u.isError&&(0,h.jsx)(l,{error:u.error instanceof Error?u.error:void 0,msg:`Failed to deregister task definition.`}),t[8]=u.error,t[9]=u.isError,t[10]=w):w=t[10];let T;t[11]===r?T=t[12]:(T=r.length===0?(0,h.jsx)(`p`,{className:`text-muted-foreground`,children:`No task definitions found.`}):(0,h.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,h.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,h.jsx)(`thead`,{children:(0,h.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,h.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Family : Revision`}),(0,h.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:(0,h.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,h.jsx)(`tbody`,{children:r.map(e=>{let t=g(e);return(0,h.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,h.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:t}),(0,h.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,h.jsx)(o,{onClick:()=>_(t),size:`sm`,variant:`destructive`,children:`Deregister`})})]},e)})})]})}),t[11]=r,t[12]=T);let E=`This marks task definition "${f}" INACTIVE. Existing tasks keep running; no new tasks can use it.`,D;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>!e&&_(null),t[13]=D):D=t[13];let O=f!==null,k;t[14]!==u.isPending||t[15]!==y||t[16]!==O||t[17]!==E?(k=(0,h.jsx)(d,{confirmLabel:`Deregister`,description:E,isPending:u.isPending,onConfirm:y,onOpenChange:D,open:O,pendingLabel:`Deregistering…`,title:`Deregister task definition`}),t[14]=u.isPending,t[15]=y,t[16]=O,t[17]=E,t[18]=k):k=t[18];let A;return t[19]!==k||t[20]!==C||t[21]!==w||t[22]!==T?(A=(0,h.jsxs)(h.Fragment,{children:[C,w,T,k]}),t[19]=k,t[20]=C,t[21]=w,t[22]=T,t[23]=A):A=t[23],A}function v(){let e=(0,p.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(u,{title:`Task definitions`}),(0,h.jsx)(f,{}),(0,h.jsx)(_,{})]}),e[0]=t):t=e[0],t}var y=v;export{y as component}; \ No newline at end of file diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/create-service-page.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/create-service-page.tsx index d6f7c8ba4..3a6507c75 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/create-service-page.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/create-service-page.tsx @@ -29,8 +29,7 @@ import { elbv2TargetGroupsQueryOptions } from "@/queries/elbv2" import { createServiceSchema, type CreateServiceFormData } from "@/types/ecs" function familyRevision(arn: string): string { - const idx = arn.lastIndexOf("/") - return idx === -1 ? arn : arn.slice(idx + 1) + return arn.split("/").at(-1) ?? arn } export function CreateServicePage({ cluster }: { cluster: string }) { diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/run-task-page.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/run-task-page.tsx index ee31bb03b..f5f603479 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/run-task-page.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/run-task-page.tsx @@ -29,8 +29,7 @@ import { runTaskSchema, type RunTaskFormData } from "@/types/ecs" // familyRevision turns a task definition ARN into its "family:revision" id. function familyRevision(arn: string): string { - const idx = arn.lastIndexOf("/") - return idx === -1 ? arn : arn.slice(idx + 1) + return arn.split("/").at(-1) ?? arn } export function RunTaskPage({ cluster }: { cluster: string }) { diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/service-detail-page.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/service-detail-page.tsx index d5c19b212..3245d39d0 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/service-detail-page.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/service-detail-page.tsx @@ -17,11 +17,7 @@ import { ecsServicesQueryOptions, ecsTasksQueryOptions } from "@/queries/ecs" // shortArn renders the trailing resource segment of an ARN, falling back to the // whole string when there is no slash. function shortArn(arn: string | undefined): string { - if (!arn) { - return "" - } - const idx = arn.lastIndexOf("/") - return idx === -1 ? arn : arn.slice(idx + 1) + return arn?.split("/").at(-1) ?? "" } function attachmentDetail(task: Task, name: string): string | undefined { diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/services-tab.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/services-tab.tsx index 801602922..6c25e39c0 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/services-tab.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/services-tab.tsx @@ -9,11 +9,7 @@ import { ecsServicesQueryOptions } from "@/queries/ecs" // shortArn renders the trailing resource segment of an ARN (the part after the // final "/"), falling back to the whole string when there is no slash. function shortArn(arn: string | undefined): string { - if (!arn) { - return "" - } - const idx = arn.lastIndexOf("/") - return idx === -1 ? arn : arn.slice(idx + 1) + return arn?.split("/").at(-1) ?? "" } export function ServicesTab({ clusterName }: { clusterName: string }) { diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/task-definitions-list.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/task-definitions-list.tsx index 9ba749642..0cbe1fe3d 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/task-definitions-list.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/task-definitions-list.tsx @@ -11,8 +11,7 @@ import { ecsTaskDefinitionsQueryOptions } from "@/queries/ecs" // familyRevision extracts the "family:revision" identifier from a task // definition ARN; DeregisterTaskDefinition requires that explicit form. function familyRevision(arn: string): string { - const idx = arn.lastIndexOf("/") - return idx === -1 ? arn : arn.slice(idx + 1) + return arn.split("/").at(-1) ?? arn } // TaskDefinitionsList renders the account-scoped task definitions. clusterName, diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/task-detail-page.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/task-detail-page.tsx index d5352c9b3..17f900f71 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/task-detail-page.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/task-detail-page.tsx @@ -11,11 +11,7 @@ import { ecsTasksQueryOptions } from "@/queries/ecs" // shortArn renders the trailing resource segment of an ARN, falling back to the // whole string when there is no slash. function shortArn(arn: string | undefined): string { - if (!arn) { - return "" - } - const idx = arn.lastIndexOf("/") - return idx === -1 ? arn : arn.slice(idx + 1) + return arn?.split("/").at(-1) ?? "" } function attachmentDetail( diff --git a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/tasks-tab.tsx b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/tasks-tab.tsx index f2ccae39c..fb79ad92d 100644 --- a/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/tasks-tab.tsx +++ b/spinifex/services/spinifexui/frontend/src/routes/_auth/ecs/(clusters)/-components/tasks-tab.tsx @@ -11,11 +11,7 @@ import { useStopTask } from "@/mutations/ecs" import { ecsTasksQueryOptions } from "@/queries/ecs" function taskId(arn: string | undefined): string { - if (!arn) { - return "" - } - const idx = arn.lastIndexOf("/") - return idx === -1 ? arn : arn.slice(idx + 1) + return arn?.split("/").at(-1) ?? "" } export function TasksTab({ clusterName }: { clusterName: string }) {