local-serverless-stack 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/ui/assets/{BucketDetailPage-DQU5IfHZ.js → BucketDetailPage-Hg4Gg3jC.js} +1 -1
- package/dist/ui/assets/{BucketsPage-FDb9r2GE.js → BucketsPage-BHkg7TQp.js} +1 -1
- package/dist/ui/assets/DynamoPage-CH_TgPh_.js +1 -0
- package/dist/ui/assets/{DynamoTablePage-D2-tvZSS.js → DynamoTablePage-BPvl5y6_.js} +1 -1
- package/dist/ui/assets/{OverviewPage-DKpsGNi-.js → OverviewPage-nhomNDqx.js} +1 -1
- package/dist/ui/assets/{QueueDetailPage-m_Ux1JRb.js → QueueDetailPage-DHDPgRDc.js} +1 -1
- package/dist/ui/assets/{QueuesPage-CEfnzK5n.js → QueuesPage-D5YcEbUU.js} +1 -1
- package/dist/ui/assets/{ServiceDetailPage-DMgYxag6.js → ServiceDetailPage-DxJ0t7HQ.js} +1 -1
- package/dist/ui/assets/{ServicesPage-Dl9Md68f.js → ServicesPage-DWDaaOz9.js} +1 -1
- package/dist/ui/assets/{index-xSUtPJWt.js → index-D3WwZ4lY.js} +2 -2
- package/dist/ui/index.html +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/DynamoPage-D0Q2SOCV.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.1.1] - 2026-05-21
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **DynamoDB tables: search filter**: the DynamoDB tab now has a text input in the table-list header that filters rows by table name or owning service as you type, so finding a table no longer requires `Ctrl+F`. When a query matches nothing, an empty state shows the active query.
|
|
12
|
+
|
|
8
13
|
## [0.1.0] - 2026-05-21
|
|
9
14
|
|
|
10
15
|
### Added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as R,v as Q,Q as W,i as k,G as t,f as c,S as n,d as b,w as d,n as o,A as g,m as r,h as m,E as p,_ as I,j as U,b as X,k as K,R as F,s as N,D as Y,p as S,U as Z,M as ee,K as T,J as te,V as ae,W as le,F as ne,O as oe,y as u,g as ie,L as re}from"./index-
|
|
1
|
+
import{o as R,v as Q,Q as W,i as k,G as t,f as c,S as n,d as b,w as d,n as o,A as g,m as r,h as m,E as p,_ as I,j as U,b as X,k as K,R as F,s as N,D as Y,p as S,U as Z,M as ee,K as T,J as te,V as ae,W as le,F as ne,O as oe,y as u,g as ie,L as re}from"./index-D3WwZ4lY.js";const ue={style:{"font-size":"1.1rem"}},se={key:1,style:{display:"flex","justify-content":"center",padding:"2rem"}},de={key:0,style:{display:"flex","justify-content":"center",padding:"2rem"}},ce=["href"],fe=["href"],ve=R({__name:"BucketDetail",props:{bucketName:{}},emits:["back"],setup(z,{emit:V}){const s=z,$=V,f=oe(),i=u(null),y=u([]),h=u(""),_=u(!0),B=u(!1),j=u(null),w=u(""),x=u(""),C=u("text/plain"),O=u(!1),L=[{key:"key",label:"Key"},{key:"size",label:"Size",align:"right"},{key:"lastModified",label:"Modified"},{key:"actions",label:"",align:"right"}],E=ie(()=>y.value.reduce((l,e)=>l+(e.size||0),0));function D(l){if(l==null)return"—";if(l===0)return"0 B";const e=["B","KB","MB","GB","TB"],a=Math.floor(Math.log(l)/Math.log(1024));return`${(l/Math.pow(1024,a)).toFixed(a===0?0:1)} ${e[a]}`}function A(l){return l?new Date(l).toLocaleString():"—"}async function M(){try{i.value=await b.getBucket(s.bucketName),j.value=null}catch(l){j.value=l.message||"Failed to load bucket",i.value=null}finally{_.value=!1}}async function v(){B.value=!0;try{const l=await b.listBucketObjects(s.bucketName,{prefix:h.value||void 0,maxKeys:200});y.value=l.objects}catch(l){f.add({title:"Failed to load objects",description:l.message,variant:"danger"})}finally{B.value=!1}}function G(l){return b.bucketObjectContentUrl(s.bucketName,l,!1)}function J(l){return b.bucketObjectContentUrl(s.bucketName,l,!0)}async function q(l){if(confirm(`Delete object "${l}"?`))try{await b.deleteBucketObject(s.bucketName,l),f.add({title:"Object deleted",variant:"info"}),await v()}catch(e){f.add({title:"Failed to delete object",description:e.message,variant:"danger"})}}async function H(){if(!w.value||!x.value){f.add({title:"Key and body are required",variant:"warning"});return}O.value=!0;try{await b.putBucketObject(s.bucketName,{key:w.value,body:x.value,contentType:C.value||void 0}),f.add({title:"Object uploaded",variant:"info"}),w.value="",x.value="",await v(),await M()}catch(l){f.add({title:"Failed to upload object",description:l.message,variant:"danger"})}finally{O.value=!1}}return Q(()=>{M(),v()}),W(()=>s.bucketName,()=>{M(),v()}),(l,e)=>(d(),k(t(c),{direction:"vertical",gap:"1rem"},{default:n(()=>[o(t(c),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:n(()=>[o(t(c),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:n(()=>{var a;return[o(t(g),{size:"sm",variant:"ghost",onClick:e[0]||(e[0]=P=>$("back"))},{default:n(()=>[...e[9]||(e[9]=[r("← Buckets",-1)])]),_:1}),m("strong",ue,p(z.bucketName),1),(a=i.value)!=null&&a.versioning?(d(),k(t(I),{key:0,tone:"info",variant:"soft"},{default:n(()=>[...e[10]||(e[10]=[r("Versioning",-1)])]),_:1})):U("",!0)]}),_:1}),o(t(g),{size:"sm",variant:"ghost",loading:B.value,onClick:e[1]||(e[1]=a=>v())},{default:n(()=>[...e[11]||(e[11]=[r("Refresh",-1)])]),_:1},8,["loading"])]),_:1}),j.value?(d(),k(t(X),{key:0,variant:"danger",dismissible:"",onDismiss:e[2]||(e[2]=a=>j.value=null)},{default:n(()=>[r(p(j.value),1)]),_:1})):U("",!0),_.value&&!i.value?(d(),K("div",se,[o(t(F),{label:"Loading bucket..."})])):i.value?(d(),K(ne,{key:2},[o(t(Y),{columns:4,gap:"0.75rem"},{default:n(()=>[o(t(N),{label:"Objects",value:i.value.objectCount??0,tone:"info"},null,8,["value"]),o(t(N),{label:"Size",value:D(i.value.totalSize),tone:"neutral"},null,8,["value"]),o(t(N),{label:"Versioning",value:i.value.versioning?"Enabled":"Disabled",tone:i.value.versioning?"success":"neutral"},null,8,["value","tone"]),o(t(N),{label:"Notifications",value:i.value.notifications??0,tone:(i.value.notifications??0)>0?"info":"neutral"},null,8,["value","tone"])]),_:1}),o(t(T),{variant:"outline"},{header:n(()=>[...e[12]||(e[12]=[m("strong",null,"Upload object",-1)])]),default:n(()=>[o(t(c),{direction:"vertical",gap:"0.5rem"},{default:n(()=>[o(t(S),{modelValue:w.value,"onUpdate:modelValue":e[3]||(e[3]=a=>w.value=a),placeholder:"object/key.txt",label:"Key"},null,8,["modelValue"]),o(t(S),{modelValue:C.value,"onUpdate:modelValue":e[4]||(e[4]=a=>C.value=a),placeholder:"text/plain",label:"Content-Type"},null,8,["modelValue"]),e[14]||(e[14]=m("label",{class:"muted",style:{"font-size":"0.875rem"}},"Body",-1)),Z(m("textarea",{"onUpdate:modelValue":e[5]||(e[5]=a=>x.value=a),rows:"4",style:{width:"100%","font-family":"var(--tree-font-mono, monospace)",padding:"0.5rem"},placeholder:"Hello, world!"},null,512),[[ee,x.value]]),o(t(c),{direction:"horizontal",justify:"flex-end"},{default:n(()=>[o(t(g),{size:"sm",loading:O.value,onClick:H},{default:n(()=>[...e[13]||(e[13]=[r("Upload",-1)])]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1}),o(t(T),{variant:"outline"},{header:n(()=>[o(t(c),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:n(()=>[m("strong",null,"Objects ("+p(y.value.length)+" · "+p(D(E.value))+")",1),o(t(c),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:n(()=>[o(t(S),{modelValue:h.value,"onUpdate:modelValue":e[6]||(e[6]=a=>h.value=a),placeholder:"prefix filter",size:"sm",onKeyup:e[7]||(e[7]=le(a=>v(),["enter"]))},null,8,["modelValue"]),o(t(g),{size:"sm",variant:"ghost",onClick:e[8]||(e[8]=a=>v())},{default:n(()=>[...e[15]||(e[15]=[r("Apply",-1)])]),_:1})]),_:1})]),_:1})]),default:n(()=>[B.value?(d(),K("div",de,[o(t(F),{label:"Loading objects..."})])):y.value.length?(d(),k(t(ae),{key:2,columns:L,rows:y.value},{"cell-key":n(({row:a})=>[m("a",{href:G(String(a.key)),target:"_blank",rel:"noopener noreferrer",style:{"text-decoration":"none","font-weight":"500"}},p(a.key),9,ce)]),"cell-size":n(({row:a})=>[r(p(D(Number(a.size))),1)]),"cell-lastModified":n(({row:a})=>[r(p(A(a.lastModified)),1)]),"cell-actions":n(({row:a})=>[o(t(c),{direction:"horizontal",gap:"0.25rem",justify:"flex-end"},{default:n(()=>[m("a",{href:J(String(a.key)),target:"_blank",rel:"noopener noreferrer",style:{"text-decoration":"none"}},[o(t(g),{size:"sm",variant:"ghost"},{default:n(()=>[...e[16]||(e[16]=[r("Download",-1)])]),_:1})],8,fe),o(t(g),{size:"sm",variant:"ghost",tone:"danger",onClick:P=>q(String(a.key))},{default:n(()=>[...e[17]||(e[17]=[r(" Delete ",-1)])]),_:1},8,["onClick"])]),_:2},1024)]),_:1},8,["rows"])):(d(),k(t(te),{key:1,title:"No objects",description:"This bucket is empty (or the prefix filter excluded everything)."}))]),_:1})],64)):U("",!0)]),_:1}))}}),pe=R({__name:"BucketDetailPage",props:{bucketName:{}},setup(z){const V=re();function s(){V.push("/buckets")}return($,f)=>(d(),k(ve,{"bucket-name":z.bucketName,onBack:s},null,8,["bucket-name"]))}});export{pe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as x,L as N,v as D,u as I,w as o,i as u,G as n,f as C,S as a,n as l,D as L,s as b,b as O,m as c,E as r,j as T,K as E,k as z,R as K,J as U,V as F,A as G,_ as p,a as J,B as P,h as _,X as q,y as m,g as j,d as R}from"./index-
|
|
1
|
+
import{o as x,L as N,v as D,u as I,w as o,i as u,G as n,f as C,S as a,n as l,D as L,s as b,b as O,m as c,E as r,j as T,K as E,k as z,R as K,J as U,V as F,A as G,_ as p,a as J,B as P,h as _,X as q,y as m,g as j,d as R}from"./index-D3WwZ4lY.js";const A={key:0,style:{display:"flex","justify-content":"center",padding:"2rem"}},X=["onClick"],H={key:1,class:"muted",style:{"font-size":"0.75rem"}},Q=x({__name:"BucketsView",setup(V){const y=N(),i=m([]),h=m({}),d=m(!0),v=m(null);let g=null;const $=[{key:"name",label:"Bucket"},{key:"service",label:"Service"},{key:"objectCount",label:"Objects",align:"right"},{key:"totalSize",label:"Size",align:"right"},{key:"versioning",label:"Versioning"},{key:"notifications",label:"Notifications",align:"right"},{key:"actions",label:"",align:"right"}],M=j(()=>i.value.map(t=>({...t,service:h.value[t.name]||""}))),k=j(()=>({buckets:i.value.length,objects:i.value.reduce((t,s)=>t+(s.objectCount||0),0),size:i.value.reduce((t,s)=>t+(s.totalSize||0),0)}));function B(t){if(t==null)return"—";if(t===0)return"0 B";const s=["B","KB","MB","GB","TB"],e=Math.floor(Math.log(t)/Math.log(1024));return`${(t/Math.pow(1024,e)).toFixed(e===0?0:1)} ${s[e]}`}async function S(){try{const[t,s]=await Promise.all([R.listBuckets(),R.listResourceOwners().catch(()=>({tables:[],queues:[],topics:[],buckets:[]}))]);i.value=t;const e={};for(const f of s.buckets||[])e[f.name]=f.service;h.value=e,v.value=null}catch(t){v.value=t.message||"Failed to load buckets"}finally{d.value=!1}}function w(t){y.push(`/buckets/${encodeURIComponent(t)}`)}return D(()=>{S(),g=window.setInterval(S,1e4)}),I(()=>{g&&window.clearInterval(g)}),(t,s)=>(o(),u(n(C),{direction:"vertical",gap:"1.25rem"},{default:a(()=>[l(n(L),{columns:3,gap:"1rem"},{default:a(()=>[l(n(b),{label:"Buckets",value:k.value.buckets,tone:"info",loading:d.value},null,8,["value","loading"]),l(n(b),{label:"Objects",value:k.value.objects,tone:"success",loading:d.value},null,8,["value","loading"]),l(n(b),{label:"Total size",value:B(k.value.size),tone:"neutral",loading:d.value},null,8,["value","loading"])]),_:1}),v.value?(o(),u(n(O),{key:0,variant:"danger",dismissible:"",onDismiss:s[0]||(s[0]=e=>v.value=null)},{default:a(()=>[c(r(v.value),1)]),_:1})):T("",!0),l(n(E),{variant:"outline"},{header:a(()=>[l(n(C),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:a(()=>[...s[1]||(s[1]=[_("strong",null,"S3 Buckets",-1),_("span",{class:"muted"},"Refreshes every 10s",-1)])]),_:1})]),default:a(()=>[d.value?(o(),z("div",A,[l(n(K),{label:"Loading buckets..."})])):i.value.length?(o(),u(n(F),{key:2,columns:$,rows:M.value},{"cell-name":a(({row:e})=>[_("a",{href:"#",style:{"text-decoration":"none","font-weight":"600"},onClick:q(f=>w(String(e.name)),["prevent"])},r(e.name),9,X)]),"cell-service":a(({row:e})=>[e.service?(o(),u(n(J),{key:0,to:`/services/${encodeURIComponent(String(e.service))}`,style:{"text-decoration":"none"}},{default:a(()=>[l(n(P),{size:"sm",variant:"soft",clickable:""},{default:a(()=>[c(r(e.service),1)]),_:2},1024)]),_:2},1032,["to"])):(o(),z("span",H,"unmanaged"))]),"cell-objectCount":a(({row:e})=>[l(n(p),{tone:"info",variant:"soft"},{default:a(()=>[c(r(e.objectCount??0),1)]),_:2},1024)]),"cell-totalSize":a(({row:e})=>[c(r(B(e.totalSize)),1)]),"cell-versioning":a(({row:e})=>[l(n(p),{tone:e.versioning?"success":"neutral",variant:"soft"},{default:a(()=>[c(r(e.versioning?"Enabled":"Disabled"),1)]),_:2},1032,["tone"])]),"cell-notifications":a(({row:e})=>[l(n(p),{tone:Number(e.notifications)>0?"info":"neutral",variant:"soft"},{default:a(()=>[c(r(e.notifications??0),1)]),_:2},1032,["tone"])]),"cell-actions":a(({row:e})=>[l(n(G),{size:"sm",variant:"ghost",onClick:f=>w(String(e.name))},{default:a(()=>[...s[2]||(s[2]=[c(" Open ",-1)])]),_:1},8,["onClick"])]),_:1},8,["rows"])):(o(),u(n(U),{key:1,title:"No buckets found",description:"Register a microservice that defines S3 resources or create buckets directly in LocalStack."}))]),_:1})]),_:1}))}}),Y=x({__name:"BucketsPage",setup(V){return(y,i)=>(o(),u(Q))}});export{Y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as A,v as j,u as F,w as n,i,G as s,f as C,S as a,n as o,D as q,s as N,b as H,m as r,E as u,j as f,K as J,k as y,R as W,J as P,V as Q,A as X,B as p,_ as I,a as Y,h as L,p as Z,y as g,g as B,d as T,L as ee}from"./index-D3WwZ4lY.js";const te={key:0,style:{display:"flex","justify-content":"center",padding:"2rem"}},se=["onClick"],ae={key:1},ne={class:"muted mono",style:{"font-size":"0.75rem"}},le={key:1,class:"muted",style:{"font-size":"0.75rem"}},ie={key:1,class:"muted",style:{"font-size":"0.75rem"}},oe={key:1,class:"muted",style:{"font-size":"0.75rem"}},re=A({__name:"DynamoTablesList",emits:["open"],setup(M,{emit:D}){const w=D,d=g([]),b=g([]),R=g({}),c=g(!0),k=g(null),h=g("");let z=null;const U=[{key:"name",label:"Table"},{key:"service",label:"Service"},{key:"status",label:"Status"},{key:"itemCount",label:"Items",align:"right"},{key:"seed",label:"Seed"},{key:"features",label:"Features"},{key:"actions",label:"",align:"right"}],S=B(()=>{const l=d.value.map(e=>{var G,K;const t=(G=e.keySchema.find(_=>_.KeyType==="HASH"))==null?void 0:G.AttributeName,m=(K=e.keySchema.find(_=>_.KeyType==="RANGE"))==null?void 0:K.AttributeName,x=m?`PK: ${t} · SK: ${m}`:`PK: ${t??"—"}`,O=b.value.find(_=>_.tableName===e.name);return{name:e.name,status:e.status,itemCount:e.itemCount||0,keyDescriptor:x,billingMode:e.billingMode,ttlOn:e.ttl.enabled,streamOn:e.streamEnabled,hasGsi:e.hasGsi,hasLsi:e.hasLsi,service:R.value[e.name]||"",seedItemCount:O?O.itemCount:null,exists:!0}});for(const e of b.value)!e.tableExists&&!l.some(t=>t.name===e.tableName)&&l.push({name:e.tableName,status:"PENDING",itemCount:0,keyDescriptor:"—",ttlOn:!1,streamOn:!1,hasGsi:!1,hasLsi:!1,service:R.value[e.tableName]||"",seedItemCount:e.itemCount,exists:!1});return l.sort((e,t)=>e.name.localeCompare(t.name))}),E=B(()=>{const l=h.value.trim().toLowerCase();return l?S.value.filter(e=>e.name.toLowerCase().includes(l)||(e.service||"").toLowerCase().includes(l)):S.value}),v=B(()=>({tables:d.value.length,items:d.value.reduce((l,e)=>l+(e.itemCount||0),0),warnings:d.value.reduce((l,e)=>{var t;return l+(((t=e.warnings)==null?void 0:t.length)||0)},0),seedsPending:b.value.filter(l=>!l.tableExists).length}));async function V(){try{const[l,e,t]=await Promise.all([T.listDynamoTables(),T.listSeeds().catch(()=>({seedsDir:"",entries:[]})),T.listResourceOwners().catch(()=>({tables:[],queues:[],topics:[],buckets:[]}))]);d.value=l.tables,b.value=e.entries;const m={};for(const x of t.tables)m[x.name]=x.service;R.value=m,k.value=null}catch(l){k.value=l.message||"Failed to load DynamoDB tables"}finally{c.value=!1}}function $(l){l.exists&&w("open",l.name)}return j(()=>{V(),z=window.setInterval(V,15e3)}),F(()=>{z&&window.clearInterval(z)}),(l,e)=>(n(),i(s(C),{direction:"vertical",gap:"1.25rem"},{default:a(()=>[o(s(q),{columns:4,gap:"1rem"},{default:a(()=>[o(s(N),{label:"Tables",value:v.value.tables,tone:"info",loading:c.value},null,8,["value","loading"]),o(s(N),{label:"Total items",value:v.value.items,tone:"success",loading:c.value},null,8,["value","loading"]),o(s(N),{label:"Seeds pending",value:v.value.seedsPending,tone:v.value.seedsPending>0?"warning":"neutral",loading:c.value},null,8,["value","tone","loading"]),o(s(N),{label:"Warnings",value:v.value.warnings,tone:v.value.warnings>0?"warning":"neutral",loading:c.value},null,8,["value","tone","loading"])]),_:1}),k.value?(n(),i(s(H),{key:0,variant:"danger",dismissible:"",onDismiss:e[0]||(e[0]=t=>k.value=null)},{default:a(()=>[r(u(k.value),1)]),_:1})):f("",!0),o(s(J),{variant:"outline"},{header:a(()=>[o(s(C),{direction:"horizontal",justify:"space-between",align:"center",gap:"1rem"},{default:a(()=>[e[3]||(e[3]=L("strong",null,"DynamoDB tables",-1)),o(s(C),{direction:"horizontal",align:"center",gap:"1rem"},{default:a(()=>[o(s(Z),{modelValue:h.value,"onUpdate:modelValue":e[1]||(e[1]=t=>h.value=t),placeholder:"Filter tables...",style:{"min-width":"16rem"}},null,8,["modelValue"]),e[2]||(e[2]=L("span",{class:"muted",style:{"font-size":"0.75rem"}}," Rows with reduced opacity exist only as a seed file ",-1))]),_:1})]),_:1})]),default:a(()=>[c.value?(n(),y("div",te,[o(s(W),{label:"Loading tables..."})])):S.value.length?E.value.length?(n(),i(s(Q),{key:3,columns:U,rows:E.value,"row-class":t=>t.exists?"":"dim-row"},{"cell-name":a(({row:t})=>[o(s(C),{direction:"vertical",gap:"0.125rem"},{default:a(()=>[t.exists?(n(),y("strong",{key:0,style:{cursor:"pointer","text-decoration":"underline","text-decoration-style":"dotted","text-underline-offset":"3px"},onClick:m=>$(t)},u(t.name),9,se)):(n(),y("strong",ae,u(t.name),1)),L("span",ne,u(t.keyDescriptor),1)]),_:2},1024)]),"cell-service":a(({row:t})=>[t.service?(n(),i(s(Y),{key:0,to:`/services/${encodeURIComponent(String(t.service))}`,style:{"text-decoration":"none"}},{default:a(()=>[o(s(p),{size:"sm",variant:"soft",clickable:""},{default:a(()=>[r(u(t.service),1)]),_:2},1024)]),_:2},1032,["to"])):(n(),y("span",le,"—"))]),"cell-status":a(({row:t})=>[t.exists?(n(),i(s(I),{key:0,tone:t.status==="ACTIVE"?"success":"warning",variant:"soft"},{default:a(()=>[r(u(t.status||"UNKNOWN"),1)]),_:2},1032,["tone"])):(n(),i(s(I),{key:1,tone:"warning",variant:"outline"},{default:a(()=>[...e[4]||(e[4]=[r("Not created",-1)])]),_:1}))]),"cell-itemCount":a(({row:t})=>[r(u(t.exists?t.itemCount:"—"),1)]),"cell-seed":a(({row:t})=>[t.seedItemCount!==null?(n(),i(s(I),{key:0,tone:t.exists?"info":"warning",variant:"soft"},{default:a(()=>[r(u(t.seedItemCount)+" seeded item"+u(t.seedItemCount===1?"":"s"),1)]),_:2},1032,["tone"])):(n(),y("span",ie,"no seed"))]),"cell-features":a(({row:t})=>[o(s(C),{direction:"horizontal",gap:"0.25rem",wrap:""},{default:a(()=>[t.billingMode?(n(),i(s(p),{key:0,size:"sm",variant:"soft"},{default:a(()=>[r(u(t.billingMode),1)]),_:2},1024)):f("",!0),t.ttlOn?(n(),i(s(p),{key:1,size:"sm",variant:"solid"},{default:a(()=>[...e[5]||(e[5]=[r("TTL",-1)])]),_:1})):f("",!0),t.streamOn?(n(),i(s(p),{key:2,size:"sm",variant:"solid"},{default:a(()=>[...e[6]||(e[6]=[r("Streams",-1)])]),_:1})):f("",!0),t.hasGsi?(n(),i(s(p),{key:3,size:"sm",variant:"soft"},{default:a(()=>[...e[7]||(e[7]=[r("GSI",-1)])]),_:1})):f("",!0),t.hasLsi?(n(),i(s(p),{key:4,size:"sm",variant:"soft"},{default:a(()=>[...e[8]||(e[8]=[r("LSI",-1)])]),_:1})):f("",!0)]),_:2},1024)]),"cell-actions":a(({row:t})=>[t.exists?(n(),i(s(X),{key:0,size:"sm",variant:"soft",onClick:m=>$(t)},{default:a(()=>[...e[9]||(e[9]=[r(" Explore ",-1)])]),_:1},8,["onClick"])):(n(),y("span",oe," Register service to provision "))]),_:1},8,["rows","row-class"])):(n(),i(s(P),{key:2,title:"No matching tables",description:`No tables match "${h.value}".`},null,8,["description"])):(n(),i(s(P),{key:1,title:"No DynamoDB tables",description:"Register a microservice with DynamoDB resources or drop a seed file into the seeds directory."}))]),_:1})]),_:1}))}}),de=A({__name:"DynamoPage",setup(M){const D=ee();function w(d){D.push(`/dynamo/${encodeURIComponent(d)}`)}return(d,b)=>(n(),i(re,{onOpen:w}))}});export{de as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{o as W,Q as ve,w as r,i as k,G as e,a0 as Xe,S as t,n as l,f as o,b as ne,m as c,E as b,j as A,h as f,_ as J,x as Ye,A as E,k as R,F as G,y as g,g as q,d as K,O as fe,K as P,N as Ze,Z as B,t as le,Y as we,p as L,H as et,X as _e,z as M,R as Ve,J as xe,V as tt,l as at,c as lt,q as ye,D as ge,s as oe,e as nt,B as ke,v as it,$ as st,P as de,T as ut,C as me,I as rt,L as Ce}from"./index-
|
|
1
|
+
import{o as W,Q as ve,w as r,i as k,G as e,a0 as Xe,S as t,n as l,f as o,b as ne,m as c,E as b,j as A,h as f,_ as J,x as Ye,A as E,k as R,F as G,y as g,g as q,d as K,O as fe,K as P,N as Ze,Z as B,t as le,Y as we,p as L,H as et,X as _e,z as M,R as Ve,J as xe,V as tt,l as at,c as lt,q as ye,D as ge,s as oe,e as nt,B as ke,v as it,$ as st,P as de,T as ut,C as me,I as rt,L as Ce}from"./index-D3WwZ4lY.js";const ot=W({__name:"DynamoItemEditor",props:{open:{type:Boolean},tableName:{},mode:{},item:{},originalKey:{}},emits:["update:open","saved","request-edit","request-clone","request-delete"],setup(S,{emit:$}){const u=S,z=$,x=fe(),V=g(""),v=g(null),w=g(!1),_=q({get:()=>u.open,set:i=>z("update:open",i)}),I=q(()=>u.mode==="create"?`Create item · ${u.tableName}`:u.mode==="view"?`View item · ${u.tableName}`:`Edit item · ${u.tableName}`),j=q(()=>u.mode==="view");ve(()=>[u.open,u.item,u.mode],([i])=>{i&&(V.value=u.item&&Object.keys(u.item).length?JSON.stringify(u.item,null,2):`{
|
|
2
2
|
|
|
3
3
|
}`,v.value=null)},{immediate:!0});function C(){try{const i=JSON.parse(V.value);return i===null||typeof i!="object"||Array.isArray(i)?(v.value="Item must be a JSON object",null):(v.value=null,i)}catch(i){return v.value=i.message,null}}async function N(){const i=C();if(i){w.value=!0;try{u.mode==="edit"&&u.originalKey&&Object.entries(u.originalKey).some(([p,T])=>JSON.stringify(i[p])!==JSON.stringify(T))&&await K.deleteDynamoItem(u.tableName,u.originalKey),await K.putDynamoItem(u.tableName,i),x.add({title:u.mode==="create"?"Item created":"Item saved",variant:"success"}),z("saved"),_.value=!1}catch(d){x.add({title:"Save failed",description:d.message,variant:"danger"})}finally{w.value=!1}}}function y(){const i=C();i&&(V.value=JSON.stringify(i,null,2))}return(i,d)=>(r(),k(e(Xe),{open:_.value,"onUpdate:open":d[5]||(d[5]=p=>_.value=p),title:I.value,size:"lg"},{footer:t(()=>[l(e(o),{direction:"horizontal",gap:"0.5rem",justify:"space-between"},{default:t(()=>[l(e(o),{direction:"horizontal",gap:"0.5rem"},{default:t(()=>[j.value?A("",!0):(r(),k(e(E),{key:0,size:"sm",variant:"ghost",onClick:y},{default:t(()=>[...d[8]||(d[8]=[c(" Format JSON ",-1)])]),_:1})),j.value?(r(),R(G,{key:1},[l(e(E),{size:"sm",variant:"soft",onClick:d[1]||(d[1]=p=>z("request-edit"))},{default:t(()=>[...d[9]||(d[9]=[c("Edit",-1)])]),_:1}),l(e(E),{size:"sm",variant:"ghost",onClick:d[2]||(d[2]=p=>z("request-clone"))},{default:t(()=>[...d[10]||(d[10]=[c("Clone",-1)])]),_:1}),l(e(E),{size:"sm",variant:"ghost",tone:"danger",onClick:d[3]||(d[3]=p=>z("request-delete"))},{default:t(()=>[...d[11]||(d[11]=[c("Delete",-1)])]),_:1})],64)):A("",!0)]),_:1}),l(e(o),{direction:"horizontal",gap:"0.5rem"},{default:t(()=>[l(e(E),{size:"sm",variant:"ghost",onClick:d[4]||(d[4]=p=>_.value=!1)},{default:t(()=>[c(b(j.value?"Close":"Cancel"),1)]),_:1}),j.value?A("",!0):(r(),k(e(E),{key:0,size:"sm",variant:"solid",loading:w.value,disabled:!!v.value,onClick:N},{default:t(()=>[c(b(S.mode==="create"?"Create":"Save"),1)]),_:1},8,["loading","disabled"]))]),_:1})]),_:1})]),default:t(()=>[l(e(o),{direction:"vertical",gap:"0.75rem"},{default:t(()=>[v.value?(r(),k(e(ne),{key:0,variant:"danger"},{default:t(()=>[c(b(v.value),1)]),_:1})):A("",!0),l(e(o),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[d[7]||(d[7]=f("span",{class:"muted",style:{"font-size":"0.75rem"}}," JSON object. Types are inferred — numbers, booleans, strings, arrays, nested objects are all supported. ",-1)),j.value?(r(),k(e(J),{key:0,tone:"neutral",variant:"soft"},{default:t(()=>[...d[6]||(d[6]=[c("read-only",-1)])]),_:1})):A("",!0)]),_:1}),l(e(Ye),{modelValue:V.value,"onUpdate:modelValue":d[0]||(d[0]=p=>V.value=p),rows:18,readonly:j.value,spellcheck:"false",class:"mono",onBlur:C},null,8,["modelValue","readonly"])]),_:1})]),_:1},8,["open","title"]))}}),dt={style:{width:"100%"}},mt={class:"muted",style:{"font-size":"0.75rem"}},vt={key:0,style:{display:"flex","justify-content":"center",padding:"2rem"}},ft={key:1,class:"mono"},pt={class:"mono",style:{"font-size":"0.8rem"}},bt=W({__name:"DynamoItemsExplorer",props:{table:{}},setup(S){const $=S,u=fe(),z=g("scan"),x=g(""),V=g(50),v=g(""),w=g("="),_=g(""),I=g(""),j=g(!1),C=g([]),N=g(!1),y=g([]),i=g(void 0),d=g(void 0),p=g(null),T=g(!1),D=g(null),X=g(!1),Y=g(!1),Z=g("view"),U=g(null),ee=g(null),ie=g(!1),se=g(null),Se=[{value:"scan",label:"Scan"},{value:"query",label:"Query"}],Ae=[{value:"=",label:"Equal to"},{value:"<=",label:"Less than or equal to"},{value:"<",label:"Less than"},{value:">=",label:"Greater than or equal to"},{value:">",label:"Greater than"},{value:"between",label:"Between"},{value:"begins_with",label:"Begins with"}],ze=[{value:"=",label:"Equal to"},{value:"<>",label:"Not equal to"},{value:"<",label:"Less than"},{value:"<=",label:"Less than or equal to"},{value:">",label:"Greater than"},{value:">=",label:"Greater than or equal to"},{value:"begins_with",label:"Begins with"},{value:"contains",label:"Contains"},{value:"attribute_exists",label:"Exists"},{value:"attribute_not_exists",label:"Does not exist"}],Te=[{value:"String",label:"String"},{value:"Number",label:"Number"},{value:"Boolean",label:"Boolean"},{value:"Null",label:"Null"}],Ie=q(()=>{const s=[{value:"",label:`Table - ${$.table.name}`}];for(const a of $.table.gsis||[])a.IndexName&&s.push({value:a.IndexName,label:`Index - ${a.IndexName}`});for(const a of $.table.lsis||[])a.IndexName&&s.push({value:a.IndexName,label:`Index - ${a.IndexName}`});return s}),pe=q(()=>{if(!x.value)return $.table.keySchema;const s=$.table.gsis.find(a=>a.IndexName===x.value)||$.table.lsis.find(a=>a.IndexName===x.value);return(s==null?void 0:s.KeySchema)||$.table.keySchema}),te=q(()=>{var s,a;return((a=(s=pe.value)==null?void 0:s.find(n=>n.KeyType==="HASH"))==null?void 0:a.AttributeName)||""}),F=q(()=>{var s,a;return((a=(s=pe.value)==null?void 0:s.find(n=>n.KeyType==="RANGE"))==null?void 0:a.AttributeName)||""}),ue=q(()=>(pe.value||[]).map(s=>s.AttributeName).filter(s=>!!s)),be=q(()=>{const s=new Set;for(const a of y.value)Object.keys(a).forEach(n=>{ue.value.includes(n)||s.add(n)});return Array.from(s).sort()});function he(s){const a=$.table.attributeDefinitions.find(n=>n.AttributeName===s);return a!=null&&a.AttributeType?a.AttributeType==="S"?"String":a.AttributeType==="N"?"Number":a.AttributeType==="B"?"Binary":a.AttributeType:null}function Ne(s,a,n){const m=he(s);return a?m?`${s} (${m}, PK)`:`${s} (PK)`:n?m?`${s} (${m}, SK)`:`${s} (SK)`:m?`${s} (${m})`:s}const De=q(()=>{const s=ue.value.map((n,m)=>({key:`__attr__${n}`,label:Ne(n,m===0,m===1)})),a=be.value.map(n=>({key:`__attr__${n}`,label:Ne(n)}));return[...s,...a]}),Ee=q(()=>y.value.map((s,a)=>{const n={__id:a,__raw:s};for(const m of ue.value)n[`__attr__${m}`]=s[m];for(const m of be.value)n[`__attr__${m}`]=s[m];return n}));function ce(s){return s===void 0?"—":s===null?"null":typeof s=="boolean"?s?"true":"false":typeof s=="object"?JSON.stringify(s).slice(0,80):String(s).slice(0,80)}function je(s,a){switch(a){case"Number":{const n=Number(s);if(Number.isNaN(n))throw new Error(`"${s}" is not a number`);return n}case"Boolean":return s==="true"||s==="1";case"Null":return null;case"String":default:return s}}function ae(s,a){const n=$.table.attributeDefinitions.find(m=>m.AttributeName===a);if((n==null?void 0:n.AttributeType)==="N"){const m=Number(s);if(Number.isNaN(m))throw new Error(`"${s}" is not a number for ${a}`);return m}return s}function qe(){const s={},a={};if(!te.value)throw new Error("No partition key on the selected table or index");if(!v.value)throw new Error(`Partition key value (${te.value}) is required`);s["#pk"]=te.value,a[":pkv"]=ae(v.value,te.value);let n="#pk = :pkv";if(F.value&&_.value)if(s["#sk"]=F.value,w.value==="between"){if(!I.value)throw new Error("BETWEEN requires two values");a[":skv1"]=ae(_.value,F.value),a[":skv2"]=ae(I.value,F.value),n+=" AND #sk BETWEEN :skv1 AND :skv2"}else w.value==="begins_with"?(a[":skv"]=ae(_.value,F.value),n+=" AND begins_with(#sk, :skv)"):(a[":skv"]=ae(_.value,F.value),n+=` AND #sk ${w.value} :skv`);return{keyExpr:n,names:s,values:a}}function Re(){const s={},a={},n=[];return C.value.forEach((m,h)=>{if(!m.attr)return;const O=`#fn${h}`,re=`:fv${h}`;if(s[O]=m.attr,m.op==="attribute_exists"){n.push(`attribute_exists(${O})`);return}if(m.op==="attribute_not_exists"){n.push(`attribute_not_exists(${O})`);return}a[re]=je(m.value,m.type),m.op==="begins_with"?n.push(`begins_with(${O}, ${re})`):m.op==="contains"?n.push(`contains(${O}, ${re})`):n.push(`${O} ${m.op} ${re}`)}),{expr:n.join(" AND "),names:s,values:a}}function Be(s){const a=Re(),n={indexName:x.value||void 0,limit:V.value>0?V.value:void 0,exclusiveStartKey:s};let m=a.names,h=a.values;if(a.expr&&(n.filterExpression=a.expr),z.value==="query"){const O=qe();n.keyConditionExpression=O.keyExpr,m={...m,...O.names},h={...h,...O.values},j.value&&(n.scanIndexForward=!1)}return Object.keys(m).length&&(n.expressionAttributeNames=m),Object.keys(h).length&&(n.expressionAttributeValues=h),n}async function H(s){T.value=!0,D.value=null;try{const a=Be(s),n=z.value==="scan"?await K.scanDynamoTable($.table.name,a):await K.queryDynamoTable($.table.name,a);s?y.value=[...y.value,...n.items]:(y.value=n.items,p.value=new Date),i.value=n.lastEvaluatedKey,d.value=n.scannedCount,X.value=!0}catch(a){D.value=a.message||"Request failed"}finally{T.value=!1}}function Ke(){v.value="",w.value="=",_.value="",I.value="",j.value=!1,C.value=[],y.value=[],i.value=void 0,d.value=void 0,X.value=!1,D.value=null}function Oe(){i.value&&H(i.value)}function Ue(){C.value.push({attr:"",op:"=",type:"String",value:""}),N.value=!0}function Le(s){C.value.splice(s,1)}function $e(s){const a={};for(const n of $.table.keySchema)n.AttributeName&&(a[n.AttributeName]=s[n.AttributeName]);return a}function Pe(){const s={};for(const a of $.table.keySchema){if(!a.AttributeName)continue;const n=$.table.attributeDefinitions.find(m=>m.AttributeName===a.AttributeName);s[a.AttributeName]=(n==null?void 0:n.AttributeType)==="N"?0:""}return s}function Fe(){Z.value="create",U.value=Pe(),ee.value=null,Y.value=!0}function Je(s){Z.value="view",U.value=s,ee.value=null,Y.value=!0}function Ge(){U.value&&(ee.value=$e(U.value),Z.value="edit")}function Me(){if(!U.value)return;const s={...U.value};for(const a of $.table.keySchema){if(!a.AttributeName)continue;const n=$.table.attributeDefinitions.find(m=>m.AttributeName===a.AttributeName);s[a.AttributeName]=(n==null?void 0:n.AttributeType)==="N"?0:""}U.value=s,ee.value=null,Z.value="create"}function He(){U.value&&(se.value=$e(U.value),ie.value=!0)}async function Qe(){if(se.value)try{await K.deleteDynamoItem($.table.name,se.value),u.add({title:"Item deleted",variant:"info"}),Y.value=!1,await H()}catch(s){u.add({title:"Delete failed",description:s.message,variant:"danger"})}finally{ie.value=!1,se.value=null}}function We(){H()}const Q=q(()=>{const s=y.value.length,a=d.value??s,n=a>0?Math.round(s/a*100):100;return{returned:s,scanned:a,efficiency:n,finished:!i.value}});return H(),ve(()=>[z.value,x.value],()=>{y.value=[],i.value=void 0,d.value=void 0,X.value=!1}),(s,a)=>(r(),k(e(o),{direction:"vertical",gap:"1rem"},{default:t(()=>[l(e(P),{variant:"outline"},{header:t(()=>[...a[15]||(a[15]=[f("strong",null,"Scan or query items",-1)])]),footer:t(()=>[l(e(o),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[l(e(o),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[l(e(E),{variant:"solid",loading:T.value,onClick:a[8]||(a[8]=n=>H())},{default:t(()=>[...a[20]||(a[20]=[c("Run",-1)])]),_:1},8,["loading"]),l(e(E),{variant:"ghost",onClick:Ke},{default:t(()=>[...a[21]||(a[21]=[c("Reset",-1)])]),_:1})]),_:1}),l(e(o),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[a[22]||(a[22]=f("span",{class:"muted"},"Limit",-1)),l(e(L),{modelValue:V.value,"onUpdate:modelValue":a[9]||(a[9]=n=>V.value=n),modelModifiers:{number:!0},type:"number",size:"sm",style:{width:"6rem"}},null,8,["modelValue"])]),_:1})]),_:1})]),default:t(()=>[l(e(o),{direction:"vertical",gap:"1rem"},{default:t(()=>[f("div",dt,[l(e(Ze),{modelValue:z.value,"onUpdate:modelValue":a[0]||(a[0]=n=>z.value=n),options:Se,size:"md"},null,8,["modelValue"])]),l(e(o),{direction:"horizontal",gap:"1rem"},{default:t(()=>[l(e(B),{label:"Select a table or index",style:{flex:"1"}},{default:t(()=>[l(e(le),{modelValue:x.value,"onUpdate:modelValue":a[1]||(a[1]=n=>x.value=n),options:Ie.value},null,8,["modelValue","options"])]),_:1}),l(e(B),{label:"Select attribute projection",style:{flex:"1"}},{default:t(()=>[l(e(le),{"model-value":"All attributes",options:[{value:"All attributes",label:"All attributes"}],disabled:""})]),_:1})]),_:1}),z.value==="query"?(r(),R(G,{key:0},[l(e(we)),l(e(o),{direction:"vertical",gap:"0.5rem"},{default:t(()=>[a[16]||(a[16]=f("strong",{style:{"font-size":"0.9rem"}},"Partition key",-1)),l(e(o),{direction:"horizontal",gap:"1rem"},{default:t(()=>[l(e(B),{label:"Attribute",style:{flex:"1"}},{default:t(()=>[l(e(L),{"model-value":te.value||"—",disabled:""},null,8,["model-value"])]),_:1}),l(e(B),{label:"Value",style:{flex:"2"}},{default:t(()=>[l(e(L),{modelValue:v.value,"onUpdate:modelValue":a[2]||(a[2]=n=>v.value=n),placeholder:"Enter attribute value"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),F.value?(r(),k(e(o),{key:0,direction:"vertical",gap:"0.5rem"},{default:t(()=>[a[17]||(a[17]=f("strong",{style:{"font-size":"0.9rem"}},"Sort key – optional",-1)),l(e(o),{direction:"horizontal",gap:"0.75rem",align:"end"},{default:t(()=>[l(e(B),{label:"Attribute",style:{flex:"1.4"}},{default:t(()=>[l(e(L),{"model-value":F.value,disabled:""},null,8,["model-value"])]),_:1}),l(e(B),{label:"Value",style:{flex:"1.2","min-width":"11rem"}},{default:t(()=>[l(e(le),{modelValue:w.value,"onUpdate:modelValue":a[3]||(a[3]=n=>w.value=n),options:Ae},null,8,["modelValue"])]),_:1}),l(e(L),{modelValue:_.value,"onUpdate:modelValue":a[4]||(a[4]=n=>_.value=n),placeholder:"Enter attribute value",style:{flex:"2"}},null,8,["modelValue"]),w.value==="between"?(r(),k(e(L),{key:0,modelValue:I.value,"onUpdate:modelValue":a[5]||(a[5]=n=>I.value=n),placeholder:"and value",style:{flex:"2"}},null,8,["modelValue"])):A("",!0),l(e(et),{modelValue:j.value,"onUpdate:modelValue":a[6]||(a[6]=n=>j.value=n),label:"Sort descending"},null,8,["modelValue"])]),_:1})]),_:1})):A("",!0)],64)):A("",!0),l(e(we)),l(e(o),{direction:"vertical",gap:"0.5rem"},{default:t(()=>[f("a",{href:"#",style:{"text-decoration":"none","font-weight":"600","font-size":"0.9rem"},onClick:a[7]||(a[7]=_e(n=>N.value=!N.value,["prevent"]))},b(N.value?"▼":"▶")+" Filters – optional ",1),N.value?(r(),k(e(o),{key:0,direction:"vertical",gap:"0.5rem"},{default:t(()=>[(r(!0),R(G,null,M(C.value,(n,m)=>(r(),k(e(o),{key:`f-${m}`,direction:"horizontal",gap:"0.5rem",align:"end"},{default:t(()=>[l(e(B),{label:"Attribute name",style:{flex:"1.4"}},{default:t(()=>[l(e(L),{modelValue:n.attr,"onUpdate:modelValue":h=>n.attr=h,placeholder:"Enter attribute name"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),l(e(B),{label:"Condition",style:{flex:"1.4"}},{default:t(()=>[l(e(le),{modelValue:n.op,"onUpdate:modelValue":h=>n.op=h,options:ze},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),l(e(B),{label:"Type",style:{flex:"0.9"}},{default:t(()=>[l(e(le),{modelValue:n.type,"onUpdate:modelValue":h=>n.type=h,options:Te},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),l(e(B),{label:"Value",style:{flex:"1.7"}},{default:t(()=>[l(e(L),{modelValue:n.value,"onUpdate:modelValue":h=>n.value=h,disabled:n.op==="attribute_exists"||n.op==="attribute_not_exists",placeholder:"Enter attribute value"},null,8,["modelValue","onUpdate:modelValue","disabled"])]),_:2},1024),l(e(E),{size:"sm",variant:"outline",onClick:h=>Le(m)},{default:t(()=>[...a[18]||(a[18]=[c("Remove",-1)])]),_:1},8,["onClick"])]),_:2},1024))),128)),f("div",null,[l(e(E),{size:"sm",variant:"outline",onClick:Ue},{default:t(()=>[...a[19]||(a[19]=[c("Add filter",-1)])]),_:1})])]),_:1})):A("",!0)]),_:1})]),_:1})]),_:1}),D.value?(r(),k(e(ne),{key:0,variant:"danger",dismissible:"",onDismiss:a[10]||(a[10]=n=>D.value=null)},{default:t(()=>[c(b(D.value),1)]),_:1})):A("",!0),X.value&&!D.value?(r(),k(e(ne),{key:1,variant:Q.value.finished?"success":"warning",dismissible:"",onDismiss:a[11]||(a[11]=n=>X.value=!1)},{default:t(()=>[l(e(o),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[f("span",null,[f("strong",null,b(Q.value.finished?"Completed":"Stopped"),1),a[23]||(a[23]=c(" · Items returned: ",-1)),f("strong",null,b(Q.value.returned),1),a[24]||(a[24]=c(" · Items scanned: ",-1)),f("strong",null,b(Q.value.scanned),1),a[25]||(a[25]=c(" · Efficiency: ",-1)),f("strong",null,b(Q.value.efficiency)+"%",1)]),Q.value.finished?A("",!0):(r(),k(e(E),{key:0,size:"sm",variant:"outline",loading:T.value,onClick:Oe},{default:t(()=>[...a[26]||(a[26]=[c(" Retrieve next page ",-1)])]),_:1},8,["loading"]))]),_:1})]),_:1},8,["variant"])):A("",!0),l(e(P),{variant:"outline"},{header:t(()=>[l(e(o),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[l(e(o),{direction:"vertical",gap:"0.125rem"},{default:t(()=>[f("strong",null,b(x.value?`Index: ${x.value} (${$.table.name})`:`Table: ${$.table.name}`)+" – Items returned ("+b(y.value.length)+") ",1),f("span",mt,b(z.value==="scan"?"Scan":"Query")+" started on "+b(p.value?p.value.toLocaleString():"—"),1)]),_:1}),l(e(o),{direction:"horizontal",gap:"0.5rem"},{default:t(()=>[l(e(E),{size:"sm",variant:"ghost",loading:T.value,onClick:a[12]||(a[12]=n=>H())},{default:t(()=>[...a[27]||(a[27]=[c("Refresh",-1)])]),_:1},8,["loading"]),l(e(E),{size:"sm",variant:"outline",onClick:Fe},{default:t(()=>[...a[28]||(a[28]=[c("Create item",-1)])]),_:1})]),_:1})]),_:1})]),default:t(()=>[T.value&&!y.value.length?(r(),R("div",vt,[l(e(Ve),{label:"Running..."})])):y.value.length?(r(),k(e(tt),{key:2,columns:De.value,rows:Ee.value},at({_:2},[M(ue.value,(n,m)=>({name:`cell-__attr__${n}`,fn:t(({row:h})=>[m===0?(r(),k(e(lt),{key:0,href:"#",class:"mono",onClick:_e(O=>Je(h.__raw),["prevent"])},{default:t(()=>[c(b(ce(h[`__attr__${n}`])),1)]),_:2},1032,["onClick"])):(r(),R("span",ft,b(ce(h[`__attr__${n}`])),1))])})),M(be.value,n=>({name:`cell-__attr__${n}`,fn:t(({row:m})=>[f("span",pt,b(ce(m[`__attr__${n}`])),1)])}))]),1032,["columns","rows"])):(r(),k(e(xe),{key:1,title:"No items",description:"Run the operation to load items."}))]),_:1}),l(ot,{open:Y.value,"onUpdate:open":a[13]||(a[13]=n=>Y.value=n),"table-name":$.table.name,mode:Z.value,item:U.value,"original-key":ee.value,onSaved:We,onRequestEdit:Ge,onRequestClone:Me,onRequestDelete:He},null,8,["open","table-name","mode","item","original-key"]),l(e(ye),{open:ie.value,"onUpdate:open":a[14]||(a[14]=n=>ie.value=n),title:"Delete item",description:`Delete this item from ${$.table.name}? This cannot be undone.`,"confirm-label":"Delete","cancel-label":"Cancel",tone:"danger",onConfirm:Qe},null,8,["open","description"])]),_:1}))}}),ct={key:0,class:"muted mono",style:{"font-size":"0.7rem"}},yt={key:1,class:"muted",style:{"font-size":"0.75rem"}},gt={class:"muted mono",style:{"font-size":"0.75rem"}},kt={class:"muted",style:{"font-size":"0.75rem"}},Nt=W({__name:"DynamoTableSettings",props:{table:{}},emits:["refresh"],setup(S,{emit:$}){const u=S,z=$,x=fe(),V=g(u.table.ttl.enabled),v=g(u.table.ttl.attributeName||""),w=g(!1),_=g(null);ve(()=>[u.table.ttl.enabled,u.table.ttl.attributeName],([C,N])=>{V.value=C,v.value=N||""});async function I(){if(V.value&&!v.value.trim()){_.value="Attribute name is required to enable TTL";return}w.value=!0,_.value=null;try{await K.setDynamoTtl(u.table.name,V.value,v.value.trim()||void 0),x.add({title:V.value?"TTL enabled":"TTL disabled",description:V.value?`Attribute: ${v.value}`:void 0,variant:"success"}),z("refresh")}catch(C){_.value=C.message||"Failed to update TTL"}finally{w.value=!1}}function j(C){return C<1024?`${C} B`:C<1024*1024?`${(C/1024).toFixed(1)} KB`:`${(C/(1024*1024)).toFixed(1)} MB`}return(C,N)=>(r(),k(e(o),{direction:"vertical",gap:"1rem"},{default:t(()=>[l(e(ge),{columns:4,gap:"0.75rem"},{default:t(()=>[l(e(oe),{label:"Items",value:u.table.itemCount,tone:"info"},null,8,["value"]),l(e(oe),{label:"Size",value:j(u.table.sizeBytes),tone:"neutral"},null,8,["value"]),l(e(oe),{label:"Status",value:u.table.status||"UNKNOWN",tone:u.table.status==="ACTIVE"?"success":"warning"},null,8,["value","tone"]),l(e(oe),{label:"Billing",value:u.table.billingMode||"—",tone:"neutral"},null,8,["value"])]),_:1}),l(e(P),{variant:"outline"},{header:t(()=>[...N[3]||(N[3]=[f("strong",null,"Time to Live (TTL)",-1)])]),default:t(()=>[_.value?(r(),k(e(ne),{key:0,variant:"danger",dismissible:"",onDismiss:N[0]||(N[0]=y=>_.value=null)},{default:t(()=>[c(b(_.value),1)]),_:1})):A("",!0),l(e(o),{direction:"vertical",gap:"0.75rem"},{default:t(()=>[N[5]||(N[5]=f("span",{class:"muted",style:{"font-size":"0.8rem"}}," When TTL is enabled, items are automatically deleted by DynamoDB after the timestamp in the configured attribute (epoch seconds). Items are eventually consistent and may take time to be removed. ",-1)),l(e(B),{label:"Enable TTL"},{default:t(()=>[l(e(nt),{modelValue:V.value,"onUpdate:modelValue":N[1]||(N[1]=y=>V.value=y)},null,8,["modelValue"])]),_:1}),l(e(B),{label:"Attribute name",hint:V.value?"Required when enabling TTL":"Disabled — value retained for reference"},{default:t(()=>[l(e(L),{modelValue:v.value,"onUpdate:modelValue":N[2]||(N[2]=y=>v.value=y),placeholder:"e.g. expiresAt",disabled:!V.value},null,8,["modelValue","disabled"])]),_:1},8,["hint"]),l(e(o),{direction:"horizontal",justify:"flex-end"},{default:t(()=>[l(e(E),{size:"sm",variant:"solid",loading:w.value,onClick:I},{default:t(()=>[...N[4]||(N[4]=[c(" Apply ",-1)])]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1}),l(e(P),{variant:"outline"},{header:t(()=>[...N[6]||(N[6]=[f("strong",null,"Streams",-1)])]),default:t(()=>[l(e(o),{direction:"vertical",gap:"0.5rem"},{default:t(()=>[l(e(o),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[l(e(J),{tone:u.table.streamEnabled?"success":"neutral",variant:"soft"},{default:t(()=>[c(b(u.table.streamEnabled?"Enabled":"Disabled"),1)]),_:1},8,["tone"]),u.table.streamViewType?(r(),k(e(ke),{key:0,size:"sm",variant:"soft"},{default:t(()=>[c(b(u.table.streamViewType),1)]),_:1})):A("",!0)]),_:1}),u.table.streamArn?(r(),R("span",ct,b(u.table.streamArn),1)):(r(),R("span",yt," Streams configuration is set at table creation time and cannot be changed from here. "))]),_:1})]),_:1}),l(e(P),{variant:"outline"},{header:t(()=>[...N[7]||(N[7]=[f("strong",null,"Identifier",-1)])]),default:t(()=>[l(e(o),{direction:"vertical",gap:"0.25rem"},{default:t(()=>[f("span",gt," ARN: "+b(u.table.arn||"—"),1),f("span",kt," Created: "+b(u.table.createdAt?new Date(u.table.createdAt).toLocaleString():"—"),1)]),_:1})]),_:1})]),_:1}))}}),$t={class:"mono",style:{"font-size":"0.8rem"}},wt={class:"mono"},_t=W({__name:"DynamoSeedPanel",props:{tableName:{},seedFile:{},seedItemCount:{},tableItemCount:{}},emits:["refresh"],setup(S,{emit:$}){const u=S,z=$,x=fe(),V=g(!1),v=g(!1),w=g(!1),_=g(!1),I=g(!1);async function j(){if(!V.value){V.value=!0;try{const y=await K.runSeed(u.tableName),i=y.results.reduce((p,T)=>p+(T.inserted||0),0),d=y.results.find(p=>p.skipped);d?x.add({title:"Seed skipped",description:`${u.tableName}: ${d.reason||"unknown reason"}`,variant:"warning"}):x.add({title:"Seed applied",description:`${i} item(s) inserted into ${u.tableName}`,variant:"success"}),z("refresh")}catch(y){x.add({title:"Seed failed",description:y.message,variant:"danger"})}finally{V.value=!1}}}async function C(){if(!w.value){w.value=!0;try{const i=(await K.clearSeed(u.tableName)).results.reduce((d,p)=>d+(p.deleted||0),0);x.add({title:"Table purged",description:`${i} item(s) removed from ${u.tableName}`,variant:"info"}),z("refresh")}catch(y){x.add({title:"Purge failed",description:y.message,variant:"danger"})}finally{w.value=!1,_.value=!1}}}async function N(){if(!v.value){v.value=!0;try{const i=(await K.clearSeed(u.tableName)).results.reduce((T,D)=>T+(D.deleted||0),0),p=(await K.runSeed(u.tableName)).results.reduce((T,D)=>T+(D.inserted||0),0);x.add({title:"Seed redone",description:`${i} removed, ${p} inserted in ${u.tableName}`,variant:"success"}),z("refresh")}catch(y){x.add({title:"Redo failed",description:y.message,variant:"danger"})}finally{v.value=!1,I.value=!1}}}return(y,i)=>(r(),k(e(o),{direction:"vertical",gap:"1rem"},{default:t(()=>[l(e(P),{variant:"outline"},{header:t(()=>[l(e(o),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>[i[4]||(i[4]=f("strong",null,"Seed file",-1)),l(e(J),{tone:"info",variant:"soft"},{default:t(()=>[c(b(S.seedItemCount)+" item"+b(S.seedItemCount===1?"":"s"),1)]),_:1})]),_:1})]),default:t(()=>[l(e(o),{direction:"vertical",gap:"0.5rem"},{default:t(()=>[l(e(o),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>[i[5]||(i[5]=f("span",{class:"muted"},"Path",-1)),f("span",$t,b(S.seedFile),1)]),_:1}),l(e(o),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>[i[6]||(i[6]=f("span",{class:"muted"},"Current rows in table",-1)),f("span",wt,b(S.tableItemCount),1)]),_:1})]),_:1})]),_:1}),l(e(P),{variant:"outline"},{header:t(()=>[...i[7]||(i[7]=[f("strong",null,"Actions",-1)])]),default:t(()=>[l(e(o),{direction:"vertical",gap:"0.75rem"},{default:t(()=>[l(e(o),{direction:"horizontal",justify:"space-between",align:"center",gap:"1rem"},{default:t(()=>[l(e(o),{direction:"vertical",gap:"0.125rem"},{default:t(()=>[...i[8]||(i[8]=[f("strong",null,"Apply seed",-1),f("span",{class:"muted",style:{"font-size":"0.825rem"}}," Inserts every item from the seed file. Existing items with the same key are overwritten. ",-1)])]),_:1}),l(e(E),{variant:"solid",loading:V.value,disabled:S.seedItemCount<=0,onClick:j},{default:t(()=>[...i[9]||(i[9]=[c(" Apply ",-1)])]),_:1},8,["loading","disabled"])]),_:1}),l(e(o),{direction:"horizontal",justify:"space-between",align:"center",gap:"1rem"},{default:t(()=>[l(e(o),{direction:"vertical",gap:"0.125rem"},{default:t(()=>[...i[10]||(i[10]=[f("strong",null,"Redo seed",-1),f("span",{class:"muted",style:{"font-size":"0.825rem"}}," Purges the table first, then re-applies the seed file. Use when stale rows are blocking a fresh load. ",-1)])]),_:1}),l(e(E),{variant:"soft",loading:v.value,disabled:S.seedItemCount<=0,onClick:i[0]||(i[0]=d=>I.value=!0)},{default:t(()=>[...i[11]||(i[11]=[c(" Redo ",-1)])]),_:1},8,["loading","disabled"])]),_:1}),l(e(o),{direction:"horizontal",justify:"space-between",align:"center",gap:"1rem"},{default:t(()=>[l(e(o),{direction:"vertical",gap:"0.125rem"},{default:t(()=>[...i[12]||(i[12]=[f("strong",null,"Purge table",-1),f("span",{class:"muted",style:{"font-size":"0.825rem"}}," Deletes every item currently in this table. The seed file is not touched. ",-1)])]),_:1}),l(e(E),{variant:"danger",loading:w.value,onClick:i[1]||(i[1]=d=>_.value=!0)},{default:t(()=>[...i[13]||(i[13]=[c(" Purge ",-1)])]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1}),l(e(ye),{open:_.value,"onUpdate:open":i[2]||(i[2]=d=>_.value=d),title:`Purge ${S.tableName}?`,description:`This deletes all ${S.tableItemCount} item(s) currently in the table. The seed file on disk is not affected.`,"confirm-label":"Purge","cancel-label":"Cancel","confirm-variant":"danger",onConfirm:C},null,8,["open","title","description"]),l(e(ye),{open:I.value,"onUpdate:open":i[3]||(i[3]=d=>I.value=d),title:`Redo seed for ${S.tableName}?`,description:`This purges all ${S.tableItemCount} current item(s), then re-applies ${S.seedItemCount} seeded item(s).`,"confirm-label":"Redo","cancel-label":"Cancel","confirm-variant":"danger",onConfirm:N},null,8,["open","title","description"])]),_:1}))}}),Vt={style:{"font-size":"1.1rem"}},xt={key:2,style:{display:"flex","justify-content":"center",padding:"2rem"}},Ct={style:{"padding-top":"1rem"}},St={style:{"padding-top":"1rem"}},At={class:"muted",style:{"font-size":"0.75rem"}},zt={class:"muted",style:{"font-size":"0.75rem"}},Tt={style:{"padding-top":"1rem"}},It={style:{"padding-top":"1rem"}},ht=W({__name:"DynamoTableDetail",props:{tableName:{}},emits:["back"],setup(S,{emit:$}){const u=S,z=$,x=rt(),V=Ce(),v=g(null),w=g(null),_=g(!0),I=g(null),j=["items","indexes","settings","seed"],C=q({get(){const y=String(x.query.tab||"");return j.includes(y)?y:"items"},set(y){V.replace({query:{...x.query,tab:y==="items"?void 0:y}})}});async function N(){_.value=!0;try{const[y,i]=await Promise.all([K.describeDynamoTable(u.tableName),K.listSeeds().catch(()=>({seedsDir:"",entries:[]}))]);v.value=y,w.value=i.entries.find(d=>d.tableName===u.tableName)||null,I.value=null}catch(y){I.value=y.message||"Failed to load table",v.value=null}finally{_.value=!1}}return it(N),ve(()=>u.tableName,N),(y,i)=>(r(),k(e(o),{direction:"vertical",gap:"1rem"},{default:t(()=>{var d;return[l(e(o),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[l(e(o),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>{var p;return[l(e(E),{size:"sm",variant:"ghost",onClick:i[0]||(i[0]=T=>z("back"))},{default:t(()=>[...i[3]||(i[3]=[c("← Tables",-1)])]),_:1}),f("strong",Vt,b(S.tableName),1),(p=v.value)!=null&&p.status?(r(),k(e(J),{key:0,tone:v.value.status==="ACTIVE"?"success":"warning",variant:"soft"},{default:t(()=>[c(b(v.value.status),1)]),_:1},8,["tone"])):A("",!0),w.value?(r(),k(e(J),{key:1,tone:"info",variant:"soft"},{default:t(()=>[c(" Seed: "+b(w.value.itemCount)+" item"+b(w.value.itemCount===1?"":"s"),1)]),_:1})):A("",!0)]}),_:1}),l(e(E),{size:"sm",variant:"ghost",loading:_.value,onClick:N},{default:t(()=>[...i[4]||(i[4]=[c("Refresh",-1)])]),_:1},8,["loading"])]),_:1}),(d=v.value)!=null&&d.warnings.length?(r(),k(e(o),{key:0,direction:"horizontal",gap:"0.375rem",wrap:""},{default:t(()=>[(r(!0),R(G,null,M(v.value.warnings,p=>(r(),k(e(J),{key:p,tone:"warning",variant:"soft"},{default:t(()=>[c("⚠ "+b(p),1)]),_:2},1024))),128))]),_:1})):A("",!0),I.value?(r(),k(e(ne),{key:1,variant:"danger",dismissible:"",onDismiss:i[1]||(i[1]=p=>I.value=null)},{default:t(()=>[c(b(I.value),1)]),_:1})):A("",!0),_.value&&!v.value?(r(),R("div",xt,[l(e(Ve),{label:"Loading table..."})])):v.value?(r(),k(e(st),{key:3,modelValue:C.value,"onUpdate:modelValue":i[2]||(i[2]=p=>C.value=p)},{default:t(()=>[l(e(ut),null,{default:t(()=>[l(e(de),{value:"items"},{default:t(()=>[...i[5]||(i[5]=[c("Items",-1)])]),_:1}),l(e(de),{value:"indexes"},{default:t(()=>[...i[6]||(i[6]=[c("Indexes",-1)])]),_:1}),l(e(de),{value:"settings"},{default:t(()=>[...i[7]||(i[7]=[c("Settings",-1)])]),_:1}),w.value?(r(),k(e(de),{key:0,value:"seed"},{default:t(()=>[...i[8]||(i[8]=[c("Seed",-1)])]),_:1})):A("",!0)]),_:1}),l(e(me),{value:"items"},{default:t(()=>[f("div",Ct,[l(bt,{table:v.value},null,8,["table"])])]),_:1}),l(e(me),{value:"indexes"},{default:t(()=>[f("div",St,[!v.value.gsis.length&&!v.value.lsis.length?(r(),k(e(xe),{key:0,title:"No secondary indexes",description:"This table has only the primary key."})):(r(),k(e(o),{key:1,direction:"vertical",gap:"1rem"},{default:t(()=>[v.value.gsis.length?(r(),k(e(ge),{key:0,columns:2,gap:"0.75rem"},{default:t(()=>[(r(!0),R(G,null,M(v.value.gsis,p=>(r(),k(e(P),{key:p.IndexName,variant:"outline"},{header:t(()=>[l(e(o),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[f("strong",null,b(p.IndexName),1),l(e(J),{tone:"info",variant:"soft"},{default:t(()=>[...i[9]||(i[9]=[c("GSI",-1)])]),_:1})]),_:2},1024)]),default:t(()=>[l(e(o),{direction:"vertical",gap:"0.5rem"},{default:t(()=>{var T;return[l(e(o),{direction:"horizontal",gap:"0.5rem",wrap:""},{default:t(()=>[(r(!0),R(G,null,M(p.KeySchema||[],D=>(r(),k(e(ke),{key:D.AttributeName,size:"sm",variant:"soft"},{default:t(()=>[c(b(D.AttributeName)+" ("+b(D.KeyType)+") ",1)]),_:2},1024))),128))]),_:2},1024),f("span",At," Projection: "+b(((T=p.Projection)==null?void 0:T.ProjectionType)||"—")+" · Items: "+b(p.ItemCount??"—")+" · Status: "+b(p.IndexStatus||"—"),1)]}),_:2},1024)]),_:2},1024))),128))]),_:1})):A("",!0),v.value.lsis.length?(r(),k(e(ge),{key:1,columns:2,gap:"0.75rem"},{default:t(()=>[(r(!0),R(G,null,M(v.value.lsis,p=>(r(),k(e(P),{key:p.IndexName,variant:"outline"},{header:t(()=>[l(e(o),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[f("strong",null,b(p.IndexName),1),l(e(J),{tone:"neutral",variant:"soft"},{default:t(()=>[...i[10]||(i[10]=[c("LSI",-1)])]),_:1})]),_:2},1024)]),default:t(()=>[l(e(o),{direction:"vertical",gap:"0.5rem"},{default:t(()=>{var T;return[l(e(o),{direction:"horizontal",gap:"0.5rem",wrap:""},{default:t(()=>[(r(!0),R(G,null,M(p.KeySchema||[],D=>(r(),k(e(ke),{key:D.AttributeName,size:"sm",variant:"soft"},{default:t(()=>[c(b(D.AttributeName)+" ("+b(D.KeyType)+") ",1)]),_:2},1024))),128))]),_:2},1024),f("span",zt," Projection: "+b(((T=p.Projection)==null?void 0:T.ProjectionType)||"—"),1)]}),_:2},1024)]),_:2},1024))),128))]),_:1})):A("",!0)]),_:1}))])]),_:1}),l(e(me),{value:"settings"},{default:t(()=>[f("div",Tt,[l(Nt,{table:v.value,onRefresh:N},null,8,["table"])])]),_:1}),w.value?(r(),k(e(me),{key:0,value:"seed"},{default:t(()=>[f("div",It,[l(_t,{"table-name":v.value.name,"seed-file":w.value.file,"seed-item-count":w.value.itemCount,"table-item-count":v.value.itemCount,onRefresh:N},null,8,["table-name","seed-file","seed-item-count","table-item-count"])])]),_:1})):A("",!0)]),_:1},8,["modelValue"])):A("",!0)]}),_:1}))}}),Et=W({__name:"DynamoTablePage",props:{tableName:{}},setup(S){const $=Ce();function u(){$.push("/dynamo")}return(z,x)=>(r(),k(ht,{"table-name":S.tableName,onBack:u},null,8,["table-name"]))}});export{Et as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as $,v as K,u as M,i as g,S as t,G as e,f as r,d as h,y as b,w as f,n,h as o,_ as p,m as c,E as u,K as w,k as _,R as G,B as N,Y as H,F as L,z as T,j as D,D as R,s as S,a as U,A as W,g as y}from"./index-
|
|
1
|
+
import{o as $,v as K,u as M,i as g,S as t,G as e,f as r,d as h,y as b,w as f,n,h as o,_ as p,m as c,E as u,K as w,k as _,R as G,B as N,Y as H,F as L,z as T,j as D,D as R,s as S,a as U,A as W,g as y}from"./index-D3WwZ4lY.js";const Y={key:0,style:{display:"flex","justify-content":"center",padding:"2rem"}},Z={class:"mono"},J={class:"mono",style:{"font-size":"0.8rem"}},X={class:"mono"},ee={class:"mono"},te={key:0,class:"muted"},ae={class:"mono",style:{"font-size":"0.75rem"}},ne={class:"mono",style:{"font-size":"0.75rem"}},se={style:{"font-size":"1.05rem"}},oe={class:"muted",style:{"font-size":"0.825rem"}},le=$({__name:"OverviewPage",setup(P){const v=b(null),d=b(null),k=b([]),m=b({tables:[],queues:[],topics:[],buckets:[]}),C=b(!0);let B=null;async function E(){try{const[i,a,s,l]=await Promise.all([h.checkHealth(),h.getConfig(),h.listServices(),h.listResources()]);v.value=i,d.value=a,k.value=s,m.value=l}catch(i){console.error("Overview load failed:",i)}finally{C.value=!1}}const F=y(()=>k.value.filter(i=>i.status==="running").length),I=y(()=>k.value.length),V=y(()=>{var i;return(i=v.value)!=null&&i.localstack?"success":"danger"}),O=y(()=>{var i,a;return!!((a=(i=v.value)==null?void 0:i.dynamoProxy)!=null&&a.enabled)}),z=y(()=>{var i,a;return!!((a=(i=v.value)==null?void 0:i.dynamoProxy)!=null&&a.running)}),j=y(()=>{var i;return!!((i=d.value)!=null&&i.autoPackage)}),x=y(()=>{var i;return!!((i=d.value)!=null&&i.persistence)}),Q=[{type:"SNS Topics",description:"Pub/sub fan-out for cross-service events",status:"covered",to:null},{type:"SQS Queues",description:"Async message queues with consumer monitoring",status:"covered",to:"/queues"},{type:"DynamoDB Tables",description:"Tables, indexes, items explorer and seeds",status:"covered",to:"/dynamo"},{type:"S3 Buckets",description:"Buckets, objects browser, upload/download, Lambda notifications",status:"covered",to:"/buckets"}];return K(()=>{E(),B=window.setInterval(E,15e3)}),M(()=>{B&&window.clearInterval(B)}),(i,a)=>(f(),g(e(r),{direction:"vertical",gap:"1.5rem"},{default:t(()=>[n(e(w),{variant:"outline",class:"overview-hero"},{default:t(()=>[n(e(r),{direction:"vertical",gap:"1rem"},{default:t(()=>[n(e(r),{direction:"horizontal",gap:"0.75rem",align:"center",wrap:""},{default:t(()=>[a[1]||(a[1]=o("span",{style:{"font-size":"1.75rem"}},"⚡",-1)),n(e(r),{direction:"vertical",gap:"0.125rem"},{default:t(()=>[...a[0]||(a[0]=[o("strong",{style:{"font-size":"1.5rem"}},"Local Serverless Stack",-1),o("span",{class:"muted"},"One LocalStack. Every microservice. Zero docker juggling.",-1)])]),_:1})]),_:1}),a[3]||(a[3]=o("p",{style:{"max-width":"70ch","line-height":"1.55"}}," A single control plane for your local serverless workflow. Register a Serverless Framework project and LSS parses its CloudFormation template, provisions the resources in a shared LocalStack instance, wires up event-source mappings, and gives you live visibility into every queue, table, and topic — without spinning up a separate LocalStack per service. ",-1)),n(e(r),{direction:"horizontal",gap:"0.5rem",wrap:""},{default:t(()=>[n(e(p),{tone:V.value,variant:"soft"},{default:t(()=>{var s;return[c(" LocalStack "+u((s=v.value)!=null&&s.localstack?"running":"offline"),1)]}),_:1},8,["tone"]),O.value?(f(),g(e(p),{key:0,tone:z.value?"success":"warning",variant:"soft"},{default:t(()=>[c(" Dynamo Proxy "+u(z.value?"on":"enabled (not listening)"),1)]),_:1},8,["tone"])):(f(),g(e(p),{key:1,tone:"neutral",variant:"soft"},{default:t(()=>[...a[2]||(a[2]=[c("Dynamo Proxy off",-1)])]),_:1})),n(e(p),{tone:j.value?"info":"neutral",variant:"soft"},{default:t(()=>[c(" Auto-package "+u(j.value?"on":"off"),1)]),_:1},8,["tone"]),n(e(p),{tone:x.value?"info":"neutral",variant:"soft"},{default:t(()=>[c(" Persistence "+u(x.value?"on":"off"),1)]),_:1},8,["tone"])]),_:1})]),_:1})]),_:1}),C.value&&!v.value?(f(),_("div",Y,[n(e(G),{label:"Loading overview..."})])):(f(),_(L,{key:1},[n(e(R),{columns:2,gap:"1rem"},{default:t(()=>[n(e(w),{variant:"outline"},{header:t(()=>[...a[4]||(a[4]=[o("strong",null,"Server status",-1)])]),default:t(()=>[n(e(r),{direction:"vertical",gap:"0.75rem"},{default:t(()=>[n(e(r),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>{var s;return[a[5]||(a[5]=o("span",{class:"muted"},"LocalStack",-1)),n(e(p),{tone:(s=v.value)!=null&&s.localstack?"success":"danger",variant:"soft"},{default:t(()=>{var l;return[c(u((l=v.value)!=null&&l.localstack?"Running":"Offline"),1)]}),_:1},8,["tone"])]}),_:1}),n(e(r),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>{var s,l;return[a[6]||(a[6]=o("span",{class:"muted"},"Endpoint",-1)),o("span",Z,u(((l=(s=d.value)==null?void 0:s.localstack)==null?void 0:l.endpoint)||"—"),1)]}),_:1}),n(e(r),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>{var s,l;return[a[7]||(a[7]=o("span",{class:"muted"},"Image",-1)),o("span",J,u(((l=(s=d.value)==null?void 0:s.localstack)==null?void 0:l.image)||"—"),1)]}),_:1}),n(e(r),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>[a[8]||(a[8]=o("span",{class:"muted"},"Mode",-1)),n(e(N),{size:"sm",variant:"soft"},{default:t(()=>{var s,l;return[c(u(((l=(s=d.value)==null?void 0:s.localstack)==null?void 0:l.mode)||"—"),1)]}),_:1})]),_:1}),n(e(H)),n(e(r),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>[a[10]||(a[10]=o("span",{class:"muted"},"Dynamo Proxy",-1)),n(e(r),{direction:"horizontal",gap:"0.375rem",align:"center"},{default:t(()=>[O.value?(f(),g(e(p),{key:0,tone:z.value?"success":"warning",variant:"soft"},{default:t(()=>{var s,l;return[c(u(z.value?`Listening :${(l=(s=v.value)==null?void 0:s.dynamoProxy)==null?void 0:l.port}`:"Enabled, not listening"),1)]}),_:1},8,["tone"])):(f(),g(e(p),{key:1,tone:"neutral",variant:"soft"},{default:t(()=>[...a[9]||(a[9]=[c("Disabled",-1)])]),_:1}))]),_:1})]),_:1}),n(e(r),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>[a[11]||(a[11]=o("span",{class:"muted"},"Auto-package",-1)),n(e(p),{tone:j.value?"info":"neutral",variant:"soft"},{default:t(()=>[c(u(j.value?"on":"off"),1)]),_:1},8,["tone"])]),_:1}),n(e(r),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>[a[12]||(a[12]=o("span",{class:"muted"},"Persistence",-1)),n(e(p),{tone:x.value?"info":"neutral",variant:"soft"},{default:t(()=>[c(u(x.value?"on":"off"),1)]),_:1},8,["tone"])]),_:1})]),_:1})]),_:1}),n(e(w),{variant:"outline"},{header:t(()=>[...a[13]||(a[13]=[o("strong",null,"LESC configuration",-1)])]),default:t(()=>[n(e(r),{direction:"vertical",gap:"0.75rem"},{default:t(()=>{var s;return[n(e(r),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>{var l;return[a[14]||(a[14]=o("span",{class:"muted"},"Default region",-1)),o("span",X,u(((l=d.value)==null?void 0:l.region)||"—"),1)]}),_:1}),n(e(r),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>{var l;return[a[15]||(a[15]=o("span",{class:"muted"},"Server port",-1)),o("span",ee,u(((l=d.value)==null?void 0:l.serverPort)||"—"),1)]}),_:1}),n(e(r),{direction:"horizontal",justify:"space-between",align:"start",wrap:""},{default:t(()=>[a[16]||(a[16]=o("span",{class:"muted"},"LocalStack services",-1)),n(e(r),{direction:"horizontal",gap:"0.25rem",wrap:"",justify:"flex-end"},{default:t(()=>{var l,q;return[(f(!0),_(L,null,T(((l=d.value)==null?void 0:l.services)||[],A=>(f(),g(e(N),{key:A,size:"sm",variant:"soft"},{default:t(()=>[c(u(A),1)]),_:2},1024))),128)),(((q=d.value)==null?void 0:q.services)||[]).length?D("",!0):(f(),_("span",te,"—"))]}),_:1})]),_:1}),n(e(r),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>{var l;return[a[17]||(a[17]=o("span",{class:"muted"},"Seeds dir",-1)),o("span",ae,u(((l=d.value)==null?void 0:l.seedsDir)||"—"),1)]}),_:1}),(s=d.value)!=null&&s.configPath?(f(),g(e(r),{key:0,direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>[a[18]||(a[18]=o("span",{class:"muted"},"Config file",-1)),o("span",ne,u(d.value.configPath),1)]),_:1})):D("",!0)]}),_:1})]),_:1})]),_:1}),n(e(R),{columns:5,gap:"1rem"},{default:t(()=>[n(e(S),{label:"Services running",value:`${F.value} / ${I.value}`,tone:"success"},null,8,["value"]),n(e(S),{label:"DynamoDB tables",value:m.value.tables.length,tone:"info"},null,8,["value"]),n(e(S),{label:"SQS queues",value:m.value.queues.length,tone:"warning"},null,8,["value"]),n(e(S),{label:"SNS topics",value:m.value.topics.length,tone:"info"},null,8,["value"]),n(e(S),{label:"S3 buckets",value:m.value.buckets.length,tone:"neutral"},null,8,["value"])]),_:1}),n(e(w),{variant:"outline"},{header:t(()=>[n(e(r),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>[...a[19]||(a[19]=[o("strong",null,"What's covered",-1),o("span",{class:"muted",style:{"font-size":"0.75rem"}}," Resource types LSS understands today ",-1)])]),_:1})]),default:t(()=>[n(e(R),{columns:2,gap:"0.75rem"},{default:t(()=>[(f(),_(L,null,T(Q,s=>n(e(w),{key:s.type,variant:"soft"},{default:t(()=>[n(e(r),{direction:"horizontal",gap:"0.75rem",align:"center",justify:"space-between"},{default:t(()=>[n(e(r),{direction:"vertical",gap:"0.125rem"},{default:t(()=>[n(e(r),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[o("span",se,u(s.status==="covered"?"✓":"⏳"),1),o("strong",null,u(s.type),1),n(e(p),{tone:s.status==="covered"?"success":"neutral",variant:"soft"},{default:t(()=>[c(u(s.status==="covered"?"Supported":"Planned"),1)]),_:2},1032,["tone"])]),_:2},1024),o("span",oe,u(s.description),1)]),_:2},1024),s.to?(f(),g(e(U),{key:0,to:s.to,style:{"text-decoration":"none"}},{default:t(()=>[n(e(W),{size:"sm",variant:"ghost"},{default:t(()=>[...a[20]||(a[20]=[c("Open →",-1)])]),_:1})]),_:1},8,["to"])):D("",!0)]),_:2},1024)]),_:2},1024)),64))]),_:1})]),_:1})],64))]),_:1}))}}),re=(P,v)=>{const d=P.__vccOpts||P;for(const[k,m]of v)d[k]=m;return d},ue=re(le,[["__scopeId","data-v-b8378960"]]);export{ue as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as te,w as i,i as c,G as e,f as m,S as t,n as a,K as P,Z as $,x as _e,p as M,j as b,h as f,A as w,m as r,k,F as D,z as J,t as we,E as d,_ as x,b as ee,R as ae,J as le,V as ze,X as Ve,Y as Ie,q as qe,y as p,g as X,d as Q,O as se,v as he,u as $e,Q as Ce,s as H,D as xe,T as Se,P as Y,C as Z,B as K,r as Ne,$ as Ae,I as Me,L as ne}from"./index-xSUtPJWt.js";const De={key:0,class:"muted mono",style:{"font-size":"0.75rem"}},Pe={key:0,style:{display:"flex","justify-content":"center",padding:"2rem"}},je=["onClick"],Ue={class:"mono",style:{"font-size":"0.8rem"}},Fe={class:"mono",style:{"font-size":"0.75rem"}},Te={class:"muted",style:{"font-size":"0.75rem"}},Oe={key:1,class:"muted",style:{"font-size":"0.75rem"}},Re={key:0,style:{padding:"0.75rem 1rem","border-top":"1px solid var(--tree-color-border, #e5e7eb)"}},Be={key:0},Qe={class:"mono",style:{"white-space":"pre-wrap","word-break":"break-word","font-size":"0.78rem",background:"var(--tree-color-surface-muted, #f6f7f9)",padding:"0.5rem","border-radius":"6px","max-height":"280px",overflow:"auto"}},Le=te({__name:"QueueSendReceivePanel",props:{queue:{}},emits:["refresh"],setup(O,{emit:L}){const z=O,j=L,V=se(),U=p(""),R=p(0),v=p("default"),C=p(""),I=p([]),S=p(!1),N=p(null),A=p(null),B=p(10),q=p(0),E=p(0),y=p([]),F=p(!1),o=p(null),n=p({}),g=p(!1),G=p(!1),W=p({}),ue=[{value:"String",label:"String"},{value:"Number",label:"Number"},{value:"Binary",label:"Binary"}],T=X(()=>z.queue.fifo),ie=[{key:"preview",label:"Body preview"},{key:"messageId",label:"Message ID"},{key:"sentAt",label:"Sent at"},{key:"attrs",label:"Attrs",align:"right"},{key:"actions",label:"",align:"right"}],oe=X(()=>y.value.map((u,l)=>{var s;return{__id:l,__raw:u,messageId:u.messageId||"—",preview:re(u.body),sentAt:de((s=u.attributes)==null?void 0:s.SentTimestamp),attrs:u.messageAttributes?Object.keys(u.messageAttributes).length:0}}));function re(u){if(!u)return"—";const l=u.replace(/\s+/g," ").trim();return l.length>80?`${l.slice(0,80)}…`:l}function de(u){if(!u)return"—";const l=Number(u);return l?new Date(l).toLocaleString():"—"}function me(){I.value.push({name:"",type:"String",value:""})}function fe(u){I.value.splice(u,1)}function ve(u){if(!u)return"";const l=u.trim();if(!(l.startsWith("{")||l.startsWith("[")))return u;try{return JSON.stringify(JSON.parse(l),null,2)}catch{return u}}function ge(u){W.value[u]=!W.value[u]}async function pe(){if(!U.value.trim()){N.value="Message body is required";return}S.value=!0,N.value=null;try{const u=I.value.filter(s=>s.name.trim()),l=await Q.sendQueueMessage(z.queue.name,{body:U.value,delaySeconds:T.value?void 0:R.value||void 0,messageAttributes:u.length?u:void 0,messageGroupId:T.value?v.value||"default":void 0,messageDeduplicationId:T.value&&C.value?C.value:void 0});A.value={messageId:l.messageId,sequenceNumber:l.sequenceNumber},V.add({title:"Message sent",description:l.messageId,variant:"success"}),j("refresh")}catch(u){N.value=u.message||"Failed to send message"}finally{S.value=!1}}async function ce(){F.value=!0,o.value=null;try{const u=await Q.receiveQueueMessages(z.queue.name,{maxNumberOfMessages:B.value,visibilityTimeout:E.value,waitTimeSeconds:q.value});y.value=u.messages,u.messages.length||V.add({title:"No messages available",description:"The queue returned an empty batch.",variant:"info"}),j("refresh")}catch(u){o.value=u.message||"Failed to poll messages"}finally{F.value=!1}}async function ye(u){if(!(!u.receiptHandle||!u.messageId)){n.value[u.messageId]=!0;try{await Q.deleteQueueMessage(z.queue.name,u.receiptHandle),y.value=y.value.filter(l=>l.messageId!==u.messageId),V.add({title:"Message deleted",variant:"success"}),j("refresh")}catch(l){V.add({title:"Failed to delete message",description:l.message,variant:"danger"})}finally{delete n.value[u.messageId]}}}async function be(){G.value=!0;try{await Q.purgeQueue(z.queue.name),y.value=[],V.add({title:"Queue purged",description:"All messages were removed. It can take up to 60s to fully clear.",variant:"warning"}),j("refresh")}catch(u){V.add({title:"Failed to purge queue",description:u.message,variant:"danger"})}finally{G.value=!1,g.value=!1}}function ke(u){var l;(l=navigator.clipboard)==null||l.writeText(u).then(()=>{V.add({title:"Copied to clipboard",variant:"info"})})}return(u,l)=>(i(),c(e(m),{direction:"vertical",gap:"1rem"},{default:t(()=>[a(e(P),{variant:"outline"},{header:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[l[14]||(l[14]=f("strong",null,"Send a message",-1)),T.value?(i(),c(e(x),{key:0,tone:"info",variant:"soft"},{default:t(()=>[...l[13]||(l[13]=[r("FIFO",-1)])]),_:1})):b("",!0)]),_:1})]),footer:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[a(e(w),{variant:"solid",loading:S.value,onClick:pe},{default:t(()=>[...l[18]||(l[18]=[r("Send message",-1)])]),_:1},8,["loading"]),a(e(w),{variant:"ghost",disabled:S.value,onClick:l[4]||(l[4]=s=>U.value="")},{default:t(()=>[...l[19]||(l[19]=[r("Clear",-1)])]),_:1},8,["disabled"])]),_:1}),A.value?(i(),k("span",De,[r(" Last sent: "+d(A.value.messageId)+" ",1),A.value.sequenceNumber?(i(),k(D,{key:0},[r(" · seq "+d(A.value.sequenceNumber),1)],64)):b("",!0)])):b("",!0)]),_:1})]),default:t(()=>[a(e(m),{direction:"vertical",gap:"0.75rem"},{default:t(()=>[a(e($),{label:"Message body",hint:"Plain text or JSON"},{default:t(()=>[a(e(_e),{modelValue:U.value,"onUpdate:modelValue":l[0]||(l[0]=s=>U.value=s),rows:6,placeholder:'{"event": "order.created", "orderId": "abc-123"}'},null,8,["modelValue"])]),_:1}),a(e(m),{direction:"horizontal",gap:"1rem"},{default:t(()=>[T.value?b("",!0):(i(),c(e($),{key:0,label:"Delay (seconds)",hint:"0–900",style:{flex:"1"}},{default:t(()=>[a(e(M),{modelValue:R.value,"onUpdate:modelValue":l[1]||(l[1]=s=>R.value=s),modelModifiers:{number:!0},type:"number",min:"0",max:"900"},null,8,["modelValue"])]),_:1})),T.value?(i(),c(e($),{key:1,label:"MessageGroupId",hint:"Required for FIFO. Defaults to 'default'.",style:{flex:"1"}},{default:t(()=>[a(e(M),{modelValue:v.value,"onUpdate:modelValue":l[2]||(l[2]=s=>v.value=s),placeholder:"default"},null,8,["modelValue"])]),_:1})):b("",!0),T.value?(i(),c(e($),{key:2,label:"MessageDeduplicationId",hint:"Optional if content-based dedup is on",style:{flex:"1"}},{default:t(()=>[a(e(M),{modelValue:C.value,"onUpdate:modelValue":l[3]||(l[3]=s=>C.value=s),placeholder:"auto"},null,8,["modelValue"])]),_:1})):b("",!0)]),_:1}),a(e(m),{direction:"vertical",gap:"0.5rem"},{default:t(()=>[a(e(m),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>[l[16]||(l[16]=f("strong",{style:{"font-size":"0.85rem"}},"Message attributes – optional",-1)),a(e(w),{size:"sm",variant:"outline",onClick:me},{default:t(()=>[...l[15]||(l[15]=[r("Add attribute",-1)])]),_:1})]),_:1}),(i(!0),k(D,null,J(I.value,(s,h)=>(i(),c(e(m),{key:`a-${h}`,direction:"horizontal",gap:"0.5rem",align:"end"},{default:t(()=>[a(e($),{label:"Name",style:{flex:"1.4"}},{default:t(()=>[a(e(M),{modelValue:s.name,"onUpdate:modelValue":_=>s.name=_,placeholder:"contentType"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),a(e($),{label:"Type",style:{flex:"0.9"}},{default:t(()=>[a(e(we),{modelValue:s.type,"onUpdate:modelValue":_=>s.type=_,options:ue},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),a(e($),{label:"Value",style:{flex:"2"}},{default:t(()=>[a(e(M),{modelValue:s.value,"onUpdate:modelValue":_=>s.value=_,placeholder:"application/json"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),a(e(w),{size:"sm",variant:"outline",onClick:_=>fe(h)},{default:t(()=>[...l[17]||(l[17]=[r("Remove",-1)])]),_:1},8,["onClick"])]),_:2},1024))),128))]),_:1})]),_:1})]),_:1}),N.value?(i(),c(e(ee),{key:0,variant:"danger",dismissible:"",onDismiss:l[5]||(l[5]=s=>N.value=null)},{default:t(()=>[r(d(N.value),1)]),_:1})):b("",!0),a(e(P),{variant:"outline"},{header:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[l[21]||(l[21]=f("strong",null,"Poll for messages",-1)),a(e(x),{tone:"warning",variant:"soft"},{default:t(()=>[...l[20]||(l[20]=[r(" Messages become invisible during the visibility timeout ",-1)])]),_:1})]),_:1})]),footer:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem"},{default:t(()=>[a(e(w),{variant:"solid",loading:F.value,onClick:ce},{default:t(()=>[...l[22]||(l[22]=[r("Poll messages",-1)])]),_:1},8,["loading"]),a(e(w),{variant:"ghost",disabled:!y.value.length,onClick:l[9]||(l[9]=s=>y.value=[])},{default:t(()=>[...l[23]||(l[23]=[r(" Clear results ",-1)])]),_:1},8,["disabled"])]),_:1}),a(e(w),{size:"sm",variant:"outline",tone:"danger",onClick:l[10]||(l[10]=s=>g.value=!0)},{default:t(()=>[...l[24]||(l[24]=[r(" Purge queue ",-1)])]),_:1})]),_:1})]),default:t(()=>[a(e(m),{direction:"horizontal",gap:"1rem"},{default:t(()=>[a(e($),{label:"Max messages",hint:"1–10",style:{flex:"1"}},{default:t(()=>[a(e(M),{modelValue:B.value,"onUpdate:modelValue":l[6]||(l[6]=s=>B.value=s),modelModifiers:{number:!0},type:"number",min:"1",max:"10"},null,8,["modelValue"])]),_:1}),a(e($),{label:"Visibility timeout (s)",hint:"0 keeps messages visible",style:{flex:"1"}},{default:t(()=>[a(e(M),{modelValue:E.value,"onUpdate:modelValue":l[7]||(l[7]=s=>E.value=s),modelModifiers:{number:!0},type:"number",min:"0"},null,8,["modelValue"])]),_:1}),a(e($),{label:"Wait time (s)",hint:"0–20 (long polling)",style:{flex:"1"}},{default:t(()=>[a(e(M),{modelValue:q.value,"onUpdate:modelValue":l[8]||(l[8]=s=>q.value=s),modelModifiers:{number:!0},type:"number",min:"0",max:"20"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),o.value?(i(),c(e(ee),{key:1,variant:"danger",dismissible:"",onDismiss:l[11]||(l[11]=s=>o.value=null)},{default:t(()=>[r(d(o.value),1)]),_:1})):b("",!0),a(e(P),{variant:"outline"},{header:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[f("strong",null,"Received messages ("+d(y.value.length)+")",1),l[25]||(l[25]=f("span",{class:"muted",style:{"font-size":"0.75rem"}}," Click a row to view the full body ",-1))]),_:1})]),default:t(()=>[F.value&&!y.value.length?(i(),k("div",Pe,[a(e(ae),{label:"Polling..."})])):y.value.length?(i(),c(e(ze),{key:2,columns:ie,rows:oe.value},{"cell-preview":t(({row:s})=>[f("a",{href:"#",style:{"text-decoration":"none"},onClick:Ve(h=>ge(String(s.messageId)),["prevent"])},[f("span",Ue,d(W.value[String(s.messageId)]?"▼":"▶")+" "+d(s.preview),1)],8,je)]),"cell-messageId":t(({row:s})=>[f("span",Fe,d(s.messageId),1)]),"cell-sentAt":t(({row:s})=>[f("span",Te,d(s.sentAt),1)]),"cell-attrs":t(({row:s})=>[Number(s.attrs)>0?(i(),c(e(x),{key:0,tone:"info",variant:"soft"},{default:t(()=>[r(d(s.attrs),1)]),_:2},1024)):(i(),k("span",Oe,"—"))]),"cell-actions":t(({row:s})=>[a(e(m),{direction:"horizontal",gap:"0.25rem",justify:"flex-end"},{default:t(()=>[a(e(w),{size:"sm",variant:"ghost",onClick:h=>ke(String(s.__raw.body||""))},{default:t(()=>[...l[26]||(l[26]=[r(" Copy ",-1)])]),_:1},8,["onClick"]),a(e(w),{size:"sm",variant:"outline",tone:"danger",loading:n.value[String(s.messageId)],onClick:h=>ye(s.__raw)},{default:t(()=>[...l[27]||(l[27]=[r(" Delete ",-1)])]),_:1},8,["loading","onClick"])]),_:2},1024)]),_:1},8,["rows"])):(i(),c(e(le),{key:1,title:"No messages loaded",description:"Use Poll messages to fetch a batch from the queue."})),(i(!0),k(D,null,J(y.value,s=>(i(),k(D,{key:`detail-${s.messageId}`},[s.messageId&&W.value[s.messageId]?(i(),k("div",Re,[a(e(m),{direction:"vertical",gap:"0.5rem"},{default:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",wrap:""},{default:t(()=>[a(e(x),{tone:"neutral",variant:"soft"},{default:t(()=>[r("id: "+d(s.messageId),1)]),_:2},1024),s.md5OfBody?(i(),c(e(x),{key:0,tone:"neutral",variant:"soft"},{default:t(()=>[r(" md5: "+d(s.md5OfBody.slice(0,12))+"… ",1)]),_:2},1024)):b("",!0),(i(!0),k(D,null,J(s.attributes||{},(h,_)=>(i(),c(e(x),{key:_,tone:"info",variant:"soft"},{default:t(()=>[r(d(_)+": "+d(h),1)]),_:2},1024))),128))]),_:2},1024),s.messageAttributes&&Object.keys(s.messageAttributes).length?(i(),k("div",Be,[l[28]||(l[28]=f("strong",{style:{"font-size":"0.8rem"}},"Message attributes",-1)),a(e(m),{direction:"horizontal",gap:"0.375rem",wrap:""},{default:t(()=>[(i(!0),k(D,null,J(s.messageAttributes,(h,_)=>(i(),c(e(x),{key:`ma-${_}`,tone:"success",variant:"soft"},{default:t(()=>[r(d(_)+" ("+d(h.type||"String")+"): "+d(h.value),1)]),_:2},1024))),128))]),_:2},1024)])):b("",!0),a(e(Ie)),f("pre",Qe,d(ve(s.body)),1)]),_:2},1024)])):b("",!0)],64))),128))]),_:1}),a(e(qe),{open:g.value,"onUpdate:open":l[12]||(l[12]=s=>g.value=s),title:"Purge queue",description:`Delete every message in '${z.queue.name}'? AWS rate-limits PurgeQueue to once every 60 seconds.`,"confirm-label":"Purge","cancel-label":"Cancel",tone:"danger",loading:G.value,onConfirm:be},null,8,["open","description","loading"])]),_:1}))}}),Ee={style:{"font-size":"1.1rem"}},Je={key:1,style:{display:"flex","justify-content":"center",padding:"2rem"}},Ge={style:{"padding-top":"1rem"}},We={style:{"padding-top":"1rem"}},He={class:"mono"},Ke={class:"muted",style:{"font-size":"0.75rem"}},Xe={style:{"padding-top":"1rem"}},Ye={class:"mono",style:{"font-size":"0.78rem"}},Ze={class:"mono",style:{"font-size":"0.78rem"}},et={class:"muted",style:{"font-size":"0.75rem"}},tt={class:"mono"},at=te({__name:"QueueDetail",props:{queueName:{}},emits:["back"],setup(O,{emit:L}){const z=O,j=L,V=Me(),U=ne(),R=se(),v=p(null),C=p(!0),I=p(null);let S=null;const N=["send-receive","consumers","attributes"],A=X({get(){const o=String(V.query.tab||"");return N.includes(o)?o:"send-receive"},set(o){U.replace({query:{...V.query,tab:o==="send-receive"?void 0:o}})}}),B=X(()=>{const o=v.value;if(!o)return 0;const n=o.available+o.inFlight+o.processed;return n?Math.round(o.processed/n*100):0});async function q(o=!0){o&&(C.value=!0);try{v.value=await Q.getQueue(z.queueName),I.value=null}catch(n){I.value=n.message||"Failed to load queue",v.value=null}finally{C.value=!1}}async function E(){if(v.value)try{await Q.resetQueueProcessed(v.value.name),R.add({title:"Processed counter reset",variant:"info"}),await q(!1)}catch(o){R.add({title:"Failed to reset counter",description:o.message,variant:"danger"})}}function y(o){return o===void 0?"—":o<60?`${o}s`:o<3600?`${Math.round(o/60)}m`:o<86400?`${Math.round(o/3600)}h`:`${Math.round(o/86400)}d`}function F(o){return o?new Date(o).toLocaleString():"—"}return he(()=>{q(),S=window.setInterval(()=>q(!1),4e3)}),$e(()=>{S&&window.clearInterval(S)}),Ce(()=>z.queueName,()=>q()),(o,n)=>(i(),c(e(m),{direction:"vertical",gap:"1rem"},{default:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>{var g;return[a(e(w),{size:"sm",variant:"ghost",onClick:n[0]||(n[0]=G=>j("back"))},{default:t(()=>[...n[5]||(n[5]=[r("← Queues",-1)])]),_:1}),f("strong",Ee,d(O.queueName),1),(g=v.value)!=null&&g.fifo?(i(),c(e(x),{key:0,tone:"info",variant:"soft"},{default:t(()=>[...n[6]||(n[6]=[r("FIFO",-1)])]),_:1})):b("",!0)]}),_:1}),a(e(w),{size:"sm",variant:"ghost",loading:C.value,onClick:n[1]||(n[1]=g=>q())},{default:t(()=>[...n[7]||(n[7]=[r("Refresh",-1)])]),_:1},8,["loading"])]),_:1}),I.value?(i(),c(e(ee),{key:0,variant:"danger",dismissible:"",onDismiss:n[2]||(n[2]=g=>I.value=null)},{default:t(()=>[r(d(I.value),1)]),_:1})):b("",!0),C.value&&!v.value?(i(),k("div",Je,[a(e(ae),{label:"Loading queue..."})])):v.value?(i(),k(D,{key:2},[a(e(xe),{columns:4,gap:"0.75rem"},{default:t(()=>[a(e(H),{label:"Available",value:v.value.available,tone:"warning"},null,8,["value"]),a(e(H),{label:"In flight",value:v.value.inFlight,tone:"info"},null,8,["value"]),a(e(H),{label:"Delayed",value:v.value.delayed,tone:"neutral"},null,8,["value"]),a(e(H),{label:"Processed (session)",value:v.value.processed,tone:"success"},null,8,["value"])]),_:1}),a(e(Ae),{modelValue:A.value,"onUpdate:modelValue":n[4]||(n[4]=g=>A.value=g)},{default:t(()=>[a(e(Se),null,{default:t(()=>[a(e(Y),{value:"send-receive"},{default:t(()=>[...n[8]||(n[8]=[r("Send & receive",-1)])]),_:1}),a(e(Y),{value:"consumers"},{default:t(()=>[...n[9]||(n[9]=[r("Consumers",-1)])]),_:1}),a(e(Y),{value:"attributes"},{default:t(()=>[...n[10]||(n[10]=[r("Attributes",-1)])]),_:1})]),_:1}),a(e(Z),{value:"send-receive"},{default:t(()=>[f("div",Ge,[a(Le,{queue:v.value,onRefresh:n[3]||(n[3]=g=>q(!1))},null,8,["queue"])])]),_:1}),a(e(Z),{value:"consumers"},{default:t(()=>[f("div",We,[a(e(P),{variant:"outline"},{header:t(()=>[...n[11]||(n[11]=[f("strong",null,"Lambda event-source mappings",-1)])]),default:t(()=>[v.value.consumers.length?(i(),c(e(m),{key:0,direction:"vertical",gap:"0.5rem"},{default:t(()=>[(i(!0),k(D,null,J(v.value.consumers,g=>(i(),c(e(P),{key:g.uuid||g.functionName,variant:"soft"},{default:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[a(e(m),{direction:"vertical",gap:"0.125rem"},{default:t(()=>[f("span",He,d(g.functionName),1),f("span",Ke," UUID: "+d(g.uuid||"—")+" · batch size "+d(g.batchSize??"—"),1)]),_:2},1024),a(e(x),{tone:g.enabled?"success":"neutral",variant:"soft"},{default:t(()=>[r(d(g.state||(g.enabled?"Enabled":"Disabled")),1)]),_:2},1032,["tone"])]),_:2},1024)]),_:2},1024))),128))]),_:1})):(i(),c(e(le),{key:1,title:"No consumers attached",description:"No Lambda event-source mapping currently points at this queue."}))]),_:1})])]),_:1}),a(e(Z),{value:"attributes"},{default:t(()=>[f("div",Xe,[a(e(m),{direction:"vertical",gap:"1rem"},{default:t(()=>[a(e(P),{variant:"outline"},{header:t(()=>[...n[12]||(n[12]=[f("strong",null,"Identity",-1)])]),default:t(()=>[a(e(m),{direction:"vertical",gap:"0.5rem"},{default:t(()=>[a(e(m),{direction:"horizontal",justify:"space-between",wrap:"",gap:"0.5rem"},{default:t(()=>[n[13]||(n[13]=f("span",{class:"muted"},"Queue URL",-1)),f("span",Ye,d(v.value.url),1)]),_:1}),a(e(m),{direction:"horizontal",justify:"space-between",wrap:"",gap:"0.5rem"},{default:t(()=>[n[14]||(n[14]=f("span",{class:"muted"},"ARN",-1)),f("span",Ze,d(v.value.arn||"—"),1)]),_:1})]),_:1})]),_:1}),a(e(P),{variant:"outline"},{header:t(()=>[...n[15]||(n[15]=[f("strong",null,"Configuration",-1)])]),footer:t(()=>[f("span",et," Created "+d(F(v.value.createdAt))+" · last polled "+d(F(v.value.lastPolledAt)),1)]),default:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",wrap:""},{default:t(()=>[a(e(K),{size:"sm",variant:"soft"},{default:t(()=>[r(" FIFO: "+d(v.value.fifo?"yes":"no"),1)]),_:1}),a(e(K),{size:"sm",variant:"soft"},{default:t(()=>[r(" Visibility timeout: "+d(y(v.value.visibilityTimeout)),1)]),_:1}),a(e(K),{size:"sm",variant:"soft"},{default:t(()=>[r(" Retention: "+d(y(v.value.messageRetentionPeriod)),1)]),_:1}),a(e(K),{size:"sm",variant:"soft"},{default:t(()=>[r(" Delayed: "+d(v.value.delayed),1)]),_:1})]),_:1})]),_:1}),a(e(P),{variant:"outline"},{header:t(()=>[...n[16]||(n[16]=[f("strong",null,"Throughput",-1)])]),footer:t(()=>[a(e(m),{direction:"horizontal",justify:"flex-end"},{default:t(()=>[a(e(w),{size:"sm",variant:"ghost",onClick:E},{default:t(()=>[...n[18]||(n[18]=[r(" Reset processed counter ",-1)])]),_:1})]),_:1})]),default:t(()=>[a(e(m),{direction:"vertical",gap:"0.5rem"},{default:t(()=>[a(e(m),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>[n[17]||(n[17]=f("span",{class:"muted"},"Processed share (this session)",-1)),f("span",tt,d(B.value)+"%",1)]),_:1}),a(e(Ne),{value:B.value},null,8,["value"])]),_:1})]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"])],64)):b("",!0)]),_:1}))}}),st=te({__name:"QueueDetailPage",props:{queueName:{}},setup(O){const L=ne();function z(){L.push("/queues")}return(j,V)=>(i(),c(at,{"queue-name":O.queueName,onBack:z},null,8,["queue-name"]))}});export{st as default};
|
|
1
|
+
import{o as te,w as i,i as c,G as e,f as m,S as t,n as a,K as P,Z as $,x as _e,p as M,j as b,h as f,A as w,m as r,k,F as D,z as J,t as we,E as d,_ as x,b as ee,R as ae,J as le,V as ze,X as Ve,Y as Ie,q as qe,y as p,g as X,d as Q,O as se,v as he,u as $e,Q as Ce,s as H,D as xe,T as Se,P as Y,C as Z,B as K,r as Ne,$ as Ae,I as Me,L as ne}from"./index-D3WwZ4lY.js";const De={key:0,class:"muted mono",style:{"font-size":"0.75rem"}},Pe={key:0,style:{display:"flex","justify-content":"center",padding:"2rem"}},je=["onClick"],Ue={class:"mono",style:{"font-size":"0.8rem"}},Fe={class:"mono",style:{"font-size":"0.75rem"}},Te={class:"muted",style:{"font-size":"0.75rem"}},Oe={key:1,class:"muted",style:{"font-size":"0.75rem"}},Re={key:0,style:{padding:"0.75rem 1rem","border-top":"1px solid var(--tree-color-border, #e5e7eb)"}},Be={key:0},Qe={class:"mono",style:{"white-space":"pre-wrap","word-break":"break-word","font-size":"0.78rem",background:"var(--tree-color-surface-muted, #f6f7f9)",padding:"0.5rem","border-radius":"6px","max-height":"280px",overflow:"auto"}},Le=te({__name:"QueueSendReceivePanel",props:{queue:{}},emits:["refresh"],setup(O,{emit:L}){const z=O,j=L,V=se(),U=p(""),R=p(0),v=p("default"),C=p(""),I=p([]),S=p(!1),N=p(null),A=p(null),B=p(10),q=p(0),E=p(0),y=p([]),F=p(!1),o=p(null),n=p({}),g=p(!1),G=p(!1),W=p({}),ue=[{value:"String",label:"String"},{value:"Number",label:"Number"},{value:"Binary",label:"Binary"}],T=X(()=>z.queue.fifo),ie=[{key:"preview",label:"Body preview"},{key:"messageId",label:"Message ID"},{key:"sentAt",label:"Sent at"},{key:"attrs",label:"Attrs",align:"right"},{key:"actions",label:"",align:"right"}],oe=X(()=>y.value.map((u,l)=>{var s;return{__id:l,__raw:u,messageId:u.messageId||"—",preview:re(u.body),sentAt:de((s=u.attributes)==null?void 0:s.SentTimestamp),attrs:u.messageAttributes?Object.keys(u.messageAttributes).length:0}}));function re(u){if(!u)return"—";const l=u.replace(/\s+/g," ").trim();return l.length>80?`${l.slice(0,80)}…`:l}function de(u){if(!u)return"—";const l=Number(u);return l?new Date(l).toLocaleString():"—"}function me(){I.value.push({name:"",type:"String",value:""})}function fe(u){I.value.splice(u,1)}function ve(u){if(!u)return"";const l=u.trim();if(!(l.startsWith("{")||l.startsWith("[")))return u;try{return JSON.stringify(JSON.parse(l),null,2)}catch{return u}}function ge(u){W.value[u]=!W.value[u]}async function pe(){if(!U.value.trim()){N.value="Message body is required";return}S.value=!0,N.value=null;try{const u=I.value.filter(s=>s.name.trim()),l=await Q.sendQueueMessage(z.queue.name,{body:U.value,delaySeconds:T.value?void 0:R.value||void 0,messageAttributes:u.length?u:void 0,messageGroupId:T.value?v.value||"default":void 0,messageDeduplicationId:T.value&&C.value?C.value:void 0});A.value={messageId:l.messageId,sequenceNumber:l.sequenceNumber},V.add({title:"Message sent",description:l.messageId,variant:"success"}),j("refresh")}catch(u){N.value=u.message||"Failed to send message"}finally{S.value=!1}}async function ce(){F.value=!0,o.value=null;try{const u=await Q.receiveQueueMessages(z.queue.name,{maxNumberOfMessages:B.value,visibilityTimeout:E.value,waitTimeSeconds:q.value});y.value=u.messages,u.messages.length||V.add({title:"No messages available",description:"The queue returned an empty batch.",variant:"info"}),j("refresh")}catch(u){o.value=u.message||"Failed to poll messages"}finally{F.value=!1}}async function ye(u){if(!(!u.receiptHandle||!u.messageId)){n.value[u.messageId]=!0;try{await Q.deleteQueueMessage(z.queue.name,u.receiptHandle),y.value=y.value.filter(l=>l.messageId!==u.messageId),V.add({title:"Message deleted",variant:"success"}),j("refresh")}catch(l){V.add({title:"Failed to delete message",description:l.message,variant:"danger"})}finally{delete n.value[u.messageId]}}}async function be(){G.value=!0;try{await Q.purgeQueue(z.queue.name),y.value=[],V.add({title:"Queue purged",description:"All messages were removed. It can take up to 60s to fully clear.",variant:"warning"}),j("refresh")}catch(u){V.add({title:"Failed to purge queue",description:u.message,variant:"danger"})}finally{G.value=!1,g.value=!1}}function ke(u){var l;(l=navigator.clipboard)==null||l.writeText(u).then(()=>{V.add({title:"Copied to clipboard",variant:"info"})})}return(u,l)=>(i(),c(e(m),{direction:"vertical",gap:"1rem"},{default:t(()=>[a(e(P),{variant:"outline"},{header:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[l[14]||(l[14]=f("strong",null,"Send a message",-1)),T.value?(i(),c(e(x),{key:0,tone:"info",variant:"soft"},{default:t(()=>[...l[13]||(l[13]=[r("FIFO",-1)])]),_:1})):b("",!0)]),_:1})]),footer:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[a(e(w),{variant:"solid",loading:S.value,onClick:pe},{default:t(()=>[...l[18]||(l[18]=[r("Send message",-1)])]),_:1},8,["loading"]),a(e(w),{variant:"ghost",disabled:S.value,onClick:l[4]||(l[4]=s=>U.value="")},{default:t(()=>[...l[19]||(l[19]=[r("Clear",-1)])]),_:1},8,["disabled"])]),_:1}),A.value?(i(),k("span",De,[r(" Last sent: "+d(A.value.messageId)+" ",1),A.value.sequenceNumber?(i(),k(D,{key:0},[r(" · seq "+d(A.value.sequenceNumber),1)],64)):b("",!0)])):b("",!0)]),_:1})]),default:t(()=>[a(e(m),{direction:"vertical",gap:"0.75rem"},{default:t(()=>[a(e($),{label:"Message body",hint:"Plain text or JSON"},{default:t(()=>[a(e(_e),{modelValue:U.value,"onUpdate:modelValue":l[0]||(l[0]=s=>U.value=s),rows:6,placeholder:'{"event": "order.created", "orderId": "abc-123"}'},null,8,["modelValue"])]),_:1}),a(e(m),{direction:"horizontal",gap:"1rem"},{default:t(()=>[T.value?b("",!0):(i(),c(e($),{key:0,label:"Delay (seconds)",hint:"0–900",style:{flex:"1"}},{default:t(()=>[a(e(M),{modelValue:R.value,"onUpdate:modelValue":l[1]||(l[1]=s=>R.value=s),modelModifiers:{number:!0},type:"number",min:"0",max:"900"},null,8,["modelValue"])]),_:1})),T.value?(i(),c(e($),{key:1,label:"MessageGroupId",hint:"Required for FIFO. Defaults to 'default'.",style:{flex:"1"}},{default:t(()=>[a(e(M),{modelValue:v.value,"onUpdate:modelValue":l[2]||(l[2]=s=>v.value=s),placeholder:"default"},null,8,["modelValue"])]),_:1})):b("",!0),T.value?(i(),c(e($),{key:2,label:"MessageDeduplicationId",hint:"Optional if content-based dedup is on",style:{flex:"1"}},{default:t(()=>[a(e(M),{modelValue:C.value,"onUpdate:modelValue":l[3]||(l[3]=s=>C.value=s),placeholder:"auto"},null,8,["modelValue"])]),_:1})):b("",!0)]),_:1}),a(e(m),{direction:"vertical",gap:"0.5rem"},{default:t(()=>[a(e(m),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>[l[16]||(l[16]=f("strong",{style:{"font-size":"0.85rem"}},"Message attributes – optional",-1)),a(e(w),{size:"sm",variant:"outline",onClick:me},{default:t(()=>[...l[15]||(l[15]=[r("Add attribute",-1)])]),_:1})]),_:1}),(i(!0),k(D,null,J(I.value,(s,h)=>(i(),c(e(m),{key:`a-${h}`,direction:"horizontal",gap:"0.5rem",align:"end"},{default:t(()=>[a(e($),{label:"Name",style:{flex:"1.4"}},{default:t(()=>[a(e(M),{modelValue:s.name,"onUpdate:modelValue":_=>s.name=_,placeholder:"contentType"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),a(e($),{label:"Type",style:{flex:"0.9"}},{default:t(()=>[a(e(we),{modelValue:s.type,"onUpdate:modelValue":_=>s.type=_,options:ue},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),a(e($),{label:"Value",style:{flex:"2"}},{default:t(()=>[a(e(M),{modelValue:s.value,"onUpdate:modelValue":_=>s.value=_,placeholder:"application/json"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),a(e(w),{size:"sm",variant:"outline",onClick:_=>fe(h)},{default:t(()=>[...l[17]||(l[17]=[r("Remove",-1)])]),_:1},8,["onClick"])]),_:2},1024))),128))]),_:1})]),_:1})]),_:1}),N.value?(i(),c(e(ee),{key:0,variant:"danger",dismissible:"",onDismiss:l[5]||(l[5]=s=>N.value=null)},{default:t(()=>[r(d(N.value),1)]),_:1})):b("",!0),a(e(P),{variant:"outline"},{header:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[l[21]||(l[21]=f("strong",null,"Poll for messages",-1)),a(e(x),{tone:"warning",variant:"soft"},{default:t(()=>[...l[20]||(l[20]=[r(" Messages become invisible during the visibility timeout ",-1)])]),_:1})]),_:1})]),footer:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem"},{default:t(()=>[a(e(w),{variant:"solid",loading:F.value,onClick:ce},{default:t(()=>[...l[22]||(l[22]=[r("Poll messages",-1)])]),_:1},8,["loading"]),a(e(w),{variant:"ghost",disabled:!y.value.length,onClick:l[9]||(l[9]=s=>y.value=[])},{default:t(()=>[...l[23]||(l[23]=[r(" Clear results ",-1)])]),_:1},8,["disabled"])]),_:1}),a(e(w),{size:"sm",variant:"outline",tone:"danger",onClick:l[10]||(l[10]=s=>g.value=!0)},{default:t(()=>[...l[24]||(l[24]=[r(" Purge queue ",-1)])]),_:1})]),_:1})]),default:t(()=>[a(e(m),{direction:"horizontal",gap:"1rem"},{default:t(()=>[a(e($),{label:"Max messages",hint:"1–10",style:{flex:"1"}},{default:t(()=>[a(e(M),{modelValue:B.value,"onUpdate:modelValue":l[6]||(l[6]=s=>B.value=s),modelModifiers:{number:!0},type:"number",min:"1",max:"10"},null,8,["modelValue"])]),_:1}),a(e($),{label:"Visibility timeout (s)",hint:"0 keeps messages visible",style:{flex:"1"}},{default:t(()=>[a(e(M),{modelValue:E.value,"onUpdate:modelValue":l[7]||(l[7]=s=>E.value=s),modelModifiers:{number:!0},type:"number",min:"0"},null,8,["modelValue"])]),_:1}),a(e($),{label:"Wait time (s)",hint:"0–20 (long polling)",style:{flex:"1"}},{default:t(()=>[a(e(M),{modelValue:q.value,"onUpdate:modelValue":l[8]||(l[8]=s=>q.value=s),modelModifiers:{number:!0},type:"number",min:"0",max:"20"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),o.value?(i(),c(e(ee),{key:1,variant:"danger",dismissible:"",onDismiss:l[11]||(l[11]=s=>o.value=null)},{default:t(()=>[r(d(o.value),1)]),_:1})):b("",!0),a(e(P),{variant:"outline"},{header:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[f("strong",null,"Received messages ("+d(y.value.length)+")",1),l[25]||(l[25]=f("span",{class:"muted",style:{"font-size":"0.75rem"}}," Click a row to view the full body ",-1))]),_:1})]),default:t(()=>[F.value&&!y.value.length?(i(),k("div",Pe,[a(e(ae),{label:"Polling..."})])):y.value.length?(i(),c(e(ze),{key:2,columns:ie,rows:oe.value},{"cell-preview":t(({row:s})=>[f("a",{href:"#",style:{"text-decoration":"none"},onClick:Ve(h=>ge(String(s.messageId)),["prevent"])},[f("span",Ue,d(W.value[String(s.messageId)]?"▼":"▶")+" "+d(s.preview),1)],8,je)]),"cell-messageId":t(({row:s})=>[f("span",Fe,d(s.messageId),1)]),"cell-sentAt":t(({row:s})=>[f("span",Te,d(s.sentAt),1)]),"cell-attrs":t(({row:s})=>[Number(s.attrs)>0?(i(),c(e(x),{key:0,tone:"info",variant:"soft"},{default:t(()=>[r(d(s.attrs),1)]),_:2},1024)):(i(),k("span",Oe,"—"))]),"cell-actions":t(({row:s})=>[a(e(m),{direction:"horizontal",gap:"0.25rem",justify:"flex-end"},{default:t(()=>[a(e(w),{size:"sm",variant:"ghost",onClick:h=>ke(String(s.__raw.body||""))},{default:t(()=>[...l[26]||(l[26]=[r(" Copy ",-1)])]),_:1},8,["onClick"]),a(e(w),{size:"sm",variant:"outline",tone:"danger",loading:n.value[String(s.messageId)],onClick:h=>ye(s.__raw)},{default:t(()=>[...l[27]||(l[27]=[r(" Delete ",-1)])]),_:1},8,["loading","onClick"])]),_:2},1024)]),_:1},8,["rows"])):(i(),c(e(le),{key:1,title:"No messages loaded",description:"Use Poll messages to fetch a batch from the queue."})),(i(!0),k(D,null,J(y.value,s=>(i(),k(D,{key:`detail-${s.messageId}`},[s.messageId&&W.value[s.messageId]?(i(),k("div",Re,[a(e(m),{direction:"vertical",gap:"0.5rem"},{default:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",wrap:""},{default:t(()=>[a(e(x),{tone:"neutral",variant:"soft"},{default:t(()=>[r("id: "+d(s.messageId),1)]),_:2},1024),s.md5OfBody?(i(),c(e(x),{key:0,tone:"neutral",variant:"soft"},{default:t(()=>[r(" md5: "+d(s.md5OfBody.slice(0,12))+"… ",1)]),_:2},1024)):b("",!0),(i(!0),k(D,null,J(s.attributes||{},(h,_)=>(i(),c(e(x),{key:_,tone:"info",variant:"soft"},{default:t(()=>[r(d(_)+": "+d(h),1)]),_:2},1024))),128))]),_:2},1024),s.messageAttributes&&Object.keys(s.messageAttributes).length?(i(),k("div",Be,[l[28]||(l[28]=f("strong",{style:{"font-size":"0.8rem"}},"Message attributes",-1)),a(e(m),{direction:"horizontal",gap:"0.375rem",wrap:""},{default:t(()=>[(i(!0),k(D,null,J(s.messageAttributes,(h,_)=>(i(),c(e(x),{key:`ma-${_}`,tone:"success",variant:"soft"},{default:t(()=>[r(d(_)+" ("+d(h.type||"String")+"): "+d(h.value),1)]),_:2},1024))),128))]),_:2},1024)])):b("",!0),a(e(Ie)),f("pre",Qe,d(ve(s.body)),1)]),_:2},1024)])):b("",!0)],64))),128))]),_:1}),a(e(qe),{open:g.value,"onUpdate:open":l[12]||(l[12]=s=>g.value=s),title:"Purge queue",description:`Delete every message in '${z.queue.name}'? AWS rate-limits PurgeQueue to once every 60 seconds.`,"confirm-label":"Purge","cancel-label":"Cancel",tone:"danger",loading:G.value,onConfirm:be},null,8,["open","description","loading"])]),_:1}))}}),Ee={style:{"font-size":"1.1rem"}},Je={key:1,style:{display:"flex","justify-content":"center",padding:"2rem"}},Ge={style:{"padding-top":"1rem"}},We={style:{"padding-top":"1rem"}},He={class:"mono"},Ke={class:"muted",style:{"font-size":"0.75rem"}},Xe={style:{"padding-top":"1rem"}},Ye={class:"mono",style:{"font-size":"0.78rem"}},Ze={class:"mono",style:{"font-size":"0.78rem"}},et={class:"muted",style:{"font-size":"0.75rem"}},tt={class:"mono"},at=te({__name:"QueueDetail",props:{queueName:{}},emits:["back"],setup(O,{emit:L}){const z=O,j=L,V=Me(),U=ne(),R=se(),v=p(null),C=p(!0),I=p(null);let S=null;const N=["send-receive","consumers","attributes"],A=X({get(){const o=String(V.query.tab||"");return N.includes(o)?o:"send-receive"},set(o){U.replace({query:{...V.query,tab:o==="send-receive"?void 0:o}})}}),B=X(()=>{const o=v.value;if(!o)return 0;const n=o.available+o.inFlight+o.processed;return n?Math.round(o.processed/n*100):0});async function q(o=!0){o&&(C.value=!0);try{v.value=await Q.getQueue(z.queueName),I.value=null}catch(n){I.value=n.message||"Failed to load queue",v.value=null}finally{C.value=!1}}async function E(){if(v.value)try{await Q.resetQueueProcessed(v.value.name),R.add({title:"Processed counter reset",variant:"info"}),await q(!1)}catch(o){R.add({title:"Failed to reset counter",description:o.message,variant:"danger"})}}function y(o){return o===void 0?"—":o<60?`${o}s`:o<3600?`${Math.round(o/60)}m`:o<86400?`${Math.round(o/3600)}h`:`${Math.round(o/86400)}d`}function F(o){return o?new Date(o).toLocaleString():"—"}return he(()=>{q(),S=window.setInterval(()=>q(!1),4e3)}),$e(()=>{S&&window.clearInterval(S)}),Ce(()=>z.queueName,()=>q()),(o,n)=>(i(),c(e(m),{direction:"vertical",gap:"1rem"},{default:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>{var g;return[a(e(w),{size:"sm",variant:"ghost",onClick:n[0]||(n[0]=G=>j("back"))},{default:t(()=>[...n[5]||(n[5]=[r("← Queues",-1)])]),_:1}),f("strong",Ee,d(O.queueName),1),(g=v.value)!=null&&g.fifo?(i(),c(e(x),{key:0,tone:"info",variant:"soft"},{default:t(()=>[...n[6]||(n[6]=[r("FIFO",-1)])]),_:1})):b("",!0)]}),_:1}),a(e(w),{size:"sm",variant:"ghost",loading:C.value,onClick:n[1]||(n[1]=g=>q())},{default:t(()=>[...n[7]||(n[7]=[r("Refresh",-1)])]),_:1},8,["loading"])]),_:1}),I.value?(i(),c(e(ee),{key:0,variant:"danger",dismissible:"",onDismiss:n[2]||(n[2]=g=>I.value=null)},{default:t(()=>[r(d(I.value),1)]),_:1})):b("",!0),C.value&&!v.value?(i(),k("div",Je,[a(e(ae),{label:"Loading queue..."})])):v.value?(i(),k(D,{key:2},[a(e(xe),{columns:4,gap:"0.75rem"},{default:t(()=>[a(e(H),{label:"Available",value:v.value.available,tone:"warning"},null,8,["value"]),a(e(H),{label:"In flight",value:v.value.inFlight,tone:"info"},null,8,["value"]),a(e(H),{label:"Delayed",value:v.value.delayed,tone:"neutral"},null,8,["value"]),a(e(H),{label:"Processed (session)",value:v.value.processed,tone:"success"},null,8,["value"])]),_:1}),a(e(Ae),{modelValue:A.value,"onUpdate:modelValue":n[4]||(n[4]=g=>A.value=g)},{default:t(()=>[a(e(Se),null,{default:t(()=>[a(e(Y),{value:"send-receive"},{default:t(()=>[...n[8]||(n[8]=[r("Send & receive",-1)])]),_:1}),a(e(Y),{value:"consumers"},{default:t(()=>[...n[9]||(n[9]=[r("Consumers",-1)])]),_:1}),a(e(Y),{value:"attributes"},{default:t(()=>[...n[10]||(n[10]=[r("Attributes",-1)])]),_:1})]),_:1}),a(e(Z),{value:"send-receive"},{default:t(()=>[f("div",Ge,[a(Le,{queue:v.value,onRefresh:n[3]||(n[3]=g=>q(!1))},null,8,["queue"])])]),_:1}),a(e(Z),{value:"consumers"},{default:t(()=>[f("div",We,[a(e(P),{variant:"outline"},{header:t(()=>[...n[11]||(n[11]=[f("strong",null,"Lambda event-source mappings",-1)])]),default:t(()=>[v.value.consumers.length?(i(),c(e(m),{key:0,direction:"vertical",gap:"0.5rem"},{default:t(()=>[(i(!0),k(D,null,J(v.value.consumers,g=>(i(),c(e(P),{key:g.uuid||g.functionName,variant:"soft"},{default:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[a(e(m),{direction:"vertical",gap:"0.125rem"},{default:t(()=>[f("span",He,d(g.functionName),1),f("span",Ke," UUID: "+d(g.uuid||"—")+" · batch size "+d(g.batchSize??"—"),1)]),_:2},1024),a(e(x),{tone:g.enabled?"success":"neutral",variant:"soft"},{default:t(()=>[r(d(g.state||(g.enabled?"Enabled":"Disabled")),1)]),_:2},1032,["tone"])]),_:2},1024)]),_:2},1024))),128))]),_:1})):(i(),c(e(le),{key:1,title:"No consumers attached",description:"No Lambda event-source mapping currently points at this queue."}))]),_:1})])]),_:1}),a(e(Z),{value:"attributes"},{default:t(()=>[f("div",Xe,[a(e(m),{direction:"vertical",gap:"1rem"},{default:t(()=>[a(e(P),{variant:"outline"},{header:t(()=>[...n[12]||(n[12]=[f("strong",null,"Identity",-1)])]),default:t(()=>[a(e(m),{direction:"vertical",gap:"0.5rem"},{default:t(()=>[a(e(m),{direction:"horizontal",justify:"space-between",wrap:"",gap:"0.5rem"},{default:t(()=>[n[13]||(n[13]=f("span",{class:"muted"},"Queue URL",-1)),f("span",Ye,d(v.value.url),1)]),_:1}),a(e(m),{direction:"horizontal",justify:"space-between",wrap:"",gap:"0.5rem"},{default:t(()=>[n[14]||(n[14]=f("span",{class:"muted"},"ARN",-1)),f("span",Ze,d(v.value.arn||"—"),1)]),_:1})]),_:1})]),_:1}),a(e(P),{variant:"outline"},{header:t(()=>[...n[15]||(n[15]=[f("strong",null,"Configuration",-1)])]),footer:t(()=>[f("span",et," Created "+d(F(v.value.createdAt))+" · last polled "+d(F(v.value.lastPolledAt)),1)]),default:t(()=>[a(e(m),{direction:"horizontal",gap:"0.5rem",wrap:""},{default:t(()=>[a(e(K),{size:"sm",variant:"soft"},{default:t(()=>[r(" FIFO: "+d(v.value.fifo?"yes":"no"),1)]),_:1}),a(e(K),{size:"sm",variant:"soft"},{default:t(()=>[r(" Visibility timeout: "+d(y(v.value.visibilityTimeout)),1)]),_:1}),a(e(K),{size:"sm",variant:"soft"},{default:t(()=>[r(" Retention: "+d(y(v.value.messageRetentionPeriod)),1)]),_:1}),a(e(K),{size:"sm",variant:"soft"},{default:t(()=>[r(" Delayed: "+d(v.value.delayed),1)]),_:1})]),_:1})]),_:1}),a(e(P),{variant:"outline"},{header:t(()=>[...n[16]||(n[16]=[f("strong",null,"Throughput",-1)])]),footer:t(()=>[a(e(m),{direction:"horizontal",justify:"flex-end"},{default:t(()=>[a(e(w),{size:"sm",variant:"ghost",onClick:E},{default:t(()=>[...n[18]||(n[18]=[r(" Reset processed counter ",-1)])]),_:1})]),_:1})]),default:t(()=>[a(e(m),{direction:"vertical",gap:"0.5rem"},{default:t(()=>[a(e(m),{direction:"horizontal",justify:"space-between",align:"center"},{default:t(()=>[n[17]||(n[17]=f("span",{class:"muted"},"Processed share (this session)",-1)),f("span",tt,d(B.value)+"%",1)]),_:1}),a(e(Ne),{value:B.value},null,8,["value"])]),_:1})]),_:1})]),_:1})])]),_:1})]),_:1},8,["modelValue"])],64)):b("",!0)]),_:1}))}}),st=te({__name:"QueueDetailPage",props:{queueName:{}},setup(O){const L=ne();function z(){L.push("/queues")}return(j,V)=>(i(),c(at,{"queue-name":O.queueName,onBack:z},null,8,["queue-name"]))}});export{st as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as z,L as $,v as P,u as j,w as i,i as d,G as t,f as m,S as a,n as s,D as q,s as _,b as D,m as r,E as u,j as A,K as T,k,R as U,J as E,V as J,_ as g,A as K,F as M,z as O,B as N,a as G,h as y,X,y as b,g as Q,d as x}from"./index-
|
|
1
|
+
import{o as z,L as $,v as P,u as j,w as i,i as d,G as t,f as m,S as a,n as s,D as q,s as _,b as D,m as r,E as u,j as A,K as T,k,R as U,J as E,V as J,_ as g,A as K,F as M,z as O,B as N,a as G,h as y,X,y as b,g as Q,d as x}from"./index-D3WwZ4lY.js";const H={key:0,style:{display:"flex","justify-content":"center",padding:"2rem"}},W=["onClick"],Y={class:"muted mono",style:{"font-size":"0.75rem"}},Z={key:1,class:"muted",style:{"font-size":"0.75rem"}},ee=z({__name:"QueuesView",setup(B){const F=$(),c=b([]),S=b({}),v=b(!0),f=b(null);let h=null;const R=[{key:"name",label:"Queue"},{key:"service",label:"Service"},{key:"available",label:"Available",align:"right"},{key:"inFlight",label:"In flight",align:"right"},{key:"processed",label:"Processed",align:"right"},{key:"consumers",label:"Consumers"},{key:"actions",label:"",align:"right"}],I=Q(()=>c.value.map(n=>({...n,consumersCount:n.consumers.length,service:S.value[n.name]||""}))),p=Q(()=>({queues:c.value.length,available:c.value.reduce((n,l)=>n+l.available,0),inFlight:c.value.reduce((n,l)=>n+l.inFlight,0),processed:c.value.reduce((n,l)=>n+l.processed,0)}));async function w(){try{const[n,l]=await Promise.all([x.listQueues(),x.listResourceOwners().catch(()=>({tables:[],queues:[],topics:[],buckets:[]}))]);c.value=n;const e={};for(const o of l.queues)e[o.name]=o.service;S.value=e,f.value=null}catch(n){f.value=n.message||"Failed to load queues"}finally{v.value=!1}}function C(n){F.push(`/queues/${encodeURIComponent(n)}`)}function L(n){return n.available>0?"warning":n.inFlight>0?"info":n.consumers.some(l=>l.enabled)?"success":"neutral"}function V(n){return n.available>0?"Backlog":n.inFlight>0?"Processing":n.consumers.length?"Idle":"No consumers"}return P(()=>{w(),h=window.setInterval(w,4e3)}),j(()=>{h&&window.clearInterval(h)}),(n,l)=>(i(),d(t(m),{direction:"vertical",gap:"1.25rem"},{default:a(()=>[s(t(q),{columns:4,gap:"1rem"},{default:a(()=>[s(t(_),{label:"Queues",value:p.value.queues,tone:"info",loading:v.value},null,8,["value","loading"]),s(t(_),{label:"Available messages",value:p.value.available,tone:"warning",loading:v.value},null,8,["value","loading"]),s(t(_),{label:"In flight",value:p.value.inFlight,tone:"info",loading:v.value},null,8,["value","loading"]),s(t(_),{label:"Processed",value:p.value.processed,tone:"success",loading:v.value},null,8,["value","loading"])]),_:1}),f.value?(i(),d(t(D),{key:0,variant:"danger",dismissible:"",onDismiss:l[0]||(l[0]=e=>f.value=null)},{default:a(()=>[r(u(f.value),1)]),_:1})):A("",!0),s(t(T),{variant:"outline"},{header:a(()=>[s(t(m),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:a(()=>[...l[1]||(l[1]=[y("strong",null,"SQS Queues",-1),y("span",{class:"muted"},"Live · refreshes every 4s",-1)])]),_:1})]),default:a(()=>[v.value?(i(),k("div",H,[s(t(U),{label:"Loading queues..."})])):c.value.length?(i(),d(t(J),{key:2,columns:R,rows:I.value},{"cell-name":a(({row:e})=>[s(t(m),{direction:"vertical",gap:"0.125rem"},{default:a(()=>[y("a",{href:"#",style:{"text-decoration":"none","font-weight":"600"},onClick:X(o=>C(String(e.name)),["prevent"])},u(e.name),9,W),y("span",Y,u(String(e.arn||e.url||"")),1)]),_:2},1024)]),"cell-service":a(({row:e})=>[e.service?(i(),d(t(G),{key:0,to:`/services/${encodeURIComponent(String(e.service))}`,style:{"text-decoration":"none"}},{default:a(()=>[s(t(N),{size:"sm",variant:"soft",clickable:""},{default:a(()=>[r(u(e.service),1)]),_:2},1024)]),_:2},1032,["to"])):(i(),k("span",Z,"unmanaged"))]),"cell-available":a(({row:e})=>[s(t(g),{tone:Number(e.available)>0?"warning":"neutral",variant:"soft"},{default:a(()=>[r(u(e.available),1)]),_:2},1032,["tone"])]),"cell-inFlight":a(({row:e})=>[s(t(g),{tone:Number(e.inFlight)>0?"info":"neutral",variant:"soft"},{default:a(()=>[r(u(e.inFlight),1)]),_:2},1032,["tone"])]),"cell-processed":a(({row:e})=>[s(t(g),{tone:"success",variant:"soft"},{default:a(()=>[r(u(e.processed),1)]),_:2},1024)]),"cell-consumers":a(({row:e})=>[s(t(m),{direction:"horizontal",gap:"0.25rem",wrap:""},{default:a(()=>[e.consumers.length?(i(!0),k(M,{key:0},O(e.consumers,o=>(i(),d(t(N),{key:o.uuid||o.functionName,size:"sm",variant:o.enabled?"solid":"outline"},{default:a(()=>[r(u(o.functionName),1)]),_:2},1032,["variant"]))),128)):(i(),d(t(g),{key:1,tone:"neutral",variant:"soft"},{default:a(()=>[...l[2]||(l[2]=[r("No consumers",-1)])]),_:1}))]),_:2},1024)]),"cell-actions":a(({row:e})=>[s(t(m),{direction:"horizontal",gap:"0.375rem",justify:"flex-end"},{default:a(()=>[s(t(g),{tone:L(e),variant:"solid"},{default:a(()=>[r(u(V(e)),1)]),_:2},1032,["tone"]),s(t(K),{size:"sm",variant:"ghost",onClick:o=>C(String(e.name))},{default:a(()=>[...l[3]||(l[3]=[r(" Open ",-1)])]),_:1},8,["onClick"])]),_:2},1024)]),_:1},8,["rows"])):(i(),d(t(E),{key:1,title:"No queues found",description:"Register a microservice that defines SQS resources or create queues directly in LocalStack."}))]),_:1})]),_:1}))}}),ne=z({__name:"QueuesPage",setup(B){return(F,c)=>(i(),d(ee))}});export{ne as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as ne,v as le,u as se,Q as oe,i as m,S as t,G as e,f as l,d as q,y as g,w as o,n,a as P,A as L,m as d,h as v,E as u,_,j as y,b as re,k,R as ie,s as x,D as ue,K as A,J as de,F as z,z as D,B as $,a0 as ve,q as ce,g as fe,O as me,L as pe}from"./index-xSUtPJWt.js";const ge={style:{"font-size":"1.1rem"}},ye={key:1,style:{display:"flex","justify-content":"center",padding:"2rem"}},be={class:"mono"},we={class:"mono"},_e={class:"mono"},ke={class:"mono"},ze={class:"muted"},he={class:"muted"},Se={class:"muted"},Ne={class:"muted"},Le={class:"muted"},De={class:"muted"},$e={class:"logs-pre"},je=ne({__name:"ServiceDetailPage",props:{serviceName:{}},setup(B){const p=B,G=pe(),h=me(),f=g(null),R=g(!0),C=g(null),T=g(!1),F=g(!1),U=g(!1),E=g([]),Q=g("stopped");let b=null,V=null;const O=g(!1),r=fe(()=>{var a;const i={lambda:[],dynamodb:[],sqs:[],sns:[],s3:[],"event-source":[]};for(const s of((a=f.value)==null?void 0:a.resources)||[])i[s.type]||(i[s.type]=[]),i[s.type].push(s);return i});async function S(){R.value=!0;try{f.value=await q.getService(p.serviceName),C.value=null}catch(i){C.value=i.message||"Service not found",f.value=null}finally{R.value=!1}}async function H(){if(!T.value){T.value=!0;try{await q.startService(p.serviceName),h.add({title:"Service started",description:p.serviceName,variant:"success"}),await S()}catch(i){h.add({title:"Failed to start",description:i.message,variant:"danger"})}finally{T.value=!1}}}async function W(){if(!F.value){F.value=!0;try{await q.stopService(p.serviceName),h.add({title:"Service stopped",description:p.serviceName,variant:"info"}),await S()}catch(i){h.add({title:"Failed to stop",description:i.message,variant:"danger"})}finally{F.value=!1}}}async function J(){try{const i=await q.getServiceLogs(p.serviceName);E.value=i.logs||[],Q.value=i.status||"stopped"}catch(i){console.error("Failed to fetch logs:",i)}}function X(){U.value=!0,J(),b&&window.clearInterval(b),b=window.setInterval(J,2e3)}function Y(){U.value=!1,b&&window.clearInterval(b),b=null}async function Z(){try{await q.deleteService(p.serviceName),h.add({title:"Service deleted",description:p.serviceName,variant:"info"}),G.push("/services")}catch(i){h.add({title:"Failed to delete",description:i.message,variant:"danger"})}finally{O.value=!1}}function ee(i){switch(i){case"running":return"success";case"registered":return"warning";case"stopped":return"neutral";default:return"danger"}}function te(i){return i?new Date(i).toLocaleString():"—"}return le(()=>{S(),V=window.setInterval(S,1e4)}),se(()=>{V&&window.clearInterval(V),b&&window.clearInterval(b)}),oe(()=>p.serviceName,S),(i,a)=>(o(),m(e(l),{direction:"vertical",gap:"1.25rem"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>{var s;return[n(e(P),{to:"/services",style:{"text-decoration":"none"}},{default:t(()=>[n(e(L),{size:"sm",variant:"ghost"},{default:t(()=>[...a[5]||(a[5]=[d("← Services",-1)])]),_:1})]),_:1}),v("strong",ge,u(B.serviceName),1),(s=f.value)!=null&&s.status?(o(),m(e(_),{key:0,tone:ee(f.value.status),variant:"soft"},{default:t(()=>[d(u(f.value.status),1)]),_:1},8,["tone"])):y("",!0)]}),_:1}),n(e(l),{direction:"horizontal",gap:"0.375rem"},{default:t(()=>{var s,w;return[n(e(L),{size:"sm",variant:"soft",disabled:((s=f.value)==null?void 0:s.status)==="running",loading:T.value,onClick:H},{default:t(()=>[...a[6]||(a[6]=[d(" Start ",-1)])]),_:1},8,["disabled","loading"]),n(e(L),{size:"sm",variant:"soft",disabled:((w=f.value)==null?void 0:w.status)!=="running",loading:F.value,onClick:W},{default:t(()=>[...a[7]||(a[7]=[d(" Stop ",-1)])]),_:1},8,["disabled","loading"]),n(e(L),{size:"sm",variant:"ghost",onClick:X},{default:t(()=>[...a[8]||(a[8]=[d("Logs",-1)])]),_:1}),n(e(L),{size:"sm",variant:"ghost",loading:R.value,onClick:S},{default:t(()=>[...a[9]||(a[9]=[d("Refresh",-1)])]),_:1},8,["loading"]),n(e(L),{size:"sm",variant:"danger",onClick:a[0]||(a[0]=N=>O.value=!0)},{default:t(()=>[...a[10]||(a[10]=[d("Delete",-1)])]),_:1})]}),_:1})]),_:1}),C.value?(o(),m(e(re),{key:0,variant:"danger",dismissible:"",onDismiss:a[1]||(a[1]=s=>C.value=null)},{default:t(()=>[d(u(C.value),1)]),_:1})):y("",!0),R.value&&!f.value?(o(),k("div",ye,[n(e(ie),{label:"Loading service..."})])):f.value?(o(),k(z,{key:2},[n(e(ue),{columns:5,gap:"1rem"},{default:t(()=>{var s,w,N,j,I;return[n(e(x),{label:"Lambdas",value:((s=r.value.lambda)==null?void 0:s.length)||0,tone:"info"},null,8,["value"]),n(e(x),{label:"Tables",value:((w=r.value.dynamodb)==null?void 0:w.length)||0,tone:"info"},null,8,["value"]),n(e(x),{label:"Queues",value:((N=r.value.sqs)==null?void 0:N.length)||0,tone:"warning"},null,8,["value"]),n(e(x),{label:"Topics",value:((j=r.value.sns)==null?void 0:j.length)||0,tone:"info"},null,8,["value"]),n(e(x),{label:"Buckets",value:((I=r.value.s3)==null?void 0:I.length)||0,tone:"neutral"},null,8,["value"])]}),_:1}),n(e(A),{variant:"outline"},{header:t(()=>[...a[11]||(a[11]=[v("strong",null,"Metadata",-1)])]),default:t(()=>[n(e(l),{direction:"vertical",gap:"0.5rem"},{default:t(()=>[n(e(l),{direction:"horizontal",justify:"space-between"},{default:t(()=>[a[12]||(a[12]=v("span",{class:"muted"},"Path",-1)),v("span",be,u(f.value.root),1)]),_:1}),n(e(l),{direction:"horizontal",justify:"space-between"},{default:t(()=>[a[13]||(a[13]=v("span",{class:"muted"},"Region",-1)),v("span",we,u(f.value.region||"—"),1)]),_:1}),n(e(l),{direction:"horizontal",justify:"space-between"},{default:t(()=>[a[14]||(a[14]=v("span",{class:"muted"},"Invoke port",-1)),v("span",_e,u(f.value.invokePort??"—"),1)]),_:1}),n(e(l),{direction:"horizontal",justify:"space-between"},{default:t(()=>[a[15]||(a[15]=v("span",{class:"muted"},"PID",-1)),v("span",ke,u(f.value.pid??"—"),1)]),_:1}),n(e(l),{direction:"horizontal",justify:"space-between"},{default:t(()=>[a[16]||(a[16]=v("span",{class:"muted"},"Last updated",-1)),v("span",null,u(te(f.value.lastUpdated)),1)]),_:1})]),_:1})]),_:1}),n(e(A),{variant:"outline"},{header:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[a[17]||(a[17]=v("strong",null,"Declared resources",-1)),n(e(_),{tone:"neutral",variant:"soft"},{default:t(()=>{var s;return[d(u(((s=f.value.resources)==null?void 0:s.length)||0)+" total ",1)]}),_:1})]),_:1})]),default:t(()=>{var s;return[(s=f.value.resources)!=null&&s.length?(o(),m(e(l),{key:1,direction:"vertical",gap:"1rem"},{default:t(()=>{var w,N,j,I,K,M;return[(w=r.value.dynamodb)!=null&&w.length?(o(),m(e(l),{key:0,direction:"vertical",gap:"0.5rem"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[n(e(_),{tone:"info",variant:"soft"},{default:t(()=>[...a[18]||(a[18]=[d("DynamoDB tables",-1)])]),_:1}),v("span",ze,u(r.value.dynamodb.length),1)]),_:1}),n(e(l),{direction:"horizontal",gap:"0.375rem",wrap:""},{default:t(()=>[(o(!0),k(z,null,D(r.value.dynamodb,c=>(o(),m(e(P),{key:`db-${c.name}`,to:`/dynamo/${encodeURIComponent(c.name)}`,style:{"text-decoration":"none"}},{default:t(()=>[n(e($),{size:"sm",variant:"soft",clickable:""},{default:t(()=>[d(u(c.name),1)]),_:2},1024)]),_:2},1032,["to"]))),128))]),_:1})]),_:1})):y("",!0),(N=r.value.sqs)!=null&&N.length?(o(),m(e(l),{key:1,direction:"vertical",gap:"0.5rem"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[n(e(_),{tone:"warning",variant:"soft"},{default:t(()=>[...a[19]||(a[19]=[d("SQS queues",-1)])]),_:1}),v("span",he,u(r.value.sqs.length),1)]),_:1}),n(e(l),{direction:"horizontal",gap:"0.375rem",wrap:""},{default:t(()=>[(o(!0),k(z,null,D(r.value.sqs,c=>(o(),m(e(P),{key:`q-${c.name}`,to:"/queues",style:{"text-decoration":"none"}},{default:t(()=>[n(e($),{size:"sm",variant:"soft",clickable:""},{default:t(()=>[d(u(c.name),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1})):y("",!0),(j=r.value.sns)!=null&&j.length?(o(),m(e(l),{key:2,direction:"vertical",gap:"0.5rem"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[n(e(_),{tone:"info",variant:"soft"},{default:t(()=>[...a[20]||(a[20]=[d("SNS topics",-1)])]),_:1}),v("span",Se,u(r.value.sns.length),1)]),_:1}),n(e(l),{direction:"horizontal",gap:"0.375rem",wrap:""},{default:t(()=>[(o(!0),k(z,null,D(r.value.sns,c=>(o(),m(e($),{key:`t-${c.name}`,size:"sm",variant:"soft"},{default:t(()=>[d(u(c.name),1)]),_:2},1024))),128))]),_:1})]),_:1})):y("",!0),(I=r.value.s3)!=null&&I.length?(o(),m(e(l),{key:3,direction:"vertical",gap:"0.5rem"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[n(e(_),{tone:"neutral",variant:"soft"},{default:t(()=>[...a[21]||(a[21]=[d("S3 buckets",-1)])]),_:1}),v("span",Ne,u(r.value.s3.length),1)]),_:1}),n(e(l),{direction:"horizontal",gap:"0.375rem",wrap:""},{default:t(()=>[(o(!0),k(z,null,D(r.value.s3,c=>(o(),m(e(P),{key:`b-${c.name}`,to:`/buckets/${encodeURIComponent(c.name)}`,style:{"text-decoration":"none"}},{default:t(()=>[n(e($),{size:"sm",variant:"soft",clickable:""},{default:t(()=>[d(u(c.name),1)]),_:2},1024)]),_:2},1032,["to"]))),128))]),_:1})]),_:1})):y("",!0),(K=r.value.lambda)!=null&&K.length?(o(),m(e(l),{key:4,direction:"vertical",gap:"0.5rem"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[n(e(_),{tone:"neutral",variant:"soft"},{default:t(()=>[...a[22]||(a[22]=[d("Lambda functions",-1)])]),_:1}),v("span",Le,u(r.value.lambda.length),1)]),_:1}),n(e(l),{direction:"horizontal",gap:"0.375rem",wrap:""},{default:t(()=>[(o(!0),k(z,null,D(r.value.lambda,c=>(o(),m(e($),{key:`l-${c.name}`,size:"sm",variant:"soft"},{default:t(()=>[d(" λ "+u(c.name),1)]),_:2},1024))),128))]),_:1})]),_:1})):y("",!0),(M=r.value["event-source"])!=null&&M.length?(o(),m(e(l),{key:5,direction:"vertical",gap:"0.5rem"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[n(e(_),{tone:"neutral",variant:"soft"},{default:t(()=>[...a[23]||(a[23]=[d("Event-source mappings",-1)])]),_:1}),v("span",De,u(r.value["event-source"].length),1)]),_:1}),n(e(l),{direction:"horizontal",gap:"0.375rem",wrap:""},{default:t(()=>[(o(!0),k(z,null,D(r.value["event-source"],(c,ae)=>(o(),m(e($),{key:`es-${ae}-${c.name}`,size:"sm",variant:"outline"},{default:t(()=>[d(u(c.name),1)]),_:2},1024))),128))]),_:1})]),_:1})):y("",!0)]}),_:1})):(o(),m(e(de),{key:0,title:"No resources declared",description:"This service's CloudFormation template has no resources LSS understands yet."}))]}),_:1})],64)):y("",!0),n(e(ve),{open:U.value,"onUpdate:open":[a[2]||(a[2]=s=>U.value=s),a[3]||(a[3]=s=>{s||Y()})],title:`Logs — ${B.serviceName}`,description:`Status: ${Q.value}`,size:"lg"},{default:t(()=>[v("pre",$e,u(E.value.join(`
|
|
1
|
+
import{o as ne,v as le,u as se,Q as oe,i as m,S as t,G as e,f as l,d as q,y as g,w as o,n,a as P,A as L,m as d,h as v,E as u,_,j as y,b as re,k,R as ie,s as x,D as ue,K as A,J as de,F as z,z as D,B as $,a0 as ve,q as ce,g as fe,O as me,L as pe}from"./index-D3WwZ4lY.js";const ge={style:{"font-size":"1.1rem"}},ye={key:1,style:{display:"flex","justify-content":"center",padding:"2rem"}},be={class:"mono"},we={class:"mono"},_e={class:"mono"},ke={class:"mono"},ze={class:"muted"},he={class:"muted"},Se={class:"muted"},Ne={class:"muted"},Le={class:"muted"},De={class:"muted"},$e={class:"logs-pre"},je=ne({__name:"ServiceDetailPage",props:{serviceName:{}},setup(B){const p=B,G=pe(),h=me(),f=g(null),R=g(!0),C=g(null),T=g(!1),F=g(!1),U=g(!1),E=g([]),Q=g("stopped");let b=null,V=null;const O=g(!1),r=fe(()=>{var a;const i={lambda:[],dynamodb:[],sqs:[],sns:[],s3:[],"event-source":[]};for(const s of((a=f.value)==null?void 0:a.resources)||[])i[s.type]||(i[s.type]=[]),i[s.type].push(s);return i});async function S(){R.value=!0;try{f.value=await q.getService(p.serviceName),C.value=null}catch(i){C.value=i.message||"Service not found",f.value=null}finally{R.value=!1}}async function H(){if(!T.value){T.value=!0;try{await q.startService(p.serviceName),h.add({title:"Service started",description:p.serviceName,variant:"success"}),await S()}catch(i){h.add({title:"Failed to start",description:i.message,variant:"danger"})}finally{T.value=!1}}}async function W(){if(!F.value){F.value=!0;try{await q.stopService(p.serviceName),h.add({title:"Service stopped",description:p.serviceName,variant:"info"}),await S()}catch(i){h.add({title:"Failed to stop",description:i.message,variant:"danger"})}finally{F.value=!1}}}async function J(){try{const i=await q.getServiceLogs(p.serviceName);E.value=i.logs||[],Q.value=i.status||"stopped"}catch(i){console.error("Failed to fetch logs:",i)}}function X(){U.value=!0,J(),b&&window.clearInterval(b),b=window.setInterval(J,2e3)}function Y(){U.value=!1,b&&window.clearInterval(b),b=null}async function Z(){try{await q.deleteService(p.serviceName),h.add({title:"Service deleted",description:p.serviceName,variant:"info"}),G.push("/services")}catch(i){h.add({title:"Failed to delete",description:i.message,variant:"danger"})}finally{O.value=!1}}function ee(i){switch(i){case"running":return"success";case"registered":return"warning";case"stopped":return"neutral";default:return"danger"}}function te(i){return i?new Date(i).toLocaleString():"—"}return le(()=>{S(),V=window.setInterval(S,1e4)}),se(()=>{V&&window.clearInterval(V),b&&window.clearInterval(b)}),oe(()=>p.serviceName,S),(i,a)=>(o(),m(e(l),{direction:"vertical",gap:"1.25rem"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>{var s;return[n(e(P),{to:"/services",style:{"text-decoration":"none"}},{default:t(()=>[n(e(L),{size:"sm",variant:"ghost"},{default:t(()=>[...a[5]||(a[5]=[d("← Services",-1)])]),_:1})]),_:1}),v("strong",ge,u(B.serviceName),1),(s=f.value)!=null&&s.status?(o(),m(e(_),{key:0,tone:ee(f.value.status),variant:"soft"},{default:t(()=>[d(u(f.value.status),1)]),_:1},8,["tone"])):y("",!0)]}),_:1}),n(e(l),{direction:"horizontal",gap:"0.375rem"},{default:t(()=>{var s,w;return[n(e(L),{size:"sm",variant:"soft",disabled:((s=f.value)==null?void 0:s.status)==="running",loading:T.value,onClick:H},{default:t(()=>[...a[6]||(a[6]=[d(" Start ",-1)])]),_:1},8,["disabled","loading"]),n(e(L),{size:"sm",variant:"soft",disabled:((w=f.value)==null?void 0:w.status)!=="running",loading:F.value,onClick:W},{default:t(()=>[...a[7]||(a[7]=[d(" Stop ",-1)])]),_:1},8,["disabled","loading"]),n(e(L),{size:"sm",variant:"ghost",onClick:X},{default:t(()=>[...a[8]||(a[8]=[d("Logs",-1)])]),_:1}),n(e(L),{size:"sm",variant:"ghost",loading:R.value,onClick:S},{default:t(()=>[...a[9]||(a[9]=[d("Refresh",-1)])]),_:1},8,["loading"]),n(e(L),{size:"sm",variant:"danger",onClick:a[0]||(a[0]=N=>O.value=!0)},{default:t(()=>[...a[10]||(a[10]=[d("Delete",-1)])]),_:1})]}),_:1})]),_:1}),C.value?(o(),m(e(re),{key:0,variant:"danger",dismissible:"",onDismiss:a[1]||(a[1]=s=>C.value=null)},{default:t(()=>[d(u(C.value),1)]),_:1})):y("",!0),R.value&&!f.value?(o(),k("div",ye,[n(e(ie),{label:"Loading service..."})])):f.value?(o(),k(z,{key:2},[n(e(ue),{columns:5,gap:"1rem"},{default:t(()=>{var s,w,N,j,I;return[n(e(x),{label:"Lambdas",value:((s=r.value.lambda)==null?void 0:s.length)||0,tone:"info"},null,8,["value"]),n(e(x),{label:"Tables",value:((w=r.value.dynamodb)==null?void 0:w.length)||0,tone:"info"},null,8,["value"]),n(e(x),{label:"Queues",value:((N=r.value.sqs)==null?void 0:N.length)||0,tone:"warning"},null,8,["value"]),n(e(x),{label:"Topics",value:((j=r.value.sns)==null?void 0:j.length)||0,tone:"info"},null,8,["value"]),n(e(x),{label:"Buckets",value:((I=r.value.s3)==null?void 0:I.length)||0,tone:"neutral"},null,8,["value"])]}),_:1}),n(e(A),{variant:"outline"},{header:t(()=>[...a[11]||(a[11]=[v("strong",null,"Metadata",-1)])]),default:t(()=>[n(e(l),{direction:"vertical",gap:"0.5rem"},{default:t(()=>[n(e(l),{direction:"horizontal",justify:"space-between"},{default:t(()=>[a[12]||(a[12]=v("span",{class:"muted"},"Path",-1)),v("span",be,u(f.value.root),1)]),_:1}),n(e(l),{direction:"horizontal",justify:"space-between"},{default:t(()=>[a[13]||(a[13]=v("span",{class:"muted"},"Region",-1)),v("span",we,u(f.value.region||"—"),1)]),_:1}),n(e(l),{direction:"horizontal",justify:"space-between"},{default:t(()=>[a[14]||(a[14]=v("span",{class:"muted"},"Invoke port",-1)),v("span",_e,u(f.value.invokePort??"—"),1)]),_:1}),n(e(l),{direction:"horizontal",justify:"space-between"},{default:t(()=>[a[15]||(a[15]=v("span",{class:"muted"},"PID",-1)),v("span",ke,u(f.value.pid??"—"),1)]),_:1}),n(e(l),{direction:"horizontal",justify:"space-between"},{default:t(()=>[a[16]||(a[16]=v("span",{class:"muted"},"Last updated",-1)),v("span",null,u(te(f.value.lastUpdated)),1)]),_:1})]),_:1})]),_:1}),n(e(A),{variant:"outline"},{header:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center",justify:"space-between"},{default:t(()=>[a[17]||(a[17]=v("strong",null,"Declared resources",-1)),n(e(_),{tone:"neutral",variant:"soft"},{default:t(()=>{var s;return[d(u(((s=f.value.resources)==null?void 0:s.length)||0)+" total ",1)]}),_:1})]),_:1})]),default:t(()=>{var s;return[(s=f.value.resources)!=null&&s.length?(o(),m(e(l),{key:1,direction:"vertical",gap:"1rem"},{default:t(()=>{var w,N,j,I,K,M;return[(w=r.value.dynamodb)!=null&&w.length?(o(),m(e(l),{key:0,direction:"vertical",gap:"0.5rem"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[n(e(_),{tone:"info",variant:"soft"},{default:t(()=>[...a[18]||(a[18]=[d("DynamoDB tables",-1)])]),_:1}),v("span",ze,u(r.value.dynamodb.length),1)]),_:1}),n(e(l),{direction:"horizontal",gap:"0.375rem",wrap:""},{default:t(()=>[(o(!0),k(z,null,D(r.value.dynamodb,c=>(o(),m(e(P),{key:`db-${c.name}`,to:`/dynamo/${encodeURIComponent(c.name)}`,style:{"text-decoration":"none"}},{default:t(()=>[n(e($),{size:"sm",variant:"soft",clickable:""},{default:t(()=>[d(u(c.name),1)]),_:2},1024)]),_:2},1032,["to"]))),128))]),_:1})]),_:1})):y("",!0),(N=r.value.sqs)!=null&&N.length?(o(),m(e(l),{key:1,direction:"vertical",gap:"0.5rem"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[n(e(_),{tone:"warning",variant:"soft"},{default:t(()=>[...a[19]||(a[19]=[d("SQS queues",-1)])]),_:1}),v("span",he,u(r.value.sqs.length),1)]),_:1}),n(e(l),{direction:"horizontal",gap:"0.375rem",wrap:""},{default:t(()=>[(o(!0),k(z,null,D(r.value.sqs,c=>(o(),m(e(P),{key:`q-${c.name}`,to:"/queues",style:{"text-decoration":"none"}},{default:t(()=>[n(e($),{size:"sm",variant:"soft",clickable:""},{default:t(()=>[d(u(c.name),1)]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1})):y("",!0),(j=r.value.sns)!=null&&j.length?(o(),m(e(l),{key:2,direction:"vertical",gap:"0.5rem"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[n(e(_),{tone:"info",variant:"soft"},{default:t(()=>[...a[20]||(a[20]=[d("SNS topics",-1)])]),_:1}),v("span",Se,u(r.value.sns.length),1)]),_:1}),n(e(l),{direction:"horizontal",gap:"0.375rem",wrap:""},{default:t(()=>[(o(!0),k(z,null,D(r.value.sns,c=>(o(),m(e($),{key:`t-${c.name}`,size:"sm",variant:"soft"},{default:t(()=>[d(u(c.name),1)]),_:2},1024))),128))]),_:1})]),_:1})):y("",!0),(I=r.value.s3)!=null&&I.length?(o(),m(e(l),{key:3,direction:"vertical",gap:"0.5rem"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[n(e(_),{tone:"neutral",variant:"soft"},{default:t(()=>[...a[21]||(a[21]=[d("S3 buckets",-1)])]),_:1}),v("span",Ne,u(r.value.s3.length),1)]),_:1}),n(e(l),{direction:"horizontal",gap:"0.375rem",wrap:""},{default:t(()=>[(o(!0),k(z,null,D(r.value.s3,c=>(o(),m(e(P),{key:`b-${c.name}`,to:`/buckets/${encodeURIComponent(c.name)}`,style:{"text-decoration":"none"}},{default:t(()=>[n(e($),{size:"sm",variant:"soft",clickable:""},{default:t(()=>[d(u(c.name),1)]),_:2},1024)]),_:2},1032,["to"]))),128))]),_:1})]),_:1})):y("",!0),(K=r.value.lambda)!=null&&K.length?(o(),m(e(l),{key:4,direction:"vertical",gap:"0.5rem"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[n(e(_),{tone:"neutral",variant:"soft"},{default:t(()=>[...a[22]||(a[22]=[d("Lambda functions",-1)])]),_:1}),v("span",Le,u(r.value.lambda.length),1)]),_:1}),n(e(l),{direction:"horizontal",gap:"0.375rem",wrap:""},{default:t(()=>[(o(!0),k(z,null,D(r.value.lambda,c=>(o(),m(e($),{key:`l-${c.name}`,size:"sm",variant:"soft"},{default:t(()=>[d(" λ "+u(c.name),1)]),_:2},1024))),128))]),_:1})]),_:1})):y("",!0),(M=r.value["event-source"])!=null&&M.length?(o(),m(e(l),{key:5,direction:"vertical",gap:"0.5rem"},{default:t(()=>[n(e(l),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:t(()=>[n(e(_),{tone:"neutral",variant:"soft"},{default:t(()=>[...a[23]||(a[23]=[d("Event-source mappings",-1)])]),_:1}),v("span",De,u(r.value["event-source"].length),1)]),_:1}),n(e(l),{direction:"horizontal",gap:"0.375rem",wrap:""},{default:t(()=>[(o(!0),k(z,null,D(r.value["event-source"],(c,ae)=>(o(),m(e($),{key:`es-${ae}-${c.name}`,size:"sm",variant:"outline"},{default:t(()=>[d(u(c.name),1)]),_:2},1024))),128))]),_:1})]),_:1})):y("",!0)]}),_:1})):(o(),m(e(de),{key:0,title:"No resources declared",description:"This service's CloudFormation template has no resources LSS understands yet."}))]}),_:1})],64)):y("",!0),n(e(ve),{open:U.value,"onUpdate:open":[a[2]||(a[2]=s=>U.value=s),a[3]||(a[3]=s=>{s||Y()})],title:`Logs — ${B.serviceName}`,description:`Status: ${Q.value}`,size:"lg"},{default:t(()=>[v("pre",$e,u(E.value.join(`
|
|
2
2
|
`)||"— no output yet —"),1)]),_:1},8,["open","title","description"]),n(e(ce),{open:O.value,"onUpdate:open":a[4]||(a[4]=s=>O.value=s),title:`Delete service “${B.serviceName}”?`,description:"This removes the service from the cache and cleans up its provisioned resources in LocalStack.","confirm-label":"Delete","cancel-label":"Cancel","confirm-variant":"danger",onConfirm:Z},null,8,["open","title"])]),_:1}))}});export{je as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as A,v as ee,u as te,w as o,i as c,G as n,K as ae,S as s,k as K,n as r,R as se,J as ne,V as re,f as L,A as w,m as l,E as u,B as h,j as _,h as x,_ as le,a as ie,a0 as oe,q as ue,Z as de,p as ce,W as ve,y as i,g as O,d as b,O as fe}from"./index-
|
|
1
|
+
import{o as A,v as ee,u as te,w as o,i as c,G as n,K as ae,S as s,k as K,n as r,R as se,J as ne,V as re,f as L,A as w,m as l,E as u,B as h,j as _,h as x,_ as le,a as ie,a0 as oe,q as ue,Z as de,p as ce,W as ve,y as i,g as O,d as b,O as fe}from"./index-D3WwZ4lY.js";const ge={key:0,style:{display:"flex","justify-content":"center",padding:"2rem"}},pe={style:{"text-decoration":"underline","text-decoration-style":"dotted","text-underline-offset":"3px"}},me={class:"mono"},ye={key:5,class:"muted",style:{"font-size":"0.75rem"}},ke={class:"logs-pre"},Se=A({__name:"ServicesList",setup(M){const d=fe(),B=i([]),V=i(!0),C=i(!1),f=i(""),m=i(null),$=i([]),U=i("stopped"),v=i(null),g=i({}),p=i({}),y=i(null),z=i(!1);let D=null;const P=[{key:"name",label:"Name"},{key:"status",label:"Status"},{key:"root",label:"Path"},{key:"resourceBreakdown",label:"Resources"},{key:"lastUpdated",label:"Last updated"},{key:"actions",label:"Actions",align:"right"}],E=O(()=>B.value.map(t=>({...t}))),j=O({get:()=>m.value!==null,set:t=>{t||Z()}});async function k(){try{B.value=await b.listServices()}catch(t){console.error("Failed to load services:",t)}finally{V.value=!1}}async function J(t){if(!g.value[t]){g.value={...g.value,[t]:!0};try{await b.startService(t),d.add({title:"Service started",description:t,variant:"success"}),await k()}catch(a){d.add({title:"Failed to start service",description:a.message,variant:"danger"})}finally{g.value={...g.value,[t]:!1}}}}async function G(t){if(!p.value[t]){p.value={...p.value,[t]:!0};try{await b.stopService(t),d.add({title:"Service stopped",description:t,variant:"info"}),await k()}catch(a){d.add({title:"Failed to stop service",description:a.message,variant:"danger"})}finally{p.value={...p.value,[t]:!1}}}}async function F(t){try{const a=await b.getServiceLogs(t);$.value=a.logs||[],U.value=a.status||"stopped"}catch(a){console.error("Failed to fetch logs:",a)}}function W(t){m.value=t,F(t),v.value&&window.clearInterval(v.value),v.value=window.setInterval(()=>F(t),2e3)}function Z(){m.value=null,$.value=[],v.value&&window.clearInterval(v.value),v.value=null}async function I(){if(f.value.trim()){C.value=!0;try{await b.registerService(f.value),d.add({title:"Service registered",description:f.value,variant:"success"}),f.value="",await k()}catch(t){d.add({title:"Failed to register service",description:t.message,variant:"danger"})}finally{C.value=!1}}}function H(t){y.value=t,z.value=!0}async function Q(){if(!y.value)return;const t=y.value;try{await b.deleteService(t),d.add({title:"Service deleted",description:t,variant:"info"}),await k()}catch(a){d.add({title:"Failed to delete service",description:a.message,variant:"danger"})}finally{y.value=null,z.value=!1}}function X(t){return new Date(t).toLocaleString()}function Y(t){switch(t){case"running":return"success";case"registered":return"warning";case"stopped":return"neutral";default:return"danger"}}return ee(()=>{k(),D=window.setInterval(k,1e4)}),te(()=>{D&&window.clearInterval(D),v.value&&window.clearInterval(v.value)}),(t,a)=>(o(),c(n(ae),{variant:"outline"},{header:s(()=>[r(n(L),{direction:"horizontal",gap:"0.75rem",align:"center",justify:"space-between"},{default:s(()=>[a[4]||(a[4]=x("strong",null,"Microservices",-1)),r(n(L),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:s(()=>[r(n(de),{hint:"Absolute path to a Serverless project",htmlFor:"register-path"},{default:s(()=>[r(n(ce),{modelValue:f.value,"onUpdate:modelValue":a[0]||(a[0]=e=>f.value=e),placeholder:"/path/to/microservice",disabled:C.value,onKeyup:ve(I,["enter"])},null,8,["modelValue","disabled"])]),_:1}),r(n(w),{variant:"solid",loading:C.value,disabled:!f.value.trim(),onClick:I},{default:s(()=>[...a[3]||(a[3]=[l(" Register ",-1)])]),_:1},8,["loading","disabled"])]),_:1})]),_:1})]),default:s(()=>[V.value?(o(),K("div",ge,[r(n(se),{label:"Loading services..."})])):B.value.length?(o(),c(n(re),{key:2,columns:P,rows:E.value},{"cell-name":s(({row:e})=>[r(n(ie),{to:`/services/${encodeURIComponent(String(e.name))}`,style:{color:"inherit","text-decoration":"none"}},{default:s(()=>[x("strong",pe,u(e.name),1)]),_:2},1032,["to"])]),"cell-status":s(({row:e})=>[r(n(le),{tone:Y(String(e.status)),variant:"soft"},{default:s(()=>[l(u(e.status),1)]),_:2},1032,["tone"])]),"cell-root":s(({row:e})=>[x("span",me,u(e.root),1)]),"cell-resourceBreakdown":s(({row:e})=>[r(n(L),{direction:"horizontal",gap:"0.25rem",wrap:""},{default:s(()=>{var S,N,R,T,q;return[(S=e.resourceBreakdown)!=null&&S.lambdas?(o(),c(n(h),{key:0,size:"sm",variant:"soft"},{default:s(()=>[l(" λ "+u(e.resourceBreakdown.lambdas),1)]),_:2},1024)):_("",!0),(N=e.resourceBreakdown)!=null&&N.tables?(o(),c(n(h),{key:1,size:"sm",variant:"soft"},{default:s(()=>[l(" 🗄 "+u(e.resourceBreakdown.tables),1)]),_:2},1024)):_("",!0),(R=e.resourceBreakdown)!=null&&R.queues?(o(),c(n(h),{key:2,size:"sm",variant:"soft"},{default:s(()=>[l(" 📨 "+u(e.resourceBreakdown.queues),1)]),_:2},1024)):_("",!0),(T=e.resourceBreakdown)!=null&&T.topics?(o(),c(n(h),{key:3,size:"sm",variant:"soft"},{default:s(()=>[l(" 📣 "+u(e.resourceBreakdown.topics),1)]),_:2},1024)):_("",!0),(q=e.resourceBreakdown)!=null&&q.buckets?(o(),c(n(h),{key:4,size:"sm",variant:"soft"},{default:s(()=>[l(" 🪣 "+u(e.resourceBreakdown.buckets),1)]),_:2},1024)):_("",!0),e.resourcesCount?_("",!0):(o(),K("span",ye," none "))]}),_:2},1024)]),"cell-lastUpdated":s(({row:e})=>[l(u(X(Number(e.lastUpdated))),1)]),"cell-actions":s(({row:e})=>[r(n(L),{direction:"horizontal",gap:"0.375rem",justify:"flex-end",wrap:""},{default:s(()=>[r(n(w),{size:"sm",variant:"soft",disabled:e.status==="running"||g.value[String(e.name)],loading:g.value[String(e.name)],onClick:S=>J(String(e.name))},{default:s(()=>[...a[5]||(a[5]=[l(" Start ",-1)])]),_:1},8,["disabled","loading","onClick"]),r(n(w),{size:"sm",variant:"soft",disabled:e.status!=="running"||p.value[String(e.name)],loading:p.value[String(e.name)],onClick:S=>G(String(e.name))},{default:s(()=>[...a[6]||(a[6]=[l(" Stop ",-1)])]),_:1},8,["disabled","loading","onClick"]),r(n(w),{size:"sm",variant:"ghost",onClick:S=>W(String(e.name))},{default:s(()=>[...a[7]||(a[7]=[l(" Logs ",-1)])]),_:1},8,["onClick"]),r(n(w),{size:"sm",variant:"danger",onClick:S=>H(String(e.name))},{default:s(()=>[...a[8]||(a[8]=[l(" Delete ",-1)])]),_:1},8,["onClick"])]),_:2},1024)]),_:1},8,["rows"])):(o(),c(n(ne),{key:1,title:"No services registered",description:"Register your first microservice using the form above."})),r(n(oe),{open:j.value,"onUpdate:open":a[1]||(a[1]=e=>j.value=e),title:m.value?`Logs — ${m.value}`:"Logs",description:m.value?`Status: ${U.value}`:"",size:"lg"},{default:s(()=>[x("pre",ke,u($.value.join(`
|
|
2
2
|
`)||"— no output yet —"),1)]),_:1},8,["open","title","description"]),r(n(ue),{open:z.value,"onUpdate:open":a[2]||(a[2]=e=>z.value=e),title:`Delete service${y.value?` “${y.value}”`:""}?`,description:"This removes the service from the cache and cleans up its provisioned resources in LocalStack.","confirm-label":"Delete","cancel-label":"Cancel","confirm-variant":"danger",onConfirm:Q},null,8,["open","title"])]),_:1}))}}),be=A({__name:"ServicesPage",setup(M){return(d,B)=>(o(),c(Se))}});export{be as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OverviewPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OverviewPage-nhomNDqx.js","assets/OverviewPage-CwLnw4VW.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const r of s.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&a(r)}).observe(document,{childList:!0,subtree:!0});function l(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function a(n){if(n.ep)return;n.ep=!0;const s=l(n);fetch(n.href,s)}})();/**
|
|
3
3
|
* @vue/shared v3.5.34
|
|
4
4
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
@@ -33,4 +33,4 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OverviewPage-DK
|
|
|
33
33
|
* vue-router v4.6.4
|
|
34
34
|
* (c) 2025 Eduardo San Martin Morote
|
|
35
35
|
* @license MIT
|
|
36
|
-
*/let Ug=()=>location.protocol+"//"+location.host;function gu(e,t){const{pathname:l,search:a,hash:n}=t,s=e.indexOf("#");if(s>-1){let r=n.includes(e.slice(s))?e.slice(s).length:1,i=n.slice(r);return i[0]!=="/"&&(i="/"+i),vi(i,"")}return vi(l,e)+a+n}function Kg(e,t,l,a){let n=[],s=[],r=null;const i=({state:f})=>{const v=gu(e,location),T=l.value,k=t.value;let C=0;if(f){if(l.value=v,t.value=f,r&&r===T){r=null;return}C=k?f.position-k.position:0}else a(v);n.forEach(R=>{R(l.value,T,{delta:C,type:ts.pop,direction:C?C>0?On.forward:On.back:On.unknown})})};function o(){r=l.value}function c(f){n.push(f);const v=()=>{const T=n.indexOf(f);T>-1&&n.splice(T,1)};return s.push(v),v}function u(){if(document.visibilityState==="hidden"){const{history:f}=window;if(!f.state)return;f.replaceState(Me({},f.state,{scroll:pn()}),"")}}function d(){for(const f of s)f();s=[],window.removeEventListener("popstate",i),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",i),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:o,listen:c,destroy:d}}function yi(e,t,l,a=!1,n=!1){return{back:e,current:t,forward:l,replaced:a,position:window.history.length,scroll:n?pn():null}}function Gg(e){const{history:t,location:l}=window,a={value:gu(e,l)},n={value:t.state};n.value||s(a.value,{back:null,current:a.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function s(o,c,u){const d=e.indexOf("#"),f=d>-1?(l.host&&document.querySelector("base")?e:e.slice(d))+o:Ug()+e+o;try{t[u?"replaceState":"pushState"](c,"",f),n.value=c}catch(v){console.error(v),l[u?"replace":"assign"](f)}}function r(o,c){s(o,Me({},t.state,yi(n.value.back,o,n.value.forward,!0),c,{position:n.value.position}),!0),a.value=o}function i(o,c){const u=Me({},n.value,t.state,{forward:o,scroll:pn()});s(u.current,u,!0),s(o,Me({},yi(a.value,o,null),{position:u.position+1},c),!1),a.value=o}return{location:a,state:n,push:i,replace:r}}function Wg(e){e=Ig(e);const t=Gg(e),l=Kg(e,t.state,t.location,t.replace);function a(s,r=!0){r||l.pauseListeners(),history.go(s)}const n=Me({location:"",base:e,go:a,createHref:Og.bind(null,e)},t,l);return Object.defineProperty(n,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(n,"state",{enumerable:!0,get:()=>t.state.value}),n}let xl=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Ze=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Ze||{});const qg={type:xl.Static,value:""},Qg=/[a-zA-Z0-9_]/;function Jg(e){if(!e)return[[]];if(e==="/")return[[qg]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(v){throw new Error(`ERR (${l})/"${c}": ${v}`)}let l=Ze.Static,a=l;const n=[];let s;function r(){s&&n.push(s),s=[]}let i=0,o,c="",u="";function d(){c&&(l===Ze.Static?s.push({type:xl.Static,value:c}):l===Ze.Param||l===Ze.ParamRegExp||l===Ze.ParamRegExpEnd?(s.length>1&&(o==="*"||o==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),s.push({type:xl.Param,value:c,regexp:u,repeatable:o==="*"||o==="+",optional:o==="*"||o==="?"})):t("Invalid state to consume buffer"),c="")}function f(){c+=o}for(;i<e.length;){if(o=e[i++],o==="\\"&&l!==Ze.ParamRegExp){a=l,l=Ze.EscapeNext;continue}switch(l){case Ze.Static:o==="/"?(c&&d(),r()):o===":"?(d(),l=Ze.Param):f();break;case Ze.EscapeNext:f(),l=a;break;case Ze.Param:o==="("?l=Ze.ParamRegExp:Qg.test(o)?f():(d(),l=Ze.Static,o!=="*"&&o!=="?"&&o!=="+"&&i--);break;case Ze.ParamRegExp:o===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+o:l=Ze.ParamRegExpEnd:u+=o;break;case Ze.ParamRegExpEnd:d(),l=Ze.Static,o!=="*"&&o!=="?"&&o!=="+"&&i--,u="";break;default:t("Unknown state");break}}return l===Ze.ParamRegExp&&t(`Unfinished custom RegExp for param "${c}"`),d(),r(),n}const _i="[^/]+?",Yg={sensitive:!1,strict:!1,start:!0,end:!0};var pt=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(pt||{});const Xg=/[.+*?^${}()[\]/\\]/g;function Zg(e,t){const l=Me({},Yg,t),a=[];let n=l.start?"^":"";const s=[];for(const c of e){const u=c.length?[]:[pt.Root];l.strict&&!c.length&&(n+="/");for(let d=0;d<c.length;d++){const f=c[d];let v=pt.Segment+(l.sensitive?pt.BonusCaseSensitive:0);if(f.type===xl.Static)d||(n+="/"),n+=f.value.replace(Xg,"\\$&"),v+=pt.Static;else if(f.type===xl.Param){const{value:T,repeatable:k,optional:C,regexp:R}=f;s.push({name:T,repeatable:k,optional:C});const I=R||_i;if(I!==_i){v+=pt.BonusCustomRegExp;try{`${I}`}catch(y){throw new Error(`Invalid custom RegExp for param "${T}" (${I}): `+y.message)}}let $=k?`((?:${I})(?:/(?:${I}))*)`:`(${I})`;d||($=C&&c.length<2?`(?:/${$})`:"/"+$),C&&($+="?"),n+=$,v+=pt.Dynamic,C&&(v+=pt.BonusOptional),k&&(v+=pt.BonusRepeatable),I===".*"&&(v+=pt.BonusWildcard)}u.push(v)}a.push(u)}if(l.strict&&l.end){const c=a.length-1;a[c][a[c].length-1]+=pt.BonusStrict}l.strict||(n+="/?"),l.end?n+="$":l.strict&&!n.endsWith("/")&&(n+="(?:/|$)");const r=new RegExp(n,l.sensitive?"":"i");function i(c){const u=c.match(r),d={};if(!u)return null;for(let f=1;f<u.length;f++){const v=u[f]||"",T=s[f-1];d[T.name]=v&&T.repeatable?v.split("/"):v}return d}function o(c){let u="",d=!1;for(const f of e){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const v of f)if(v.type===xl.Static)u+=v.value;else if(v.type===xl.Param){const{value:T,repeatable:k,optional:C}=v,R=T in c?c[T]:"";if(Rt(R)&&!k)throw new Error(`Provided param "${T}" is an array but it is not repeatable (* or + modifiers)`);const I=Rt(R)?R.join("/"):R;if(!I)if(C)f.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${T}"`);u+=I}}return u||"/"}return{re:r,score:a,keys:s,parse:i,stringify:o}}function ey(e,t){let l=0;for(;l<e.length&&l<t.length;){const a=t[l]-e[l];if(a)return a;l++}return e.length<t.length?e.length===1&&e[0]===pt.Static+pt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===pt.Static+pt.Segment?1:-1:0}function yu(e,t){let l=0;const a=e.score,n=t.score;for(;l<a.length&&l<n.length;){const s=ey(a[l],n[l]);if(s)return s;l++}if(Math.abs(n.length-a.length)===1){if(ki(a))return 1;if(ki(n))return-1}return n.length-a.length}function ki(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const ty={strict:!1,end:!0,sensitive:!1};function ly(e,t,l){const a=Zg(Jg(e.path),l),n=Me(a,{record:e,parent:t,children:[],alias:[]});return t&&!n.record.aliasOf==!t.record.aliasOf&&t.children.push(n),n}function ay(e,t){const l=[],a=new Map;t=pi(ty,t);function n(d){return a.get(d)}function s(d,f,v){const T=!v,k=Ti(d);k.aliasOf=v&&v.record;const C=pi(t,d),R=[k];if("alias"in d){const y=typeof d.alias=="string"?[d.alias]:d.alias;for(const _ of y)R.push(Ti(Me({},k,{components:v?v.record.components:k.components,path:_,aliasOf:v?v.record:k})))}let I,$;for(const y of R){const{path:_}=y;if(f&&_[0]!=="/"){const S=f.record.path,A=S[S.length-1]==="/"?"":"/";y.path=f.record.path+(_&&A+_)}if(I=ly(y,f,C),v?v.alias.push(I):($=$||I,$!==I&&$.alias.push(I),T&&d.name&&!xi(I)&&r(d.name)),_u(I)&&o(I),k.children){const S=k.children;for(let A=0;A<S.length;A++)s(S[A],I,v&&v.children[A])}v=v||I}return $?()=>{r($)}:va}function r(d){if(hu(d)){const f=a.get(d);f&&(a.delete(d),l.splice(l.indexOf(f),1),f.children.forEach(r),f.alias.forEach(r))}else{const f=l.indexOf(d);f>-1&&(l.splice(f,1),d.record.name&&a.delete(d.record.name),d.children.forEach(r),d.alias.forEach(r))}}function i(){return l}function o(d){const f=ry(d,l);l.splice(f,0,d),d.record.name&&!xi(d)&&a.set(d.record.name,d)}function c(d,f){let v,T={},k,C;if("name"in d&&d.name){if(v=a.get(d.name),!v)throw Jl(We.MATCHER_NOT_FOUND,{location:d});C=v.record.name,T=Me(wi(f.params,v.keys.filter($=>!$.optional).concat(v.parent?v.parent.keys.filter($=>$.optional):[]).map($=>$.name)),d.params&&wi(d.params,v.keys.map($=>$.name))),k=v.stringify(T)}else if(d.path!=null)k=d.path,v=l.find($=>$.re.test(k)),v&&(T=v.parse(k),C=v.record.name);else{if(v=f.name?a.get(f.name):l.find($=>$.re.test(f.path)),!v)throw Jl(We.MATCHER_NOT_FOUND,{location:d,currentLocation:f});C=v.record.name,T=Me({},f.params,d.params),k=v.stringify(T)}const R=[];let I=v;for(;I;)R.unshift(I.record),I=I.parent;return{name:C,path:k,params:T,matched:R,meta:sy(R)}}e.forEach(d=>s(d));function u(){l.length=0,a.clear()}return{addRoute:s,resolve:c,removeRoute:r,clearRoutes:u,getRoutes:i,getRecordMatcher:n}}function wi(e,t){const l={};for(const a of t)a in e&&(l[a]=e[a]);return l}function Ti(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:ny(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function ny(e){const t={},l=e.props||!1;if("component"in e)t.default=l;else for(const a in e.components)t[a]=typeof l=="object"?l[a]:l;return t}function xi(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function sy(e){return e.reduce((t,l)=>Me(t,l.meta),{})}function ry(e,t){let l=0,a=t.length;for(;l!==a;){const s=l+a>>1;yu(e,t[s])<0?a=s:l=s+1}const n=iy(e);return n&&(a=t.lastIndexOf(n,a-1)),a}function iy(e){let t=e;for(;t=t.parent;)if(_u(t)&&yu(e,t)===0)return t}function _u({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ci(e){const t=tt(vn),l=tt(ks),a=h(()=>{const o=P(e.to);return t.resolve(o)}),n=h(()=>{const{matched:o}=a.value,{length:c}=o,u=o[c-1],d=l.matched;if(!u||!d.length)return-1;const f=d.findIndex(Ql.bind(null,u));if(f>-1)return f;const v=Ei(o[c-2]);return c>1&&Ei(u)===v&&d[d.length-1].path!==v?d.findIndex(Ql.bind(null,o[c-2])):f}),s=h(()=>n.value>-1&&fy(l.params,a.value.params)),r=h(()=>n.value>-1&&n.value===l.matched.length-1&&mu(l.params,a.value.params));function i(o={}){if(cy(o)){const c=t[P(e.replace)?"replace":"push"](P(e.to)).catch(va);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:a,href:h(()=>a.value.href),isActive:s,isExactActive:r,navigate:i}}function oy(e){return e.length===1?e[0]:e}const uy=ve({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Ci,setup(e,{slots:t}){const l=Al(Ci(e)),{options:a}=tt(vn),n=h(()=>({[Si(e.activeClass,a.linkActiveClass,"router-link-active")]:l.isActive,[Si(e.exactActiveClass,a.linkExactActiveClass,"router-link-exact-active")]:l.isExactActive}));return()=>{const s=t.default&&oy(t.default(l));return e.custom?s:wa("a",{"aria-current":l.isExactActive?e.ariaCurrentValue:null,href:l.href,onClick:l.navigate,class:n.value},s)}}}),dy=uy;function cy(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function fy(e,t){for(const l in t){const a=t[l],n=e[l];if(typeof a=="string"){if(a!==n)return!1}else if(!Rt(n)||n.length!==a.length||a.some((s,r)=>s.valueOf()!==n[r].valueOf()))return!1}return!0}function Ei(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Si=(e,t,l)=>e??t??l,py=ve({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:l}){const a=tt(as),n=h(()=>e.route||a.value),s=tt(gi,0),r=h(()=>{let c=P(s);const{matched:u}=n.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),i=h(()=>n.value.matched[r.value]);Xt(gi,h(()=>r.value+1)),Xt(zg,i),Xt(as,n);const o=de();return Ve(()=>[o.value,i.value,e.name],([c,u,d],[f,v,T])=>{u&&(u.instances[d]=c,v&&v!==u&&c&&c===f&&(u.leaveGuards.size||(u.leaveGuards=v.leaveGuards),u.updateGuards.size||(u.updateGuards=v.updateGuards))),c&&u&&(!v||!Ql(u,v)||!f)&&(u.enterCallbacks[d]||[]).forEach(k=>k(c))},{flush:"post"}),()=>{const c=n.value,u=e.name,d=i.value,f=d&&d.components[u];if(!f)return Ai(l.default,{Component:f,route:c});const v=d.props[u],T=v?v===!0?c.params:typeof v=="function"?v(c):v:null,C=wa(f,Me({},T,t,{onVnodeUnmounted:R=>{R.component.isUnmounted&&(d.instances[u]=null)},ref:o}));return Ai(l.default,{Component:C,route:c})||C}}});function Ai(e,t){if(!e)return null;const l=e(t);return l.length===1?l[0]:l}const ku=py;function vy(e){const t=ay(e.routes,e),l=e.parseQuery||Fg,a=e.stringifyQuery||bi,n=e.history,s=la(),r=la(),i=la(),o=pd(sl);let c=sl;Bl&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=In.bind(null,M=>""+M),d=In.bind(null,Tg),f=In.bind(null,Ea);function v(M,N){let q,ue;return hu(M)?(q=t.getRecordMatcher(M),ue=N):ue=M,t.addRoute(ue,q)}function T(M){const N=t.getRecordMatcher(M);N&&t.removeRoute(N)}function k(){return t.getRoutes().map(M=>M.record)}function C(M){return!!t.getRecordMatcher(M)}function R(M,N){if(N=Me({},N||o.value),typeof M=="string"){const E=$n(l,M,N.path),H=t.resolve({path:E.path},N),j=n.createHref(E.fullPath);return Me(E,H,{params:f(H.params),hash:Ea(E.hash),redirectedFrom:void 0,href:j})}let q;if(M.path!=null)q=Me({},M,{path:$n(l,M.path,N.path).path});else{const E=Me({},M.params);for(const H in E)E[H]==null&&delete E[H];q=Me({},M,{params:d(E)}),N.params=d(N.params)}const ue=t.resolve(q,N),z=M.hash||"";ue.params=u(f(ue.params));const p=Eg(a,Me({},M,{hash:_g(z),path:ue.path})),b=n.createHref(p);return Me({fullPath:p,hash:z,query:a===bi?Hg(M.query):M.query||{}},ue,{redirectedFrom:void 0,href:b})}function I(M){return typeof M=="string"?$n(l,M,o.value.path):Me({},M)}function $(M,N){if(c!==M)return Jl(We.NAVIGATION_CANCELLED,{from:N,to:M})}function y(M){return A(M)}function _(M){return y(Me(I(M),{replace:!0}))}function S(M,N){const q=M.matched[M.matched.length-1];if(q&&q.redirect){const{redirect:ue}=q;let z=typeof ue=="function"?ue(M,N):ue;return typeof z=="string"&&(z=z.includes("?")||z.includes("#")?z=I(z):{path:z},z.params={}),Me({query:M.query,hash:M.hash,params:z.path!=null?{}:M.params},z)}}function A(M,N){const q=c=R(M),ue=o.value,z=M.state,p=M.force,b=M.replace===!0,E=S(q,ue);if(E)return A(Me(I(E),{state:typeof E=="object"?Me({},z,E.state):z,force:p,replace:b}),N||q);const H=q;H.redirectedFrom=N;let j;return!p&&Sg(a,ue,q)&&(j=Jl(We.NAVIGATION_DUPLICATED,{to:H,from:ue}),W(ue,ue,!0,!1)),(j?Promise.resolve(j):O(H,ue)).catch(U=>Gt(U)?Gt(U,We.NAVIGATION_GUARD_REDIRECT)?U:fe(U):V(U,H,ue)).then(U=>{if(U){if(Gt(U,We.NAVIGATION_GUARD_REDIRECT))return A(Me({replace:b},I(U.to),{state:typeof U.to=="object"?Me({},z,U.to.state):z,force:p}),N||H)}else U=D(H,ue,!0,b,z);return J(H,ue,U),U})}function B(M,N){const q=$(M,N);return q?Promise.reject(q):Promise.resolve()}function F(M){const N=le.values().next().value;return N&&typeof N.runWithContext=="function"?N.runWithContext(M):M()}function O(M,N){let q;const[ue,z,p]=jg(M,N);q=Rn(ue.reverse(),"beforeRouteLeave",M,N);for(const E of ue)E.leaveGuards.forEach(H=>{q.push(ul(H,M,N))});const b=B.bind(null,M,N);return q.push(b),he(q).then(()=>{q=[];for(const E of s.list())q.push(ul(E,M,N));return q.push(b),he(q)}).then(()=>{q=Rn(z,"beforeRouteUpdate",M,N);for(const E of z)E.updateGuards.forEach(H=>{q.push(ul(H,M,N))});return q.push(b),he(q)}).then(()=>{q=[];for(const E of p)if(E.beforeEnter)if(Rt(E.beforeEnter))for(const H of E.beforeEnter)q.push(ul(H,M,N));else q.push(ul(E.beforeEnter,M,N));return q.push(b),he(q)}).then(()=>(M.matched.forEach(E=>E.enterCallbacks={}),q=Rn(p,"beforeRouteEnter",M,N,F),q.push(b),he(q))).then(()=>{q=[];for(const E of r.list())q.push(ul(E,M,N));return q.push(b),he(q)}).catch(E=>Gt(E,We.NAVIGATION_CANCELLED)?E:Promise.reject(E))}function J(M,N,q){i.list().forEach(ue=>F(()=>ue(M,N,q)))}function D(M,N,q,ue,z){const p=$(M,N);if(p)return p;const b=N===sl,E=Bl?history.state:{};q&&(ue||b?n.replace(M.fullPath,Me({scroll:b&&E&&E.scroll},z)):n.push(M.fullPath,z)),o.value=M,W(M,N,q,b),fe()}let Z;function te(){Z||(Z=n.listen((M,N,q)=>{if(!xe.listening)return;const ue=R(M),z=S(ue,xe.currentRoute.value);if(z){A(Me(z,{replace:!0,force:!0}),ue).catch(va);return}c=ue;const p=o.value;Bl&&Bg(hi(p.fullPath,q.delta),pn()),O(ue,p).catch(b=>Gt(b,We.NAVIGATION_ABORTED|We.NAVIGATION_CANCELLED)?b:Gt(b,We.NAVIGATION_GUARD_REDIRECT)?(A(Me(I(b.to),{force:!0}),ue).then(E=>{Gt(E,We.NAVIGATION_ABORTED|We.NAVIGATION_DUPLICATED)&&!q.delta&&q.type===ts.pop&&n.go(-1,!1)}).catch(va),Promise.reject()):(q.delta&&n.go(-q.delta,!1),V(b,ue,p))).then(b=>{b=b||D(ue,p,!1),b&&(q.delta&&!Gt(b,We.NAVIGATION_CANCELLED)?n.go(-q.delta,!1):q.type===ts.pop&&Gt(b,We.NAVIGATION_ABORTED|We.NAVIGATION_DUPLICATED)&&n.go(-1,!1)),J(ue,p,b)}).catch(va)}))}let Ae=la(),Q=la(),x;function V(M,N,q){fe(M);const ue=Q.list();return ue.length?ue.forEach(z=>z(M,N,q)):console.error(M),Promise.reject(M)}function ne(){return x&&o.value!==sl?Promise.resolve():new Promise((M,N)=>{Ae.add([M,N])})}function fe(M){return x||(x=!M,te(),Ae.list().forEach(([N,q])=>M?q(M):N()),Ae.reset()),M}function W(M,N,q,ue){const{scrollBehavior:z}=e;if(!Bl||!z)return Promise.resolve();const p=!q&&Pg(hi(M.fullPath,0))||(ue||!q)&&history.state&&history.state.scroll||null;return Ke().then(()=>z(M,N,p)).then(b=>b&&Vg(b)).catch(b=>V(b,M,N))}const pe=M=>n.go(M);let ie;const le=new Set,xe={currentRoute:o,listening:!0,addRoute:v,removeRoute:T,clearRoutes:t.clearRoutes,hasRoute:C,getRoutes:k,resolve:R,options:e,push:y,replace:_,go:pe,back:()=>pe(-1),forward:()=>pe(1),beforeEach:s.add,beforeResolve:r.add,afterEach:i.add,onError:Q.add,isReady:ne,install(M){M.component("RouterLink",dy),M.component("RouterView",ku),M.config.globalProperties.$router=xe,Object.defineProperty(M.config.globalProperties,"$route",{enumerable:!0,get:()=>P(o)}),Bl&&!ie&&o.value===sl&&(ie=!0,y(n.location).catch(ue=>{}));const N={};for(const ue in sl)Object.defineProperty(N,ue,{get:()=>o.value[ue],enumerable:!0});M.provide(vn,xe),M.provide(ks,eo(N)),M.provide(as,o);const q=M.unmount;le.add(M),M.unmount=function(){le.delete(M),le.size<1&&(c=sl,Z&&Z(),Z=null,o.value=sl,ie=!1,x=!1),q()}}};function he(M){return M.reduce((N,q)=>N.then(()=>F(q)),Promise.resolve())}return xe}function my(){return tt(vn)}function hy(e){return tt(ks)}const wu="lss-region",Di="us-east-1";function by(){try{return localStorage.getItem(wu)||Di}catch{return Di}}const Cl=de(by());Ve(Cl,e=>{try{localStorage.setItem(wu,e)}catch{}});const gy=[{value:"us-east-1",label:"us-east-1 — N. Virginia"},{value:"us-east-2",label:"us-east-2 — Ohio"},{value:"us-west-1",label:"us-west-1 — N. California"},{value:"us-west-2",label:"us-west-2 — Oregon"},{value:"eu-west-1",label:"eu-west-1 — Ireland"},{value:"eu-west-2",label:"eu-west-2 — London"},{value:"eu-west-3",label:"eu-west-3 — Paris"},{value:"eu-central-1",label:"eu-central-1 — Frankfurt"},{value:"eu-north-1",label:"eu-north-1 — Stockholm"},{value:"ap-southeast-1",label:"ap-southeast-1 — Singapore"},{value:"ap-southeast-2",label:"ap-southeast-2 — Sydney"},{value:"ap-northeast-1",label:"ap-northeast-1 — Tokyo"},{value:"ap-northeast-2",label:"ap-northeast-2 — Seoul"},{value:"ap-south-1",label:"ap-south-1 — Mumbai"},{value:"sa-east-1",label:"sa-east-1 — São Paulo"},{value:"ca-central-1",label:"ca-central-1 — Canada"}],Tu="";function yy(e){const t=Cl.value;if(!t)return e;const l=e.includes("?")?"&":"?";return`${e}${l}region=${encodeURIComponent(t)}`}async function Ie(e,t){const l=await fetch(`${Tu}${yy(e)}`,{headers:{"Content-Type":"application/json",...t==null?void 0:t.headers},...t});if(!l.ok){const a=await l.json().catch(()=>({error:l.statusText}));throw new Error(a.error||"Request failed")}return l.json()}const _y={checkHealth:()=>Ie("/api/health"),getConfig:()=>Ie("/api/config"),listServices:()=>Ie("/api/services"),getService:e=>Ie(`/api/services/${encodeURIComponent(e)}`),registerService:e=>Ie("/api/services/register",{method:"POST",body:JSON.stringify({servicePath:e})}),deleteService:e=>Ie(`/api/services/${e}`,{method:"DELETE"}),updateServiceStatus:(e,t,l)=>Ie(`/api/services/${e}/status`,{method:"PATCH",body:JSON.stringify({status:t,pid:l})}),startService:(e,t)=>Ie(`/api/services/${e}/start`,{method:"POST",body:JSON.stringify(t||{})}),stopService:e=>Ie(`/api/services/${e}/stop`,{method:"POST"}),getServiceLogs:e=>Ie(`/api/services/${e}/logs`),listResources:()=>Ie("/api/resources"),listResourceOwners:()=>Ie("/api/resources/owners"),listBuckets:()=>Ie("/api/buckets"),getBucket:e=>Ie(`/api/buckets/${encodeURIComponent(e)}`),listBucketObjects:(e,t)=>{const l=new URLSearchParams;t!=null&&t.prefix&&l.set("prefix",t.prefix),t!=null&&t.continuationToken&&l.set("continuationToken",t.continuationToken),(t==null?void 0:t.maxKeys)!==void 0&&l.set("maxKeys",String(t.maxKeys)),t!=null&&t.delimiter&&l.set("delimiter",t.delimiter);const a=l.toString();return Ie(`/api/buckets/${encodeURIComponent(e)}/objects${a?`?${a}`:""}`)},bucketObjectContentUrl:(e,t,l=!1)=>{const a=new URLSearchParams({key:t});l&&a.set("download","1");const n=Cl.value;return n&&a.set("region",n),`${Tu}/api/buckets/${encodeURIComponent(e)}/objects/content?${a.toString()}`},putBucketObject:(e,t)=>Ie(`/api/buckets/${encodeURIComponent(e)}/objects`,{method:"POST",body:JSON.stringify(t)}),deleteBucketObject:(e,t)=>Ie(`/api/buckets/${encodeURIComponent(e)}/objects?key=${encodeURIComponent(t)}`,{method:"DELETE"}),listQueues:()=>Ie("/api/queues"),getQueue:e=>Ie(`/api/queues/${encodeURIComponent(e)}`),resetQueueProcessed:e=>Ie(`/api/queues/${encodeURIComponent(e)}/reset-processed`,{method:"POST"}),sendQueueMessage:(e,t)=>Ie(`/api/queues/${encodeURIComponent(e)}/messages`,{method:"POST",body:JSON.stringify(t)}),receiveQueueMessages:(e,t)=>Ie(`/api/queues/${encodeURIComponent(e)}/messages/receive`,{method:"POST",body:JSON.stringify(t)}),deleteQueueMessage:(e,t)=>Ie(`/api/queues/${encodeURIComponent(e)}/messages/delete`,{method:"POST",body:JSON.stringify({receiptHandle:t})}),purgeQueue:e=>Ie(`/api/queues/${encodeURIComponent(e)}/purge`,{method:"POST"}),listDynamoTables:()=>Ie("/api/dynamo/tables"),describeDynamoTable:e=>Ie(`/api/dynamo/tables/${encodeURIComponent(e)}`),setDynamoTtl:(e,t,l)=>Ie(`/api/dynamo/tables/${encodeURIComponent(e)}/ttl`,{method:"PUT",body:JSON.stringify({enabled:t,attributeName:l})}),scanDynamoTable:(e,t)=>Ie(`/api/dynamo/tables/${encodeURIComponent(e)}/scan`,{method:"POST",body:JSON.stringify(t)}),queryDynamoTable:(e,t)=>Ie(`/api/dynamo/tables/${encodeURIComponent(e)}/query`,{method:"POST",body:JSON.stringify(t)}),getDynamoItem:(e,t)=>Ie(`/api/dynamo/tables/${encodeURIComponent(e)}/items/get`,{method:"POST",body:JSON.stringify({key:t})}),putDynamoItem:(e,t)=>Ie(`/api/dynamo/tables/${encodeURIComponent(e)}/items`,{method:"POST",body:JSON.stringify({item:t})}),deleteDynamoItem:(e,t)=>Ie(`/api/dynamo/tables/${encodeURIComponent(e)}/items/delete`,{method:"POST",body:JSON.stringify({key:t})}),listSeeds:()=>Ie("/api/seeds"),runSeed:e=>Ie("/api/seeds/run",{method:"POST",body:JSON.stringify(e?{tableName:e}:{})}),clearSeed:e=>Ie("/api/seeds/clear",{method:"POST",body:JSON.stringify(e?{tableName:e}:{})})},ky={class:"app-shell"},wy={class:"app-main"},Ty=ve({__name:"App",setup(e){const t=hy(),l=my(),a=de({status:"unknown",localstack:!1,dynamoProxy:{enabled:!1,running:!1,port:8e3}}),n=de(document.documentElement.getAttribute("data-tree-theme")||"dark");let s=null;const r=h(()=>{const d=t.path.split("/").filter(Boolean);return d.length===0?"/":`/${d[0]}`}),i=h(()=>[{label:n.value==="dark"?"Switch to light":"Switch to dark",value:"theme"}]);function o(d){d&&d!==r.value&&l.push(d)}function c(d){d==="theme"&&(n.value=n.value==="dark"?"light":"dark",document.documentElement.setAttribute("data-tree-theme",n.value))}async function u(){try{a.value=await _y.checkHealth()}catch(d){console.error("Health check failed:",d)}}return Yl(()=>{u(),s=window.setInterval(u,1e4)}),st(()=>{s&&window.clearInterval(s)}),(d,f)=>(m(),De(P(Xn),{position:"top-right"},{default:we(()=>[w("div",ky,[me(P(ra),{sticky:"",bordered:""},{start:we(()=>[me(P(qa),{direction:"vertical",gap:"0.125rem"},{default:we(()=>[...f[1]||(f[1]=[w("strong",null,"Local Serverless Stack",-1),w("span",{class:"muted",style:{"font-size":"0.75rem"}}," Local development control plane ",-1)])]),_:1})]),center:we(()=>[me(P(Qn),{"model-value":r.value,"onUpdate:modelValue":o},{default:we(()=>[me(P(Jn),null,{default:we(()=>[me(P(Tl),{value:"/"},{default:we(()=>[...f[2]||(f[2]=[$e("Overview",-1)])]),_:1}),me(P(Tl),{value:"/services"},{default:we(()=>[...f[3]||(f[3]=[$e("Services",-1)])]),_:1}),me(P(Tl),{value:"/queues"},{default:we(()=>[...f[4]||(f[4]=[$e("Queues",-1)])]),_:1}),me(P(Tl),{value:"/buckets"},{default:we(()=>[...f[5]||(f[5]=[$e("S3",-1)])]),_:1}),me(P(Tl),{value:"/dynamo"},{default:we(()=>[...f[6]||(f[6]=[$e("DynamoDB",-1)])]),_:1})]),_:1})]),_:1},8,["model-value"])]),end:we(()=>[me(P(qa),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:we(()=>{var v;return[me(P(xa),{tone:a.value.localstack?"success":"danger",variant:"soft"},{default:we(()=>[$e(" LocalStack: "+ee(a.value.localstack?"Running":"Offline"),1)]),_:1},8,["tone"]),(v=a.value.dynamoProxy)!=null&&v.enabled?(m(),De(P(xa),{key:0,tone:a.value.dynamoProxy.running?"success":"warning",variant:"soft"},{default:we(()=>[$e(" Dynamo Proxy: "+ee(a.value.dynamoProxy.running?"On":"Off"),1)]),_:1},8,["tone"])):K("",!0),me(P(qn),{modelValue:P(Cl),"onUpdate:modelValue":f[0]||(f[0]=T=>Qe(Cl)?Cl.value=T:null),options:P(gy),size:"sm",style:{"min-width":"14rem"},"aria-label":"AWS Region"},null,8,["modelValue","options"]),me(P(Wn),{items:i.value,size:"sm",label:"Open menu",onSelect:c},{trigger:we(()=>[me(P(Wl),{size:"sm",variant:"ghost","aria-label":"Open menu"},{default:we(()=>[...f[7]||(f[7]=[$e(" ⋮ ",-1)])]),_:1})]),_:1},8,["items"])]}),_:1})]),_:1}),w("main",wy,[(m(),g("div",{key:`${P(t).fullPath}-${P(Cl)}`},[me(P(ku))]))])])]),_:1}))}}),xy="modulepreload",Cy=function(e){return"/"+e},Ii={},Wt=function(t,l,a){let n=Promise.resolve();if(l&&l.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),o=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));n=r(l.map(c=>{if(c=Cy(c),c in Ii)return;Ii[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":xy,u||(f.as="script"),f.crossOrigin="",f.href=c,o&&f.setAttribute("nonce",o),document.head.appendChild(f),u)return new Promise((v,T)=>{f.addEventListener("load",v),f.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(r){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=r,window.dispatchEvent(i),!i.defaultPrevented)throw r}return n.then(r=>{for(const i of r||[])i.status==="rejected"&&s(i.reason);return t().catch(s)})},Ey=[{path:"/",name:"overview",component:()=>Wt(()=>import("./OverviewPage-DKpsGNi-.js"),__vite__mapDeps([0,1])),meta:{title:"Overview"}},{path:"/services",name:"services",component:()=>Wt(()=>import("./ServicesPage-Dl9Md68f.js"),[]),meta:{title:"Services"}},{path:"/services/:name",name:"service-detail",component:()=>Wt(()=>import("./ServiceDetailPage-DMgYxag6.js"),[]),props:e=>({serviceName:String(e.params.name)}),meta:{title:"Service"}},{path:"/queues",name:"queues",component:()=>Wt(()=>import("./QueuesPage-CEfnzK5n.js"),[]),meta:{title:"Queues"}},{path:"/queues/:name",name:"queue-detail",component:()=>Wt(()=>import("./QueueDetailPage-m_Ux1JRb.js"),[]),props:e=>({queueName:String(e.params.name)}),meta:{title:"Queue"}},{path:"/buckets",name:"buckets",component:()=>Wt(()=>import("./BucketsPage-FDb9r2GE.js"),[]),meta:{title:"S3 Buckets"}},{path:"/buckets/:name",name:"bucket-detail",component:()=>Wt(()=>import("./BucketDetailPage-DQU5IfHZ.js"),[]),props:e=>({bucketName:String(e.params.name)}),meta:{title:"S3 Bucket"}},{path:"/dynamo",name:"dynamo",component:()=>Wt(()=>import("./DynamoPage-D0Q2SOCV.js"),[]),meta:{title:"DynamoDB"}},{path:"/dynamo/:name",name:"dynamo-table",component:()=>Wt(()=>import("./DynamoTablePage-D2-tvZSS.js"),[]),props:e=>({tableName:String(e.params.name)}),meta:{title:"DynamoDB Table"}},{path:"/:pathMatch(.*)*",redirect:"/"}],Sy=vy({history:Wg(),routes:Ey});document.documentElement.setAttribute("data-tree-theme","dark");cf(Ty).use(ou).use(Sy).mount("#app");export{Qn as $,Wl as A,ui as B,si as C,Fr as D,ee as E,Te as F,P as G,Dr as H,hy as I,Mr as J,Ar as K,my as L,Dy as M,Jr as N,Xh as O,Tl as P,Ve as Q,jt as R,we as S,Jn as T,Ay as U,oi as V,Iy as W,Ma as X,ii as Y,ti as Z,xa as _,dy as a,Gn as a0,Cr as b,Hr as c,_y as d,Zr as e,qa as f,h as g,w as h,De as i,K as j,g as k,Ud as l,$e as m,me as n,ve as o,Gr as p,$r as q,ni as r,Xr as s,qn as t,st as u,Yl as v,m as w,Yr as x,de as y,Le as z};
|
|
36
|
+
*/let Ug=()=>location.protocol+"//"+location.host;function gu(e,t){const{pathname:l,search:a,hash:n}=t,s=e.indexOf("#");if(s>-1){let r=n.includes(e.slice(s))?e.slice(s).length:1,i=n.slice(r);return i[0]!=="/"&&(i="/"+i),vi(i,"")}return vi(l,e)+a+n}function Kg(e,t,l,a){let n=[],s=[],r=null;const i=({state:f})=>{const v=gu(e,location),T=l.value,k=t.value;let C=0;if(f){if(l.value=v,t.value=f,r&&r===T){r=null;return}C=k?f.position-k.position:0}else a(v);n.forEach(R=>{R(l.value,T,{delta:C,type:ts.pop,direction:C?C>0?On.forward:On.back:On.unknown})})};function o(){r=l.value}function c(f){n.push(f);const v=()=>{const T=n.indexOf(f);T>-1&&n.splice(T,1)};return s.push(v),v}function u(){if(document.visibilityState==="hidden"){const{history:f}=window;if(!f.state)return;f.replaceState(Me({},f.state,{scroll:pn()}),"")}}function d(){for(const f of s)f();s=[],window.removeEventListener("popstate",i),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",i),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:o,listen:c,destroy:d}}function yi(e,t,l,a=!1,n=!1){return{back:e,current:t,forward:l,replaced:a,position:window.history.length,scroll:n?pn():null}}function Gg(e){const{history:t,location:l}=window,a={value:gu(e,l)},n={value:t.state};n.value||s(a.value,{back:null,current:a.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function s(o,c,u){const d=e.indexOf("#"),f=d>-1?(l.host&&document.querySelector("base")?e:e.slice(d))+o:Ug()+e+o;try{t[u?"replaceState":"pushState"](c,"",f),n.value=c}catch(v){console.error(v),l[u?"replace":"assign"](f)}}function r(o,c){s(o,Me({},t.state,yi(n.value.back,o,n.value.forward,!0),c,{position:n.value.position}),!0),a.value=o}function i(o,c){const u=Me({},n.value,t.state,{forward:o,scroll:pn()});s(u.current,u,!0),s(o,Me({},yi(a.value,o,null),{position:u.position+1},c),!1),a.value=o}return{location:a,state:n,push:i,replace:r}}function Wg(e){e=Ig(e);const t=Gg(e),l=Kg(e,t.state,t.location,t.replace);function a(s,r=!0){r||l.pauseListeners(),history.go(s)}const n=Me({location:"",base:e,go:a,createHref:Og.bind(null,e)},t,l);return Object.defineProperty(n,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(n,"state",{enumerable:!0,get:()=>t.state.value}),n}let xl=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Ze=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Ze||{});const qg={type:xl.Static,value:""},Qg=/[a-zA-Z0-9_]/;function Jg(e){if(!e)return[[]];if(e==="/")return[[qg]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(v){throw new Error(`ERR (${l})/"${c}": ${v}`)}let l=Ze.Static,a=l;const n=[];let s;function r(){s&&n.push(s),s=[]}let i=0,o,c="",u="";function d(){c&&(l===Ze.Static?s.push({type:xl.Static,value:c}):l===Ze.Param||l===Ze.ParamRegExp||l===Ze.ParamRegExpEnd?(s.length>1&&(o==="*"||o==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),s.push({type:xl.Param,value:c,regexp:u,repeatable:o==="*"||o==="+",optional:o==="*"||o==="?"})):t("Invalid state to consume buffer"),c="")}function f(){c+=o}for(;i<e.length;){if(o=e[i++],o==="\\"&&l!==Ze.ParamRegExp){a=l,l=Ze.EscapeNext;continue}switch(l){case Ze.Static:o==="/"?(c&&d(),r()):o===":"?(d(),l=Ze.Param):f();break;case Ze.EscapeNext:f(),l=a;break;case Ze.Param:o==="("?l=Ze.ParamRegExp:Qg.test(o)?f():(d(),l=Ze.Static,o!=="*"&&o!=="?"&&o!=="+"&&i--);break;case Ze.ParamRegExp:o===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+o:l=Ze.ParamRegExpEnd:u+=o;break;case Ze.ParamRegExpEnd:d(),l=Ze.Static,o!=="*"&&o!=="?"&&o!=="+"&&i--,u="";break;default:t("Unknown state");break}}return l===Ze.ParamRegExp&&t(`Unfinished custom RegExp for param "${c}"`),d(),r(),n}const _i="[^/]+?",Yg={sensitive:!1,strict:!1,start:!0,end:!0};var pt=(function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e})(pt||{});const Xg=/[.+*?^${}()[\]/\\]/g;function Zg(e,t){const l=Me({},Yg,t),a=[];let n=l.start?"^":"";const s=[];for(const c of e){const u=c.length?[]:[pt.Root];l.strict&&!c.length&&(n+="/");for(let d=0;d<c.length;d++){const f=c[d];let v=pt.Segment+(l.sensitive?pt.BonusCaseSensitive:0);if(f.type===xl.Static)d||(n+="/"),n+=f.value.replace(Xg,"\\$&"),v+=pt.Static;else if(f.type===xl.Param){const{value:T,repeatable:k,optional:C,regexp:R}=f;s.push({name:T,repeatable:k,optional:C});const I=R||_i;if(I!==_i){v+=pt.BonusCustomRegExp;try{`${I}`}catch(y){throw new Error(`Invalid custom RegExp for param "${T}" (${I}): `+y.message)}}let $=k?`((?:${I})(?:/(?:${I}))*)`:`(${I})`;d||($=C&&c.length<2?`(?:/${$})`:"/"+$),C&&($+="?"),n+=$,v+=pt.Dynamic,C&&(v+=pt.BonusOptional),k&&(v+=pt.BonusRepeatable),I===".*"&&(v+=pt.BonusWildcard)}u.push(v)}a.push(u)}if(l.strict&&l.end){const c=a.length-1;a[c][a[c].length-1]+=pt.BonusStrict}l.strict||(n+="/?"),l.end?n+="$":l.strict&&!n.endsWith("/")&&(n+="(?:/|$)");const r=new RegExp(n,l.sensitive?"":"i");function i(c){const u=c.match(r),d={};if(!u)return null;for(let f=1;f<u.length;f++){const v=u[f]||"",T=s[f-1];d[T.name]=v&&T.repeatable?v.split("/"):v}return d}function o(c){let u="",d=!1;for(const f of e){(!d||!u.endsWith("/"))&&(u+="/"),d=!1;for(const v of f)if(v.type===xl.Static)u+=v.value;else if(v.type===xl.Param){const{value:T,repeatable:k,optional:C}=v,R=T in c?c[T]:"";if(Rt(R)&&!k)throw new Error(`Provided param "${T}" is an array but it is not repeatable (* or + modifiers)`);const I=Rt(R)?R.join("/"):R;if(!I)if(C)f.length<2&&(u.endsWith("/")?u=u.slice(0,-1):d=!0);else throw new Error(`Missing required param "${T}"`);u+=I}}return u||"/"}return{re:r,score:a,keys:s,parse:i,stringify:o}}function ey(e,t){let l=0;for(;l<e.length&&l<t.length;){const a=t[l]-e[l];if(a)return a;l++}return e.length<t.length?e.length===1&&e[0]===pt.Static+pt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===pt.Static+pt.Segment?1:-1:0}function yu(e,t){let l=0;const a=e.score,n=t.score;for(;l<a.length&&l<n.length;){const s=ey(a[l],n[l]);if(s)return s;l++}if(Math.abs(n.length-a.length)===1){if(ki(a))return 1;if(ki(n))return-1}return n.length-a.length}function ki(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const ty={strict:!1,end:!0,sensitive:!1};function ly(e,t,l){const a=Zg(Jg(e.path),l),n=Me(a,{record:e,parent:t,children:[],alias:[]});return t&&!n.record.aliasOf==!t.record.aliasOf&&t.children.push(n),n}function ay(e,t){const l=[],a=new Map;t=pi(ty,t);function n(d){return a.get(d)}function s(d,f,v){const T=!v,k=Ti(d);k.aliasOf=v&&v.record;const C=pi(t,d),R=[k];if("alias"in d){const y=typeof d.alias=="string"?[d.alias]:d.alias;for(const _ of y)R.push(Ti(Me({},k,{components:v?v.record.components:k.components,path:_,aliasOf:v?v.record:k})))}let I,$;for(const y of R){const{path:_}=y;if(f&&_[0]!=="/"){const S=f.record.path,A=S[S.length-1]==="/"?"":"/";y.path=f.record.path+(_&&A+_)}if(I=ly(y,f,C),v?v.alias.push(I):($=$||I,$!==I&&$.alias.push(I),T&&d.name&&!xi(I)&&r(d.name)),_u(I)&&o(I),k.children){const S=k.children;for(let A=0;A<S.length;A++)s(S[A],I,v&&v.children[A])}v=v||I}return $?()=>{r($)}:va}function r(d){if(hu(d)){const f=a.get(d);f&&(a.delete(d),l.splice(l.indexOf(f),1),f.children.forEach(r),f.alias.forEach(r))}else{const f=l.indexOf(d);f>-1&&(l.splice(f,1),d.record.name&&a.delete(d.record.name),d.children.forEach(r),d.alias.forEach(r))}}function i(){return l}function o(d){const f=ry(d,l);l.splice(f,0,d),d.record.name&&!xi(d)&&a.set(d.record.name,d)}function c(d,f){let v,T={},k,C;if("name"in d&&d.name){if(v=a.get(d.name),!v)throw Jl(We.MATCHER_NOT_FOUND,{location:d});C=v.record.name,T=Me(wi(f.params,v.keys.filter($=>!$.optional).concat(v.parent?v.parent.keys.filter($=>$.optional):[]).map($=>$.name)),d.params&&wi(d.params,v.keys.map($=>$.name))),k=v.stringify(T)}else if(d.path!=null)k=d.path,v=l.find($=>$.re.test(k)),v&&(T=v.parse(k),C=v.record.name);else{if(v=f.name?a.get(f.name):l.find($=>$.re.test(f.path)),!v)throw Jl(We.MATCHER_NOT_FOUND,{location:d,currentLocation:f});C=v.record.name,T=Me({},f.params,d.params),k=v.stringify(T)}const R=[];let I=v;for(;I;)R.unshift(I.record),I=I.parent;return{name:C,path:k,params:T,matched:R,meta:sy(R)}}e.forEach(d=>s(d));function u(){l.length=0,a.clear()}return{addRoute:s,resolve:c,removeRoute:r,clearRoutes:u,getRoutes:i,getRecordMatcher:n}}function wi(e,t){const l={};for(const a of t)a in e&&(l[a]=e[a]);return l}function Ti(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:ny(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function ny(e){const t={},l=e.props||!1;if("component"in e)t.default=l;else for(const a in e.components)t[a]=typeof l=="object"?l[a]:l;return t}function xi(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function sy(e){return e.reduce((t,l)=>Me(t,l.meta),{})}function ry(e,t){let l=0,a=t.length;for(;l!==a;){const s=l+a>>1;yu(e,t[s])<0?a=s:l=s+1}const n=iy(e);return n&&(a=t.lastIndexOf(n,a-1)),a}function iy(e){let t=e;for(;t=t.parent;)if(_u(t)&&yu(e,t)===0)return t}function _u({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ci(e){const t=tt(vn),l=tt(ks),a=h(()=>{const o=P(e.to);return t.resolve(o)}),n=h(()=>{const{matched:o}=a.value,{length:c}=o,u=o[c-1],d=l.matched;if(!u||!d.length)return-1;const f=d.findIndex(Ql.bind(null,u));if(f>-1)return f;const v=Ei(o[c-2]);return c>1&&Ei(u)===v&&d[d.length-1].path!==v?d.findIndex(Ql.bind(null,o[c-2])):f}),s=h(()=>n.value>-1&&fy(l.params,a.value.params)),r=h(()=>n.value>-1&&n.value===l.matched.length-1&&mu(l.params,a.value.params));function i(o={}){if(cy(o)){const c=t[P(e.replace)?"replace":"push"](P(e.to)).catch(va);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:a,href:h(()=>a.value.href),isActive:s,isExactActive:r,navigate:i}}function oy(e){return e.length===1?e[0]:e}const uy=ve({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Ci,setup(e,{slots:t}){const l=Al(Ci(e)),{options:a}=tt(vn),n=h(()=>({[Si(e.activeClass,a.linkActiveClass,"router-link-active")]:l.isActive,[Si(e.exactActiveClass,a.linkExactActiveClass,"router-link-exact-active")]:l.isExactActive}));return()=>{const s=t.default&&oy(t.default(l));return e.custom?s:wa("a",{"aria-current":l.isExactActive?e.ariaCurrentValue:null,href:l.href,onClick:l.navigate,class:n.value},s)}}}),dy=uy;function cy(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function fy(e,t){for(const l in t){const a=t[l],n=e[l];if(typeof a=="string"){if(a!==n)return!1}else if(!Rt(n)||n.length!==a.length||a.some((s,r)=>s.valueOf()!==n[r].valueOf()))return!1}return!0}function Ei(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Si=(e,t,l)=>e??t??l,py=ve({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:l}){const a=tt(as),n=h(()=>e.route||a.value),s=tt(gi,0),r=h(()=>{let c=P(s);const{matched:u}=n.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),i=h(()=>n.value.matched[r.value]);Xt(gi,h(()=>r.value+1)),Xt(zg,i),Xt(as,n);const o=de();return Ve(()=>[o.value,i.value,e.name],([c,u,d],[f,v,T])=>{u&&(u.instances[d]=c,v&&v!==u&&c&&c===f&&(u.leaveGuards.size||(u.leaveGuards=v.leaveGuards),u.updateGuards.size||(u.updateGuards=v.updateGuards))),c&&u&&(!v||!Ql(u,v)||!f)&&(u.enterCallbacks[d]||[]).forEach(k=>k(c))},{flush:"post"}),()=>{const c=n.value,u=e.name,d=i.value,f=d&&d.components[u];if(!f)return Ai(l.default,{Component:f,route:c});const v=d.props[u],T=v?v===!0?c.params:typeof v=="function"?v(c):v:null,C=wa(f,Me({},T,t,{onVnodeUnmounted:R=>{R.component.isUnmounted&&(d.instances[u]=null)},ref:o}));return Ai(l.default,{Component:C,route:c})||C}}});function Ai(e,t){if(!e)return null;const l=e(t);return l.length===1?l[0]:l}const ku=py;function vy(e){const t=ay(e.routes,e),l=e.parseQuery||Fg,a=e.stringifyQuery||bi,n=e.history,s=la(),r=la(),i=la(),o=pd(sl);let c=sl;Bl&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=In.bind(null,M=>""+M),d=In.bind(null,Tg),f=In.bind(null,Ea);function v(M,N){let q,ue;return hu(M)?(q=t.getRecordMatcher(M),ue=N):ue=M,t.addRoute(ue,q)}function T(M){const N=t.getRecordMatcher(M);N&&t.removeRoute(N)}function k(){return t.getRoutes().map(M=>M.record)}function C(M){return!!t.getRecordMatcher(M)}function R(M,N){if(N=Me({},N||o.value),typeof M=="string"){const E=$n(l,M,N.path),H=t.resolve({path:E.path},N),j=n.createHref(E.fullPath);return Me(E,H,{params:f(H.params),hash:Ea(E.hash),redirectedFrom:void 0,href:j})}let q;if(M.path!=null)q=Me({},M,{path:$n(l,M.path,N.path).path});else{const E=Me({},M.params);for(const H in E)E[H]==null&&delete E[H];q=Me({},M,{params:d(E)}),N.params=d(N.params)}const ue=t.resolve(q,N),z=M.hash||"";ue.params=u(f(ue.params));const p=Eg(a,Me({},M,{hash:_g(z),path:ue.path})),b=n.createHref(p);return Me({fullPath:p,hash:z,query:a===bi?Hg(M.query):M.query||{}},ue,{redirectedFrom:void 0,href:b})}function I(M){return typeof M=="string"?$n(l,M,o.value.path):Me({},M)}function $(M,N){if(c!==M)return Jl(We.NAVIGATION_CANCELLED,{from:N,to:M})}function y(M){return A(M)}function _(M){return y(Me(I(M),{replace:!0}))}function S(M,N){const q=M.matched[M.matched.length-1];if(q&&q.redirect){const{redirect:ue}=q;let z=typeof ue=="function"?ue(M,N):ue;return typeof z=="string"&&(z=z.includes("?")||z.includes("#")?z=I(z):{path:z},z.params={}),Me({query:M.query,hash:M.hash,params:z.path!=null?{}:M.params},z)}}function A(M,N){const q=c=R(M),ue=o.value,z=M.state,p=M.force,b=M.replace===!0,E=S(q,ue);if(E)return A(Me(I(E),{state:typeof E=="object"?Me({},z,E.state):z,force:p,replace:b}),N||q);const H=q;H.redirectedFrom=N;let j;return!p&&Sg(a,ue,q)&&(j=Jl(We.NAVIGATION_DUPLICATED,{to:H,from:ue}),W(ue,ue,!0,!1)),(j?Promise.resolve(j):O(H,ue)).catch(U=>Gt(U)?Gt(U,We.NAVIGATION_GUARD_REDIRECT)?U:fe(U):V(U,H,ue)).then(U=>{if(U){if(Gt(U,We.NAVIGATION_GUARD_REDIRECT))return A(Me({replace:b},I(U.to),{state:typeof U.to=="object"?Me({},z,U.to.state):z,force:p}),N||H)}else U=D(H,ue,!0,b,z);return J(H,ue,U),U})}function B(M,N){const q=$(M,N);return q?Promise.reject(q):Promise.resolve()}function F(M){const N=le.values().next().value;return N&&typeof N.runWithContext=="function"?N.runWithContext(M):M()}function O(M,N){let q;const[ue,z,p]=jg(M,N);q=Rn(ue.reverse(),"beforeRouteLeave",M,N);for(const E of ue)E.leaveGuards.forEach(H=>{q.push(ul(H,M,N))});const b=B.bind(null,M,N);return q.push(b),he(q).then(()=>{q=[];for(const E of s.list())q.push(ul(E,M,N));return q.push(b),he(q)}).then(()=>{q=Rn(z,"beforeRouteUpdate",M,N);for(const E of z)E.updateGuards.forEach(H=>{q.push(ul(H,M,N))});return q.push(b),he(q)}).then(()=>{q=[];for(const E of p)if(E.beforeEnter)if(Rt(E.beforeEnter))for(const H of E.beforeEnter)q.push(ul(H,M,N));else q.push(ul(E.beforeEnter,M,N));return q.push(b),he(q)}).then(()=>(M.matched.forEach(E=>E.enterCallbacks={}),q=Rn(p,"beforeRouteEnter",M,N,F),q.push(b),he(q))).then(()=>{q=[];for(const E of r.list())q.push(ul(E,M,N));return q.push(b),he(q)}).catch(E=>Gt(E,We.NAVIGATION_CANCELLED)?E:Promise.reject(E))}function J(M,N,q){i.list().forEach(ue=>F(()=>ue(M,N,q)))}function D(M,N,q,ue,z){const p=$(M,N);if(p)return p;const b=N===sl,E=Bl?history.state:{};q&&(ue||b?n.replace(M.fullPath,Me({scroll:b&&E&&E.scroll},z)):n.push(M.fullPath,z)),o.value=M,W(M,N,q,b),fe()}let Z;function te(){Z||(Z=n.listen((M,N,q)=>{if(!xe.listening)return;const ue=R(M),z=S(ue,xe.currentRoute.value);if(z){A(Me(z,{replace:!0,force:!0}),ue).catch(va);return}c=ue;const p=o.value;Bl&&Bg(hi(p.fullPath,q.delta),pn()),O(ue,p).catch(b=>Gt(b,We.NAVIGATION_ABORTED|We.NAVIGATION_CANCELLED)?b:Gt(b,We.NAVIGATION_GUARD_REDIRECT)?(A(Me(I(b.to),{force:!0}),ue).then(E=>{Gt(E,We.NAVIGATION_ABORTED|We.NAVIGATION_DUPLICATED)&&!q.delta&&q.type===ts.pop&&n.go(-1,!1)}).catch(va),Promise.reject()):(q.delta&&n.go(-q.delta,!1),V(b,ue,p))).then(b=>{b=b||D(ue,p,!1),b&&(q.delta&&!Gt(b,We.NAVIGATION_CANCELLED)?n.go(-q.delta,!1):q.type===ts.pop&&Gt(b,We.NAVIGATION_ABORTED|We.NAVIGATION_DUPLICATED)&&n.go(-1,!1)),J(ue,p,b)}).catch(va)}))}let Ae=la(),Q=la(),x;function V(M,N,q){fe(M);const ue=Q.list();return ue.length?ue.forEach(z=>z(M,N,q)):console.error(M),Promise.reject(M)}function ne(){return x&&o.value!==sl?Promise.resolve():new Promise((M,N)=>{Ae.add([M,N])})}function fe(M){return x||(x=!M,te(),Ae.list().forEach(([N,q])=>M?q(M):N()),Ae.reset()),M}function W(M,N,q,ue){const{scrollBehavior:z}=e;if(!Bl||!z)return Promise.resolve();const p=!q&&Pg(hi(M.fullPath,0))||(ue||!q)&&history.state&&history.state.scroll||null;return Ke().then(()=>z(M,N,p)).then(b=>b&&Vg(b)).catch(b=>V(b,M,N))}const pe=M=>n.go(M);let ie;const le=new Set,xe={currentRoute:o,listening:!0,addRoute:v,removeRoute:T,clearRoutes:t.clearRoutes,hasRoute:C,getRoutes:k,resolve:R,options:e,push:y,replace:_,go:pe,back:()=>pe(-1),forward:()=>pe(1),beforeEach:s.add,beforeResolve:r.add,afterEach:i.add,onError:Q.add,isReady:ne,install(M){M.component("RouterLink",dy),M.component("RouterView",ku),M.config.globalProperties.$router=xe,Object.defineProperty(M.config.globalProperties,"$route",{enumerable:!0,get:()=>P(o)}),Bl&&!ie&&o.value===sl&&(ie=!0,y(n.location).catch(ue=>{}));const N={};for(const ue in sl)Object.defineProperty(N,ue,{get:()=>o.value[ue],enumerable:!0});M.provide(vn,xe),M.provide(ks,eo(N)),M.provide(as,o);const q=M.unmount;le.add(M),M.unmount=function(){le.delete(M),le.size<1&&(c=sl,Z&&Z(),Z=null,o.value=sl,ie=!1,x=!1),q()}}};function he(M){return M.reduce((N,q)=>N.then(()=>F(q)),Promise.resolve())}return xe}function my(){return tt(vn)}function hy(e){return tt(ks)}const wu="lss-region",Di="us-east-1";function by(){try{return localStorage.getItem(wu)||Di}catch{return Di}}const Cl=de(by());Ve(Cl,e=>{try{localStorage.setItem(wu,e)}catch{}});const gy=[{value:"us-east-1",label:"us-east-1 — N. Virginia"},{value:"us-east-2",label:"us-east-2 — Ohio"},{value:"us-west-1",label:"us-west-1 — N. California"},{value:"us-west-2",label:"us-west-2 — Oregon"},{value:"eu-west-1",label:"eu-west-1 — Ireland"},{value:"eu-west-2",label:"eu-west-2 — London"},{value:"eu-west-3",label:"eu-west-3 — Paris"},{value:"eu-central-1",label:"eu-central-1 — Frankfurt"},{value:"eu-north-1",label:"eu-north-1 — Stockholm"},{value:"ap-southeast-1",label:"ap-southeast-1 — Singapore"},{value:"ap-southeast-2",label:"ap-southeast-2 — Sydney"},{value:"ap-northeast-1",label:"ap-northeast-1 — Tokyo"},{value:"ap-northeast-2",label:"ap-northeast-2 — Seoul"},{value:"ap-south-1",label:"ap-south-1 — Mumbai"},{value:"sa-east-1",label:"sa-east-1 — São Paulo"},{value:"ca-central-1",label:"ca-central-1 — Canada"}],Tu="";function yy(e){const t=Cl.value;if(!t)return e;const l=e.includes("?")?"&":"?";return`${e}${l}region=${encodeURIComponent(t)}`}async function Ie(e,t){const l=await fetch(`${Tu}${yy(e)}`,{headers:{"Content-Type":"application/json",...t==null?void 0:t.headers},...t});if(!l.ok){const a=await l.json().catch(()=>({error:l.statusText}));throw new Error(a.error||"Request failed")}return l.json()}const _y={checkHealth:()=>Ie("/api/health"),getConfig:()=>Ie("/api/config"),listServices:()=>Ie("/api/services"),getService:e=>Ie(`/api/services/${encodeURIComponent(e)}`),registerService:e=>Ie("/api/services/register",{method:"POST",body:JSON.stringify({servicePath:e})}),deleteService:e=>Ie(`/api/services/${e}`,{method:"DELETE"}),updateServiceStatus:(e,t,l)=>Ie(`/api/services/${e}/status`,{method:"PATCH",body:JSON.stringify({status:t,pid:l})}),startService:(e,t)=>Ie(`/api/services/${e}/start`,{method:"POST",body:JSON.stringify(t||{})}),stopService:e=>Ie(`/api/services/${e}/stop`,{method:"POST"}),getServiceLogs:e=>Ie(`/api/services/${e}/logs`),listResources:()=>Ie("/api/resources"),listResourceOwners:()=>Ie("/api/resources/owners"),listBuckets:()=>Ie("/api/buckets"),getBucket:e=>Ie(`/api/buckets/${encodeURIComponent(e)}`),listBucketObjects:(e,t)=>{const l=new URLSearchParams;t!=null&&t.prefix&&l.set("prefix",t.prefix),t!=null&&t.continuationToken&&l.set("continuationToken",t.continuationToken),(t==null?void 0:t.maxKeys)!==void 0&&l.set("maxKeys",String(t.maxKeys)),t!=null&&t.delimiter&&l.set("delimiter",t.delimiter);const a=l.toString();return Ie(`/api/buckets/${encodeURIComponent(e)}/objects${a?`?${a}`:""}`)},bucketObjectContentUrl:(e,t,l=!1)=>{const a=new URLSearchParams({key:t});l&&a.set("download","1");const n=Cl.value;return n&&a.set("region",n),`${Tu}/api/buckets/${encodeURIComponent(e)}/objects/content?${a.toString()}`},putBucketObject:(e,t)=>Ie(`/api/buckets/${encodeURIComponent(e)}/objects`,{method:"POST",body:JSON.stringify(t)}),deleteBucketObject:(e,t)=>Ie(`/api/buckets/${encodeURIComponent(e)}/objects?key=${encodeURIComponent(t)}`,{method:"DELETE"}),listQueues:()=>Ie("/api/queues"),getQueue:e=>Ie(`/api/queues/${encodeURIComponent(e)}`),resetQueueProcessed:e=>Ie(`/api/queues/${encodeURIComponent(e)}/reset-processed`,{method:"POST"}),sendQueueMessage:(e,t)=>Ie(`/api/queues/${encodeURIComponent(e)}/messages`,{method:"POST",body:JSON.stringify(t)}),receiveQueueMessages:(e,t)=>Ie(`/api/queues/${encodeURIComponent(e)}/messages/receive`,{method:"POST",body:JSON.stringify(t)}),deleteQueueMessage:(e,t)=>Ie(`/api/queues/${encodeURIComponent(e)}/messages/delete`,{method:"POST",body:JSON.stringify({receiptHandle:t})}),purgeQueue:e=>Ie(`/api/queues/${encodeURIComponent(e)}/purge`,{method:"POST"}),listDynamoTables:()=>Ie("/api/dynamo/tables"),describeDynamoTable:e=>Ie(`/api/dynamo/tables/${encodeURIComponent(e)}`),setDynamoTtl:(e,t,l)=>Ie(`/api/dynamo/tables/${encodeURIComponent(e)}/ttl`,{method:"PUT",body:JSON.stringify({enabled:t,attributeName:l})}),scanDynamoTable:(e,t)=>Ie(`/api/dynamo/tables/${encodeURIComponent(e)}/scan`,{method:"POST",body:JSON.stringify(t)}),queryDynamoTable:(e,t)=>Ie(`/api/dynamo/tables/${encodeURIComponent(e)}/query`,{method:"POST",body:JSON.stringify(t)}),getDynamoItem:(e,t)=>Ie(`/api/dynamo/tables/${encodeURIComponent(e)}/items/get`,{method:"POST",body:JSON.stringify({key:t})}),putDynamoItem:(e,t)=>Ie(`/api/dynamo/tables/${encodeURIComponent(e)}/items`,{method:"POST",body:JSON.stringify({item:t})}),deleteDynamoItem:(e,t)=>Ie(`/api/dynamo/tables/${encodeURIComponent(e)}/items/delete`,{method:"POST",body:JSON.stringify({key:t})}),listSeeds:()=>Ie("/api/seeds"),runSeed:e=>Ie("/api/seeds/run",{method:"POST",body:JSON.stringify(e?{tableName:e}:{})}),clearSeed:e=>Ie("/api/seeds/clear",{method:"POST",body:JSON.stringify(e?{tableName:e}:{})})},ky={class:"app-shell"},wy={class:"app-main"},Ty=ve({__name:"App",setup(e){const t=hy(),l=my(),a=de({status:"unknown",localstack:!1,dynamoProxy:{enabled:!1,running:!1,port:8e3}}),n=de(document.documentElement.getAttribute("data-tree-theme")||"dark");let s=null;const r=h(()=>{const d=t.path.split("/").filter(Boolean);return d.length===0?"/":`/${d[0]}`}),i=h(()=>[{label:n.value==="dark"?"Switch to light":"Switch to dark",value:"theme"}]);function o(d){d&&d!==r.value&&l.push(d)}function c(d){d==="theme"&&(n.value=n.value==="dark"?"light":"dark",document.documentElement.setAttribute("data-tree-theme",n.value))}async function u(){try{a.value=await _y.checkHealth()}catch(d){console.error("Health check failed:",d)}}return Yl(()=>{u(),s=window.setInterval(u,1e4)}),st(()=>{s&&window.clearInterval(s)}),(d,f)=>(m(),De(P(Xn),{position:"top-right"},{default:we(()=>[w("div",ky,[me(P(ra),{sticky:"",bordered:""},{start:we(()=>[me(P(qa),{direction:"vertical",gap:"0.125rem"},{default:we(()=>[...f[1]||(f[1]=[w("strong",null,"Local Serverless Stack",-1),w("span",{class:"muted",style:{"font-size":"0.75rem"}}," Local development control plane ",-1)])]),_:1})]),center:we(()=>[me(P(Qn),{"model-value":r.value,"onUpdate:modelValue":o},{default:we(()=>[me(P(Jn),null,{default:we(()=>[me(P(Tl),{value:"/"},{default:we(()=>[...f[2]||(f[2]=[$e("Overview",-1)])]),_:1}),me(P(Tl),{value:"/services"},{default:we(()=>[...f[3]||(f[3]=[$e("Services",-1)])]),_:1}),me(P(Tl),{value:"/queues"},{default:we(()=>[...f[4]||(f[4]=[$e("Queues",-1)])]),_:1}),me(P(Tl),{value:"/buckets"},{default:we(()=>[...f[5]||(f[5]=[$e("S3",-1)])]),_:1}),me(P(Tl),{value:"/dynamo"},{default:we(()=>[...f[6]||(f[6]=[$e("DynamoDB",-1)])]),_:1})]),_:1})]),_:1},8,["model-value"])]),end:we(()=>[me(P(qa),{direction:"horizontal",gap:"0.5rem",align:"center"},{default:we(()=>{var v;return[me(P(xa),{tone:a.value.localstack?"success":"danger",variant:"soft"},{default:we(()=>[$e(" LocalStack: "+ee(a.value.localstack?"Running":"Offline"),1)]),_:1},8,["tone"]),(v=a.value.dynamoProxy)!=null&&v.enabled?(m(),De(P(xa),{key:0,tone:a.value.dynamoProxy.running?"success":"warning",variant:"soft"},{default:we(()=>[$e(" Dynamo Proxy: "+ee(a.value.dynamoProxy.running?"On":"Off"),1)]),_:1},8,["tone"])):K("",!0),me(P(qn),{modelValue:P(Cl),"onUpdate:modelValue":f[0]||(f[0]=T=>Qe(Cl)?Cl.value=T:null),options:P(gy),size:"sm",style:{"min-width":"14rem"},"aria-label":"AWS Region"},null,8,["modelValue","options"]),me(P(Wn),{items:i.value,size:"sm",label:"Open menu",onSelect:c},{trigger:we(()=>[me(P(Wl),{size:"sm",variant:"ghost","aria-label":"Open menu"},{default:we(()=>[...f[7]||(f[7]=[$e(" ⋮ ",-1)])]),_:1})]),_:1},8,["items"])]}),_:1})]),_:1}),w("main",wy,[(m(),g("div",{key:`${P(t).fullPath}-${P(Cl)}`},[me(P(ku))]))])])]),_:1}))}}),xy="modulepreload",Cy=function(e){return"/"+e},Ii={},Wt=function(t,l,a){let n=Promise.resolve();if(l&&l.length>0){let r=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),o=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));n=r(l.map(c=>{if(c=Cy(c),c in Ii)return;Ii[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":xy,u||(f.as="script"),f.crossOrigin="",f.href=c,o&&f.setAttribute("nonce",o),document.head.appendChild(f),u)return new Promise((v,T)=>{f.addEventListener("load",v),f.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(r){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=r,window.dispatchEvent(i),!i.defaultPrevented)throw r}return n.then(r=>{for(const i of r||[])i.status==="rejected"&&s(i.reason);return t().catch(s)})},Ey=[{path:"/",name:"overview",component:()=>Wt(()=>import("./OverviewPage-nhomNDqx.js"),__vite__mapDeps([0,1])),meta:{title:"Overview"}},{path:"/services",name:"services",component:()=>Wt(()=>import("./ServicesPage-DWDaaOz9.js"),[]),meta:{title:"Services"}},{path:"/services/:name",name:"service-detail",component:()=>Wt(()=>import("./ServiceDetailPage-DxJ0t7HQ.js"),[]),props:e=>({serviceName:String(e.params.name)}),meta:{title:"Service"}},{path:"/queues",name:"queues",component:()=>Wt(()=>import("./QueuesPage-D5YcEbUU.js"),[]),meta:{title:"Queues"}},{path:"/queues/:name",name:"queue-detail",component:()=>Wt(()=>import("./QueueDetailPage-DHDPgRDc.js"),[]),props:e=>({queueName:String(e.params.name)}),meta:{title:"Queue"}},{path:"/buckets",name:"buckets",component:()=>Wt(()=>import("./BucketsPage-BHkg7TQp.js"),[]),meta:{title:"S3 Buckets"}},{path:"/buckets/:name",name:"bucket-detail",component:()=>Wt(()=>import("./BucketDetailPage-Hg4Gg3jC.js"),[]),props:e=>({bucketName:String(e.params.name)}),meta:{title:"S3 Bucket"}},{path:"/dynamo",name:"dynamo",component:()=>Wt(()=>import("./DynamoPage-CH_TgPh_.js"),[]),meta:{title:"DynamoDB"}},{path:"/dynamo/:name",name:"dynamo-table",component:()=>Wt(()=>import("./DynamoTablePage-BPvl5y6_.js"),[]),props:e=>({tableName:String(e.params.name)}),meta:{title:"DynamoDB Table"}},{path:"/:pathMatch(.*)*",redirect:"/"}],Sy=vy({history:Wg(),routes:Ey});document.documentElement.setAttribute("data-tree-theme","dark");cf(Ty).use(ou).use(Sy).mount("#app");export{Qn as $,Wl as A,ui as B,si as C,Fr as D,ee as E,Te as F,P as G,Dr as H,hy as I,Mr as J,Ar as K,my as L,Dy as M,Jr as N,Xh as O,Tl as P,Ve as Q,jt as R,we as S,Jn as T,Ay as U,oi as V,Iy as W,Ma as X,ii as Y,ti as Z,xa as _,dy as a,Gn as a0,Cr as b,Hr as c,_y as d,Zr as e,qa as f,h as g,w as h,De as i,K as j,g as k,Ud as l,$e as m,me as n,ve as o,Gr as p,$r as q,ni as r,Xr as s,qn as t,st as u,Yl as v,m as w,Yr as x,de as y,Le as z};
|
package/dist/ui/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta charset="UTF-8" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>LSS Orchestrator</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-D3WwZ4lY.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-EYnsoJOq.css">
|
|
10
10
|
</head>
|
|
11
11
|
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as K,v as A,u as M,w as n,i,G as a,f as x,S as s,n as r,D as U,s as h,b as j,m as o,E as u,j as f,K as F,k as y,R as H,J,V as W,A as q,B as g,_ as z,a as Q,h as I,y as _,g as G,d as w,L as X}from"./index-xSUtPJWt.js";const Y={key:0,style:{display:"flex","justify-content":"center",padding:"2rem"}},Z=["onClick"],ee={key:1},te={class:"muted mono",style:{"font-size":"0.75rem"}},se={key:1,class:"muted",style:{"font-size":"0.75rem"}},ae={key:1,class:"muted",style:{"font-size":"0.75rem"}},ne={key:1,class:"muted",style:{"font-size":"0.75rem"}},le=K({__name:"DynamoTablesList",emits:["open"],setup(P,{emit:D}){const N=D,d=_([]),p=_([]),R=_({}),c=_(!0),b=_(null);let S=null;const V=[{key:"name",label:"Table"},{key:"service",label:"Service"},{key:"status",label:"Status"},{key:"itemCount",label:"Items",align:"right"},{key:"seed",label:"Seed"},{key:"features",label:"Features"},{key:"actions",label:"",align:"right"}],B=G(()=>{const l=d.value.map(t=>{var O,$;const e=(O=t.keySchema.find(k=>k.KeyType==="HASH"))==null?void 0:O.AttributeName,m=($=t.keySchema.find(k=>k.KeyType==="RANGE"))==null?void 0:$.AttributeName,C=m?`PK: ${e} · SK: ${m}`:`PK: ${e??"—"}`,L=p.value.find(k=>k.tableName===t.name);return{name:t.name,status:t.status,itemCount:t.itemCount||0,keyDescriptor:C,billingMode:t.billingMode,ttlOn:t.ttl.enabled,streamOn:t.streamEnabled,hasGsi:t.hasGsi,hasLsi:t.hasLsi,service:R.value[t.name]||"",seedItemCount:L?L.itemCount:null,exists:!0}});for(const t of p.value)!t.tableExists&&!l.some(e=>e.name===t.tableName)&&l.push({name:t.tableName,status:"PENDING",itemCount:0,keyDescriptor:"—",ttlOn:!1,streamOn:!1,hasGsi:!1,hasLsi:!1,service:R.value[t.tableName]||"",seedItemCount:t.itemCount,exists:!1});return l.sort((t,e)=>t.name.localeCompare(e.name))}),v=G(()=>({tables:d.value.length,items:d.value.reduce((l,t)=>l+(t.itemCount||0),0),warnings:d.value.reduce((l,t)=>{var e;return l+(((e=t.warnings)==null?void 0:e.length)||0)},0),seedsPending:p.value.filter(l=>!l.tableExists).length}));async function T(){try{const[l,t,e]=await Promise.all([w.listDynamoTables(),w.listSeeds().catch(()=>({seedsDir:"",entries:[]})),w.listResourceOwners().catch(()=>({tables:[],queues:[],topics:[],buckets:[]}))]);d.value=l.tables,p.value=t.entries;const m={};for(const C of e.tables)m[C.name]=C.service;R.value=m,b.value=null}catch(l){b.value=l.message||"Failed to load DynamoDB tables"}finally{c.value=!1}}function E(l){l.exists&&N("open",l.name)}return A(()=>{T(),S=window.setInterval(T,15e3)}),M(()=>{S&&window.clearInterval(S)}),(l,t)=>(n(),i(a(x),{direction:"vertical",gap:"1.25rem"},{default:s(()=>[r(a(U),{columns:4,gap:"1rem"},{default:s(()=>[r(a(h),{label:"Tables",value:v.value.tables,tone:"info",loading:c.value},null,8,["value","loading"]),r(a(h),{label:"Total items",value:v.value.items,tone:"success",loading:c.value},null,8,["value","loading"]),r(a(h),{label:"Seeds pending",value:v.value.seedsPending,tone:v.value.seedsPending>0?"warning":"neutral",loading:c.value},null,8,["value","tone","loading"]),r(a(h),{label:"Warnings",value:v.value.warnings,tone:v.value.warnings>0?"warning":"neutral",loading:c.value},null,8,["value","tone","loading"])]),_:1}),b.value?(n(),i(a(j),{key:0,variant:"danger",dismissible:"",onDismiss:t[0]||(t[0]=e=>b.value=null)},{default:s(()=>[o(u(b.value),1)]),_:1})):f("",!0),r(a(F),{variant:"outline"},{header:s(()=>[r(a(x),{direction:"horizontal",justify:"space-between",align:"center"},{default:s(()=>[...t[1]||(t[1]=[I("strong",null,"DynamoDB tables",-1),I("span",{class:"muted",style:{"font-size":"0.75rem"}}," Rows with reduced opacity exist only as a seed file ",-1)])]),_:1})]),default:s(()=>[c.value?(n(),y("div",Y,[r(a(H),{label:"Loading tables..."})])):B.value.length?(n(),i(a(W),{key:2,columns:V,rows:B.value,"row-class":e=>e.exists?"":"dim-row"},{"cell-name":s(({row:e})=>[r(a(x),{direction:"vertical",gap:"0.125rem"},{default:s(()=>[e.exists?(n(),y("strong",{key:0,style:{cursor:"pointer","text-decoration":"underline","text-decoration-style":"dotted","text-underline-offset":"3px"},onClick:m=>E(e)},u(e.name),9,Z)):(n(),y("strong",ee,u(e.name),1)),I("span",te,u(e.keyDescriptor),1)]),_:2},1024)]),"cell-service":s(({row:e})=>[e.service?(n(),i(a(Q),{key:0,to:`/services/${encodeURIComponent(String(e.service))}`,style:{"text-decoration":"none"}},{default:s(()=>[r(a(g),{size:"sm",variant:"soft",clickable:""},{default:s(()=>[o(u(e.service),1)]),_:2},1024)]),_:2},1032,["to"])):(n(),y("span",se,"—"))]),"cell-status":s(({row:e})=>[e.exists?(n(),i(a(z),{key:0,tone:e.status==="ACTIVE"?"success":"warning",variant:"soft"},{default:s(()=>[o(u(e.status||"UNKNOWN"),1)]),_:2},1032,["tone"])):(n(),i(a(z),{key:1,tone:"warning",variant:"outline"},{default:s(()=>[...t[2]||(t[2]=[o("Not created",-1)])]),_:1}))]),"cell-itemCount":s(({row:e})=>[o(u(e.exists?e.itemCount:"—"),1)]),"cell-seed":s(({row:e})=>[e.seedItemCount!==null?(n(),i(a(z),{key:0,tone:e.exists?"info":"warning",variant:"soft"},{default:s(()=>[o(u(e.seedItemCount)+" seeded item"+u(e.seedItemCount===1?"":"s"),1)]),_:2},1032,["tone"])):(n(),y("span",ae,"no seed"))]),"cell-features":s(({row:e})=>[r(a(x),{direction:"horizontal",gap:"0.25rem",wrap:""},{default:s(()=>[e.billingMode?(n(),i(a(g),{key:0,size:"sm",variant:"soft"},{default:s(()=>[o(u(e.billingMode),1)]),_:2},1024)):f("",!0),e.ttlOn?(n(),i(a(g),{key:1,size:"sm",variant:"solid"},{default:s(()=>[...t[3]||(t[3]=[o("TTL",-1)])]),_:1})):f("",!0),e.streamOn?(n(),i(a(g),{key:2,size:"sm",variant:"solid"},{default:s(()=>[...t[4]||(t[4]=[o("Streams",-1)])]),_:1})):f("",!0),e.hasGsi?(n(),i(a(g),{key:3,size:"sm",variant:"soft"},{default:s(()=>[...t[5]||(t[5]=[o("GSI",-1)])]),_:1})):f("",!0),e.hasLsi?(n(),i(a(g),{key:4,size:"sm",variant:"soft"},{default:s(()=>[...t[6]||(t[6]=[o("LSI",-1)])]),_:1})):f("",!0)]),_:2},1024)]),"cell-actions":s(({row:e})=>[e.exists?(n(),i(a(q),{key:0,size:"sm",variant:"soft",onClick:m=>E(e)},{default:s(()=>[...t[7]||(t[7]=[o(" Explore ",-1)])]),_:1},8,["onClick"])):(n(),y("span",ne," Register service to provision "))]),_:1},8,["rows","row-class"])):(n(),i(a(J),{key:1,title:"No DynamoDB tables",description:"Register a microservice with DynamoDB resources or drop a seed file into the seeds directory."}))]),_:1})]),_:1}))}}),oe=K({__name:"DynamoPage",setup(P){const D=X();function N(d){D.push(`/dynamo/${encodeURIComponent(d)}`)}return(d,p)=>(n(),i(le,{onOpen:N}))}});export{oe as default};
|