mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-15 09:01:31 +00:00
feat: use STS tokens on frontend (#322)
This commit is contained in:
@@ -6,17 +6,12 @@ ARCH := $(shell uname -m)
|
||||
ifeq ($(ARCH),x86_64)
|
||||
GO_ARCH := amd64
|
||||
AWS_ARCH := x86_64
|
||||
# On x86, we can run ARM VMs via emulation
|
||||
QEMU_PACKAGES := qemu-system-x86 qemu-system-arm
|
||||
else ifeq ($(ARCH),aarch64)
|
||||
GO_ARCH := arm64
|
||||
AWS_ARCH := aarch64
|
||||
# On ARM, we can run x86 VMs via emulation
|
||||
QEMU_PACKAGES := qemu-system-aarch64 qemu-system-x86
|
||||
else ifeq ($(ARCH),arm64)
|
||||
GO_ARCH := arm64
|
||||
AWS_ARCH := aarch64
|
||||
QEMU_PACKAGES := qemu-system-aarch64 qemu-system-x86
|
||||
else
|
||||
$(error Unsupported architecture: $(ARCH). Only x86_64 and aarch64/arm64 are supported.)
|
||||
endif
|
||||
@@ -115,10 +110,6 @@ install-microvm: $(MICROVM_ARTIFACTS) ## Install microVM artifacts to /usr/share
|
||||
sudo install -m 0644 $(MICROVM_OUT_DIR)/vmlinuz /usr/share/spinifex/microvm/vmlinuz
|
||||
sudo install -m 0644 $(MICROVM_OUT_DIR)/initramfs.cpio.gz /usr/share/spinifex/microvm/initramfs.cpio.gz
|
||||
|
||||
go_run:
|
||||
@echo -e "\n....Running $(GO_PROJECT_NAME)...."
|
||||
$(GOPATH)/bin/$(GO_PROJECT_NAME)
|
||||
|
||||
# Preflight — runs the same checks as GitHub Actions (lint + vuln + tests).
|
||||
# Use this before committing to catch CI failures locally.
|
||||
preflight:
|
||||
@@ -168,13 +159,8 @@ diff-coverage: test-cover
|
||||
|
||||
bench:
|
||||
@echo -e "\n....Running benchmarks for $(GO_PROJECT_NAME)...."
|
||||
$(MAKE) easyjson
|
||||
LOG_IGNORE=1 go test -benchmem -run=. -bench=. ./...
|
||||
|
||||
run:
|
||||
$(MAKE) go_build
|
||||
$(MAKE) go_run
|
||||
|
||||
# Fast iteration: build + install binary + restart all services.
|
||||
# Microvm artifacts are reinstalled when they already exist on disk — the rule's
|
||||
# input timestamps drive a rebuild only if anything actually changed. On a fresh
|
||||
@@ -201,11 +187,10 @@ clean:
|
||||
|
||||
install-system:
|
||||
@echo -e "\n....Installing system dependencies for $(ARCH)...."
|
||||
@echo "QEMU packages: $(QEMU_PACKAGES)"
|
||||
sudo apt-get update && sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
-o Dpkg::Options::="--force-confdef" \
|
||||
-o Dpkg::Options::="--force-confold" \
|
||||
nbdkit nbdkit-plugin-dev pkg-config $(QEMU_PACKAGES) qemu-utils qemu-kvm \
|
||||
nbdkit nbdkit-plugin-dev pkg-config qemu-system-x86 qemu-system-arm qemu-utils qemu-kvm \
|
||||
ovmf qemu-efi-aarch64 \
|
||||
libvirt-daemon-system libvirt-clients libvirt-dev make gcc jq curl \
|
||||
iproute2 netcat-openbsd openssh-client wget git unzip sudo xz-utils file \
|
||||
@@ -234,19 +219,15 @@ install-aws:
|
||||
quickinstall: install-system install-go install-aws
|
||||
@echo -e "\n✅ Quickinstall complete for $(ARCH)."
|
||||
@echo " Please ensure /usr/local/go/bin is in your PATH."
|
||||
@echo " Installed: Go ($(GO_ARCH)), AWS CLI ($(AWS_ARCH)), QEMU ($(QEMU_PACKAGES))"
|
||||
|
||||
# Lint all Go code via golangci-lint (replaces check-format, vet, gosec, staticcheck)
|
||||
lint:
|
||||
@echo "Running golangci-lint..."
|
||||
$(_Q)golangci-lint run ./...
|
||||
@echo " golangci-lint ok"
|
||||
|
||||
# Auto-fix all linter issues that have fixers
|
||||
fix:
|
||||
golangci-lint run --fix ./...
|
||||
|
||||
# Govulncheck — dependency vulnerability scanning (not covered by golangci-lint)
|
||||
govulncheck:
|
||||
@echo "Running govulncheck..."
|
||||
$(_Q)go tool govulncheck ./...
|
||||
@@ -353,7 +334,7 @@ ansible-cluster-bootstrap:
|
||||
$(if $(POOL),-e cluster_external_pool=$(POOL),) \
|
||||
$(_ANSIBLE_EXTRA)
|
||||
|
||||
.PHONY: build build-ui build-installer build-lb-agent build-system-image build-eks-node-image import-eks-node-image publish-eks-node-image build-microvm-image install-microvm go_build go_run preflight test test-cover test-race diff-coverage bench run test-actions test-harness manifest-check diff-coverage bench run \
|
||||
.PHONY: build build-ui build-installer build-lb-agent build-system-image build-eks-node-image import-eks-node-image publish-eks-node-image build-microvm-image install-microvm go_build preflight test test-cover test-race diff-coverage bench test-actions test-harness manifest-check \
|
||||
deploy reinstall clean \
|
||||
install-system install-go install-aws quickinstall \
|
||||
lint fix govulncheck \
|
||||
|
||||
@@ -45,7 +45,6 @@ func (gw *GatewayConfig) Spinifex_Request(w http.ResponseWriter, r *http.Request
|
||||
slog.Error("Spinifex_Request: no account ID in auth context")
|
||||
return errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
identity, _ := r.Context().Value(ctxIdentity).(string)
|
||||
|
||||
// Enforce admin-only on restricted actions
|
||||
if spinifexAdminActions[action] && accountID != admin.DefaultAccountID() {
|
||||
@@ -55,8 +54,6 @@ func (gw *GatewayConfig) Spinifex_Request(w http.ResponseWriter, r *http.Request
|
||||
|
||||
var output any
|
||||
switch action {
|
||||
case "GetCallerIdentity":
|
||||
output, err = gateway_spx.GetCallerIdentity(accountID, identity)
|
||||
case "GetVersion":
|
||||
output, err = gateway_spx.GetVersion(gw.Version, gw.Commit)
|
||||
case "GetNodes":
|
||||
|
||||
@@ -33,30 +33,6 @@ func spinifexRequest(t *testing.T, gw *GatewayConfig, action, accountID, identit
|
||||
return w
|
||||
}
|
||||
|
||||
func TestSpinifex_GetCallerIdentity_Admin(t *testing.T) {
|
||||
gw := &GatewayConfig{
|
||||
DisableLogging: true,
|
||||
Version: "v0.5.0",
|
||||
Commit: "abc123",
|
||||
}
|
||||
w := spinifexRequest(t, gw, "GetCallerIdentity", admin.DefaultAccountID(), "admin")
|
||||
assert.Equal(t, http.StatusOK, w.Code)
|
||||
assert.Contains(t, w.Body.String(), `"account_id":"000000000001"`)
|
||||
assert.Contains(t, w.Body.String(), `"user_name":"admin"`)
|
||||
}
|
||||
|
||||
func TestSpinifex_GetCallerIdentity_NonAdmin(t *testing.T) {
|
||||
gw := &GatewayConfig{
|
||||
DisableLogging: true,
|
||||
Version: "v0.5.0",
|
||||
Commit: "abc123",
|
||||
}
|
||||
w := spinifexRequest(t, gw, "GetCallerIdentity", "000000000002", "alice")
|
||||
assert.Equal(t, http.StatusOK, w.Code)
|
||||
assert.Contains(t, w.Body.String(), `"account_id":"000000000002"`)
|
||||
assert.Contains(t, w.Body.String(), `"user_name":"alice"`)
|
||||
}
|
||||
|
||||
func TestSpinifex_GetVersion_Admin(t *testing.T) {
|
||||
gw := &GatewayConfig{
|
||||
DisableLogging: true,
|
||||
@@ -117,7 +93,7 @@ func TestSpinifex_MissingAction(t *testing.T) {
|
||||
|
||||
func TestSpinifex_NoAccountID(t *testing.T) {
|
||||
gw := &GatewayConfig{DisableLogging: true}
|
||||
body := "Action=GetCallerIdentity"
|
||||
body := "Action=GetVersion"
|
||||
req := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(body))
|
||||
ctx := context.WithValue(req.Context(), ctxService, "spinifex")
|
||||
req = req.WithContext(ctx)
|
||||
|
||||
@@ -14,20 +14,6 @@ import (
|
||||
"github.com/nats-io/nats.go"
|
||||
)
|
||||
|
||||
// CallerIdentityOutput is the response for GetCallerIdentity.
|
||||
type CallerIdentityOutput struct {
|
||||
AccountID string `json:"account_id"`
|
||||
UserName string `json:"user_name"`
|
||||
}
|
||||
|
||||
// GetCallerIdentity returns the caller's identity from the SigV4 auth context.
|
||||
func GetCallerIdentity(accountID, userName string) (*CallerIdentityOutput, error) {
|
||||
return &CallerIdentityOutput{
|
||||
AccountID: accountID,
|
||||
UserName: userName,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// VersionOutput is the response for GetVersion.
|
||||
type VersionOutput struct {
|
||||
Version string `json:"version"`
|
||||
|
||||
@@ -12,20 +12,6 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestGetCallerIdentity(t *testing.T) {
|
||||
out, err := GetCallerIdentity("000000000001", "admin")
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "000000000001", out.AccountID)
|
||||
assert.Equal(t, "admin", out.UserName)
|
||||
}
|
||||
|
||||
func TestGetCallerIdentity_NonAdmin(t *testing.T) {
|
||||
out, err := GetCallerIdentity("000000000002", "alice")
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "000000000002", out.AccountID)
|
||||
assert.Equal(t, "alice", out.UserName)
|
||||
}
|
||||
|
||||
func TestGetVersion_OpenSource(t *testing.T) {
|
||||
out, err := GetVersion("v0.5.0-43-gae1deb5", "ae1deb5")
|
||||
require.NoError(t, err)
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./error-banner.js";import{t as r}from"./useSuspenseQuery.js";import{Or as i}from"./awsClient.js";import{C as a,E as o,T as s,j as c}from"./SignatureV4.js";import{t as l}from"./back-link.js";import{n as u,r as d,t as f}from"./upload-button.js";import{r as p}from"./s3.js";import{S as m,ot as h}from"./index.js";var g=t(),_=e();function v(){let e=(0,g.c)(24),{bucket:t,_splat:v}=m.useParams(),y=s(v??``),{data:b}=r(h(t,y)),x=p(),S;e[0]===b.Contents?S=e[1]:(S=b.Contents??[],e[0]=b.Contents,e[1]=S);let C=S,w;e[2]===b.CommonPrefixes?w=e[3]:(w=b.CommonPrefixes??[],e[2]=b.CommonPrefixes,e[3]=w);let T=w,E=y.split(`/`).filter(Boolean),D=[{name:t,path:`/s3/ls/${t}`},...E.map((e,n)=>({name:e,path:`/s3/ls/${t}/${`${E.slice(0,n+1).join(`/`)}/`}`}))],O=E.length>1?`/s3/ls/${t}/${E.slice(0,-1).join(`/`)}/`:`/s3/ls/${t}`,k;e[4]===O?k=e[5]:(k=(0,_.jsx)(l,{to:O,children:`Back`}),e[4]=O,e[5]=k);let A;e[6]!==t||e[7]!==y||e[8]!==x.isPending||e[9]!==x.mutateAsync?(A=(0,_.jsx)(f,{bucket:t,isPending:x.isPending,onUpload:x.mutateAsync,prefix:y}),e[6]=t,e[7]=y,e[8]=x.isPending,e[9]=x.mutateAsync,e[10]=A):A=e[10];let j;e[11]===x.error?j=e[12]:(j=x.error&&(0,_.jsx)(n,{error:x.error,msg:`Failed to upload object`}),e[11]=x.error,e[12]=j);let M;e[13]!==t||e[14]!==T||e[15]!==y?(M=T.length>0&&(0,_.jsxs)(`div`,{className:`mb-6`,children:[(0,_.jsx)(`h2`,{className:`mb-3 text-lg font-semibold`,children:`Folders`}),(0,_.jsx)(`div`,{className:`space-y-2`,children:T.map(e=>e.Prefix?(0,_.jsx)(d,{bucketName:t,folderName:c(o(e.Prefix,y)),fullPrefix:a(e.Prefix,y)},e.Prefix):null)})]}),e[13]=t,e[14]=T,e[15]=y,e[16]=M):M=e[16];let N;e[17]!==t||e[18]!==C||e[19]!==y?(N=C.length>0&&(0,_.jsxs)(`div`,{className:`space-y-2`,children:[(0,_.jsx)(`h2`,{className:`mb-3 text-lg font-semibold`,children:`Objects`}),C.map(e=>e.Key?(0,_.jsx)(u,{bucketName:t,displayName:o(e.Key,y),fullKey:a(e.Key,y),object:e},e.Key):null)]}),e[17]=t,e[18]=C,e[19]=y,e[20]=N):N=e[20];let P;return e[21]!==T.length||e[22]!==C.length?(P=C.length===0&&T.length===0&&(0,_.jsx)(`p`,{className:`text-muted-foreground`,children:`No objects found in this folder.`}),e[21]=T.length,e[22]=C.length,e[23]=P):P=e[23],(0,_.jsxs)(_.Fragment,{children:[k,(0,_.jsx)(`div`,{className:`mb-6`,children:(0,_.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,_.jsx)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:D.map((e,t)=>(0,_.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t>0&&(0,_.jsx)(`span`,{children:`/`}),t===D.length-1?(0,_.jsx)(`span`,{className:`text-foreground`,children:e.name}):(0,_.jsx)(i,{className:`hover:text-foreground`,to:e.path,children:e.name})]},e.path))}),A]})}),j,M,N,P]})}export{v as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./error-banner.js";import{t as r}from"./useSuspenseQuery.js";import{vr as i}from"./awsClient.js";import{Bt as a,Gt as o,Lt as s,zt as c}from"./auth.js";import{t as l}from"./back-link.js";import{n as u,r as d,t as f}from"./upload-button.js";import{r as p}from"./s3.js";import{S as m,ot as h}from"./index.js";var g=t(),_=e();function v(){let e=(0,g.c)(24),{bucket:t,_splat:v}=m.useParams(),y=c(v??``),{data:b}=r(h(t,y)),x=p(),S;e[0]===b.Contents?S=e[1]:(S=b.Contents??[],e[0]=b.Contents,e[1]=S);let C=S,w;e[2]===b.CommonPrefixes?w=e[3]:(w=b.CommonPrefixes??[],e[2]=b.CommonPrefixes,e[3]=w);let T=w,E=y.split(`/`).filter(Boolean),D=[{name:t,path:`/s3/ls/${t}`},...E.map((e,n)=>({name:e,path:`/s3/ls/${t}/${`${E.slice(0,n+1).join(`/`)}/`}`}))],O=E.length>1?`/s3/ls/${t}/${E.slice(0,-1).join(`/`)}/`:`/s3/ls/${t}`,k;e[4]===O?k=e[5]:(k=(0,_.jsx)(l,{to:O,children:`Back`}),e[4]=O,e[5]=k);let A;e[6]!==t||e[7]!==y||e[8]!==x.isPending||e[9]!==x.mutateAsync?(A=(0,_.jsx)(f,{bucket:t,isPending:x.isPending,onUpload:x.mutateAsync,prefix:y}),e[6]=t,e[7]=y,e[8]=x.isPending,e[9]=x.mutateAsync,e[10]=A):A=e[10];let j;e[11]===x.error?j=e[12]:(j=x.error&&(0,_.jsx)(n,{error:x.error,msg:`Failed to upload object`}),e[11]=x.error,e[12]=j);let M;e[13]!==t||e[14]!==T||e[15]!==y?(M=T.length>0&&(0,_.jsxs)(`div`,{className:`mb-6`,children:[(0,_.jsx)(`h2`,{className:`mb-3 text-lg font-semibold`,children:`Folders`}),(0,_.jsx)(`div`,{className:`space-y-2`,children:T.map(e=>e.Prefix?(0,_.jsx)(d,{bucketName:t,folderName:o(a(e.Prefix,y)),fullPrefix:s(e.Prefix,y)},e.Prefix):null)})]}),e[13]=t,e[14]=T,e[15]=y,e[16]=M):M=e[16];let N;e[17]!==t||e[18]!==C||e[19]!==y?(N=C.length>0&&(0,_.jsxs)(`div`,{className:`space-y-2`,children:[(0,_.jsx)(`h2`,{className:`mb-3 text-lg font-semibold`,children:`Objects`}),C.map(e=>e.Key?(0,_.jsx)(u,{bucketName:t,displayName:a(e.Key,y),fullKey:s(e.Key,y),object:e},e.Key):null)]}),e[17]=t,e[18]=C,e[19]=y,e[20]=N):N=e[20];let P;return e[21]!==T.length||e[22]!==C.length?(P=C.length===0&&T.length===0&&(0,_.jsx)(`p`,{className:`text-muted-foreground`,children:`No objects found in this folder.`}),e[21]=T.length,e[22]=C.length,e[23]=P):P=e[23],(0,_.jsxs)(_.Fragment,{children:[k,(0,_.jsx)(`div`,{className:`mb-6`,children:(0,_.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,_.jsx)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:D.map((e,t)=>(0,_.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t>0&&(0,_.jsx)(`span`,{children:`/`}),t===D.length-1?(0,_.jsx)(`span`,{className:`text-foreground`,children:e.name}):(0,_.jsx)(i,{className:`hover:text-foreground`,to:e.path,children:e.name})]},e.path))}),A]})}),j,M,N,P]})}export{v as component};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./error-banner.js";import{t as r}from"./useSuspenseQuery.js";import{j as i}from"./SignatureV4.js";import{t as a}from"./back-link.js";import{n as o,r as s,t as c}from"./upload-button.js";import{r as l}from"./s3.js";import{N as u,ot as d}from"./index.js";import{t as f}from"./page-heading.js";var p=t(),m=e();function h(){let e=(0,p.c)(31),{bucket:t}=u.useParams(),h;e[0]===t?h=e[1]:(h=d(t),e[0]=t,e[1]=h);let{data:g}=r(h),_=l(),v;e[2]===g.Contents?v=e[3]:(v=g.Contents??[],e[2]=g.Contents,e[3]=v);let y=v,b;e[4]===g.CommonPrefixes?b=e[5]:(b=g.CommonPrefixes??[],e[4]=g.CommonPrefixes,e[5]=b);let x=b,S;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,m.jsx)(a,{to:`/s3/ls`,children:`Back to buckets`}),e[6]=S):S=e[6];let C;e[7]!==t||e[8]!==_.isPending||e[9]!==_.mutateAsync?(C=(0,m.jsx)(c,{bucket:t,isPending:_.isPending,onUpload:_.mutateAsync}),e[7]=t,e[8]=_.isPending,e[9]=_.mutateAsync,e[10]=C):C=e[10];let w;e[11]!==t||e[12]!==C?(w=(0,m.jsx)(f,{actions:C,title:t}),e[11]=t,e[12]=C,e[13]=w):w=e[13];let T;e[14]===_.error?T=e[15]:(T=_.error&&(0,m.jsx)(n,{error:_.error,msg:`Failed to upload object`}),e[14]=_.error,e[15]=T);let E;e[16]!==t||e[17]!==x?(E=x.length>0&&(0,m.jsxs)(`div`,{className:`mb-6`,children:[(0,m.jsx)(`h2`,{className:`mb-3 text-lg font-semibold`,children:`Folders`}),(0,m.jsx)(`div`,{className:`space-y-2`,children:x.map(e=>e.Prefix?(0,m.jsx)(s,{bucketName:t,folderName:i(e.Prefix),fullPrefix:e.Prefix},e.Prefix):null)})]}),e[16]=t,e[17]=x,e[18]=E):E=e[18];let D;e[19]!==t||e[20]!==y?(D=y.length>0&&(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`h2`,{className:`mb-3 text-lg font-semibold`,children:`Objects`}),y.map(e=>e.Key?(0,m.jsx)(o,{bucketName:t,displayName:e.Key,fullKey:e.Key,object:e},e.Key):null)]}),e[19]=t,e[20]=y,e[21]=D):D=e[21];let O;e[22]!==x.length||e[23]!==y.length?(O=y.length===0&&x.length===0&&(0,m.jsx)(`p`,{className:`text-muted-foreground`,children:`No objects found in this bucket.`}),e[22]=x.length,e[23]=y.length,e[24]=O):O=e[24];let k;return e[25]!==w||e[26]!==T||e[27]!==E||e[28]!==D||e[29]!==O?(k=(0,m.jsxs)(m.Fragment,{children:[S,w,T,E,D,O]}),e[25]=w,e[26]=T,e[27]=E,e[28]=D,e[29]=O,e[30]=k):k=e[30],k}export{h as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./error-banner.js";import{t as r}from"./useSuspenseQuery.js";import{Gt as i}from"./auth.js";import{t as a}from"./back-link.js";import{n as o,r as s,t as c}from"./upload-button.js";import{r as l}from"./s3.js";import{N as u,ot as d}from"./index.js";import{t as f}from"./page-heading.js";var p=t(),m=e();function h(){let e=(0,p.c)(31),{bucket:t}=u.useParams(),h;e[0]===t?h=e[1]:(h=d(t),e[0]=t,e[1]=h);let{data:g}=r(h),_=l(),v;e[2]===g.Contents?v=e[3]:(v=g.Contents??[],e[2]=g.Contents,e[3]=v);let y=v,b;e[4]===g.CommonPrefixes?b=e[5]:(b=g.CommonPrefixes??[],e[4]=g.CommonPrefixes,e[5]=b);let x=b,S;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,m.jsx)(a,{to:`/s3/ls`,children:`Back to buckets`}),e[6]=S):S=e[6];let C;e[7]!==t||e[8]!==_.isPending||e[9]!==_.mutateAsync?(C=(0,m.jsx)(c,{bucket:t,isPending:_.isPending,onUpload:_.mutateAsync}),e[7]=t,e[8]=_.isPending,e[9]=_.mutateAsync,e[10]=C):C=e[10];let w;e[11]!==t||e[12]!==C?(w=(0,m.jsx)(f,{actions:C,title:t}),e[11]=t,e[12]=C,e[13]=w):w=e[13];let T;e[14]===_.error?T=e[15]:(T=_.error&&(0,m.jsx)(n,{error:_.error,msg:`Failed to upload object`}),e[14]=_.error,e[15]=T);let E;e[16]!==t||e[17]!==x?(E=x.length>0&&(0,m.jsxs)(`div`,{className:`mb-6`,children:[(0,m.jsx)(`h2`,{className:`mb-3 text-lg font-semibold`,children:`Folders`}),(0,m.jsx)(`div`,{className:`space-y-2`,children:x.map(e=>e.Prefix?(0,m.jsx)(s,{bucketName:t,folderName:i(e.Prefix),fullPrefix:e.Prefix},e.Prefix):null)})]}),e[16]=t,e[17]=x,e[18]=E):E=e[18];let D;e[19]!==t||e[20]!==y?(D=y.length>0&&(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`h2`,{className:`mb-3 text-lg font-semibold`,children:`Objects`}),y.map(e=>e.Key?(0,m.jsx)(o,{bucketName:t,displayName:e.Key,fullKey:e.Key,object:e},e.Key):null)]}),e[19]=t,e[20]=y,e[21]=D):D=e[21];let O;e[22]!==x.length||e[23]!==y.length?(O=y.length===0&&x.length===0&&(0,m.jsx)(`p`,{className:`text-muted-foreground`,children:`No objects found in this bucket.`}),e[22]=x.length,e[23]=y.length,e[24]=O):O=e[24];let k;return e[25]!==w||e[26]!==T||e[27]!==E||e[28]!==D||e[29]!==O?(k=(0,m.jsxs)(m.Fragment,{children:[S,w,T,E,D,O]}),e[25]=w,e[26]=T,e[27]=E,e[28]=D,e[29]=O,e[30]=k):k=e[30],k}export{h as component};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{A as a}from"./SignatureV4.js";import{t as o}from"./back-link.js";import{c as s,i as c,n as l,s as u,t as d}from"./select.js";import{t as f}from"./trash-2.js";import{t as p}from"./button.js";import{G as m,L as h,n as g}from"./ec2.js";import{Ir as _,ct as v,gt as y,t as b}from"./index.js";import{t as x}from"./page-heading.js";import{t as S}from"./delete-confirmation-dialog.js";import{n as C,t as w}from"./detail-row.js";var T=t(n()),E=e();function D(){let{id:e}=b.useParams(),t=_(),{data:n}=i(v(e)),{data:D}=i(y),O=g(),k=h(),A=m(),[j,M]=(0,T.useState)(!1),[N,P]=(0,T.useState)(``),F=n.Addresses?.[0],I=D.Reservations?.flatMap(e=>e.Instances??[]).filter(e=>e.State?.Name===`running`||e.State?.Name===`stopped`)??[],L=async()=>{try{await A.mutateAsync(e),t({to:`/ec2/describe-addresses`})}finally{M(!1)}},R=async()=>{N&&await O.mutateAsync({allocationId:e,instanceId:N})},z=async()=>{F?.AssociationId&&await k.mutateAsync(F.AssociationId)};if(!F?.AllocationId)return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(o,{to:`/ec2/describe-addresses`,children:`Back to Elastic IPs`}),(0,E.jsx)(`p`,{className:`text-muted-foreground`,children:`Elastic IP not found.`})]});let B=!!F.AssociationId,V=a(F.Tags);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(o,{to:`/ec2/describe-addresses`,children:`Back to Elastic IPs`}),(A.error??O.error??k.error)&&(0,E.jsx)(r,{error:A.error??O.error??k.error??void 0,msg:`Elastic IP action failed`}),(0,E.jsxs)(`div`,{className:`space-y-6`,children:[(0,E.jsx)(x,{actions:(0,E.jsxs)(p,{disabled:B||A.isPending,onClick:()=>M(!0),size:`sm`,variant:`destructive`,children:[(0,E.jsx)(f,{className:`size-4`}),`Release`]}),subtitle:`Elastic IP Details`,title:V?`${F.AllocationId} (${V})`:F.AllocationId}),(0,E.jsxs)(C,{children:[(0,E.jsx)(C.Header,{children:`Elastic IP Information`}),(0,E.jsxs)(C.Content,{children:[(0,E.jsx)(w,{label:`Allocation ID`,value:F.AllocationId}),(0,E.jsx)(w,{label:`Public IP`,value:F.PublicIp}),(0,E.jsx)(w,{label:`Domain`,value:F.Domain}),(0,E.jsx)(w,{label:`Association ID`,value:F.AssociationId??`—`}),(0,E.jsx)(w,{label:`Instance ID`,value:F.InstanceId??`—`}),(0,E.jsx)(w,{label:`Private IP`,value:F.PrivateIpAddress??`—`})]})]}),(0,E.jsxs)(C,{children:[(0,E.jsx)(C.Header,{children:`Association`}),(0,E.jsx)(C.Content,{children:B?(0,E.jsx)(p,{disabled:k.isPending,onClick:z,size:`sm`,variant:`outline`,children:`Disassociate`}):(0,E.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,E.jsx)(`div`,{className:`flex-1`,children:(0,E.jsxs)(d,{onValueChange:e=>P(e??``),value:N,children:[(0,E.jsx)(u,{className:`w-full`,children:(0,E.jsx)(s,{placeholder:`Select an instance`})}),(0,E.jsx)(l,{children:I.map(e=>{let t=a(e.Tags);return(0,E.jsx)(c,{value:e.InstanceId??``,children:t?`${e.InstanceId} (${t})`:e.InstanceId},e.InstanceId)})})]})}),(0,E.jsx)(p,{disabled:!N||O.isPending,onClick:R,size:`sm`,children:`Associate`})]})})]})]}),(0,E.jsx)(S,{description:`Are you sure you want to release the Elastic IP "${F.AllocationId}" (${F.PublicIp})? This action cannot be undone.`,isPending:A.isPending,onConfirm:L,onOpenChange:M,open:j,title:`Release Elastic IP`})]})}export{D as component};
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{Wt as a}from"./auth.js";import{t as o}from"./back-link.js";import{c as s,i as c,n as l,s as u,t as d}from"./select.js";import{t as f}from"./trash-2.js";import{t as p}from"./button.js";import{G as m,L as h,n as g}from"./ec2.js";import{Ir as _,ct as v,gt as y,t as b}from"./index.js";import{t as x}from"./page-heading.js";import{t as S}from"./delete-confirmation-dialog.js";import{n as C,t as w}from"./detail-row.js";var T=t(n()),E=e();function D(){let{id:e}=b.useParams(),t=_(),{data:n}=i(v(e)),{data:D}=i(y),O=g(),k=h(),A=m(),[j,M]=(0,T.useState)(!1),[N,P]=(0,T.useState)(``),F=n.Addresses?.[0],I=D.Reservations?.flatMap(e=>e.Instances??[]).filter(e=>e.State?.Name===`running`||e.State?.Name===`stopped`)??[],L=async()=>{try{await A.mutateAsync(e),t({to:`/ec2/describe-addresses`})}finally{M(!1)}},R=async()=>{N&&await O.mutateAsync({allocationId:e,instanceId:N})},z=async()=>{F?.AssociationId&&await k.mutateAsync(F.AssociationId)};if(!F?.AllocationId)return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(o,{to:`/ec2/describe-addresses`,children:`Back to Elastic IPs`}),(0,E.jsx)(`p`,{className:`text-muted-foreground`,children:`Elastic IP not found.`})]});let B=!!F.AssociationId,V=a(F.Tags);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(o,{to:`/ec2/describe-addresses`,children:`Back to Elastic IPs`}),(A.error??O.error??k.error)&&(0,E.jsx)(r,{error:A.error??O.error??k.error??void 0,msg:`Elastic IP action failed`}),(0,E.jsxs)(`div`,{className:`space-y-6`,children:[(0,E.jsx)(x,{actions:(0,E.jsxs)(p,{disabled:B||A.isPending,onClick:()=>M(!0),size:`sm`,variant:`destructive`,children:[(0,E.jsx)(f,{className:`size-4`}),`Release`]}),subtitle:`Elastic IP Details`,title:V?`${F.AllocationId} (${V})`:F.AllocationId}),(0,E.jsxs)(C,{children:[(0,E.jsx)(C.Header,{children:`Elastic IP Information`}),(0,E.jsxs)(C.Content,{children:[(0,E.jsx)(w,{label:`Allocation ID`,value:F.AllocationId}),(0,E.jsx)(w,{label:`Public IP`,value:F.PublicIp}),(0,E.jsx)(w,{label:`Domain`,value:F.Domain}),(0,E.jsx)(w,{label:`Association ID`,value:F.AssociationId??`—`}),(0,E.jsx)(w,{label:`Instance ID`,value:F.InstanceId??`—`}),(0,E.jsx)(w,{label:`Private IP`,value:F.PrivateIpAddress??`—`})]})]}),(0,E.jsxs)(C,{children:[(0,E.jsx)(C.Header,{children:`Association`}),(0,E.jsx)(C.Content,{children:B?(0,E.jsx)(p,{disabled:k.isPending,onClick:z,size:`sm`,variant:`outline`,children:`Disassociate`}):(0,E.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,E.jsx)(`div`,{className:`flex-1`,children:(0,E.jsxs)(d,{onValueChange:e=>P(e??``),value:N,children:[(0,E.jsx)(u,{className:`w-full`,children:(0,E.jsx)(s,{placeholder:`Select an instance`})}),(0,E.jsx)(l,{children:I.map(e=>{let t=a(e.Tags);return(0,E.jsx)(c,{value:e.InstanceId??``,children:t?`${e.InstanceId} (${t})`:e.InstanceId},e.InstanceId)})})]})}),(0,E.jsx)(p,{disabled:!N||O.isPending,onClick:R,size:`sm`,children:`Associate`})]})})]})]}),(0,E.jsx)(S,{description:`Are you sure you want to release the Elastic IP "${F.AllocationId}" (${F.PublicIp})? This action cannot be undone.`,isPending:A.isPending,onConfirm:L,onOpenChange:M,open:j,title:`Release Elastic IP`})]})}export{D as component};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{Or as a}from"./awsClient.js";import{D as o}from"./SignatureV4.js";import{t as s}from"./back-link.js";import{t as c}from"./copy.js";import{t as l}from"./trash-2.js";import{t as u}from"./button.js";import{j as d,l as f}from"./ec2.js";import{At as p,Ir as m,Rn as h,Tt as g,d as _}from"./index.js";import{t as v}from"./page-heading.js";import{a as y,t as b}from"./field.js";import{a as x,i as S,l as C,n as w,o as T,r as E,s as D,t as O}from"./alert-dialog.js";import{t as k}from"./delete-confirmation-dialog.js";import{n as A,t as j}from"./detail-row.js";import{t as M}from"./state-badge.js";var N=t(n()),P=e();function F(){let{id:e}=_.useParams(),t=m(),{data:n}=i(p(e)),{data:F}=i(g),I=n.Snapshots?.[0],L=d(),R=f(),[z,B]=(0,N.useState)(!1),[V,H]=(0,N.useState)(!1),[U,W]=(0,N.useState)(``),G=F.Regions?.[0]?.RegionName??`ap-southeast-2`,K=I?.State===`completed`,q=async()=>{try{await L.mutateAsync(e),t({to:`/ec2/describe-snapshots`})}finally{B(!1)}},J=async()=>{try{await R.mutateAsync({sourceSnapshotId:e,sourceRegion:G,description:U||void 0}),H(!1),W(``)}catch{}};if(!I?.SnapshotId)return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(s,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:`Snapshot not found.`})]});let Y=o(I.StartTime);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(s,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),L.error&&(0,P.jsx)(r,{error:L.error,msg:`Failed to delete snapshot`}),R.error&&(0,P.jsx)(r,{error:R.error,msg:`Failed to copy snapshot`}),(0,P.jsxs)(`div`,{className:`space-y-6`,children:[(0,P.jsx)(v,{actions:(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(u,{disabled:!K,onClick:()=>B(!0),size:`sm`,variant:`destructive`,children:[(0,P.jsx)(l,{className:`size-4`}),`Delete`]}),(0,P.jsxs)(u,{disabled:!K,onClick:()=>H(!0),size:`sm`,variant:`outline`,children:[(0,P.jsx)(c,{className:`size-4`}),`Copy Snapshot`]}),(0,P.jsx)(M,{state:I.State})]}),subtitle:`Snapshot Details`,title:I.SnapshotId}),(0,P.jsxs)(A,{children:[(0,P.jsx)(A.Header,{children:`Snapshot Information`}),(0,P.jsxs)(A.Content,{children:[(0,P.jsx)(j,{label:`Snapshot ID`,value:I.SnapshotId}),(0,P.jsx)(j,{label:`Volume ID`,value:I.VolumeId?(0,P.jsx)(a,{className:`text-primary hover:underline`,params:{id:I.VolumeId},to:`/ec2/describe-volumes/$id`,children:I.VolumeId}):void 0}),(0,P.jsx)(j,{label:`Volume Size`,value:`${I.VolumeSize} GiB`}),(0,P.jsx)(j,{label:`State`,value:I.State}),(0,P.jsx)(j,{label:`Description`,value:I.Description}),(0,P.jsx)(j,{label:`Progress`,value:I.Progress}),(0,P.jsx)(j,{label:`Start Time`,value:Y}),(0,P.jsx)(j,{label:`Owner ID`,value:I.OwnerId}),(0,P.jsx)(j,{label:`Encrypted`,value:I.Encrypted?`Yes`:`No`})]})]})]}),(0,P.jsx)(k,{description:`Are you sure you want to delete the snapshot "${I.SnapshotId}"? This action cannot be undone.`,isPending:L.isPending,onConfirm:q,onOpenChange:B,open:z,title:`Delete Snapshot`}),(0,P.jsx)(O,{onOpenChange:H,open:V,children:(0,P.jsxs)(S,{children:[(0,P.jsxs)(D,{children:[(0,P.jsx)(C,{children:`Copy Snapshot`}),(0,P.jsx)(x,{children:`Create a copy of this snapshot in the current region.`})]}),(0,P.jsxs)(b,{children:[(0,P.jsx)(y,{children:(0,P.jsx)(`label`,{htmlFor:`copyDescription`,children:`Description (optional)`})}),(0,P.jsx)(h,{id:`copyDescription`,onChange:e=>W(e.target.value),placeholder:`Description for the snapshot copy`,value:U})]}),(0,P.jsxs)(T,{children:[(0,P.jsx)(E,{children:`Cancel`}),(0,P.jsx)(w,{disabled:R.isPending,onClick:J,children:R.isPending?`Copying…`:`Copy Snapshot`})]})]})})]})}export{F as component};
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{vr as a}from"./awsClient.js";import{Vt as o}from"./auth.js";import{t as s}from"./back-link.js";import{t as c}from"./copy.js";import{t as l}from"./trash-2.js";import{t as u}from"./button.js";import{j as d,l as f}from"./ec2.js";import{At as p,Ir as m,Rn as h,Tt as g,d as _}from"./index.js";import{t as v}from"./page-heading.js";import{a as y,t as b}from"./field.js";import{a as x,i as S,l as C,n as w,o as T,r as E,s as D,t as O}from"./alert-dialog.js";import{t as k}from"./delete-confirmation-dialog.js";import{n as A,t as j}from"./detail-row.js";import{t as M}from"./state-badge.js";var N=t(n()),P=e();function F(){let{id:e}=_.useParams(),t=m(),{data:n}=i(p(e)),{data:F}=i(g),I=n.Snapshots?.[0],L=d(),R=f(),[z,B]=(0,N.useState)(!1),[V,H]=(0,N.useState)(!1),[U,W]=(0,N.useState)(``),G=F.Regions?.[0]?.RegionName??`ap-southeast-2`,K=I?.State===`completed`,q=async()=>{try{await L.mutateAsync(e),t({to:`/ec2/describe-snapshots`})}finally{B(!1)}},J=async()=>{try{await R.mutateAsync({sourceSnapshotId:e,sourceRegion:G,description:U||void 0}),H(!1),W(``)}catch{}};if(!I?.SnapshotId)return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(s,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:`Snapshot not found.`})]});let Y=o(I.StartTime);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(s,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),L.error&&(0,P.jsx)(r,{error:L.error,msg:`Failed to delete snapshot`}),R.error&&(0,P.jsx)(r,{error:R.error,msg:`Failed to copy snapshot`}),(0,P.jsxs)(`div`,{className:`space-y-6`,children:[(0,P.jsx)(v,{actions:(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(u,{disabled:!K,onClick:()=>B(!0),size:`sm`,variant:`destructive`,children:[(0,P.jsx)(l,{className:`size-4`}),`Delete`]}),(0,P.jsxs)(u,{disabled:!K,onClick:()=>H(!0),size:`sm`,variant:`outline`,children:[(0,P.jsx)(c,{className:`size-4`}),`Copy Snapshot`]}),(0,P.jsx)(M,{state:I.State})]}),subtitle:`Snapshot Details`,title:I.SnapshotId}),(0,P.jsxs)(A,{children:[(0,P.jsx)(A.Header,{children:`Snapshot Information`}),(0,P.jsxs)(A.Content,{children:[(0,P.jsx)(j,{label:`Snapshot ID`,value:I.SnapshotId}),(0,P.jsx)(j,{label:`Volume ID`,value:I.VolumeId?(0,P.jsx)(a,{className:`text-primary hover:underline`,params:{id:I.VolumeId},to:`/ec2/describe-volumes/$id`,children:I.VolumeId}):void 0}),(0,P.jsx)(j,{label:`Volume Size`,value:`${I.VolumeSize} GiB`}),(0,P.jsx)(j,{label:`State`,value:I.State}),(0,P.jsx)(j,{label:`Description`,value:I.Description}),(0,P.jsx)(j,{label:`Progress`,value:I.Progress}),(0,P.jsx)(j,{label:`Start Time`,value:Y}),(0,P.jsx)(j,{label:`Owner ID`,value:I.OwnerId}),(0,P.jsx)(j,{label:`Encrypted`,value:I.Encrypted?`Yes`:`No`})]})]})]}),(0,P.jsx)(k,{description:`Are you sure you want to delete the snapshot "${I.SnapshotId}"? This action cannot be undone.`,isPending:L.isPending,onConfirm:q,onOpenChange:B,open:z,title:`Delete Snapshot`}),(0,P.jsx)(O,{onOpenChange:H,open:V,children:(0,P.jsxs)(S,{children:[(0,P.jsxs)(D,{children:[(0,P.jsx)(C,{children:`Copy Snapshot`}),(0,P.jsx)(x,{children:`Create a copy of this snapshot in the current region.`})]}),(0,P.jsxs)(b,{children:[(0,P.jsx)(y,{children:(0,P.jsx)(`label`,{htmlFor:`copyDescription`,children:`Description (optional)`})}),(0,P.jsx)(h,{id:`copyDescription`,onChange:e=>W(e.target.value),placeholder:`Description for the snapshot copy`,value:U})]}),(0,P.jsxs)(T,{children:[(0,P.jsx)(E,{children:`Cancel`}),(0,P.jsx)(w,{disabled:R.isPending,onClick:J,children:R.isPending?`Copying…`:`Copy Snapshot`})]})]})})]})}export{F as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{Or as a}from"./awsClient.js";import{A as o}from"./SignatureV4.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{M as u}from"./ec2.js";import{Ir as d,Mt as f,f as p}from"./index.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./state-badge.js";var y=t(n()),b=e();function x(){let{id:e}=p.useParams(),t=d(),{data:n}=i(f(e)),x=n.Subnets?.[0],S=u(),[C,w]=(0,y.useState)(!1),T=async()=>{try{await S.mutateAsync(e),t({to:`/ec2/describe-subnets`})}finally{w(!1)}};if(!x?.SubnetId)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-subnets`,children:`Back to Subnets`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`Subnet not found.`})]});let E=o(x.Tags);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-subnets`,children:`Back to Subnets`}),S.error&&(0,b.jsx)(r,{error:S.error,msg:`Failed to delete subnet`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(l,{onClick:()=>w(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(c,{className:`size-4`}),`Delete`]}),(0,b.jsx)(v,{state:x.State})]}),subtitle:`Subnet Details`,title:E?`${x.SubnetId} (${E})`:x.SubnetId}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Subnet Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Subnet ID`,value:x.SubnetId}),(0,b.jsx)(_,{label:`VPC ID`,value:x.VpcId?(0,b.jsx)(a,{className:`text-primary hover:underline`,params:{id:x.VpcId},to:`/ec2/describe-vpcs/$id`,children:x.VpcId}):`—`}),(0,b.jsx)(_,{label:`State`,value:x.State}),(0,b.jsx)(_,{label:`CIDR Block`,value:x.CidrBlock}),(0,b.jsx)(_,{label:`Availability Zone`,value:x.AvailabilityZone}),(0,b.jsx)(_,{label:`Available IP Count`,value:x.AvailableIpAddressCount?.toString()}),(0,b.jsx)(_,{label:`Map Public IP on Launch`,value:x.MapPublicIpOnLaunch?`Yes`:`No`}),(0,b.jsx)(_,{label:`Default for AZ`,value:x.DefaultForAz?`Yes`:`No`})]})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the subnet "${x.SubnetId}"? This action cannot be undone.`,isPending:S.isPending,onConfirm:T,onOpenChange:w,open:C,title:`Delete Subnet`})]})}export{x as component};
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{vr as a}from"./awsClient.js";import{Wt as o}from"./auth.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{M as u}from"./ec2.js";import{Ir as d,Mt as f,f as p}from"./index.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./state-badge.js";var y=t(n()),b=e();function x(){let{id:e}=p.useParams(),t=d(),{data:n}=i(f(e)),x=n.Subnets?.[0],S=u(),[C,w]=(0,y.useState)(!1),T=async()=>{try{await S.mutateAsync(e),t({to:`/ec2/describe-subnets`})}finally{w(!1)}};if(!x?.SubnetId)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-subnets`,children:`Back to Subnets`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`Subnet not found.`})]});let E=o(x.Tags);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-subnets`,children:`Back to Subnets`}),S.error&&(0,b.jsx)(r,{error:S.error,msg:`Failed to delete subnet`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(l,{onClick:()=>w(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(c,{className:`size-4`}),`Delete`]}),(0,b.jsx)(v,{state:x.State})]}),subtitle:`Subnet Details`,title:E?`${x.SubnetId} (${E})`:x.SubnetId}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Subnet Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Subnet ID`,value:x.SubnetId}),(0,b.jsx)(_,{label:`VPC ID`,value:x.VpcId?(0,b.jsx)(a,{className:`text-primary hover:underline`,params:{id:x.VpcId},to:`/ec2/describe-vpcs/$id`,children:x.VpcId}):`—`}),(0,b.jsx)(_,{label:`State`,value:x.State}),(0,b.jsx)(_,{label:`CIDR Block`,value:x.CidrBlock}),(0,b.jsx)(_,{label:`Availability Zone`,value:x.AvailabilityZone}),(0,b.jsx)(_,{label:`Available IP Count`,value:x.AvailableIpAddressCount?.toString()}),(0,b.jsx)(_,{label:`Map Public IP on Launch`,value:x.MapPublicIpOnLaunch?`Yes`:`No`}),(0,b.jsx)(_,{label:`Default for AZ`,value:x.DefaultForAz?`Yes`:`No`})]})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the subnet "${x.SubnetId}"? This action cannot be undone.`,isPending:S.isPending,onConfirm:T,onOpenChange:w,open:C,title:`Delete Subnet`})]})}export{x as component};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{Or as a}from"./awsClient.js";import{A as o}from"./SignatureV4.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{P as u}from"./ec2.js";import{Ir as d,It as f,Nt as p,g as m}from"./index.js";import{t as h}from"./page-heading.js";import{t as g}from"./delete-confirmation-dialog.js";import{n as _,t as v}from"./detail-row.js";import{t as y}from"./state-badge.js";var b=t(n()),x=e();function S(){let{id:e}=m.useParams(),t=d(),{data:n}=i(f(e)),{data:S}=i(p),C=n.Vpcs?.[0],w=u(),[T,E]=(0,b.useState)(!1),D=S.Subnets?.filter(t=>t.VpcId===e)??[],O=async()=>{try{await w.mutateAsync(e),t({to:`/ec2/describe-vpcs`})}finally{E(!1)}};if(!C?.VpcId)return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s,{to:`/ec2/describe-vpcs`,children:`Back to VPCs`}),(0,x.jsx)(`p`,{className:`text-muted-foreground`,children:`VPC not found.`})]});let k=o(C.Tags);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s,{to:`/ec2/describe-vpcs`,children:`Back to VPCs`}),w.error&&(0,x.jsx)(r,{error:w.error,msg:`Failed to delete VPC`}),(0,x.jsxs)(`div`,{className:`space-y-6`,children:[(0,x.jsx)(h,{actions:(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsxs)(l,{onClick:()=>E(!0),size:`sm`,variant:`destructive`,children:[(0,x.jsx)(c,{className:`size-4`}),`Delete`]}),(0,x.jsx)(y,{state:C.State})]}),subtitle:`VPC Details`,title:k?`${C.VpcId} (${k})`:C.VpcId}),(0,x.jsxs)(_,{children:[(0,x.jsx)(_.Header,{children:`VPC Information`}),(0,x.jsxs)(_.Content,{children:[(0,x.jsx)(v,{label:`VPC ID`,value:C.VpcId}),(0,x.jsx)(v,{label:`State`,value:C.State}),(0,x.jsx)(v,{label:`CIDR Block`,value:C.CidrBlock}),(0,x.jsx)(v,{label:`Is Default`,value:C.IsDefault?`Yes`:`No`}),(0,x.jsx)(v,{label:`DHCP Options ID`,value:C.DhcpOptionsId}),(0,x.jsx)(v,{label:`Instance Tenancy`,value:C.InstanceTenancy}),(0,x.jsx)(v,{label:`Owner ID`,value:C.OwnerId})]})]}),D.length>0&&(0,x.jsxs)(_,{children:[(0,x.jsxs)(_.Header,{children:[`Subnets (`,D.length,`)`]}),D.map(e=>e.SubnetId?(0,x.jsxs)(_.Content,{children:[(0,x.jsx)(v,{label:`Subnet ID`,value:(0,x.jsx)(a,{className:`text-primary hover:underline`,params:{id:e.SubnetId},to:`/ec2/describe-subnets/$id`,children:e.SubnetId})}),(0,x.jsx)(v,{label:`CIDR Block`,value:e.CidrBlock}),(0,x.jsx)(v,{label:`Availability Zone`,value:e.AvailabilityZone}),(0,x.jsx)(v,{label:`State`,value:e.State})]},e.SubnetId):null)]})]}),(0,x.jsx)(g,{description:`Are you sure you want to delete the VPC "${C.VpcId}"? This action cannot be undone. The VPC must have no associated subnets or internet gateways.`,isPending:w.isPending,onConfirm:O,onOpenChange:E,open:T,title:`Delete VPC`})]})}export{S as component};
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{vr as a}from"./awsClient.js";import{Wt as o}from"./auth.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{P as u}from"./ec2.js";import{Ir as d,It as f,Nt as p,g as m}from"./index.js";import{t as h}from"./page-heading.js";import{t as g}from"./delete-confirmation-dialog.js";import{n as _,t as v}from"./detail-row.js";import{t as y}from"./state-badge.js";var b=t(n()),x=e();function S(){let{id:e}=m.useParams(),t=d(),{data:n}=i(f(e)),{data:S}=i(p),C=n.Vpcs?.[0],w=u(),[T,E]=(0,b.useState)(!1),D=S.Subnets?.filter(t=>t.VpcId===e)??[],O=async()=>{try{await w.mutateAsync(e),t({to:`/ec2/describe-vpcs`})}finally{E(!1)}};if(!C?.VpcId)return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s,{to:`/ec2/describe-vpcs`,children:`Back to VPCs`}),(0,x.jsx)(`p`,{className:`text-muted-foreground`,children:`VPC not found.`})]});let k=o(C.Tags);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s,{to:`/ec2/describe-vpcs`,children:`Back to VPCs`}),w.error&&(0,x.jsx)(r,{error:w.error,msg:`Failed to delete VPC`}),(0,x.jsxs)(`div`,{className:`space-y-6`,children:[(0,x.jsx)(h,{actions:(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsxs)(l,{onClick:()=>E(!0),size:`sm`,variant:`destructive`,children:[(0,x.jsx)(c,{className:`size-4`}),`Delete`]}),(0,x.jsx)(y,{state:C.State})]}),subtitle:`VPC Details`,title:k?`${C.VpcId} (${k})`:C.VpcId}),(0,x.jsxs)(_,{children:[(0,x.jsx)(_.Header,{children:`VPC Information`}),(0,x.jsxs)(_.Content,{children:[(0,x.jsx)(v,{label:`VPC ID`,value:C.VpcId}),(0,x.jsx)(v,{label:`State`,value:C.State}),(0,x.jsx)(v,{label:`CIDR Block`,value:C.CidrBlock}),(0,x.jsx)(v,{label:`Is Default`,value:C.IsDefault?`Yes`:`No`}),(0,x.jsx)(v,{label:`DHCP Options ID`,value:C.DhcpOptionsId}),(0,x.jsx)(v,{label:`Instance Tenancy`,value:C.InstanceTenancy}),(0,x.jsx)(v,{label:`Owner ID`,value:C.OwnerId})]})]}),D.length>0&&(0,x.jsxs)(_,{children:[(0,x.jsxs)(_.Header,{children:[`Subnets (`,D.length,`)`]}),D.map(e=>e.SubnetId?(0,x.jsxs)(_.Content,{children:[(0,x.jsx)(v,{label:`Subnet ID`,value:(0,x.jsx)(a,{className:`text-primary hover:underline`,params:{id:e.SubnetId},to:`/ec2/describe-subnets/$id`,children:e.SubnetId})}),(0,x.jsx)(v,{label:`CIDR Block`,value:e.CidrBlock}),(0,x.jsx)(v,{label:`Availability Zone`,value:e.AvailabilityZone}),(0,x.jsx)(v,{label:`State`,value:e.State})]},e.SubnetId):null)]})]}),(0,x.jsx)(g,{description:`Are you sure you want to delete the VPC "${C.VpcId}"? This action cannot be undone. The VPC must have no associated subnets or internet gateways.`,isPending:w.isPending,onConfirm:O,onOpenChange:E,open:T,title:`Delete VPC`})]})}export{S as component};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{Or as a}from"./awsClient.js";import{A as o}from"./SignatureV4.js";import{t as s}from"./back-link.js";import{c,i as l,n as u,s as d,t as f}from"./select.js";import{t as p}from"./trash-2.js";import{t as m}from"./button.js";import{F as h,a as g,w as _}from"./ec2.js";import{Ir as v,Lt as y,_t as b,i as x}from"./index.js";import{t as S}from"./page-heading.js";import{t as C}from"./delete-confirmation-dialog.js";import{n as w,t as T}from"./detail-row.js";var E=t(n()),D=e();function O(){let{id:e}=x.useParams(),t=v(),{data:n}=i(b(e)),{data:O}=i(y),k=g(),A=h(),j=_(),[M,N]=(0,E.useState)(!1),[P,F]=(0,E.useState)(``),I=n.InternetGateways?.[0],L=O.Vpcs??[],R=async()=>{try{await j.mutateAsync(e),t({to:`/ec2/describe-internet-gateways`})}finally{N(!1)}},z=async()=>{P&&await k.mutateAsync({internetGatewayId:e,vpcId:P})},B=async t=>{await A.mutateAsync({internetGatewayId:e,vpcId:t})};if(!I?.InternetGatewayId)return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(s,{to:`/ec2/describe-internet-gateways`,children:`Back to Internet Gateways`}),(0,D.jsx)(`p`,{className:`text-muted-foreground`,children:`Internet Gateway not found.`})]});let V=I.Attachments?.[0],H=!!V?.VpcId,U=o(I.Tags);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(s,{to:`/ec2/describe-internet-gateways`,children:`Back to Internet Gateways`}),(j.error??k.error??A.error)&&(0,D.jsx)(r,{error:j.error??k.error??A.error??void 0,msg:`Internet Gateway action failed`}),(0,D.jsxs)(`div`,{className:`space-y-6`,children:[(0,D.jsx)(S,{actions:(0,D.jsxs)(m,{disabled:H||j.isPending,onClick:()=>N(!0),size:`sm`,variant:`destructive`,children:[(0,D.jsx)(p,{className:`size-4`}),`Delete`]}),subtitle:`Internet Gateway Details`,title:U?`${I.InternetGatewayId} (${U})`:I.InternetGatewayId}),(0,D.jsxs)(w,{children:[(0,D.jsx)(w.Header,{children:`Internet Gateway Information`}),(0,D.jsxs)(w.Content,{children:[(0,D.jsx)(T,{label:`Internet Gateway ID`,value:I.InternetGatewayId}),(0,D.jsx)(T,{label:`Owner ID`,value:I.OwnerId??`—`}),(0,D.jsx)(T,{label:`State`,value:V?.State??`detached`})]})]}),(0,D.jsxs)(w,{children:[(0,D.jsx)(w.Header,{children:`VPC Attachment`}),(0,D.jsx)(w.Content,{children:H?(0,D.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,D.jsx)(a,{className:`text-primary hover:underline`,params:{id:V.VpcId??``},to:`/ec2/describe-vpcs/$id`,children:V.VpcId}),(0,D.jsx)(m,{disabled:A.isPending,onClick:async()=>await B(V.VpcId??``),size:`sm`,variant:`outline`,children:`Detach`})]}):(0,D.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,D.jsx)(`div`,{className:`flex-1`,children:(0,D.jsxs)(f,{onValueChange:e=>F(e??``),value:P,children:[(0,D.jsx)(d,{className:`w-full`,children:(0,D.jsx)(c,{placeholder:`Select a VPC`})}),(0,D.jsx)(u,{children:L.map(e=>{let t=o(e.Tags);return(0,D.jsx)(l,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)})})]})}),(0,D.jsx)(m,{disabled:!P||k.isPending,onClick:z,size:`sm`,children:`Attach`})]})})]})]}),(0,D.jsx)(C,{description:`Are you sure you want to delete the Internet Gateway "${I.InternetGatewayId}"? This action cannot be undone.`,isPending:j.isPending,onConfirm:R,onOpenChange:N,open:M,title:`Delete Internet Gateway`})]})}export{O as component};
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{vr as a}from"./awsClient.js";import{Wt as o}from"./auth.js";import{t as s}from"./back-link.js";import{c,i as l,n as u,s as d,t as f}from"./select.js";import{t as p}from"./trash-2.js";import{t as m}from"./button.js";import{F as h,a as g,w as _}from"./ec2.js";import{Ir as v,Lt as y,_t as b,i as x}from"./index.js";import{t as S}from"./page-heading.js";import{t as C}from"./delete-confirmation-dialog.js";import{n as w,t as T}from"./detail-row.js";var E=t(n()),D=e();function O(){let{id:e}=x.useParams(),t=v(),{data:n}=i(b(e)),{data:O}=i(y),k=g(),A=h(),j=_(),[M,N]=(0,E.useState)(!1),[P,F]=(0,E.useState)(``),I=n.InternetGateways?.[0],L=O.Vpcs??[],R=async()=>{try{await j.mutateAsync(e),t({to:`/ec2/describe-internet-gateways`})}finally{N(!1)}},z=async()=>{P&&await k.mutateAsync({internetGatewayId:e,vpcId:P})},B=async t=>{await A.mutateAsync({internetGatewayId:e,vpcId:t})};if(!I?.InternetGatewayId)return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(s,{to:`/ec2/describe-internet-gateways`,children:`Back to Internet Gateways`}),(0,D.jsx)(`p`,{className:`text-muted-foreground`,children:`Internet Gateway not found.`})]});let V=I.Attachments?.[0],H=!!V?.VpcId,U=o(I.Tags);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(s,{to:`/ec2/describe-internet-gateways`,children:`Back to Internet Gateways`}),(j.error??k.error??A.error)&&(0,D.jsx)(r,{error:j.error??k.error??A.error??void 0,msg:`Internet Gateway action failed`}),(0,D.jsxs)(`div`,{className:`space-y-6`,children:[(0,D.jsx)(S,{actions:(0,D.jsxs)(m,{disabled:H||j.isPending,onClick:()=>N(!0),size:`sm`,variant:`destructive`,children:[(0,D.jsx)(p,{className:`size-4`}),`Delete`]}),subtitle:`Internet Gateway Details`,title:U?`${I.InternetGatewayId} (${U})`:I.InternetGatewayId}),(0,D.jsxs)(w,{children:[(0,D.jsx)(w.Header,{children:`Internet Gateway Information`}),(0,D.jsxs)(w.Content,{children:[(0,D.jsx)(T,{label:`Internet Gateway ID`,value:I.InternetGatewayId}),(0,D.jsx)(T,{label:`Owner ID`,value:I.OwnerId??`—`}),(0,D.jsx)(T,{label:`State`,value:V?.State??`detached`})]})]}),(0,D.jsxs)(w,{children:[(0,D.jsx)(w.Header,{children:`VPC Attachment`}),(0,D.jsx)(w.Content,{children:H?(0,D.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,D.jsx)(a,{className:`text-primary hover:underline`,params:{id:V.VpcId??``},to:`/ec2/describe-vpcs/$id`,children:V.VpcId}),(0,D.jsx)(m,{disabled:A.isPending,onClick:async()=>await B(V.VpcId??``),size:`sm`,variant:`outline`,children:`Detach`})]}):(0,D.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,D.jsx)(`div`,{className:`flex-1`,children:(0,D.jsxs)(f,{onValueChange:e=>F(e??``),value:P,children:[(0,D.jsx)(d,{className:`w-full`,children:(0,D.jsx)(c,{placeholder:`Select a VPC`})}),(0,D.jsx)(u,{children:L.map(e=>{let t=o(e.Tags);return(0,D.jsx)(l,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)})})]})}),(0,D.jsx)(m,{disabled:!P||k.isPending,onClick:z,size:`sm`,children:`Attach`})]})})]})]}),(0,D.jsx)(C,{description:`Are you sure you want to delete the Internet Gateway "${I.InternetGatewayId}"? This action cannot be undone.`,isPending:j.isPending,onConfirm:R,onOpenChange:N,open:M,title:`Delete Internet Gateway`})]})}export{O as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{D as a}from"./SignatureV4.js";import{t as o}from"./back-link.js";import{t as s}from"./trash-2.js";import{t as c}from"./button.js";import{T as l}from"./ec2.js";import{Ir as u,a as d,yt as f}from"./index.js";import{t as p}from"./page-heading.js";import{t as m}from"./delete-confirmation-dialog.js";import{n as h,t as g}from"./detail-row.js";var _=t(n()),v=e();function y(){let{id:e}=d.useParams(),t=u(),{data:n}=i(f(e)),y=n.KeyPairs?.[0],b=l(),[x,S]=(0,_.useState)(!1),C=async()=>{try{await b.mutateAsync(e),t({to:`/ec2/describe-key-pairs`})}finally{S(!1)}};if(!y?.KeyPairId)return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(o,{to:`/ec2/describe-key-pairs`,children:`Back to key pairs`}),(0,v.jsx)(`p`,{className:`text-muted-foreground`,children:`Key pair not found.`})]});let w=a(y.CreateTime);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(o,{to:`/ec2/describe-key-pairs`,children:`Back to key pairs`}),b.error&&(0,v.jsx)(r,{error:b.error,msg:`Failed to delete key pair`}),(0,v.jsxs)(`div`,{className:`space-y-6`,children:[(0,v.jsx)(p,{actions:(0,v.jsxs)(c,{onClick:()=>S(!0),size:`sm`,variant:`destructive`,children:[(0,v.jsx)(s,{className:`size-4`}),`Delete`]}),subtitle:`Key Pair Details`,title:y.KeyName??``}),(0,v.jsxs)(h,{children:[(0,v.jsx)(h.Header,{children:`Key Pair Information`}),(0,v.jsxs)(h.Content,{children:[(0,v.jsx)(g,{label:`Key Pair ID`,value:y.KeyPairId}),(0,v.jsx)(g,{label:`Key Name`,value:y.KeyName}),(0,v.jsx)(g,{label:`Key Type`,value:y.KeyType}),(0,v.jsx)(g,{label:`Key Fingerprint`,value:y.KeyFingerprint}),(0,v.jsx)(g,{label:`Creation Date`,value:w})]})]}),y.Tags&&y.Tags.length>0&&(0,v.jsxs)(h,{children:[(0,v.jsx)(h.Header,{children:`Tags`}),(0,v.jsx)(h.Content,{children:y.Tags.map(e=>(0,v.jsx)(g,{label:e.Key??``,value:e.Value},e.Key))})]})]}),(0,v.jsx)(m,{description:`Are you sure you want to delete the key pair "${y.KeyName}"? This action cannot be undone. Any instances using this key pair will no longer be able to be accessed with it.`,isPending:b.isPending,onConfirm:C,onOpenChange:S,open:x,title:`Delete Key Pair`})]})}export{y as component};
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{Vt as a}from"./auth.js";import{t as o}from"./back-link.js";import{t as s}from"./trash-2.js";import{t as c}from"./button.js";import{T as l}from"./ec2.js";import{Ir as u,a as d,yt as f}from"./index.js";import{t as p}from"./page-heading.js";import{t as m}from"./delete-confirmation-dialog.js";import{n as h,t as g}from"./detail-row.js";var _=t(n()),v=e();function y(){let{id:e}=d.useParams(),t=u(),{data:n}=i(f(e)),y=n.KeyPairs?.[0],b=l(),[x,S]=(0,_.useState)(!1),C=async()=>{try{await b.mutateAsync(e),t({to:`/ec2/describe-key-pairs`})}finally{S(!1)}};if(!y?.KeyPairId)return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(o,{to:`/ec2/describe-key-pairs`,children:`Back to key pairs`}),(0,v.jsx)(`p`,{className:`text-muted-foreground`,children:`Key pair not found.`})]});let w=a(y.CreateTime);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(o,{to:`/ec2/describe-key-pairs`,children:`Back to key pairs`}),b.error&&(0,v.jsx)(r,{error:b.error,msg:`Failed to delete key pair`}),(0,v.jsxs)(`div`,{className:`space-y-6`,children:[(0,v.jsx)(p,{actions:(0,v.jsxs)(c,{onClick:()=>S(!0),size:`sm`,variant:`destructive`,children:[(0,v.jsx)(s,{className:`size-4`}),`Delete`]}),subtitle:`Key Pair Details`,title:y.KeyName??``}),(0,v.jsxs)(h,{children:[(0,v.jsx)(h.Header,{children:`Key Pair Information`}),(0,v.jsxs)(h.Content,{children:[(0,v.jsx)(g,{label:`Key Pair ID`,value:y.KeyPairId}),(0,v.jsx)(g,{label:`Key Name`,value:y.KeyName}),(0,v.jsx)(g,{label:`Key Type`,value:y.KeyType}),(0,v.jsx)(g,{label:`Key Fingerprint`,value:y.KeyFingerprint}),(0,v.jsx)(g,{label:`Creation Date`,value:w})]})]}),y.Tags&&y.Tags.length>0&&(0,v.jsxs)(h,{children:[(0,v.jsx)(h.Header,{children:`Tags`}),(0,v.jsx)(h.Content,{children:y.Tags.map(e=>(0,v.jsx)(g,{label:e.Key??``,value:e.Value},e.Key))})]})]}),(0,v.jsx)(m,{description:`Are you sure you want to delete the key pair "${y.KeyName}"? This action cannot be undone. Any instances using this key pair will no longer be able to be accessed with it.`,isPending:b.isPending,onConfirm:C,onOpenChange:S,open:x,title:`Delete Key Pair`})]})}export{y as component};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{Or as a}from"./awsClient.js";import{A as o}from"./SignatureV4.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{E as u}from"./ec2.js";import{Ir as d,s as f,xt as p}from"./index.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./state-badge.js";var y=t(n()),b=e();function x(){let{id:e}=f.useParams(),t=d(),{data:n}=i(p(e)),x=u(),[S,C]=(0,y.useState)(!1),w=n.NatGateways?.[0],T=async()=>{try{await x.mutateAsync(e),t({to:`/ec2/describe-nat-gateways`})}finally{C(!1)}};if(!w?.NatGatewayId)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-nat-gateways`,children:`Back to NAT Gateways`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`NAT Gateway not found.`})]});let E=o(w.Tags),D=w.NatGatewayAddresses?.[0];return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-nat-gateways`,children:`Back to NAT Gateways`}),x.error&&(0,b.jsx)(r,{error:x.error,msg:`Failed to delete NAT Gateway`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(l,{disabled:x.isPending,onClick:()=>C(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(c,{className:`size-4`}),`Delete`]}),(0,b.jsx)(v,{state:w.State})]}),subtitle:`NAT Gateway Details`,title:E?`${w.NatGatewayId} (${E})`:w.NatGatewayId}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`NAT Gateway Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`NAT Gateway ID`,value:w.NatGatewayId}),(0,b.jsx)(_,{label:`State`,value:w.State}),(0,b.jsx)(_,{label:`Connectivity`,value:w.ConnectivityType}),(0,b.jsx)(_,{label:`Subnet ID`,value:w.SubnetId?(0,b.jsx)(a,{className:`text-primary hover:underline`,params:{id:w.SubnetId},to:`/ec2/describe-subnets/$id`,children:w.SubnetId}):`—`}),(0,b.jsx)(_,{label:`VPC ID`,value:w.VpcId?(0,b.jsx)(a,{className:`text-primary hover:underline`,params:{id:w.VpcId},to:`/ec2/describe-vpcs/$id`,children:w.VpcId}):`—`}),(0,b.jsx)(_,{label:`Public IP`,value:D?.PublicIp??`—`}),(0,b.jsx)(_,{label:`Allocation ID`,value:D?.AllocationId?(0,b.jsx)(a,{className:`text-primary hover:underline`,params:{id:D.AllocationId},to:`/ec2/describe-addresses/$id`,children:D.AllocationId}):`—`})]})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the NAT Gateway "${w.NatGatewayId}"? This action cannot be undone. The associated Elastic IP is not released.`,isPending:x.isPending,onConfirm:T,onOpenChange:C,open:S,title:`Delete NAT Gateway`})]})}export{x as component};
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{vr as a}from"./awsClient.js";import{Wt as o}from"./auth.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{E as u}from"./ec2.js";import{Ir as d,s as f,xt as p}from"./index.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./state-badge.js";var y=t(n()),b=e();function x(){let{id:e}=f.useParams(),t=d(),{data:n}=i(p(e)),x=u(),[S,C]=(0,y.useState)(!1),w=n.NatGateways?.[0],T=async()=>{try{await x.mutateAsync(e),t({to:`/ec2/describe-nat-gateways`})}finally{C(!1)}};if(!w?.NatGatewayId)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-nat-gateways`,children:`Back to NAT Gateways`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`NAT Gateway not found.`})]});let E=o(w.Tags),D=w.NatGatewayAddresses?.[0];return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(s,{to:`/ec2/describe-nat-gateways`,children:`Back to NAT Gateways`}),x.error&&(0,b.jsx)(r,{error:x.error,msg:`Failed to delete NAT Gateway`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(l,{disabled:x.isPending,onClick:()=>C(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(c,{className:`size-4`}),`Delete`]}),(0,b.jsx)(v,{state:w.State})]}),subtitle:`NAT Gateway Details`,title:E?`${w.NatGatewayId} (${E})`:w.NatGatewayId}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`NAT Gateway Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`NAT Gateway ID`,value:w.NatGatewayId}),(0,b.jsx)(_,{label:`State`,value:w.State}),(0,b.jsx)(_,{label:`Connectivity`,value:w.ConnectivityType}),(0,b.jsx)(_,{label:`Subnet ID`,value:w.SubnetId?(0,b.jsx)(a,{className:`text-primary hover:underline`,params:{id:w.SubnetId},to:`/ec2/describe-subnets/$id`,children:w.SubnetId}):`—`}),(0,b.jsx)(_,{label:`VPC ID`,value:w.VpcId?(0,b.jsx)(a,{className:`text-primary hover:underline`,params:{id:w.VpcId},to:`/ec2/describe-vpcs/$id`,children:w.VpcId}):`—`}),(0,b.jsx)(_,{label:`Public IP`,value:D?.PublicIp??`—`}),(0,b.jsx)(_,{label:`Allocation ID`,value:D?.AllocationId?(0,b.jsx)(a,{className:`text-primary hover:underline`,params:{id:D.AllocationId},to:`/ec2/describe-addresses/$id`,children:D.AllocationId}):`—`})]})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the NAT Gateway "${w.NatGatewayId}"? This action cannot be undone. The associated Elastic IP is not released.`,isPending:x.isPending,onConfirm:T,onOpenChange:C,open:S,title:`Delete NAT Gateway`})]})}export{x as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{Or as a}from"./awsClient.js";import{t as o}from"./back-link.js";import{t as s}from"./trash-2.js";import{t as c}from"./button.js";import{D as l}from"./ec2.js";import{Ct as u,Ir as d,c as f,gt as p}from"./index.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./state-badge.js";var y=t(n()),b=e();function x(){let{id:e}=f.useParams(),t=d(),{data:n}=i(u(e)),{data:x}=i(p),S=l(),[C,w]=(0,y.useState)(!1),T=n.PlacementGroups?.[0],E=x.Reservations?.flatMap(e=>e.Instances??[]).filter(e=>e.Placement?.GroupName===T?.GroupName)??[];return T?.GroupId?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/ec2/describe-placement-groups`,children:`Back to placement groups`}),S.error&&(0,b.jsx)(r,{error:S.error,msg:`Failed to delete placement group`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(c,{onClick:()=>w(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(s,{className:`size-4`}),`Delete`]}),(0,b.jsx)(v,{state:T.State})]}),subtitle:`Placement Group Details`,title:T.GroupName??T.GroupId}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Placement Group Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Group ID`,value:T.GroupId}),(0,b.jsx)(_,{label:`Group Name`,value:T.GroupName}),(0,b.jsx)(_,{label:`Strategy`,value:T.Strategy}),(0,b.jsx)(_,{label:`State`,value:T.State}),(0,b.jsx)(_,{label:`Spread Level`,value:T.SpreadLevel})]})]}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Instances`}),E.length>0?E.map(e=>(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Instance ID`,value:e.InstanceId?(0,b.jsx)(a,{className:`text-primary hover:underline`,params:{id:e.InstanceId},to:`/ec2/describe-instances/$id`,children:e.InstanceId}):void 0}),(0,b.jsx)(_,{label:`State`,value:e.State?.Name}),(0,b.jsx)(_,{label:`Instance Type`,value:e.InstanceType}),(0,b.jsx)(_,{label:`Availability Zone`,value:e.Placement?.AvailabilityZone})]},e.InstanceId)):(0,b.jsx)(g.Content,{children:(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`No instances in this placement group.`})})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the placement group "${T.GroupName}"? The group must have no running instances.`,isPending:S.isPending,onConfirm:async()=>{if(T?.GroupName)try{await S.mutateAsync(T.GroupName),t({to:`/ec2/describe-placement-groups`})}finally{w(!1)}},onOpenChange:w,open:C,title:`Delete Placement Group`})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/ec2/describe-placement-groups`,children:`Back to placement groups`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`Placement group not found.`})]})}export{x as component};
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{vr as a}from"./awsClient.js";import{t as o}from"./back-link.js";import{t as s}from"./trash-2.js";import{t as c}from"./button.js";import{D as l}from"./ec2.js";import{Ct as u,Ir as d,c as f,gt as p}from"./index.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./state-badge.js";var y=t(n()),b=e();function x(){let{id:e}=f.useParams(),t=d(),{data:n}=i(u(e)),{data:x}=i(p),S=l(),[C,w]=(0,y.useState)(!1),T=n.PlacementGroups?.[0],E=x.Reservations?.flatMap(e=>e.Instances??[]).filter(e=>e.Placement?.GroupName===T?.GroupName)??[];return T?.GroupId?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/ec2/describe-placement-groups`,children:`Back to placement groups`}),S.error&&(0,b.jsx)(r,{error:S.error,msg:`Failed to delete placement group`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(c,{onClick:()=>w(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(s,{className:`size-4`}),`Delete`]}),(0,b.jsx)(v,{state:T.State})]}),subtitle:`Placement Group Details`,title:T.GroupName??T.GroupId}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Placement Group Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Group ID`,value:T.GroupId}),(0,b.jsx)(_,{label:`Group Name`,value:T.GroupName}),(0,b.jsx)(_,{label:`Strategy`,value:T.Strategy}),(0,b.jsx)(_,{label:`State`,value:T.State}),(0,b.jsx)(_,{label:`Spread Level`,value:T.SpreadLevel})]})]}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Instances`}),E.length>0?E.map(e=>(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Instance ID`,value:e.InstanceId?(0,b.jsx)(a,{className:`text-primary hover:underline`,params:{id:e.InstanceId},to:`/ec2/describe-instances/$id`,children:e.InstanceId}):void 0}),(0,b.jsx)(_,{label:`State`,value:e.State?.Name}),(0,b.jsx)(_,{label:`Instance Type`,value:e.InstanceType}),(0,b.jsx)(_,{label:`Availability Zone`,value:e.Placement?.AvailabilityZone})]},e.InstanceId)):(0,b.jsx)(g.Content,{children:(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`No instances in this placement group.`})})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the placement group "${T.GroupName}"? The group must have no running instances.`,isPending:S.isPending,onConfirm:async()=>{if(T?.GroupName)try{await S.mutateAsync(T.GroupName),t({to:`/ec2/describe-placement-groups`})}finally{w(!1)}},onOpenChange:w,open:C,title:`Delete Placement Group`})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/ec2/describe-placement-groups`,children:`Back to placement groups`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`Placement group not found.`})]})}export{x as component};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{Or as a}from"./awsClient.js";import{D as o}from"./SignatureV4.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{g as u,t as d,u as f}from"./iam.js";import{Ir as p,X as m,rt as h,v as g}from"./index.js";import{t as _}from"./page-heading.js";import{t as v}from"./delete-confirmation-dialog.js";import{n as y,t as b}from"./detail-row.js";var x=t(n()),S=e();function C(){let{instanceProfileName:e}=g.useParams(),t=p(),{data:n}=i(m(e)),{data:C}=i(h),w=f(),T=d(),E=u(),[D,O]=(0,x.useState)(!1),[k,A]=(0,x.useState)(!1),[j,M]=(0,x.useState)(null),N=n.InstanceProfile,P=N?.Roles??[],F=C.Roles??[],I=new Set(P.map(e=>e.RoleName)),L=F.filter(e=>e.RoleName&&!I.has(e.RoleName)),R=async()=>{try{await w.mutateAsync(e),t({to:`/iam/list-instance-profiles`})}finally{O(!1)}},z=async t=>{await T.mutateAsync({instanceProfileName:e,roleName:t}),A(!1)},B=async t=>{M(t);try{await E.mutateAsync({instanceProfileName:e,roleName:t})}finally{M(null)}};return N?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(s,{to:`/iam/list-instance-profiles`,children:`Back to instance profiles`}),w.error&&(0,S.jsx)(r,{error:w.error,msg:`Failed to delete instance profile`}),T.error&&(0,S.jsx)(r,{error:T.error,msg:`Failed to add role`}),E.error&&(0,S.jsx)(r,{error:E.error,msg:`Failed to remove role`}),(0,S.jsxs)(`div`,{className:`space-y-6`,children:[(0,S.jsx)(_,{actions:(0,S.jsxs)(l,{onClick:()=>O(!0),size:`sm`,variant:`destructive`,children:[(0,S.jsx)(c,{className:`size-4`}),`Delete`]}),subtitle:`Instance Profile Details`,title:N.InstanceProfileName??``}),(0,S.jsxs)(y,{children:[(0,S.jsx)(y.Header,{children:`Instance Profile Information`}),(0,S.jsxs)(y.Content,{children:[(0,S.jsx)(b,{label:`Name`,value:N.InstanceProfileName}),(0,S.jsx)(b,{label:`ID`,value:N.InstanceProfileId}),(0,S.jsx)(b,{label:`ARN`,value:N.Arn}),(0,S.jsx)(b,{label:`Path`,value:N.Path}),(0,S.jsx)(b,{label:`Created`,value:o(N.CreateDate)})]})]}),(0,S.jsxs)(y,{children:[(0,S.jsx)(y.Header,{children:(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsx)(`span`,{children:`Roles`}),(0,S.jsx)(l,{onClick:()=>A(!k),size:`sm`,children:`Add Role`})]})}),(0,S.jsxs)(y.Content,{children:[k&&L.length>0&&(0,S.jsxs)(`div`,{className:`col-span-2 space-y-2 rounded-md border p-3`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium`,children:`Select a role to add:`}),(0,S.jsx)(`div`,{className:`space-y-1`,children:L.map(e=>(0,S.jsxs)(`button`,{className:`flex w-full items-center justify-between rounded-md p-2 text-left text-sm hover:bg-accent`,disabled:T.isPending,onClick:()=>{e.RoleName&&z(e.RoleName)},type:`button`,children:[(0,S.jsx)(`span`,{children:e.RoleName}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.Arn})]},e.RoleName))})]}),k&&L.length===0&&(0,S.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No roles available to add.`}),P.length>0?(0,S.jsx)(`div`,{className:`col-span-2 space-y-3`,children:P.map(e=>(0,S.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-3`,children:[(0,S.jsx)(a,{className:`text-sm font-medium text-primary hover:underline`,params:{roleName:e.RoleName??``},to:`/iam/list-roles/$roleName`,children:e.RoleName}),(0,S.jsx)(l,{disabled:j===e.RoleName,onClick:()=>{e.RoleName&&B(e.RoleName)},size:`sm`,variant:`outline`,children:`Remove`})]},e.RoleName))}):(0,S.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No roles in this instance profile.`})]})]})]}),(0,S.jsx)(v,{description:`Are you sure you want to delete the instance profile "${e}"? This action cannot be undone. You must remove all roles first.`,isPending:w.isPending,onConfirm:R,onOpenChange:O,open:D,title:`Delete Instance Profile`})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(s,{to:`/iam/list-instance-profiles`,children:`Back to instance profiles`}),(0,S.jsx)(`p`,{className:`text-muted-foreground`,children:`Instance profile not found.`})]})}export{C as component};
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{vr as a}from"./awsClient.js";import{Vt as o}from"./auth.js";import{t as s}from"./back-link.js";import{t as c}from"./trash-2.js";import{t as l}from"./button.js";import{g as u,t as d,u as f}from"./iam.js";import{Ir as p,X as m,rt as h,v as g}from"./index.js";import{t as _}from"./page-heading.js";import{t as v}from"./delete-confirmation-dialog.js";import{n as y,t as b}from"./detail-row.js";var x=t(n()),S=e();function C(){let{instanceProfileName:e}=g.useParams(),t=p(),{data:n}=i(m(e)),{data:C}=i(h),w=f(),T=d(),E=u(),[D,O]=(0,x.useState)(!1),[k,A]=(0,x.useState)(!1),[j,M]=(0,x.useState)(null),N=n.InstanceProfile,P=N?.Roles??[],F=C.Roles??[],I=new Set(P.map(e=>e.RoleName)),L=F.filter(e=>e.RoleName&&!I.has(e.RoleName)),R=async()=>{try{await w.mutateAsync(e),t({to:`/iam/list-instance-profiles`})}finally{O(!1)}},z=async t=>{await T.mutateAsync({instanceProfileName:e,roleName:t}),A(!1)},B=async t=>{M(t);try{await E.mutateAsync({instanceProfileName:e,roleName:t})}finally{M(null)}};return N?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(s,{to:`/iam/list-instance-profiles`,children:`Back to instance profiles`}),w.error&&(0,S.jsx)(r,{error:w.error,msg:`Failed to delete instance profile`}),T.error&&(0,S.jsx)(r,{error:T.error,msg:`Failed to add role`}),E.error&&(0,S.jsx)(r,{error:E.error,msg:`Failed to remove role`}),(0,S.jsxs)(`div`,{className:`space-y-6`,children:[(0,S.jsx)(_,{actions:(0,S.jsxs)(l,{onClick:()=>O(!0),size:`sm`,variant:`destructive`,children:[(0,S.jsx)(c,{className:`size-4`}),`Delete`]}),subtitle:`Instance Profile Details`,title:N.InstanceProfileName??``}),(0,S.jsxs)(y,{children:[(0,S.jsx)(y.Header,{children:`Instance Profile Information`}),(0,S.jsxs)(y.Content,{children:[(0,S.jsx)(b,{label:`Name`,value:N.InstanceProfileName}),(0,S.jsx)(b,{label:`ID`,value:N.InstanceProfileId}),(0,S.jsx)(b,{label:`ARN`,value:N.Arn}),(0,S.jsx)(b,{label:`Path`,value:N.Path}),(0,S.jsx)(b,{label:`Created`,value:o(N.CreateDate)})]})]}),(0,S.jsxs)(y,{children:[(0,S.jsx)(y.Header,{children:(0,S.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,S.jsx)(`span`,{children:`Roles`}),(0,S.jsx)(l,{onClick:()=>A(!k),size:`sm`,children:`Add Role`})]})}),(0,S.jsxs)(y.Content,{children:[k&&L.length>0&&(0,S.jsxs)(`div`,{className:`col-span-2 space-y-2 rounded-md border p-3`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium`,children:`Select a role to add:`}),(0,S.jsx)(`div`,{className:`space-y-1`,children:L.map(e=>(0,S.jsxs)(`button`,{className:`flex w-full items-center justify-between rounded-md p-2 text-left text-sm hover:bg-accent`,disabled:T.isPending,onClick:()=>{e.RoleName&&z(e.RoleName)},type:`button`,children:[(0,S.jsx)(`span`,{children:e.RoleName}),(0,S.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.Arn})]},e.RoleName))})]}),k&&L.length===0&&(0,S.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No roles available to add.`}),P.length>0?(0,S.jsx)(`div`,{className:`col-span-2 space-y-3`,children:P.map(e=>(0,S.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border p-3`,children:[(0,S.jsx)(a,{className:`text-sm font-medium text-primary hover:underline`,params:{roleName:e.RoleName??``},to:`/iam/list-roles/$roleName`,children:e.RoleName}),(0,S.jsx)(l,{disabled:j===e.RoleName,onClick:()=>{e.RoleName&&B(e.RoleName)},size:`sm`,variant:`outline`,children:`Remove`})]},e.RoleName))}):(0,S.jsx)(`p`,{className:`col-span-2 text-sm text-muted-foreground`,children:`No roles in this instance profile.`})]})]})]}),(0,S.jsx)(v,{description:`Are you sure you want to delete the instance profile "${e}"? This action cannot be undone. You must remove all roles first.`,isPending:w.isPending,onConfirm:R,onOpenChange:O,open:D,title:`Delete Instance Profile`})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(s,{to:`/iam/list-instance-profiles`,children:`Back to instance profiles`}),(0,S.jsx)(`p`,{className:`text-muted-foreground`,children:`Instance profile not found.`})]})}export{C as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{D as a}from"./SignatureV4.js";import{t as o}from"./back-link.js";import{t as s}from"./trash-2.js";import{t as c}from"./button.js";import{d as l}from"./iam.js";import{Ir as u,et as d,tt as f,y as p}from"./index.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./policy-document-viewer.js";var y=t(n()),b=e();function x(){let{policyArn:e}=p.useParams(),t=decodeURIComponent(e),n=u(),{data:x}=i(d(t)),S=x.Policy,C=l(),[w,T]=(0,y.useState)(!1),{data:E}=i(f(t,S?.DefaultVersionId??`v1`)),D=E?.PolicyVersion?.Document?decodeURIComponent(E.PolicyVersion.Document):null;return S?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/iam/list-policies`,children:`Back to policies`}),C.error&&(0,b.jsx)(r,{error:C.error,msg:`Failed to delete policy`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(c,{onClick:()=>T(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(s,{className:`size-4`}),`Delete`]}),subtitle:`Policy Details`,title:S.PolicyName??``}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Policy Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Policy Name`,value:S.PolicyName}),(0,b.jsx)(_,{label:`Policy ID`,value:S.PolicyId}),(0,b.jsx)(_,{label:`ARN`,value:S.Arn}),(0,b.jsx)(_,{label:`Path`,value:S.Path}),(0,b.jsx)(_,{label:`Description`,value:S.Description??`-`}),(0,b.jsx)(_,{label:`Created`,value:a(S.CreateDate)})]})]}),D&&(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Policy Document`}),(0,b.jsx)(`div`,{className:`p-4`,children:(0,b.jsx)(v,{document:D})})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the policy "${S.PolicyName}"? This action cannot be undone.`,isPending:C.isPending,onConfirm:async()=>{try{await C.mutateAsync(t),n({to:`/iam/list-policies`})}finally{T(!1)}},onOpenChange:T,open:w,title:`Delete Policy`})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/iam/list-policies`,children:`Back to policies`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`Policy not found.`})]})}export{x as component};
|
||||
import{n as e,o as t,r as n}from"./compiler-runtime.js";import{t as r}from"./error-banner.js";import{t as i}from"./useSuspenseQuery.js";import{Vt as a}from"./auth.js";import{t as o}from"./back-link.js";import{t as s}from"./trash-2.js";import{t as c}from"./button.js";import{d as l}from"./iam.js";import{Ir as u,et as d,tt as f,y as p}from"./index.js";import{t as m}from"./page-heading.js";import{t as h}from"./delete-confirmation-dialog.js";import{n as g,t as _}from"./detail-row.js";import{t as v}from"./policy-document-viewer.js";var y=t(n()),b=e();function x(){let{policyArn:e}=p.useParams(),t=decodeURIComponent(e),n=u(),{data:x}=i(d(t)),S=x.Policy,C=l(),[w,T]=(0,y.useState)(!1),{data:E}=i(f(t,S?.DefaultVersionId??`v1`)),D=E?.PolicyVersion?.Document?decodeURIComponent(E.PolicyVersion.Document):null;return S?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/iam/list-policies`,children:`Back to policies`}),C.error&&(0,b.jsx)(r,{error:C.error,msg:`Failed to delete policy`}),(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(m,{actions:(0,b.jsxs)(c,{onClick:()=>T(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(s,{className:`size-4`}),`Delete`]}),subtitle:`Policy Details`,title:S.PolicyName??``}),(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Policy Information`}),(0,b.jsxs)(g.Content,{children:[(0,b.jsx)(_,{label:`Policy Name`,value:S.PolicyName}),(0,b.jsx)(_,{label:`Policy ID`,value:S.PolicyId}),(0,b.jsx)(_,{label:`ARN`,value:S.Arn}),(0,b.jsx)(_,{label:`Path`,value:S.Path}),(0,b.jsx)(_,{label:`Description`,value:S.Description??`-`}),(0,b.jsx)(_,{label:`Created`,value:a(S.CreateDate)})]})]}),D&&(0,b.jsxs)(g,{children:[(0,b.jsx)(g.Header,{children:`Policy Document`}),(0,b.jsx)(`div`,{className:`p-4`,children:(0,b.jsx)(v,{document:D})})]})]}),(0,b.jsx)(h,{description:`Are you sure you want to delete the policy "${S.PolicyName}"? This action cannot be undone.`,isPending:C.isPending,onConfirm:async()=>{try{await C.mutateAsync(t),n({to:`/iam/list-policies`})}finally{T(!1)}},onOpenChange:T,open:w,title:`Delete Policy`})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{to:`/iam/list-policies`,children:`Back to policies`}),(0,b.jsx)(`p`,{className:`text-muted-foreground`,children:`Policy not found.`})]})}export{x as component};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{t as e}from"./queryOptions.js";import{u as t}from"./SignatureV4.js";import{Vt as n}from"./index.js";var r=e({queryKey:[`admin`,`nodes`],queryFn:async()=>{let e=t();if(!e)throw Error(`Not authenticated`);return await n({action:`GetNodes`,credentials:e})},staleTime:1e4}),i=e({queryKey:[`admin`,`vms`],queryFn:async()=>{let e=t();if(!e)throw Error(`Not authenticated`);return await n({action:`GetVMs`,credentials:e})},staleTime:1e4}),a=e({queryKey:[`admin`,`storageStatus`],queryFn:async()=>{let e=t();if(!e)throw Error(`Not authenticated`);return await n({action:`GetStorageStatus`,credentials:e})},staleTime:1e4});export{a as n,i as r,r as t};
|
||||
import{t as e}from"./queryOptions.js";import{r as t}from"./auth.js";import{Vt as n}from"./index.js";var r=e({queryKey:[`admin`,`nodes`],queryFn:async()=>{let e=t();if(!e)throw Error(`Not authenticated`);return await n({action:`GetNodes`,credentials:e})},staleTime:1e4}),i=e({queryKey:[`admin`,`vms`],queryFn:async()=>{let e=t();if(!e)throw Error(`Not authenticated`);return await n({action:`GetVMs`,credentials:e})},staleTime:1e4}),a=e({queryKey:[`admin`,`storageStatus`],queryFn:async()=>{let e=t();if(!e)throw Error(`Not authenticated`);return await n({action:`GetStorageStatus`,credentials:e})},staleTime:1e4});export{a as n,i as r,r as t};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{Or as n}from"./awsClient.js";import{D as r}from"./SignatureV4.js";import{n as i,t as a}from"./detail-row.js";var o=t(),s=e();function c(e){let t=(0,o.c)(58),{image:c,showExtendedDetails:u}=e,d=u===void 0?!1:u,f;t[0]===c.CreationDate?f=t[1]:(f=r(c.CreationDate),t[0]=c.CreationDate,t[1]=f);let p=f,m=d?`AMI Information`:`AMI Details`,h;t[2]===m?h=t[3]:(h=(0,s.jsx)(i.Header,{children:m}),t[2]=m,t[3]=h);let g;t[4]!==c.ImageId||t[5]!==d?(g=c.ImageId&&!d?(0,s.jsx)(n,{className:`text-primary hover:underline`,params:{id:c.ImageId},to:`/ec2/describe-images/$id`,children:c.ImageId}):c.ImageId,t[4]=c.ImageId,t[5]=d,t[6]=g):g=t[6];let _;t[7]===g?_=t[8]:(_=(0,s.jsx)(a,{label:`AMI ID`,value:g}),t[7]=g,t[8]=_);let v;t[9]===c.Name?v=t[10]:(v=(0,s.jsx)(a,{label:`AMI Name`,value:c.Name}),t[9]=c.Name,t[10]=v);let y;t[11]===c.Description?y=t[12]:(y=(0,s.jsx)(a,{label:`Description`,value:c.Description}),t[11]=c.Description,t[12]=y);let b;t[13]===c.Architecture?b=t[14]:(b=(0,s.jsx)(a,{label:`Architecture`,value:c.Architecture}),t[13]=c.Architecture,t[14]=b);let x;t[15]===c.VirtualizationType?x=t[16]:(x=(0,s.jsx)(a,{label:`Virtualization Type`,value:c.VirtualizationType}),t[15]=c.VirtualizationType,t[16]=x);let S=c.Platform??`Linux`,C;t[17]===S?C=t[18]:(C=(0,s.jsx)(a,{label:`Platform`,value:S}),t[17]=S,t[18]=C);let w;t[19]===c.PlatformDetails?w=t[20]:(w=(0,s.jsx)(a,{label:`Platform Details`,value:c.PlatformDetails}),t[19]=c.PlatformDetails,t[20]=w);let T;t[21]===c.ImageType?T=t[22]:(T=(0,s.jsx)(a,{label:`Image Type`,value:c.ImageType}),t[21]=c.ImageType,t[22]=T);let E;t[23]===c.RootDeviceType?E=t[24]:(E=(0,s.jsx)(a,{label:`Root Device Type`,value:c.RootDeviceType}),t[23]=c.RootDeviceType,t[24]=E);let D;t[25]===c.RootDeviceName?D=t[26]:(D=(0,s.jsx)(a,{label:`Root Device Name`,value:c.RootDeviceName}),t[25]=c.RootDeviceName,t[26]=D);let O;t[27]===c.OwnerId?O=t[28]:(O=(0,s.jsx)(a,{label:`Owner`,value:c.OwnerId}),t[27]=c.OwnerId,t[28]=O);let k;t[29]===c.State?k=t[30]:(k=(0,s.jsx)(a,{label:`State`,value:c.State}),t[29]=c.State,t[30]=k);let A;t[31]!==p||t[32]!==c.Public||t[33]!==d?(A=d&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a,{label:`Creation Date`,value:p}),(0,s.jsx)(a,{label:`Public`,value:c.Public?`Yes`:`No`})]}),t[31]=p,t[32]=c.Public,t[33]=d,t[34]=A):A=t[34];let j;t[35]!==x||t[36]!==C||t[37]!==w||t[38]!==T||t[39]!==E||t[40]!==D||t[41]!==O||t[42]!==k||t[43]!==A||t[44]!==_||t[45]!==v||t[46]!==y||t[47]!==b?(j=(0,s.jsxs)(i.Content,{children:[_,v,y,b,x,C,w,T,E,D,O,k,A]}),t[35]=x,t[36]=C,t[37]=w,t[38]=T,t[39]=E,t[40]=D,t[41]=O,t[42]=k,t[43]=A,t[44]=_,t[45]=v,t[46]=y,t[47]=b,t[48]=j):j=t[48];let M;t[49]!==j||t[50]!==h?(M=(0,s.jsxs)(i,{children:[h,j]}),t[49]=j,t[50]=h,t[51]=M):M=t[51];let N;t[52]!==c.BlockDeviceMappings||t[53]!==d?(N=d&&c.BlockDeviceMappings&&c.BlockDeviceMappings.length>0&&c.BlockDeviceMappings.map(l),t[52]=c.BlockDeviceMappings,t[53]=d,t[54]=N):N=t[54];let P;return t[55]!==M||t[56]!==N?(P=(0,s.jsxs)(s.Fragment,{children:[M,N]}),t[55]=M,t[56]=N,t[57]=P):P=t[57],P}function l(e){return(0,s.jsxs)(i,{children:[(0,s.jsxs)(i.Header,{children:[`Block Device: `,e.DeviceName]}),(0,s.jsxs)(i.Content,{children:[(0,s.jsx)(a,{label:`Device Name`,value:e.DeviceName}),e.Ebs&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a,{label:`Volume Size`,value:e.Ebs.VolumeSize?`${e.Ebs.VolumeSize} GB`:void 0}),(0,s.jsx)(a,{label:`Volume Type`,value:e.Ebs.VolumeType}),(0,s.jsx)(a,{label:`Delete On Termination`,value:e.Ebs.DeleteOnTermination?`Yes`:`No`}),(0,s.jsx)(a,{label:`Encrypted`,value:e.Ebs.Encrypted?`Yes`:`No`}),e.Ebs.SnapshotId&&(0,s.jsx)(a,{label:`Snapshot ID`,value:(0,s.jsx)(n,{className:`text-primary hover:underline`,params:{id:e.Ebs.SnapshotId},to:`/ec2/describe-snapshots/$id`,children:e.Ebs.SnapshotId})})]}),e.VirtualName&&(0,s.jsx)(a,{label:`Virtual Name`,value:e.VirtualName})]})]},e.DeviceName)}export{c as t};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{vr as n}from"./awsClient.js";import{Vt as r}from"./auth.js";import{n as i,t as a}from"./detail-row.js";var o=t(),s=e();function c(e){let t=(0,o.c)(58),{image:c,showExtendedDetails:u}=e,d=u===void 0?!1:u,f;t[0]===c.CreationDate?f=t[1]:(f=r(c.CreationDate),t[0]=c.CreationDate,t[1]=f);let p=f,m=d?`AMI Information`:`AMI Details`,h;t[2]===m?h=t[3]:(h=(0,s.jsx)(i.Header,{children:m}),t[2]=m,t[3]=h);let g;t[4]!==c.ImageId||t[5]!==d?(g=c.ImageId&&!d?(0,s.jsx)(n,{className:`text-primary hover:underline`,params:{id:c.ImageId},to:`/ec2/describe-images/$id`,children:c.ImageId}):c.ImageId,t[4]=c.ImageId,t[5]=d,t[6]=g):g=t[6];let _;t[7]===g?_=t[8]:(_=(0,s.jsx)(a,{label:`AMI ID`,value:g}),t[7]=g,t[8]=_);let v;t[9]===c.Name?v=t[10]:(v=(0,s.jsx)(a,{label:`AMI Name`,value:c.Name}),t[9]=c.Name,t[10]=v);let y;t[11]===c.Description?y=t[12]:(y=(0,s.jsx)(a,{label:`Description`,value:c.Description}),t[11]=c.Description,t[12]=y);let b;t[13]===c.Architecture?b=t[14]:(b=(0,s.jsx)(a,{label:`Architecture`,value:c.Architecture}),t[13]=c.Architecture,t[14]=b);let x;t[15]===c.VirtualizationType?x=t[16]:(x=(0,s.jsx)(a,{label:`Virtualization Type`,value:c.VirtualizationType}),t[15]=c.VirtualizationType,t[16]=x);let S=c.Platform??`Linux`,C;t[17]===S?C=t[18]:(C=(0,s.jsx)(a,{label:`Platform`,value:S}),t[17]=S,t[18]=C);let w;t[19]===c.PlatformDetails?w=t[20]:(w=(0,s.jsx)(a,{label:`Platform Details`,value:c.PlatformDetails}),t[19]=c.PlatformDetails,t[20]=w);let T;t[21]===c.ImageType?T=t[22]:(T=(0,s.jsx)(a,{label:`Image Type`,value:c.ImageType}),t[21]=c.ImageType,t[22]=T);let E;t[23]===c.RootDeviceType?E=t[24]:(E=(0,s.jsx)(a,{label:`Root Device Type`,value:c.RootDeviceType}),t[23]=c.RootDeviceType,t[24]=E);let D;t[25]===c.RootDeviceName?D=t[26]:(D=(0,s.jsx)(a,{label:`Root Device Name`,value:c.RootDeviceName}),t[25]=c.RootDeviceName,t[26]=D);let O;t[27]===c.OwnerId?O=t[28]:(O=(0,s.jsx)(a,{label:`Owner`,value:c.OwnerId}),t[27]=c.OwnerId,t[28]=O);let k;t[29]===c.State?k=t[30]:(k=(0,s.jsx)(a,{label:`State`,value:c.State}),t[29]=c.State,t[30]=k);let A;t[31]!==p||t[32]!==c.Public||t[33]!==d?(A=d&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a,{label:`Creation Date`,value:p}),(0,s.jsx)(a,{label:`Public`,value:c.Public?`Yes`:`No`})]}),t[31]=p,t[32]=c.Public,t[33]=d,t[34]=A):A=t[34];let j;t[35]!==x||t[36]!==C||t[37]!==w||t[38]!==T||t[39]!==E||t[40]!==D||t[41]!==O||t[42]!==k||t[43]!==A||t[44]!==_||t[45]!==v||t[46]!==y||t[47]!==b?(j=(0,s.jsxs)(i.Content,{children:[_,v,y,b,x,C,w,T,E,D,O,k,A]}),t[35]=x,t[36]=C,t[37]=w,t[38]=T,t[39]=E,t[40]=D,t[41]=O,t[42]=k,t[43]=A,t[44]=_,t[45]=v,t[46]=y,t[47]=b,t[48]=j):j=t[48];let M;t[49]!==j||t[50]!==h?(M=(0,s.jsxs)(i,{children:[h,j]}),t[49]=j,t[50]=h,t[51]=M):M=t[51];let N;t[52]!==c.BlockDeviceMappings||t[53]!==d?(N=d&&c.BlockDeviceMappings&&c.BlockDeviceMappings.length>0&&c.BlockDeviceMappings.map(l),t[52]=c.BlockDeviceMappings,t[53]=d,t[54]=N):N=t[54];let P;return t[55]!==M||t[56]!==N?(P=(0,s.jsxs)(s.Fragment,{children:[M,N]}),t[55]=M,t[56]=N,t[57]=P):P=t[57],P}function l(e){return(0,s.jsxs)(i,{children:[(0,s.jsxs)(i.Header,{children:[`Block Device: `,e.DeviceName]}),(0,s.jsxs)(i.Content,{children:[(0,s.jsx)(a,{label:`Device Name`,value:e.DeviceName}),e.Ebs&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a,{label:`Volume Size`,value:e.Ebs.VolumeSize?`${e.Ebs.VolumeSize} GB`:void 0}),(0,s.jsx)(a,{label:`Volume Type`,value:e.Ebs.VolumeType}),(0,s.jsx)(a,{label:`Delete On Termination`,value:e.Ebs.DeleteOnTermination?`Yes`:`No`}),(0,s.jsx)(a,{label:`Encrypted`,value:e.Ebs.Encrypted?`Yes`:`No`}),e.Ebs.SnapshotId&&(0,s.jsx)(a,{label:`Snapshot ID`,value:(0,s.jsx)(n,{className:`text-primary hover:underline`,params:{id:e.Ebs.SnapshotId},to:`/ec2/describe-snapshots/$id`,children:e.Ebs.SnapshotId})})]}),e.VirtualName&&(0,s.jsx)(a,{label:`Virtual Name`,value:e.VirtualName})]})]},e.DeviceName)}export{c as t};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{Or as n}from"./awsClient.js";import{Nr as r}from"./index.js";var i=r(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),a=t(),o=e();function s(e){let t=(0,a.c)(7),r,s;t[0]===e?(r=t[1],s=t[2]):({children:r,...s}=e,t[0]=e,t[1]=r,t[2]=s);let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,o.jsx)(i,{className:`size-4`}),t[3]=c):c=t[3];let l;return t[4]!==r||t[5]!==s?(l=(0,o.jsxs)(n,{className:`mb-6 inline-flex items-center gap-2 text-sm`,...s,children:[c,r]}),t[4]=r,t[5]=s,t[6]=l):l=t[6],l}export{s as t};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{vr as n}from"./awsClient.js";import{Nr as r}from"./index.js";var i=r(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),a=t(),o=e();function s(e){let t=(0,a.c)(7),r,s;t[0]===e?(r=t[1],s=t[2]):({children:r,...s}=e,t[0]=e,t[1]=r,t[2]=s);let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,o.jsx)(i,{className:`size-4`}),t[3]=c):c=t[3];let l;return t[4]!==r||t[5]!==s?(l=(0,o.jsxs)(n,{className:`mb-6 inline-flex items-center gap-2 text-sm`,...s,children:[c,r]}),t[4]=r,t[5]=s,t[6]=l):l=t[6],l}export{s as t};
|
||||
@@ -1 +1 @@
|
||||
import{t as e}from"./compiler-runtime.js";import{f as t,t as n}from"./dist.js";import{w as r}from"./SignatureV4.js";import{Pr as i}from"./index.js";var a=e(),o=n(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium whitespace-nowrap transition-all transition-colors focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-2.5!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border bg-input/20 text-foreground dark:bg-input/30 [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function s(e){let n=(0,a.c)(13),s,c,l,u,d;if(n[0]!==e){let{className:a,variant:f,render:p,...m}=e;s=p,d=f===void 0?`default`:f,u=i,c=`span`,l=t({className:r(o({className:a,variant:d}))},m),n[0]=e,n[1]=s,n[2]=c,n[3]=l,n[4]=u,n[5]=d}else s=n[1],c=n[2],l=n[3],u=n[4],d=n[5];let f;n[6]===d?f=n[7]:(f={slot:`badge`,variant:d},n[6]=d,n[7]=f);let p;return n[8]!==s||n[9]!==c||n[10]!==l||n[11]!==f?(p={defaultTagName:c,props:l,render:s,state:f},n[8]=s,n[9]=c,n[10]=l,n[11]=f,n[12]=p):p=n[12],u(p)}export{s as t};
|
||||
import{t as e}from"./compiler-runtime.js";import{f as t,t as n}from"./dist.js";import{Rt as r}from"./auth.js";import{Pr as i}from"./index.js";var a=e(),o=n(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium whitespace-nowrap transition-all transition-colors focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-2.5!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border bg-input/20 text-foreground dark:bg-input/30 [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function s(e){let n=(0,a.c)(13),s,c,l,u,d;if(n[0]!==e){let{className:a,variant:f,render:p,...m}=e;s=p,d=f===void 0?`default`:f,u=i,c=`span`,l=t({className:r(o({className:a,variant:d}))},m),n[0]=e,n[1]=s,n[2]=c,n[3]=l,n[4]=u,n[5]=d}else s=n[1],c=n[2],l=n[3],u=n[4],d=n[5];let f;n[6]===d?f=n[7]:(f={slot:`badge`,variant:d},n[6]=d,n[7]=f);let p;return n[8]!==s||n[9]!==c||n[10]!==l||n[11]!==f?(p={defaultTagName:c,props:l,render:s,state:f},n[8]=s,n[9]=c,n[10]=l,n[11]=f,n[12]=p):p=n[12],u(p)}export{s as t};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{w as n}from"./SignatureV4.js";var r=t(),i=e();function a(e){let t=(0,r.c)(10),a,o,s;t[0]===e?(a=t[1],o=t[2],s=t[3]):({className:a,size:s,...o}=e,t[0]=e,t[1]=a,t[2]=o,t[3]=s);let c=s===void 0?`default`:s,l;t[4]===a?l=t[5]:(l=n(`group/card flex flex-col gap-4 overflow-hidden rounded-lg bg-card py-4 text-xs/relaxed text-card-foreground ring-1 ring-foreground/10 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg`,a),t[4]=a,t[5]=l);let u;return t[6]!==o||t[7]!==c||t[8]!==l?(u=(0,i.jsx)(`div`,{className:l,"data-size":c,"data-slot":`card`,...o}),t[6]=o,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function o(e){let t=(0,r.c)(8),a,o;t[0]===e?(a=t[1],o=t[2]):({className:a,...o}=e,t[0]=e,t[1]=a,t[2]=o);let s;t[3]===a?s=t[4]:(s=n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,a),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-header`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function s(e){let t=(0,r.c)(8),a,o;t[0]===e?(a=t[1],o=t[2]):({className:a,...o}=e,t[0]=e,t[1]=a,t[2]=o);let s;t[3]===a?s=t[4]:(s=n(`text-sm font-medium`,a),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-title`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function c(e){let t=(0,r.c)(8),a,o;t[0]===e?(a=t[1],o=t[2]):({className:a,...o}=e,t[0]=e,t[1]=a,t[2]=o);let s;t[3]===a?s=t[4]:(s=n(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,a),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-action`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function l(e){let t=(0,r.c)(8),a,o;t[0]===e?(a=t[1],o=t[2]):({className:a,...o}=e,t[0]=e,t[1]=a,t[2]=o);let s;t[3]===a?s=t[4]:(s=n(`px-4 group-data-[size=sm]/card:px-3`,a),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-content`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function u(e){let t=(0,r.c)(8),a,o;t[0]===e?(a=t[1],o=t[2]):({className:a,...o}=e,t[0]=e,t[1]=a,t[2]=o);let s;t[3]===a?s=t[4]:(s=n(`flex items-center rounded-b-lg px-4 group-data-[size=sm]/card:px-3 [.border-t]:pt-4 group-data-[size=sm]/card:[.border-t]:pt-3`,a),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-footer`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}export{o as a,u as i,c as n,s as o,l as r,a as t};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{Rt as n}from"./auth.js";var r=t(),i=e();function a(e){let t=(0,r.c)(10),a,o,s;t[0]===e?(a=t[1],o=t[2],s=t[3]):({className:a,size:s,...o}=e,t[0]=e,t[1]=a,t[2]=o,t[3]=s);let c=s===void 0?`default`:s,l;t[4]===a?l=t[5]:(l=n(`group/card flex flex-col gap-4 overflow-hidden rounded-lg bg-card py-4 text-xs/relaxed text-card-foreground ring-1 ring-foreground/10 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg`,a),t[4]=a,t[5]=l);let u;return t[6]!==o||t[7]!==c||t[8]!==l?(u=(0,i.jsx)(`div`,{className:l,"data-size":c,"data-slot":`card`,...o}),t[6]=o,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function o(e){let t=(0,r.c)(8),a,o;t[0]===e?(a=t[1],o=t[2]):({className:a,...o}=e,t[0]=e,t[1]=a,t[2]=o);let s;t[3]===a?s=t[4]:(s=n(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,a),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-header`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function s(e){let t=(0,r.c)(8),a,o;t[0]===e?(a=t[1],o=t[2]):({className:a,...o}=e,t[0]=e,t[1]=a,t[2]=o);let s;t[3]===a?s=t[4]:(s=n(`text-sm font-medium`,a),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-title`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function c(e){let t=(0,r.c)(8),a,o;t[0]===e?(a=t[1],o=t[2]):({className:a,...o}=e,t[0]=e,t[1]=a,t[2]=o);let s;t[3]===a?s=t[4]:(s=n(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,a),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-action`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function l(e){let t=(0,r.c)(8),a,o;t[0]===e?(a=t[1],o=t[2]):({className:a,...o}=e,t[0]=e,t[1]=a,t[2]=o);let s;t[3]===a?s=t[4]:(s=n(`px-4 group-data-[size=sm]/card:px-3`,a),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-content`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function u(e){let t=(0,r.c)(8),a,o;t[0]===e?(a=t[1],o=t[2]):({className:a,...o}=e,t[0]=e,t[1]=a,t[2]=o);let s;t[3]===a?s=t[4]:(s=n(`flex items-center rounded-b-lg px-4 group-data-[size=sm]/card:px-3 [.border-t]:pt-4 group-data-[size=sm]/card:[.border-t]:pt-3`,a),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-footer`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}export{o as a,u as i,c as n,s as o,l as r,a as t};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{n as e,o as t,r as n,t as r}from"./compiler-runtime.js";import{n as i,t as a}from"./error-banner.js";import{Cr as o,Tr as s,_r as c,hr as l,n as u}from"./awsClient.js";import{Lr as d}from"./index.js";import{a as f,t as p}from"./field.js";import{a as m,i as h,l as g,n as _,o as v,r as y,s as ee,t as te}from"./alert-dialog.js";import{t as b}from"./textarea.js";var x=class extends s.classBuilder().ep(c).m(function(e,t,n,r){return[o(n,e.getEndpointParameterInstructions())]}).s(`CertificateManager`,`ImportCertificate`,{}).n(`ACMClient`,`ImportCertificateCommand`).sc(l).build(){},S=t(n(),1),C=r(),w=new TextEncoder;function T(){let e=(0,C.c)(2),t=d(),n;return e[0]===t?n=e[1]:(n={mutationFn:E,onSuccess:()=>{t.invalidateQueries({queryKey:[`acm`,`certificates`]})}},e[0]=t,e[1]=n),i(n)}async function E(e){let t=new x({Certificate:w.encode(e.certificate),PrivateKey:w.encode(e.privateKey),CertificateChain:e.certificateChain&&e.certificateChain.length>0?w.encode(e.certificateChain):void 0});return await u().send(t)}var D=e();function O(e){let t=(0,C.c)(54),{open:n,onOpenChange:r,onImported:i}=e,[o,s]=(0,S.useState)(``),[c,l]=(0,S.useState)(``),[u,d]=(0,S.useState)(``),x=T(),w;t[0]===x?w=t[1]:(w=()=>{s(``),l(``),d(``),x.reset()},t[0]=x,t[1]=w);let E=w,O;t[2]!==r||t[3]!==E?(O=e=>{e||E(),r(e)},t[2]=r,t[3]=E,t[4]=O):O=t[4];let k=O,A;t[5]!==o||t[6]!==c?(A=o.trim().length>0&&c.trim().length>0,t[5]=o,t[6]=c,t[7]=A):A=t[7];let j=A,M;t[8]!==j||t[9]!==o||t[10]!==u||t[11]!==x||t[12]!==i||t[13]!==r||t[14]!==c||t[15]!==E?(M=async()=>{if(j)try{let e=await x.mutateAsync({certificate:o,privateKey:c,certificateChain:u});e.CertificateArn&&i(e.CertificateArn),E(),r(!1)}catch{}},t[8]=j,t[9]=o,t[10]=u,t[11]=x,t[12]=i,t[13]=r,t[14]=c,t[15]=E,t[16]=M):M=t[16];let N=M,P;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(P={maxWidth:`36rem`,width:`calc(100vw - 2rem)`},t[17]=P):P=t[17];let F;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,D.jsxs)(ee,{children:[(0,D.jsx)(g,{children:`Import certificate`}),(0,D.jsx)(m,{children:`Paste a PEM-encoded certificate and its private key. The optional chain is appended for intermediate CAs.`})]}),t[18]=F):F=t[18];let I;t[19]===x.error?I=t[20]:(I=x.error&&(0,D.jsx)(a,{error:x.error,msg:`Failed to import certificate`}),t[19]=x.error,t[20]=I);let L;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-body`,children:`Certificate body`})}),t[21]=L):L=t[21];let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>s(e.target.value),t[22]=R):R=t[22];let z;t[23]===o?z=t[24]:(z=(0,D.jsxs)(p,{children:[L,(0,D.jsx)(b,{className:`font-mono text-xs`,id:`cert-body`,onChange:R,placeholder:`-----BEGIN CERTIFICATE-----`,rows:5,value:o})]}),t[23]=o,t[24]=z);let B;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-key`,children:`Private key`})}),t[25]=B):B=t[25];let V;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>l(e.target.value),t[26]=V):V=t[26];let H;t[27]===c?H=t[28]:(H=(0,D.jsxs)(p,{children:[B,(0,D.jsx)(b,{className:`font-mono text-xs`,id:`cert-key`,onChange:V,placeholder:`-----BEGIN PRIVATE KEY-----`,rows:5,value:c})]}),t[27]=c,t[28]=H);let U;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-chain`,children:`Certificate chain (optional)`})}),t[29]=U):U=t[29];let W;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>d(e.target.value),t[30]=W):W=t[30];let G;t[31]===u?G=t[32]:(G=(0,D.jsxs)(p,{children:[U,(0,D.jsx)(b,{className:`font-mono text-xs`,id:`cert-chain`,onChange:W,placeholder:`-----BEGIN CERTIFICATE-----`,rows:4,value:u})]}),t[31]=u,t[32]=G);let K;t[33]!==z||t[34]!==H||t[35]!==G?(K=(0,D.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[z,H,G]}),t[33]=z,t[34]=H,t[35]=G,t[36]=K):K=t[36];let q;t[37]===x.isPending?q=t[38]:(q=(0,D.jsx)(y,{disabled:x.isPending,children:`Cancel`}),t[37]=x.isPending,t[38]=q);let J=!j||x.isPending,Y=x.isPending?`Importing…`:`Import`,X;t[39]!==N||t[40]!==J||t[41]!==Y?(X=(0,D.jsx)(_,{disabled:J,onClick:N,children:Y}),t[39]=N,t[40]=J,t[41]=Y,t[42]=X):X=t[42];let Z;t[43]!==q||t[44]!==X?(Z=(0,D.jsxs)(v,{children:[q,X]}),t[43]=q,t[44]=X,t[45]=Z):Z=t[45];let Q;t[46]!==K||t[47]!==Z||t[48]!==I?(Q=(0,D.jsxs)(h,{className:`grid-cols-[minmax(0,1fr)]`,style:P,children:[F,I,K,Z]}),t[46]=K,t[47]=Z,t[48]=I,t[49]=Q):Q=t[49];let $;return t[50]!==k||t[51]!==n||t[52]!==Q?($=(0,D.jsx)(te,{onOpenChange:k,open:n,children:Q}),t[50]=k,t[51]=n,t[52]=Q,t[53]=$):$=t[53],$}export{O as t};
|
||||
import{n as e,o as t,r as n,t as r}from"./compiler-runtime.js";import{n as i,t as a}from"./error-banner.js";import{_r as o,hr as s,n as c}from"./awsClient.js";import{Ct as l,dt as u}from"./auth.js";import{Lr as d}from"./index.js";import{a as f,t as p}from"./field.js";import{a as m,i as h,l as g,n as _,o as v,r as y,s as ee,t as te}from"./alert-dialog.js";import{t as b}from"./textarea.js";var x=class extends l.classBuilder().ep(o).m(function(e,t,n,r){return[u(n,e.getEndpointParameterInstructions())]}).s(`CertificateManager`,`ImportCertificate`,{}).n(`ACMClient`,`ImportCertificateCommand`).sc(s).build(){},S=t(n(),1),C=r(),w=new TextEncoder;function T(){let e=(0,C.c)(2),t=d(),n;return e[0]===t?n=e[1]:(n={mutationFn:E,onSuccess:()=>{t.invalidateQueries({queryKey:[`acm`,`certificates`]})}},e[0]=t,e[1]=n),i(n)}async function E(e){let t=new x({Certificate:w.encode(e.certificate),PrivateKey:w.encode(e.privateKey),CertificateChain:e.certificateChain&&e.certificateChain.length>0?w.encode(e.certificateChain):void 0});return await c().send(t)}var D=e();function O(e){let t=(0,C.c)(54),{open:n,onOpenChange:r,onImported:i}=e,[o,s]=(0,S.useState)(``),[c,l]=(0,S.useState)(``),[u,d]=(0,S.useState)(``),x=T(),w;t[0]===x?w=t[1]:(w=()=>{s(``),l(``),d(``),x.reset()},t[0]=x,t[1]=w);let E=w,O;t[2]!==r||t[3]!==E?(O=e=>{e||E(),r(e)},t[2]=r,t[3]=E,t[4]=O):O=t[4];let k=O,A;t[5]!==o||t[6]!==c?(A=o.trim().length>0&&c.trim().length>0,t[5]=o,t[6]=c,t[7]=A):A=t[7];let j=A,M;t[8]!==j||t[9]!==o||t[10]!==u||t[11]!==x||t[12]!==i||t[13]!==r||t[14]!==c||t[15]!==E?(M=async()=>{if(j)try{let e=await x.mutateAsync({certificate:o,privateKey:c,certificateChain:u});e.CertificateArn&&i(e.CertificateArn),E(),r(!1)}catch{}},t[8]=j,t[9]=o,t[10]=u,t[11]=x,t[12]=i,t[13]=r,t[14]=c,t[15]=E,t[16]=M):M=t[16];let N=M,P;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(P={maxWidth:`36rem`,width:`calc(100vw - 2rem)`},t[17]=P):P=t[17];let F;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,D.jsxs)(ee,{children:[(0,D.jsx)(g,{children:`Import certificate`}),(0,D.jsx)(m,{children:`Paste a PEM-encoded certificate and its private key. The optional chain is appended for intermediate CAs.`})]}),t[18]=F):F=t[18];let I;t[19]===x.error?I=t[20]:(I=x.error&&(0,D.jsx)(a,{error:x.error,msg:`Failed to import certificate`}),t[19]=x.error,t[20]=I);let L;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-body`,children:`Certificate body`})}),t[21]=L):L=t[21];let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>s(e.target.value),t[22]=R):R=t[22];let z;t[23]===o?z=t[24]:(z=(0,D.jsxs)(p,{children:[L,(0,D.jsx)(b,{className:`font-mono text-xs`,id:`cert-body`,onChange:R,placeholder:`-----BEGIN CERTIFICATE-----`,rows:5,value:o})]}),t[23]=o,t[24]=z);let B;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-key`,children:`Private key`})}),t[25]=B):B=t[25];let V;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>l(e.target.value),t[26]=V):V=t[26];let H;t[27]===c?H=t[28]:(H=(0,D.jsxs)(p,{children:[B,(0,D.jsx)(b,{className:`font-mono text-xs`,id:`cert-key`,onChange:V,placeholder:`-----BEGIN PRIVATE KEY-----`,rows:5,value:c})]}),t[27]=c,t[28]=H);let U;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-chain`,children:`Certificate chain (optional)`})}),t[29]=U):U=t[29];let W;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>d(e.target.value),t[30]=W):W=t[30];let G;t[31]===u?G=t[32]:(G=(0,D.jsxs)(p,{children:[U,(0,D.jsx)(b,{className:`font-mono text-xs`,id:`cert-chain`,onChange:W,placeholder:`-----BEGIN CERTIFICATE-----`,rows:4,value:u})]}),t[31]=u,t[32]=G);let K;t[33]!==z||t[34]!==H||t[35]!==G?(K=(0,D.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[z,H,G]}),t[33]=z,t[34]=H,t[35]=G,t[36]=K):K=t[36];let q;t[37]===x.isPending?q=t[38]:(q=(0,D.jsx)(y,{disabled:x.isPending,children:`Cancel`}),t[37]=x.isPending,t[38]=q);let J=!j||x.isPending,Y=x.isPending?`Importing…`:`Import`,X;t[39]!==N||t[40]!==J||t[41]!==Y?(X=(0,D.jsx)(_,{disabled:J,onClick:N,children:Y}),t[39]=N,t[40]=J,t[41]=Y,t[42]=X):X=t[42];let Z;t[43]!==q||t[44]!==X?(Z=(0,D.jsxs)(v,{children:[q,X]}),t[43]=q,t[44]=X,t[45]=Z):Z=t[45];let Q;t[46]!==K||t[47]!==Z||t[48]!==I?(Q=(0,D.jsxs)(h,{className:`grid-cols-[minmax(0,1fr)]`,style:P,children:[F,I,K,Z]}),t[46]=K,t[47]=Z,t[48]=I,t[49]=Q):Q=t[49];let $;return t[50]!==k||t[51]!==n||t[52]!==Q?($=(0,D.jsx)(te,{onOpenChange:k,open:n,children:Q}),t[50]=k,t[51]=n,t[52]=Q,t[53]=$):$=t[53],$}export{O as t};
|
||||
@@ -1,3 +1,3 @@
|
||||
import{n as e,o as t,r as n,t as r}from"./compiler-runtime.js";import{w as i}from"./SignatureV4.js";import{t as a}from"./check.js";import{t as o}from"./chevron-down.js";import{t as s}from"./copy.js";import{t as c}from"./button.js";import{Nr as l}from"./index.js";import{t as u}from"./use-copy-to-clipboard.js";var d=l(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),f=r(),p=t(n(),1),m=e(),h={bin:`text-tactical-cyan font-semibold`,flag:`text-tactical-amber`,value:`text-foreground`,comment:`text-muted-foreground italic`,variable:`text-tactical-green font-semibold`};function g(e){return e.map(e=>e.parts.map(e=>e.value).join(``)).join(`
|
||||
import{n as e,o as t,r as n,t as r}from"./compiler-runtime.js";import{Rt as i}from"./auth.js";import{t as a}from"./check.js";import{t as o}from"./chevron-down.js";import{t as s}from"./copy.js";import{t as c}from"./button.js";import{Nr as l}from"./index.js";import{t as u}from"./use-copy-to-clipboard.js";var d=l(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),f=r(),p=t(n(),1),m=e(),h={bin:`text-tactical-cyan font-semibold`,flag:`text-tactical-amber`,value:`text-foreground`,comment:`text-muted-foreground italic`,variable:`text-tactical-green font-semibold`};function g(e){return e.map(e=>e.parts.map(e=>e.value).join(``)).join(`
|
||||
|
||||
`)}function _(e){let t=(0,f.c)(18),{commands:n}=e,[r,l]=(0,p.useState)(!1),{copied:h,copy:_}=u();if(n.length===0)return null;let b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>l(y),t[0]=b):b=t[0];let x,S;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,m.jsx)(d,{className:`size-3.5`}),S=(0,m.jsx)(`span`,{children:`AWS CLI`}),t[1]=x,t[2]=S):(x=t[1],S=t[2]);let C=r&&`rotate-180`,w;t[3]===C?w=t[4]:(w=i(`ml-auto size-3.5 transition-transform`,C),t[3]=C,t[4]=w);let T;t[5]===w?T=t[6]:(T=(0,m.jsx)(o,{className:w}),t[5]=w,t[6]=T);let E;t[7]!==r||t[8]!==T?(E=(0,m.jsxs)(`button`,{type:`button`,onClick:b,className:`flex w-full items-center gap-2 px-3 py-2 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground`,"aria-expanded":r,children:[x,S,T]}),t[7]=r,t[8]=T,t[9]=E):E=t[9];let D;t[10]!==n||t[11]!==h||t[12]!==_||t[13]!==r?(D=r&&(0,m.jsxs)(`div`,{className:`border-t border-border`,children:[(0,m.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-3 py-1.5`,children:[(0,m.jsx)(`span`,{className:`text-[0.625rem] text-muted-foreground`,children:n.length>1?`${n.length} commands`:`command`}),(0,m.jsxs)(c,{type:`button`,variant:`ghost`,size:`xs`,onClick:async()=>await _(g(n)),children:[h?(0,m.jsx)(a,{className:`size-2.5`}):(0,m.jsx)(s,{className:`size-2.5`}),h?`Copied`:`Copy`]})]}),(0,m.jsx)(`div`,{className:`overflow-x-auto p-3`,children:n.map((e,t)=>(0,m.jsxs)(`div`,{children:[n.length>1&&(0,m.jsx)(`div`,{className:`mb-1 text-[0.625rem] font-medium text-muted-foreground`,children:e.label}),(0,m.jsx)(`pre`,{className:`font-mono text-xs/relaxed`,children:(0,m.jsx)(`code`,{children:e.parts.map(v)})}),t<n.length-1&&(0,m.jsx)(`div`,{className:`my-2`})]},e.label))})]}),t[10]=n,t[11]=h,t[12]=_,t[13]=r,t[14]=D):D=t[14];let O;return t[15]!==E||t[16]!==D?(O=(0,m.jsxs)(`div`,{className:`rounded-md border border-border`,children:[E,D]}),t[15]=E,t[16]=D,t[17]=O):O=t[17],O}function v(e,t){return(0,m.jsx)(`span`,{className:h[e.type],children:e.value},t)}function y(e){return!e}export{_ as t};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./error-banner.js";import{_ as r,y as i}from"./SignatureV4.js";import{t as a}from"./back-link.js";import{t as o}from"./cli-command-panel.js";import{t as s}from"./s3.js";import{Ir as c,Rn as l}from"./index.js";import{a as u,i as d,t as f}from"./zod.js";import{t as p}from"./form-actions.js";import{t as m}from"./page-heading.js";import{a as h,r as g,t as _}from"./field.js";var v=t(),y=r({bucketName:i().min(3,`Bucket name must be at least 3 characters`).max(63,`Bucket name must be at most 63 characters`).regex(/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/,`Must start and end with a lowercase letter or number`).regex(/^[a-z0-9.-]+$/,`Only lowercase letters, numbers, hyphens, and periods allowed`).refine(e=>!e.includes(`..`),`Must not contain consecutive periods`).refine(e=>!(e.includes(`.-`)||e.includes(`-.`)),`Must not contain adjacent period and hyphen`)}),b=e();function x(){let e=(0,v.c)(44),t=c(),r=s(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={resolver:f(y)},e[0]=i):i=e[0];let{handleSubmit:x,register:C,control:w,formState:T}=d(i),{errors:E,isSubmitting:D}=T,O;e[1]===w?O=e[2]:(O={control:w},e[1]=w,e[2]=O);let k=u(O),A;e[3]===k?A=e[4]:(A=e=>e?k[e]:void 0,e[3]=k,e[4]=A);let j=A,M;e[5]!==r||e[6]!==t?(M=async e=>{await r.mutateAsync(e),t({to:`/s3/ls`})},e[5]=r,e[6]=t,e[7]=M):M=e[7];let N=M,P,F;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,b.jsx)(a,{to:`/s3/ls`,children:`Back to buckets`}),F=(0,b.jsx)(m,{title:`Create Bucket`}),e[8]=P,e[9]=F):(P=e[8],F=e[9]);let I;e[10]===r.error?I=e[11]:(I=r.error&&(0,b.jsx)(n,{error:r.error,msg:`Failed to create bucket`}),e[10]=r.error,e[11]=I);let L;e[12]!==x||e[13]!==N?(L=x(N),e[12]=x,e[13]=N,e[14]=L):L=e[14];let R;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,b.jsx)(h,{children:(0,b.jsx)(`label`,{htmlFor:`bucketName`,children:`Bucket Name`})}),e[15]=R):R=e[15];let z=!!E.bucketName,B;e[16]===C?B=e[17]:(B=C(`bucketName`),e[16]=C,e[17]=B);let V;e[18]!==z||e[19]!==B?(V=(0,b.jsx)(l,{"aria-invalid":z,id:`bucketName`,placeholder:`my-bucket`,type:`text`,...B}),e[18]=z,e[19]=B,e[20]=V):V=e[20];let H;e[21]===E.bucketName?H=e[22]:(H=(0,b.jsx)(g,{errors:[E.bucketName]}),e[21]=E.bucketName,e[22]=H);let U;e[23]!==V||e[24]!==H?(U=(0,b.jsxs)(_,{children:[R,V,H]}),e[23]=V,e[24]=H,e[25]=U):U=e[25];let W;e[26]===j?W=e[27]:(W=S(j),e[26]=j,e[27]=W);let G;e[28]===W?G=e[29]:(G=(0,b.jsx)(o,{commands:W}),e[28]=W,e[29]=G);let K;e[30]===t?K=e[31]:(K=async()=>await t({to:`/s3/ls`}),e[30]=t,e[31]=K);let q;e[32]!==r.isPending||e[33]!==D||e[34]!==K?(q=(0,b.jsx)(p,{isPending:r.isPending,isSubmitting:D,onCancel:K,pendingLabel:`Creating…`,submitLabel:`Create Bucket`}),e[32]=r.isPending,e[33]=D,e[34]=K,e[35]=q):q=e[35];let J;e[36]!==U||e[37]!==G||e[38]!==q||e[39]!==L?(J=(0,b.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:L,children:[U,G,q]}),e[36]=U,e[37]=G,e[38]=q,e[39]=L,e[40]=J):J=e[40];let Y;return e[41]!==J||e[42]!==I?(Y=(0,b.jsxs)(b.Fragment,{children:[P,F,I,J]}),e[41]=J,e[42]=I,e[43]=Y):Y=e[43],Y}function S(e){let t=e(`bucketName`);return[{label:`Create Bucket`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws s3api create-bucket`},{type:`flag`,value:` --bucket`},{type:`value`,value:` ${(typeof t==`string`?t:``)||`<BucketName>`}`}]}]}export{x as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./error-banner.js";import{f as r,u as i}from"./auth.js";import{t as a}from"./back-link.js";import{t as o}from"./cli-command-panel.js";import{t as s}from"./s3.js";import{Ir as c,Rn as l}from"./index.js";import{a as u,i as d,t as f}from"./zod.js";import{t as p}from"./form-actions.js";import{t as m}from"./page-heading.js";import{a as h,r as g,t as _}from"./field.js";var v=t(),y=i({bucketName:r().min(3,`Bucket name must be at least 3 characters`).max(63,`Bucket name must be at most 63 characters`).regex(/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/,`Must start and end with a lowercase letter or number`).regex(/^[a-z0-9.-]+$/,`Only lowercase letters, numbers, hyphens, and periods allowed`).refine(e=>!e.includes(`..`),`Must not contain consecutive periods`).refine(e=>!(e.includes(`.-`)||e.includes(`-.`)),`Must not contain adjacent period and hyphen`)}),b=e();function x(){let e=(0,v.c)(44),t=c(),r=s(),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={resolver:f(y)},e[0]=i):i=e[0];let{handleSubmit:x,register:C,control:w,formState:T}=d(i),{errors:E,isSubmitting:D}=T,O;e[1]===w?O=e[2]:(O={control:w},e[1]=w,e[2]=O);let k=u(O),A;e[3]===k?A=e[4]:(A=e=>e?k[e]:void 0,e[3]=k,e[4]=A);let j=A,M;e[5]!==r||e[6]!==t?(M=async e=>{await r.mutateAsync(e),t({to:`/s3/ls`})},e[5]=r,e[6]=t,e[7]=M):M=e[7];let N=M,P,F;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,b.jsx)(a,{to:`/s3/ls`,children:`Back to buckets`}),F=(0,b.jsx)(m,{title:`Create Bucket`}),e[8]=P,e[9]=F):(P=e[8],F=e[9]);let I;e[10]===r.error?I=e[11]:(I=r.error&&(0,b.jsx)(n,{error:r.error,msg:`Failed to create bucket`}),e[10]=r.error,e[11]=I);let L;e[12]!==x||e[13]!==N?(L=x(N),e[12]=x,e[13]=N,e[14]=L):L=e[14];let R;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,b.jsx)(h,{children:(0,b.jsx)(`label`,{htmlFor:`bucketName`,children:`Bucket Name`})}),e[15]=R):R=e[15];let z=!!E.bucketName,B;e[16]===C?B=e[17]:(B=C(`bucketName`),e[16]=C,e[17]=B);let V;e[18]!==z||e[19]!==B?(V=(0,b.jsx)(l,{"aria-invalid":z,id:`bucketName`,placeholder:`my-bucket`,type:`text`,...B}),e[18]=z,e[19]=B,e[20]=V):V=e[20];let H;e[21]===E.bucketName?H=e[22]:(H=(0,b.jsx)(g,{errors:[E.bucketName]}),e[21]=E.bucketName,e[22]=H);let U;e[23]!==V||e[24]!==H?(U=(0,b.jsxs)(_,{children:[R,V,H]}),e[23]=V,e[24]=H,e[25]=U):U=e[25];let W;e[26]===j?W=e[27]:(W=S(j),e[26]=j,e[27]=W);let G;e[28]===W?G=e[29]:(G=(0,b.jsx)(o,{commands:W}),e[28]=W,e[29]=G);let K;e[30]===t?K=e[31]:(K=async()=>await t({to:`/s3/ls`}),e[30]=t,e[31]=K);let q;e[32]!==r.isPending||e[33]!==D||e[34]!==K?(q=(0,b.jsx)(p,{isPending:r.isPending,isSubmitting:D,onCancel:K,pendingLabel:`Creating…`,submitLabel:`Create Bucket`}),e[32]=r.isPending,e[33]=D,e[34]=K,e[35]=q):q=e[35];let J;e[36]!==U||e[37]!==G||e[38]!==q||e[39]!==L?(J=(0,b.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:L,children:[U,G,q]}),e[36]=U,e[37]=G,e[38]=q,e[39]=L,e[40]=J):J=e[40];let Y;return e[41]!==J||e[42]!==I?(Y=(0,b.jsxs)(b.Fragment,{children:[P,F,I,J]}),e[41]=J,e[42]=I,e[43]=Y):Y=e[43],Y}function S(e){let t=e(`bucketName`);return[{label:`Create Bucket`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws s3api create-bucket`},{type:`flag`,value:` --bucket`},{type:`value`,value:` ${(typeof t==`string`?t:``)||`<BucketName>`}`}]}]}export{x as component};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./error-banner.js";import{t as r}from"./useSuspenseQuery.js";import{A as i}from"./SignatureV4.js";import{t as a}from"./back-link.js";import{c as o,i as s,n as c,s as l,t as u}from"./select.js";import{_ as d}from"./ec2.js";import{Ir as f,Lt as p,Rn as m}from"./index.js";import{i as h,n as g,t as _}from"./zod.js";import{t as v}from"./form-actions.js";import{t as y}from"./page-heading.js";import{a as b,r as x,t as S}from"./field.js";import{u as C}from"./ec22.js";var w=t(),T=e();function E(){let e=(0,w.c)(44),t=f(),{data:i}=r(p),s=d(),E;e[0]===i.Vpcs?E=e[1]:(E=i.Vpcs??[],e[0]=i.Vpcs,e[1]=E);let O=E,k;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(k={resolver:_(C),defaultValues:{vpcId:``,name:``}},e[2]=k):k=e[2];let{control:A,handleSubmit:j,register:M,formState:N}=h(k),{errors:P,isSubmitting:F}=N,I;e[3]!==s||e[4]!==t?(I=async e=>{let n=(await s.mutateAsync({vpcId:e.vpcId,name:e.name?.trim()?e.name.trim():void 0})).RouteTable?.RouteTableId;t(n?{to:`/ec2/describe-route-tables/$id`,params:{id:n}}:{to:`/ec2/describe-route-tables`})},e[3]=s,e[4]=t,e[5]=I):I=e[5];let L=I,R,z;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,T.jsx)(a,{to:`/ec2/describe-route-tables`,children:`Back to Route Tables`}),z=(0,T.jsx)(y,{title:`Create Route Table`}),e[6]=R,e[7]=z):(R=e[6],z=e[7]);let B;e[8]===s.error?B=e[9]:(B=s.error&&(0,T.jsx)(n,{error:s.error,msg:`Failed to create Route Table`}),e[8]=s.error,e[9]=B);let V;e[10]!==j||e[11]!==L?(V=j(L),e[10]=j,e[11]=L,e[12]=V):V=e[12];let H;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,T.jsx)(b,{children:(0,T.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),e[13]=H):H=e[13];let U;e[14]===M?U=e[15]:(U=M(`name`),e[14]=M,e[15]=U);let W;e[16]===U?W=e[17]:(W=(0,T.jsxs)(S,{children:[H,(0,T.jsx)(m,{id:`name`,placeholder:`my-route-table`,...U})]}),e[16]=U,e[17]=W);let G;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,T.jsx)(b,{children:(0,T.jsx)(`label`,{htmlFor:`vpcId`,children:`VPC`})}),e[18]=G):G=e[18];let K;e[19]!==P.vpcId||e[20]!==O?(K=e=>{let{field:t}=e;return(0,T.jsxs)(u,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,T.jsx)(l,{"aria-invalid":!!P.vpcId,className:`w-full`,id:`vpcId`,children:(0,T.jsx)(o,{placeholder:`Select a VPC`})}),(0,T.jsx)(c,{children:O.map(D)})]})},e[19]=P.vpcId,e[20]=O,e[21]=K):K=e[21];let q;e[22]!==A||e[23]!==K?(q=(0,T.jsx)(g,{control:A,name:`vpcId`,render:K}),e[22]=A,e[23]=K,e[24]=q):q=e[24];let J;e[25]===P.vpcId?J=e[26]:(J=(0,T.jsx)(x,{errors:[P.vpcId]}),e[25]=P.vpcId,e[26]=J);let Y;e[27]!==q||e[28]!==J?(Y=(0,T.jsxs)(S,{children:[G,q,J]}),e[27]=q,e[28]=J,e[29]=Y):Y=e[29];let X;e[30]===t?X=e[31]:(X=async()=>await t({to:`/ec2/describe-route-tables`}),e[30]=t,e[31]=X);let Z;e[32]!==s.isPending||e[33]!==F||e[34]!==X?(Z=(0,T.jsx)(v,{isPending:s.isPending,isSubmitting:F,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Route Table`}),e[32]=s.isPending,e[33]=F,e[34]=X,e[35]=Z):Z=e[35];let Q;e[36]!==W||e[37]!==Y||e[38]!==Z||e[39]!==V?(Q=(0,T.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:V,children:[W,Y,Z]}),e[36]=W,e[37]=Y,e[38]=Z,e[39]=V,e[40]=Q):Q=e[40];let $;return e[41]!==Q||e[42]!==B?($=(0,T.jsxs)(T.Fragment,{children:[R,z,B,Q]}),e[41]=Q,e[42]=B,e[43]=$):$=e[43],$}function D(e){let t=i(e.Tags);return(0,T.jsx)(s,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}export{E as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./error-banner.js";import{t as r}from"./useSuspenseQuery.js";import{Wt as i}from"./auth.js";import{t as a}from"./back-link.js";import{c as o,i as s,n as c,s as l,t as u}from"./select.js";import{_ as d}from"./ec2.js";import{Ir as f,Lt as p,Rn as m}from"./index.js";import{i as h,n as g,t as _}from"./zod.js";import{t as v}from"./form-actions.js";import{t as y}from"./page-heading.js";import{a as b,r as x,t as S}from"./field.js";import{u as C}from"./ec22.js";var w=t(),T=e();function E(){let e=(0,w.c)(44),t=f(),{data:i}=r(p),s=d(),E;e[0]===i.Vpcs?E=e[1]:(E=i.Vpcs??[],e[0]=i.Vpcs,e[1]=E);let O=E,k;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(k={resolver:_(C),defaultValues:{vpcId:``,name:``}},e[2]=k):k=e[2];let{control:A,handleSubmit:j,register:M,formState:N}=h(k),{errors:P,isSubmitting:F}=N,I;e[3]!==s||e[4]!==t?(I=async e=>{let n=(await s.mutateAsync({vpcId:e.vpcId,name:e.name?.trim()?e.name.trim():void 0})).RouteTable?.RouteTableId;t(n?{to:`/ec2/describe-route-tables/$id`,params:{id:n}}:{to:`/ec2/describe-route-tables`})},e[3]=s,e[4]=t,e[5]=I):I=e[5];let L=I,R,z;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,T.jsx)(a,{to:`/ec2/describe-route-tables`,children:`Back to Route Tables`}),z=(0,T.jsx)(y,{title:`Create Route Table`}),e[6]=R,e[7]=z):(R=e[6],z=e[7]);let B;e[8]===s.error?B=e[9]:(B=s.error&&(0,T.jsx)(n,{error:s.error,msg:`Failed to create Route Table`}),e[8]=s.error,e[9]=B);let V;e[10]!==j||e[11]!==L?(V=j(L),e[10]=j,e[11]=L,e[12]=V):V=e[12];let H;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,T.jsx)(b,{children:(0,T.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),e[13]=H):H=e[13];let U;e[14]===M?U=e[15]:(U=M(`name`),e[14]=M,e[15]=U);let W;e[16]===U?W=e[17]:(W=(0,T.jsxs)(S,{children:[H,(0,T.jsx)(m,{id:`name`,placeholder:`my-route-table`,...U})]}),e[16]=U,e[17]=W);let G;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,T.jsx)(b,{children:(0,T.jsx)(`label`,{htmlFor:`vpcId`,children:`VPC`})}),e[18]=G):G=e[18];let K;e[19]!==P.vpcId||e[20]!==O?(K=e=>{let{field:t}=e;return(0,T.jsxs)(u,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,T.jsx)(l,{"aria-invalid":!!P.vpcId,className:`w-full`,id:`vpcId`,children:(0,T.jsx)(o,{placeholder:`Select a VPC`})}),(0,T.jsx)(c,{children:O.map(D)})]})},e[19]=P.vpcId,e[20]=O,e[21]=K):K=e[21];let q;e[22]!==A||e[23]!==K?(q=(0,T.jsx)(g,{control:A,name:`vpcId`,render:K}),e[22]=A,e[23]=K,e[24]=q):q=e[24];let J;e[25]===P.vpcId?J=e[26]:(J=(0,T.jsx)(x,{errors:[P.vpcId]}),e[25]=P.vpcId,e[26]=J);let Y;e[27]!==q||e[28]!==J?(Y=(0,T.jsxs)(S,{children:[G,q,J]}),e[27]=q,e[28]=J,e[29]=Y):Y=e[29];let X;e[30]===t?X=e[31]:(X=async()=>await t({to:`/ec2/describe-route-tables`}),e[30]=t,e[31]=X);let Z;e[32]!==s.isPending||e[33]!==F||e[34]!==X?(Z=(0,T.jsx)(v,{isPending:s.isPending,isSubmitting:F,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Route Table`}),e[32]=s.isPending,e[33]=F,e[34]=X,e[35]=Z):Z=e[35];let Q;e[36]!==W||e[37]!==Y||e[38]!==Z||e[39]!==V?(Q=(0,T.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:V,children:[W,Y,Z]}),e[36]=W,e[37]=Y,e[38]=Z,e[39]=V,e[40]=Q):Q=e[40];let $;return e[41]!==Q||e[42]!==B?($=(0,T.jsxs)(T.Fragment,{children:[R,z,B,Q]}),e[41]=Q,e[42]=B,e[43]=$):$=e[43],$}function D(e){let t=i(e.Tags);return(0,T.jsx)(s,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}export{E as component};
|
||||
@@ -1,4 +1,4 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./error-banner.js";import{t as r}from"./useSuspenseQuery.js";import{A as i}from"./SignatureV4.js";import{t as a}from"./back-link.js";import{c as o,i as s,n as ee,s as te,t as ne}from"./select.js";import{t as re}from"./cli-command-panel.js";import{v as ie}from"./ec2.js";import{Ir as ae,Lt as oe,Rn as se}from"./index.js";import{a as ce,i as le,n as ue,t as de}from"./zod.js";import{t as fe}from"./form-actions.js";import{t as pe}from"./page-heading.js";import{a as c,r as l,t as u}from"./field.js";import{d as me}from"./ec22.js";var he=t(),d=e();function f(){let e=(0,he.c)(73),t=ae(),{data:i}=r(oe),s=ie(),f;e[0]===i.Vpcs?f=e[1]:(f=i.Vpcs??[],e[0]=i.Vpcs,e[1]=f);let p=f,m;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=de(me),e[2]=m):m=e[2];let h=p[0]?.VpcId??``,g;e[3]===h?g=e[4]:(g={resolver:m,defaultValues:{groupName:``,description:``,vpcId:h}},e[3]=h,e[4]=g);let{control:_,handleSubmit:v,register:y,formState:ve}=le(g),{errors:b,isSubmitting:ye}=ve,x;e[5]===_?x=e[6]:(x={control:_},e[5]=_,e[6]=x);let S=ce(x),C;e[7]===S?C=e[8]:(C=e=>e?S[e]:void 0,e[7]=S,e[8]=C);let w=C,T;e[9]!==s||e[10]!==t?(T=async e=>{let n=(await s.mutateAsync(e)).GroupId;t(n?{to:`/ec2/describe-security-groups/$id`,params:{id:n}}:{to:`/ec2/describe-security-groups`})},e[9]=s,e[10]=t,e[11]=T):T=e[11];let E=T,D,O;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,d.jsx)(a,{to:`/ec2/describe-security-groups`,children:`Back to Security Groups`}),O=(0,d.jsx)(pe,{title:`Create Security Group`}),e[12]=D,e[13]=O):(D=e[12],O=e[13]);let k;e[14]===s.error?k=e[15]:(k=s.error&&(0,d.jsx)(n,{error:s.error,msg:`Failed to create security group`}),e[14]=s.error,e[15]=k);let A;e[16]!==v||e[17]!==E?(A=v(E),e[16]=v,e[17]=E,e[18]=A):A=e[18];let j;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,d.jsx)(c,{children:(0,d.jsx)(`label`,{htmlFor:`groupName`,children:`Group Name`})}),e[19]=j):j=e[19];let M=!!b.groupName,N;e[20]===y?N=e[21]:(N=y(`groupName`),e[20]=y,e[21]=N);let P;e[22]!==M||e[23]!==N?(P=(0,d.jsx)(se,{"aria-invalid":M,id:`groupName`,placeholder:`my-security-group`,...N}),e[22]=M,e[23]=N,e[24]=P):P=e[24];let F;e[25]===b.groupName?F=e[26]:(F=(0,d.jsx)(l,{errors:[b.groupName]}),e[25]=b.groupName,e[26]=F);let I;e[27]!==P||e[28]!==F?(I=(0,d.jsxs)(u,{children:[j,P,F]}),e[27]=P,e[28]=F,e[29]=I):I=e[29];let L;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,d.jsx)(c,{children:(0,d.jsx)(`label`,{htmlFor:`description`,children:`Description`})}),e[30]=L):L=e[30];let R=!!b.description,z;e[31]===y?z=e[32]:(z=y(`description`),e[31]=y,e[32]=z);let B;e[33]!==R||e[34]!==z?(B=(0,d.jsx)(se,{"aria-invalid":R,id:`description`,placeholder:`My security group description`,...z}),e[33]=R,e[34]=z,e[35]=B):B=e[35];let V;e[36]===b.description?V=e[37]:(V=(0,d.jsx)(l,{errors:[b.description]}),e[36]=b.description,e[37]=V);let H;e[38]!==B||e[39]!==V?(H=(0,d.jsxs)(u,{children:[L,B,V]}),e[38]=B,e[39]=V,e[40]=H):H=e[40];let U;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,d.jsx)(c,{children:(0,d.jsx)(`label`,{htmlFor:`vpcId`,children:`VPC`})}),e[41]=U):U=e[41];let W;e[42]!==b.vpcId||e[43]!==p?(W=e=>{let{field:t}=e;return(0,d.jsxs)(ne,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,d.jsx)(te,{"aria-invalid":!!b.vpcId,className:`w-full`,id:`vpcId`,children:(0,d.jsx)(o,{})}),(0,d.jsx)(ee,{children:p.map(ge)})]})},e[42]=b.vpcId,e[43]=p,e[44]=W):W=e[44];let G;e[45]!==_||e[46]!==W?(G=(0,d.jsx)(ue,{control:_,name:`vpcId`,render:W}),e[45]=_,e[46]=W,e[47]=G):G=e[47];let K;e[48]===b.vpcId?K=e[49]:(K=(0,d.jsx)(l,{errors:[b.vpcId]}),e[48]=b.vpcId,e[49]=K);let q;e[50]!==G||e[51]!==K?(q=(0,d.jsxs)(u,{children:[U,G,K]}),e[50]=G,e[51]=K,e[52]=q):q=e[52];let J;e[53]===w?J=e[54]:(J=_e(w),e[53]=w,e[54]=J);let Y;e[55]===J?Y=e[56]:(Y=(0,d.jsx)(re,{commands:J}),e[55]=J,e[56]=Y);let X;e[57]===t?X=e[58]:(X=async()=>await t({to:`/ec2/describe-security-groups`}),e[57]=t,e[58]=X);let Z;e[59]!==s.isPending||e[60]!==ye||e[61]!==X?(Z=(0,d.jsx)(fe,{isPending:s.isPending,isSubmitting:ye,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Security Group`}),e[59]=s.isPending,e[60]=ye,e[61]=X,e[62]=Z):Z=e[62];let Q;e[63]!==A||e[64]!==I||e[65]!==H||e[66]!==q||e[67]!==Y||e[68]!==Z?(Q=(0,d.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:A,children:[I,H,q,Y,Z]}),e[63]=A,e[64]=I,e[65]=H,e[66]=q,e[67]=Y,e[68]=Z,e[69]=Q):Q=e[69];let $;return e[70]!==k||e[71]!==Q?($=(0,d.jsxs)(d.Fragment,{children:[D,O,k,Q]}),e[70]=k,e[71]=Q,e[72]=$):$=e[72],$}function ge(e){let t=i(e.Tags);return(0,d.jsx)(s,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}function _e(e){let t=e(`groupName`),n=typeof t==`string`?t:``,r=e(`description`),i=typeof r==`string`?r:``,a=e(`vpcId`),o=typeof a==`string`?a:``,s=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-security-group`},{type:`flag`,value:` \\
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./error-banner.js";import{t as r}from"./useSuspenseQuery.js";import{Wt as i}from"./auth.js";import{t as a}from"./back-link.js";import{c as o,i as s,n as ee,s as te,t as ne}from"./select.js";import{t as re}from"./cli-command-panel.js";import{v as ie}from"./ec2.js";import{Ir as ae,Lt as oe,Rn as se}from"./index.js";import{a as ce,i as le,n as ue,t as de}from"./zod.js";import{t as fe}from"./form-actions.js";import{t as pe}from"./page-heading.js";import{a as c,r as l,t as u}from"./field.js";import{d as me}from"./ec22.js";var he=t(),d=e();function f(){let e=(0,he.c)(73),t=ae(),{data:i}=r(oe),s=ie(),f;e[0]===i.Vpcs?f=e[1]:(f=i.Vpcs??[],e[0]=i.Vpcs,e[1]=f);let p=f,m;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=de(me),e[2]=m):m=e[2];let h=p[0]?.VpcId??``,g;e[3]===h?g=e[4]:(g={resolver:m,defaultValues:{groupName:``,description:``,vpcId:h}},e[3]=h,e[4]=g);let{control:_,handleSubmit:v,register:y,formState:ve}=le(g),{errors:b,isSubmitting:ye}=ve,x;e[5]===_?x=e[6]:(x={control:_},e[5]=_,e[6]=x);let S=ce(x),C;e[7]===S?C=e[8]:(C=e=>e?S[e]:void 0,e[7]=S,e[8]=C);let w=C,T;e[9]!==s||e[10]!==t?(T=async e=>{let n=(await s.mutateAsync(e)).GroupId;t(n?{to:`/ec2/describe-security-groups/$id`,params:{id:n}}:{to:`/ec2/describe-security-groups`})},e[9]=s,e[10]=t,e[11]=T):T=e[11];let E=T,D,O;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,d.jsx)(a,{to:`/ec2/describe-security-groups`,children:`Back to Security Groups`}),O=(0,d.jsx)(pe,{title:`Create Security Group`}),e[12]=D,e[13]=O):(D=e[12],O=e[13]);let k;e[14]===s.error?k=e[15]:(k=s.error&&(0,d.jsx)(n,{error:s.error,msg:`Failed to create security group`}),e[14]=s.error,e[15]=k);let A;e[16]!==v||e[17]!==E?(A=v(E),e[16]=v,e[17]=E,e[18]=A):A=e[18];let j;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,d.jsx)(c,{children:(0,d.jsx)(`label`,{htmlFor:`groupName`,children:`Group Name`})}),e[19]=j):j=e[19];let M=!!b.groupName,N;e[20]===y?N=e[21]:(N=y(`groupName`),e[20]=y,e[21]=N);let P;e[22]!==M||e[23]!==N?(P=(0,d.jsx)(se,{"aria-invalid":M,id:`groupName`,placeholder:`my-security-group`,...N}),e[22]=M,e[23]=N,e[24]=P):P=e[24];let F;e[25]===b.groupName?F=e[26]:(F=(0,d.jsx)(l,{errors:[b.groupName]}),e[25]=b.groupName,e[26]=F);let I;e[27]!==P||e[28]!==F?(I=(0,d.jsxs)(u,{children:[j,P,F]}),e[27]=P,e[28]=F,e[29]=I):I=e[29];let L;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,d.jsx)(c,{children:(0,d.jsx)(`label`,{htmlFor:`description`,children:`Description`})}),e[30]=L):L=e[30];let R=!!b.description,z;e[31]===y?z=e[32]:(z=y(`description`),e[31]=y,e[32]=z);let B;e[33]!==R||e[34]!==z?(B=(0,d.jsx)(se,{"aria-invalid":R,id:`description`,placeholder:`My security group description`,...z}),e[33]=R,e[34]=z,e[35]=B):B=e[35];let V;e[36]===b.description?V=e[37]:(V=(0,d.jsx)(l,{errors:[b.description]}),e[36]=b.description,e[37]=V);let H;e[38]!==B||e[39]!==V?(H=(0,d.jsxs)(u,{children:[L,B,V]}),e[38]=B,e[39]=V,e[40]=H):H=e[40];let U;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,d.jsx)(c,{children:(0,d.jsx)(`label`,{htmlFor:`vpcId`,children:`VPC`})}),e[41]=U):U=e[41];let W;e[42]!==b.vpcId||e[43]!==p?(W=e=>{let{field:t}=e;return(0,d.jsxs)(ne,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,d.jsx)(te,{"aria-invalid":!!b.vpcId,className:`w-full`,id:`vpcId`,children:(0,d.jsx)(o,{})}),(0,d.jsx)(ee,{children:p.map(ge)})]})},e[42]=b.vpcId,e[43]=p,e[44]=W):W=e[44];let G;e[45]!==_||e[46]!==W?(G=(0,d.jsx)(ue,{control:_,name:`vpcId`,render:W}),e[45]=_,e[46]=W,e[47]=G):G=e[47];let K;e[48]===b.vpcId?K=e[49]:(K=(0,d.jsx)(l,{errors:[b.vpcId]}),e[48]=b.vpcId,e[49]=K);let q;e[50]!==G||e[51]!==K?(q=(0,d.jsxs)(u,{children:[U,G,K]}),e[50]=G,e[51]=K,e[52]=q):q=e[52];let J;e[53]===w?J=e[54]:(J=_e(w),e[53]=w,e[54]=J);let Y;e[55]===J?Y=e[56]:(Y=(0,d.jsx)(re,{commands:J}),e[55]=J,e[56]=Y);let X;e[57]===t?X=e[58]:(X=async()=>await t({to:`/ec2/describe-security-groups`}),e[57]=t,e[58]=X);let Z;e[59]!==s.isPending||e[60]!==ye||e[61]!==X?(Z=(0,d.jsx)(fe,{isPending:s.isPending,isSubmitting:ye,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Security Group`}),e[59]=s.isPending,e[60]=ye,e[61]=X,e[62]=Z):Z=e[62];let Q;e[63]!==A||e[64]!==I||e[65]!==H||e[66]!==q||e[67]!==Y||e[68]!==Z?(Q=(0,d.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:A,children:[I,H,q,Y,Z]}),e[63]=A,e[64]=I,e[65]=H,e[66]=q,e[67]=Y,e[68]=Z,e[69]=Q):Q=e[69];let $;return e[70]!==k||e[71]!==Q?($=(0,d.jsxs)(d.Fragment,{children:[D,O,k,Q]}),e[70]=k,e[71]=Q,e[72]=$):$=e[72],$}function ge(e){let t=i(e.Tags);return(0,d.jsx)(s,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}function _e(e){let t=e(`groupName`),n=typeof t==`string`?t:``,r=e(`description`),i=typeof r==`string`?r:``,a=e(`vpcId`),o=typeof a==`string`?a:``,s=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-security-group`},{type:`flag`,value:` \\
|
||||
--group-name`},{type:`value`,value:` ${n||`<GroupName>`}`},{type:`flag`,value:` \\
|
||||
--description`},{type:`value`,value:` "${i||`<Description>`}"`}];return o&&s.push({type:`flag`,value:` \\
|
||||
--vpc-id`},{type:`value`,value:` ${o}`}),[{label:`Create Security Group`,parts:s}]}export{f as component};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{A as i}from"./SignatureV4.js";import{t as a}from"./button.js";import{lt as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";var l=t(),u=e();function d(){let e=(0,l.c)(5),{data:t}=n(o),i;e[0]===t.Addresses?i=e[1]:(i=t.Addresses??[],e[0]=t.Addresses,e[1]=i);let c=i,d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(s,{actions:(0,u.jsx)(r,{to:`/ec2/allocate-address`,children:(0,u.jsx)(a,{children:`Allocate Elastic IP`})}),title:`Elastic IPs`}),e[2]=d):d=e[2];let p;return e[3]===c?p=e[4]:(p=(0,u.jsxs)(u.Fragment,{children:[d,c.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:c.map(f)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No Elastic IPs found.`})]}),e[3]=c,e[4]=p),p}function f(e){if(!e.AllocationId)return null;let t=i(e.Tags),n=e.AssociationId?`${e.PublicIp} • associated`:`${e.PublicIp} • available`;return(0,u.jsx)(c,{params:{id:e.AllocationId},subtitle:n,title:t?`${e.AllocationId} (${t})`:e.AllocationId??``,to:`/ec2/describe-addresses/$id`},e.AllocationId)}export{d as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{Wt as i}from"./auth.js";import{t as a}from"./button.js";import{lt as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";var l=t(),u=e();function d(){let e=(0,l.c)(5),{data:t}=n(o),i;e[0]===t.Addresses?i=e[1]:(i=t.Addresses??[],e[0]=t.Addresses,e[1]=i);let c=i,d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(s,{actions:(0,u.jsx)(r,{to:`/ec2/allocate-address`,children:(0,u.jsx)(a,{children:`Allocate Elastic IP`})}),title:`Elastic IPs`}),e[2]=d):d=e[2];let p;return e[3]===c?p=e[4]:(p=(0,u.jsxs)(u.Fragment,{children:[d,c.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:c.map(f)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No Elastic IPs found.`})]}),e[3]=c,e[4]=p),p}function f(e){if(!e.AllocationId)return null;let t=i(e.Tags),n=e.AssociationId?`${e.PublicIp} • associated`:`${e.PublicIp} • available`;return(0,u.jsx)(c,{params:{id:e.AllocationId},subtitle:n,title:t?`${e.AllocationId} (${t})`:e.AllocationId??``,to:`/ec2/describe-addresses/$id`},e.AllocationId)}export{d as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{t as i}from"./button.js";import{gt as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";import{t as c}from"./state-badge.js";var l=t(),u=e(),d={running:0,pending:1,stopping:2,"shutting-down":3,stopped:4,terminated:5};function f(){let e=(0,l.c)(3),{data:t}=n(a),s;if(e[0]!==t.Reservations){let n=(t.Reservations?.flatMap(h)??[]).toSorted(m),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,u.jsx)(o,{actions:(0,u.jsx)(r,{to:`/ec2/run-instances`,children:(0,u.jsx)(i,{children:`Run Instances`})}),title:`Instances`}),e[2]=a):a=e[2],s=(0,u.jsxs)(u.Fragment,{children:[a,n.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:n.map(p)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No instances found.`})]}),e[0]=t.Reservations,e[1]=s}else s=e[1];return s}function p(e){return e.InstanceId?(0,u.jsx)(s,{badge:(0,u.jsx)(c,{state:e.State?.Name}),params:{id:e.InstanceId},subtitle:`${e.InstanceType}`,title:e.InstanceId,to:`/ec2/describe-instances/$id`},e.InstanceId):null}function m(e,t){let n=d[e.State?.Name??``]??6,r=d[t.State?.Name??``]??6;return n===r?(e.InstanceId??``).localeCompare(t.InstanceId??``):n-r}function h(e){return e.Instances??[]}export{f as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{t as i}from"./button.js";import{gt as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";import{t as c}from"./state-badge.js";var l=t(),u=e(),d={running:0,pending:1,stopping:2,"shutting-down":3,stopped:4,terminated:5};function f(){let e=(0,l.c)(3),{data:t}=n(a),s;if(e[0]!==t.Reservations){let n=(t.Reservations?.flatMap(h)??[]).toSorted(m),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,u.jsx)(o,{actions:(0,u.jsx)(r,{to:`/ec2/run-instances`,children:(0,u.jsx)(i,{children:`Run Instances`})}),title:`Instances`}),e[2]=a):a=e[2],s=(0,u.jsxs)(u.Fragment,{children:[a,n.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:n.map(p)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No instances found.`})]}),e[0]=t.Reservations,e[1]=s}else s=e[1];return s}function p(e){return e.InstanceId?(0,u.jsx)(s,{badge:(0,u.jsx)(c,{state:e.State?.Name}),params:{id:e.InstanceId},subtitle:`${e.InstanceType}`,title:e.InstanceId,to:`/ec2/describe-instances/$id`},e.InstanceId):null}function m(e,t){let n=d[e.State?.Name??``]??6,r=d[t.State?.Name??``]??6;return n===r?(e.InstanceId??``).localeCompare(t.InstanceId??``):n-r}function h(e){return e.Instances??[]}export{f as component};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{A as i}from"./SignatureV4.js";import{t as a}from"./button.js";import{vt as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";var l=t(),u=e();function d(){let e=(0,l.c)(5),{data:t}=n(o),i;e[0]===t.InternetGateways?i=e[1]:(i=t.InternetGateways??[],e[0]=t.InternetGateways,e[1]=i);let c=i,d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(s,{actions:(0,u.jsx)(r,{to:`/ec2/create-internet-gateway`,children:(0,u.jsx)(a,{children:`Create Internet Gateway`})}),title:`Internet Gateways`}),e[2]=d):d=e[2];let p;return e[3]===c?p=e[4]:(p=(0,u.jsxs)(u.Fragment,{children:[d,c.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:c.map(f)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No Internet Gateways found.`})]}),e[3]=c,e[4]=p),p}function f(e){if(!e.InternetGatewayId)return null;let t=i(e.Tags),n=e.Attachments?.[0]?.VpcId;return(0,u.jsx)(c,{params:{id:e.InternetGatewayId},subtitle:n?`attached to ${n}`:`detached`,title:t?`${e.InternetGatewayId} (${t})`:e.InternetGatewayId,to:`/ec2/describe-internet-gateways/$id`},e.InternetGatewayId)}export{d as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{Wt as i}from"./auth.js";import{t as a}from"./button.js";import{vt as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";var l=t(),u=e();function d(){let e=(0,l.c)(5),{data:t}=n(o),i;e[0]===t.InternetGateways?i=e[1]:(i=t.InternetGateways??[],e[0]=t.InternetGateways,e[1]=i);let c=i,d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(s,{actions:(0,u.jsx)(r,{to:`/ec2/create-internet-gateway`,children:(0,u.jsx)(a,{children:`Create Internet Gateway`})}),title:`Internet Gateways`}),e[2]=d):d=e[2];let p;return e[3]===c?p=e[4]:(p=(0,u.jsxs)(u.Fragment,{children:[d,c.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:c.map(f)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No Internet Gateways found.`})]}),e[3]=c,e[4]=p),p}function f(e){if(!e.InternetGatewayId)return null;let t=i(e.Tags),n=e.Attachments?.[0]?.VpcId;return(0,u.jsx)(c,{params:{id:e.InternetGatewayId},subtitle:n?`attached to ${n}`:`detached`,title:t?`${e.InternetGatewayId} (${t})`:e.InternetGatewayId,to:`/ec2/describe-internet-gateways/$id`},e.InternetGatewayId)}export{d as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{t as i}from"./button.js";import{bt as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=t(),l=e();function u(){let e=(0,c.c)(4),{data:t}=n(a),s;if(e[0]!==t.KeyPairs){let n=(t.KeyPairs??[]).toSorted(f),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,l.jsx)(r,{to:`/ec2/import-key-pair`,children:(0,l.jsx)(i,{variant:`outline`,children:`Import Key Pair`})}),e[2]=a):a=e[2];let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,l.jsx)(o,{actions:(0,l.jsxs)(`div`,{className:`flex gap-2`,children:[a,(0,l.jsx)(r,{to:`/ec2/create-key-pair`,children:(0,l.jsx)(i,{children:`Create Key Pair`})})]}),title:`Key Pairs`}),e[3]=c):c=e[3],s=(0,l.jsxs)(l.Fragment,{children:[c,n.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:n.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No key pairs found.`})]}),e[0]=t.KeyPairs,e[1]=s}else s=e[1];return s}function d(e){return e.KeyPairId?(0,l.jsx)(s,{params:{id:e.KeyPairId},subtitle:e.KeyPairId??``,title:e.KeyName??``,to:`/ec2/describe-key-pairs/$id`},e.KeyPairId):null}function f(e,t){let n=e.KeyName?.toLowerCase()??``,r=t.KeyName?.toLowerCase()??``;return n.localeCompare(r)}export{u as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{t as i}from"./button.js";import{bt as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=t(),l=e();function u(){let e=(0,c.c)(4),{data:t}=n(a),s;if(e[0]!==t.KeyPairs){let n=(t.KeyPairs??[]).toSorted(f),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,l.jsx)(r,{to:`/ec2/import-key-pair`,children:(0,l.jsx)(i,{variant:`outline`,children:`Import Key Pair`})}),e[2]=a):a=e[2];let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,l.jsx)(o,{actions:(0,l.jsxs)(`div`,{className:`flex gap-2`,children:[a,(0,l.jsx)(r,{to:`/ec2/create-key-pair`,children:(0,l.jsx)(i,{children:`Create Key Pair`})})]}),title:`Key Pairs`}),e[3]=c):c=e[3],s=(0,l.jsxs)(l.Fragment,{children:[c,n.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:n.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No key pairs found.`})]}),e[0]=t.KeyPairs,e[1]=s}else s=e[1];return s}function d(e){return e.KeyPairId?(0,l.jsx)(s,{params:{id:e.KeyPairId},subtitle:e.KeyPairId??``,title:e.KeyName??``,to:`/ec2/describe-key-pairs/$id`},e.KeyPairId):null}function f(e,t){let n=e.KeyName?.toLowerCase()??``,r=t.KeyName?.toLowerCase()??``;return n.localeCompare(r)}export{u as component};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{D as i}from"./SignatureV4.js";import{t as a}from"./button.js";import{Ir as o,R as s}from"./index.js";import{t as c}from"./page-heading.js";import{t as l}from"./state-badge.js";var u=t(),d=e();function f(){let e=(0,u.c)(10),t=o(),{data:f}=n(s),m;e[0]===f.LoadBalancers?m=e[1]:(m=f.LoadBalancers??[],e[0]=f.LoadBalancers,e[1]=m);let h=m,g;e[2]===t?g=e[3]:(g=(0,d.jsx)(c,{actions:(0,d.jsx)(a,{onClick:async()=>await t({to:`/ec2/create-load-balancer`}),children:`Create Load Balancer`}),title:`Load Balancers`}),e[2]=t,e[3]=g);let _;e[4]!==h||e[5]!==t?(_=h.length>0?(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`DNS Name`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`State`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Type`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Scheme`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`VPC`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Created`})]})}),(0,d.jsx)(`tbody`,{children:h.map(e=>{if(!e.LoadBalancerArn)return null;let n=e.LoadBalancerArn;return(0,d.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>await t({to:`/ec2/describe-load-balancers/$id`,params:{id:encodeURIComponent(n)}}),children:[(0,d.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,d.jsx)(r,{className:`text-primary hover:underline`,onClick:p,params:{id:encodeURIComponent(n)},to:`/ec2/describe-load-balancers/$id`,children:e.LoadBalancerName??n})}),(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.DNSName??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:(0,d.jsx)(l,{state:e.State?.Code})}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Type??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Scheme??``}),(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.VpcId??``}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:i(e.CreatedTime)})]},n)})})]})}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No load balancers found.`}),e[4]=h,e[5]=t,e[6]=_):_=e[6];let v;return e[7]!==g||e[8]!==_?(v=(0,d.jsxs)(d.Fragment,{children:[g,_]}),e[7]=g,e[8]=_,e[9]=v):v=e[9],v}function p(e){return e.stopPropagation()}var m=f;export{m as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{Vt as i}from"./auth.js";import{t as a}from"./button.js";import{Ir as o,R as s}from"./index.js";import{t as c}from"./page-heading.js";import{t as l}from"./state-badge.js";var u=t(),d=e();function f(){let e=(0,u.c)(10),t=o(),{data:f}=n(s),m;e[0]===f.LoadBalancers?m=e[1]:(m=f.LoadBalancers??[],e[0]=f.LoadBalancers,e[1]=m);let h=m,g;e[2]===t?g=e[3]:(g=(0,d.jsx)(c,{actions:(0,d.jsx)(a,{onClick:async()=>await t({to:`/ec2/create-load-balancer`}),children:`Create Load Balancer`}),title:`Load Balancers`}),e[2]=t,e[3]=g);let _;e[4]!==h||e[5]!==t?(_=h.length>0?(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`DNS Name`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`State`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Type`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Scheme`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`VPC`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Created`})]})}),(0,d.jsx)(`tbody`,{children:h.map(e=>{if(!e.LoadBalancerArn)return null;let n=e.LoadBalancerArn;return(0,d.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>await t({to:`/ec2/describe-load-balancers/$id`,params:{id:encodeURIComponent(n)}}),children:[(0,d.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,d.jsx)(r,{className:`text-primary hover:underline`,onClick:p,params:{id:encodeURIComponent(n)},to:`/ec2/describe-load-balancers/$id`,children:e.LoadBalancerName??n})}),(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.DNSName??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:(0,d.jsx)(l,{state:e.State?.Code})}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Type??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Scheme??``}),(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.VpcId??``}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:i(e.CreatedTime)})]},n)})})]})}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No load balancers found.`}),e[4]=h,e[5]=t,e[6]=_):_=e[6];let v;return e[7]!==g||e[8]!==_?(v=(0,d.jsxs)(d.Fragment,{children:[g,_]}),e[7]=g,e[8]=_,e[9]=v):v=e[9],v}function p(e){return e.stopPropagation()}var m=f;export{m as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{A as i}from"./SignatureV4.js";import{t as a}from"./button.js";import{St as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";import{t as l}from"./state-badge.js";var u=t(),d=e();function f(){let e=(0,u.c)(5),{data:t}=n(o),i;e[0]===t.NatGateways?i=e[1]:(i=t.NatGateways??[],e[0]=t.NatGateways,e[1]=i);let c=i,l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(r,{to:`/ec2/create-nat-gateway`,children:(0,d.jsx)(a,{children:`Create NAT Gateway`})}),title:`NAT Gateways`}),e[2]=l):l=e[2];let f;return e[3]===c?f=e[4]:(f=(0,d.jsxs)(d.Fragment,{children:[l,c.length>0?(0,d.jsx)(`div`,{className:`space-y-4`,children:c.map(p)}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No NAT Gateways found.`})]}),e[3]=c,e[4]=f),f}function p(e){if(!e.NatGatewayId)return null;let t=i(e.Tags);return(0,d.jsx)(c,{badge:(0,d.jsx)(l,{state:e.State}),params:{id:e.NatGatewayId},subtitle:e.SubnetId??``,title:t?`${e.NatGatewayId} (${t})`:e.NatGatewayId,to:`/ec2/describe-nat-gateways/$id`},e.NatGatewayId)}export{f as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{Wt as i}from"./auth.js";import{t as a}from"./button.js";import{St as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";import{t as l}from"./state-badge.js";var u=t(),d=e();function f(){let e=(0,u.c)(5),{data:t}=n(o),i;e[0]===t.NatGateways?i=e[1]:(i=t.NatGateways??[],e[0]=t.NatGateways,e[1]=i);let c=i,l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(r,{to:`/ec2/create-nat-gateway`,children:(0,d.jsx)(a,{children:`Create NAT Gateway`})}),title:`NAT Gateways`}),e[2]=l):l=e[2];let f;return e[3]===c?f=e[4]:(f=(0,d.jsxs)(d.Fragment,{children:[l,c.length>0?(0,d.jsx)(`div`,{className:`space-y-4`,children:c.map(p)}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No NAT Gateways found.`})]}),e[3]=c,e[4]=f),f}function p(e){if(!e.NatGatewayId)return null;let t=i(e.Tags);return(0,d.jsx)(c,{badge:(0,d.jsx)(l,{state:e.State}),params:{id:e.NatGatewayId},subtitle:e.SubnetId??``,title:t?`${e.NatGatewayId} (${t})`:e.NatGatewayId,to:`/ec2/describe-nat-gateways/$id`},e.NatGatewayId)}export{f as component};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{t as i}from"./button.js";import{wt as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";import{t as c}from"./state-badge.js";var l=t(),u=e();function d(){let e=(0,l.c)(5),{data:t}=n(a),s;e[0]===t.PlacementGroups?s=e[1]:(s=t.PlacementGroups??[],e[0]=t.PlacementGroups,e[1]=s);let c=s,d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(o,{actions:(0,u.jsx)(r,{to:`/ec2/create-placement-group`,children:(0,u.jsx)(i,{children:`Create Placement Group`})}),title:`Placement Groups`}),e[2]=d):d=e[2];let p;return e[3]===c?p=e[4]:(p=(0,u.jsxs)(u.Fragment,{children:[d,c.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:c.map(f)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No placement groups found.`})]}),e[3]=c,e[4]=p),p}function f(e){return e.GroupId?(0,u.jsx)(s,{badge:(0,u.jsx)(c,{state:e.State}),params:{id:e.GroupId},subtitle:`${e.Strategy} \u2022 ${e.GroupId}`,title:e.GroupName??e.GroupId,to:`/ec2/describe-placement-groups/$id`},e.GroupId):null}export{d as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{t as i}from"./button.js";import{wt as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";import{t as c}from"./state-badge.js";var l=t(),u=e();function d(){let e=(0,l.c)(5),{data:t}=n(a),s;e[0]===t.PlacementGroups?s=e[1]:(s=t.PlacementGroups??[],e[0]=t.PlacementGroups,e[1]=s);let c=s,d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(o,{actions:(0,u.jsx)(r,{to:`/ec2/create-placement-group`,children:(0,u.jsx)(i,{children:`Create Placement Group`})}),title:`Placement Groups`}),e[2]=d):d=e[2];let p;return e[3]===c?p=e[4]:(p=(0,u.jsxs)(u.Fragment,{children:[d,c.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:c.map(f)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No placement groups found.`})]}),e[3]=c,e[4]=p),p}function f(e){return e.GroupId?(0,u.jsx)(s,{badge:(0,u.jsx)(c,{state:e.State}),params:{id:e.GroupId},subtitle:`${e.Strategy} \u2022 ${e.GroupId}`,title:e.GroupName??e.GroupId,to:`/ec2/describe-placement-groups/$id`},e.GroupId):null}export{d as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{A as i}from"./SignatureV4.js";import{t as a}from"./button.js";import{Dt as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";import{t as l}from"./badge.js";var u=t(),d=e();function f(){let e=(0,u.c)(5),{data:t}=n(o),i;e[0]===t.RouteTables?i=e[1]:(i=t.RouteTables??[],e[0]=t.RouteTables,e[1]=i);let c=i,l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(r,{to:`/ec2/create-route-table`,children:(0,d.jsx)(a,{children:`Create Route Table`})}),title:`Route Tables`}),e[2]=l):l=e[2];let f;return e[3]===c?f=e[4]:(f=(0,d.jsxs)(d.Fragment,{children:[l,c.length>0?(0,d.jsx)(`div`,{className:`space-y-4`,children:c.map(p)}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No Route Tables found.`})]}),e[3]=c,e[4]=f),f}function p(e){if(!e.RouteTableId)return null;let t=i(e.Tags),n=e.Associations?.some(h)??!1,r=e.Associations?.filter(m).length??0;return(0,d.jsx)(c,{badge:n?(0,d.jsx)(l,{variant:`secondary`,children:`Main`}):null,params:{id:e.RouteTableId},subtitle:`${e.VpcId??``} · ${r} subnet${r===1?``:`s`}`,title:t?`${e.RouteTableId} (${t})`:e.RouteTableId,to:`/ec2/describe-route-tables/$id`},e.RouteTableId)}function m(e){return e.SubnetId}function h(e){return e.Main}export{f as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{Wt as i}from"./auth.js";import{t as a}from"./button.js";import{Dt as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";import{t as l}from"./badge.js";var u=t(),d=e();function f(){let e=(0,u.c)(5),{data:t}=n(o),i;e[0]===t.RouteTables?i=e[1]:(i=t.RouteTables??[],e[0]=t.RouteTables,e[1]=i);let c=i,l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(r,{to:`/ec2/create-route-table`,children:(0,d.jsx)(a,{children:`Create Route Table`})}),title:`Route Tables`}),e[2]=l):l=e[2];let f;return e[3]===c?f=e[4]:(f=(0,d.jsxs)(d.Fragment,{children:[l,c.length>0?(0,d.jsx)(`div`,{className:`space-y-4`,children:c.map(p)}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No Route Tables found.`})]}),e[3]=c,e[4]=f),f}function p(e){if(!e.RouteTableId)return null;let t=i(e.Tags),n=e.Associations?.some(h)??!1,r=e.Associations?.filter(m).length??0;return(0,d.jsx)(c,{badge:n?(0,d.jsx)(l,{variant:`secondary`,children:`Main`}):null,params:{id:e.RouteTableId},subtitle:`${e.VpcId??``} · ${r} subnet${r===1?``:`s`}`,title:t?`${e.RouteTableId} (${t})`:e.RouteTableId,to:`/ec2/describe-route-tables/$id`},e.RouteTableId)}function m(e){return e.SubnetId}function h(e){return e.Main}export{f as component};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{t as i}from"./button.js";import{kt as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=t(),l=e();function u(){let e=(0,c.c)(5),{data:t}=n(a),s;e[0]===t.SecurityGroups?s=e[1]:(s=t.SecurityGroups??[],e[0]=t.SecurityGroups,e[1]=s);let u=s,f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,l.jsx)(o,{actions:(0,l.jsx)(r,{to:`/ec2/create-security-group`,children:(0,l.jsx)(i,{children:`Create Security Group`})}),title:`Security Groups`}),e[2]=f):f=e[2];let p;return e[3]===u?p=e[4]:(p=(0,l.jsxs)(l.Fragment,{children:[f,u.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:u.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No security groups found.`})]}),e[3]=u,e[4]=p),p}function d(e){return e.GroupId?(0,l.jsx)(s,{params:{id:e.GroupId},subtitle:e.VpcId??``,title:e.GroupName?`${e.GroupId} (${e.GroupName})`:e.GroupId,to:`/ec2/describe-security-groups/$id`},e.GroupId):null}export{u as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{t as i}from"./button.js";import{kt as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=t(),l=e();function u(){let e=(0,c.c)(5),{data:t}=n(a),s;e[0]===t.SecurityGroups?s=e[1]:(s=t.SecurityGroups??[],e[0]=t.SecurityGroups,e[1]=s);let u=s,f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,l.jsx)(o,{actions:(0,l.jsx)(r,{to:`/ec2/create-security-group`,children:(0,l.jsx)(i,{children:`Create Security Group`})}),title:`Security Groups`}),e[2]=f):f=e[2];let p;return e[3]===u?p=e[4]:(p=(0,l.jsxs)(l.Fragment,{children:[f,u.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:u.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No security groups found.`})]}),e[3]=u,e[4]=p),p}function d(e){return e.GroupId?(0,l.jsx)(s,{params:{id:e.GroupId},subtitle:e.VpcId??``,title:e.GroupName?`${e.GroupId} (${e.GroupName})`:e.GroupId,to:`/ec2/describe-security-groups/$id`},e.GroupId):null}export{u as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{t as i}from"./button.js";import{jt as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";import{t as c}from"./state-badge.js";var l=t(),u=e();function d(){let e=(0,l.c)(5),{data:t}=n(a),s;e[0]===t.Snapshots?s=e[1]:(s=t.Snapshots??[],e[0]=t.Snapshots,e[1]=s);let c=s,d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(o,{actions:(0,u.jsx)(r,{to:`/ec2/create-snapshot`,children:(0,u.jsx)(i,{children:`Create Snapshot`})}),title:`Snapshots`}),e[2]=d):d=e[2];let p;return e[3]===c?p=e[4]:(p=(0,u.jsxs)(u.Fragment,{children:[d,c.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:c.map(f)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No snapshots found.`})]}),e[3]=c,e[4]=p),p}function f(e){return e.SnapshotId?(0,u.jsx)(s,{badge:(0,u.jsx)(c,{state:e.State}),params:{id:e.SnapshotId},subtitle:`${e.VolumeSize} GiB \u2022 ${e.VolumeId}`,title:e.SnapshotId,to:`/ec2/describe-snapshots/$id`},e.SnapshotId):null}export{d as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{t as i}from"./button.js";import{jt as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";import{t as c}from"./state-badge.js";var l=t(),u=e();function d(){let e=(0,l.c)(5),{data:t}=n(a),s;e[0]===t.Snapshots?s=e[1]:(s=t.Snapshots??[],e[0]=t.Snapshots,e[1]=s);let c=s,d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(o,{actions:(0,u.jsx)(r,{to:`/ec2/create-snapshot`,children:(0,u.jsx)(i,{children:`Create Snapshot`})}),title:`Snapshots`}),e[2]=d):d=e[2];let p;return e[3]===c?p=e[4]:(p=(0,u.jsxs)(u.Fragment,{children:[d,c.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:c.map(f)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No snapshots found.`})]}),e[3]=c,e[4]=p),p}function f(e){return e.SnapshotId?(0,u.jsx)(s,{badge:(0,u.jsx)(c,{state:e.State}),params:{id:e.SnapshotId},subtitle:`${e.VolumeSize} GiB \u2022 ${e.VolumeId}`,title:e.SnapshotId,to:`/ec2/describe-snapshots/$id`},e.SnapshotId):null}export{d as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{A as i}from"./SignatureV4.js";import{t as a}from"./button.js";import{Nt as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";import{t as l}from"./state-badge.js";var u=t(),d=e();function f(){let e=(0,u.c)(5),{data:t}=n(o),i;e[0]===t.Subnets?i=e[1]:(i=t.Subnets??[],e[0]=t.Subnets,e[1]=i);let c=i,l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(r,{to:`/ec2/create-subnet`,children:(0,d.jsx)(a,{children:`Create Subnet`})}),title:`Subnets`}),e[2]=l):l=e[2];let f;return e[3]===c?f=e[4]:(f=(0,d.jsxs)(d.Fragment,{children:[l,c.length>0?(0,d.jsx)(`div`,{className:`space-y-4`,children:c.map(p)}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No subnets found.`})]}),e[3]=c,e[4]=f),f}function p(e){if(!e.SubnetId)return null;let t=i(e.Tags);return(0,d.jsx)(c,{badge:(0,d.jsx)(l,{state:e.State}),params:{id:e.SubnetId},subtitle:`${e.CidrBlock??``} \u2022 ${e.AvailabilityZone??``}`,title:t?`${e.SubnetId} (${t})`:e.SubnetId,to:`/ec2/describe-subnets/$id`},e.SubnetId)}export{f as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{Wt as i}from"./auth.js";import{t as a}from"./button.js";import{Nt as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";import{t as l}from"./state-badge.js";var u=t(),d=e();function f(){let e=(0,u.c)(5),{data:t}=n(o),i;e[0]===t.Subnets?i=e[1]:(i=t.Subnets??[],e[0]=t.Subnets,e[1]=i);let c=i,l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(r,{to:`/ec2/create-subnet`,children:(0,d.jsx)(a,{children:`Create Subnet`})}),title:`Subnets`}),e[2]=l):l=e[2];let f;return e[3]===c?f=e[4]:(f=(0,d.jsxs)(d.Fragment,{children:[l,c.length>0?(0,d.jsx)(`div`,{className:`space-y-4`,children:c.map(p)}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No subnets found.`})]}),e[3]=c,e[4]=f),f}function p(e){if(!e.SubnetId)return null;let t=i(e.Tags);return(0,d.jsx)(c,{badge:(0,d.jsx)(l,{state:e.State}),params:{id:e.SubnetId},subtitle:`${e.CidrBlock??``} \u2022 ${e.AvailabilityZone??``}`,title:t?`${e.SubnetId} (${t})`:e.SubnetId,to:`/ec2/describe-subnets/$id`},e.SubnetId)}export{f as component};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useQuery.js";import{t as r}from"./useSuspenseQuery.js";import{Or as i}from"./awsClient.js";import{t as a}from"./button.js";import{Ir as o,U as s,W as c}from"./index.js";import{t as l}from"./page-heading.js";var u=t(),d=e();function f(){let e=(0,u.c)(6),t=o(),{data:n}=r(s),c;e[0]===n.TargetGroups?c=e[1]:(c=n.TargetGroups??[],e[0]=n.TargetGroups,e[1]=c);let f=c,h;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,d.jsx)(l,{actions:(0,d.jsx)(i,{to:`/ec2/create-target-group`,children:(0,d.jsx)(a,{children:`Create Target Group`})}),title:`Target Groups`}),e[2]=h):h=e[2];let g;return e[3]!==t||e[4]!==f?(g=(0,d.jsxs)(d.Fragment,{children:[h,f.length>0?(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Protocol`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Port`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`VPC`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Target Type`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Targets`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Health`})]})}),(0,d.jsx)(`tbody`,{children:f.map(e=>{if(!e.TargetGroupArn)return null;let n=e.TargetGroupArn;return(0,d.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>await t({to:`/ec2/describe-target-groups/$id`,params:{id:encodeURIComponent(n)}}),children:[(0,d.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,d.jsx)(i,{className:`text-primary hover:underline`,onClick:p,params:{id:encodeURIComponent(n)},to:`/ec2/describe-target-groups/$id`,children:e.TargetGroupName??n})}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Protocol??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Port??``}),(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.VpcId??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.TargetType??``}),(0,d.jsx)(m,{arn:n})]},n)})})]})}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No target groups found.`})]}),e[3]=t,e[4]=f,e[5]=g):g=e[5],g}function p(e){return e.stopPropagation()}function m(e){let t=(0,u.c)(13),{arn:r}=e,i;t[0]===r?i=t[1]:(i=c(r),t[0]=r,t[1]=i);let{data:a,isLoading:o}=n(i);if(o){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`td`,{className:`px-4 py-2 text-muted-foreground`,children:`…`}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-muted-foreground`,children:`…`})]}),t[2]=e):e=t[2],e}let s,l;if(t[3]!==a?.TargetHealthDescriptions){s=a?.TargetHealthDescriptions??[];let e={};for(let t of s){let n=t.TargetHealth?.State??`unknown`;e[n]=(e[n]??0)+1}l=Object.entries(e).map(h).join(`, `)||`—`,t[3]=a?.TargetHealthDescriptions,t[4]=s,t[5]=l}else s=t[4],l=t[5];let f=l,p;t[6]===s.length?p=t[7]:(p=(0,d.jsx)(`td`,{className:`px-4 py-2`,children:s.length}),t[6]=s.length,t[7]=p);let m;t[8]===f?m=t[9]:(m=(0,d.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:f}),t[8]=f,t[9]=m);let g;return t[10]!==p||t[11]!==m?(g=(0,d.jsxs)(d.Fragment,{children:[p,m]}),t[10]=p,t[11]=m,t[12]=g):g=t[12],g}function h(e){let[t,n]=e;return`${n} ${t}`}var g=f;export{g as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useQuery.js";import{t as r}from"./useSuspenseQuery.js";import{vr as i}from"./awsClient.js";import{t as a}from"./button.js";import{Ir as o,U as s,W as c}from"./index.js";import{t as l}from"./page-heading.js";var u=t(),d=e();function f(){let e=(0,u.c)(6),t=o(),{data:n}=r(s),c;e[0]===n.TargetGroups?c=e[1]:(c=n.TargetGroups??[],e[0]=n.TargetGroups,e[1]=c);let f=c,h;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,d.jsx)(l,{actions:(0,d.jsx)(i,{to:`/ec2/create-target-group`,children:(0,d.jsx)(a,{children:`Create Target Group`})}),title:`Target Groups`}),e[2]=h):h=e[2];let g;return e[3]!==t||e[4]!==f?(g=(0,d.jsxs)(d.Fragment,{children:[h,f.length>0?(0,d.jsx)(`div`,{className:`overflow-x-auto rounded-lg border bg-card`,children:(0,d.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,d.jsx)(`thead`,{children:(0,d.jsxs)(`tr`,{className:`border-b text-left text-muted-foreground`,children:[(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Name`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Protocol`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Port`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`VPC`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Target Type`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Targets`}),(0,d.jsx)(`th`,{className:`px-4 py-2 font-medium`,children:`Health`})]})}),(0,d.jsx)(`tbody`,{children:f.map(e=>{if(!e.TargetGroupArn)return null;let n=e.TargetGroupArn;return(0,d.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>await t({to:`/ec2/describe-target-groups/$id`,params:{id:encodeURIComponent(n)}}),children:[(0,d.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,d.jsx)(i,{className:`text-primary hover:underline`,onClick:p,params:{id:encodeURIComponent(n)},to:`/ec2/describe-target-groups/$id`,children:e.TargetGroupName??n})}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Protocol??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.Port??``}),(0,d.jsx)(`td`,{className:`px-4 py-2 font-mono text-xs`,children:e.VpcId??``}),(0,d.jsx)(`td`,{className:`px-4 py-2`,children:e.TargetType??``}),(0,d.jsx)(m,{arn:n})]},n)})})]})}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No target groups found.`})]}),e[3]=t,e[4]=f,e[5]=g):g=e[5],g}function p(e){return e.stopPropagation()}function m(e){let t=(0,u.c)(13),{arn:r}=e,i;t[0]===r?i=t[1]:(i=c(r),t[0]=r,t[1]=i);let{data:a,isLoading:o}=n(i);if(o){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`td`,{className:`px-4 py-2 text-muted-foreground`,children:`…`}),(0,d.jsx)(`td`,{className:`px-4 py-2 text-muted-foreground`,children:`…`})]}),t[2]=e):e=t[2],e}let s,l;if(t[3]!==a?.TargetHealthDescriptions){s=a?.TargetHealthDescriptions??[];let e={};for(let t of s){let n=t.TargetHealth?.State??`unknown`;e[n]=(e[n]??0)+1}l=Object.entries(e).map(h).join(`, `)||`—`,t[3]=a?.TargetHealthDescriptions,t[4]=s,t[5]=l}else s=t[4],l=t[5];let f=l,p;t[6]===s.length?p=t[7]:(p=(0,d.jsx)(`td`,{className:`px-4 py-2`,children:s.length}),t[6]=s.length,t[7]=p);let m;t[8]===f?m=t[9]:(m=(0,d.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:f}),t[8]=f,t[9]=m);let g;return t[10]!==p||t[11]!==m?(g=(0,d.jsxs)(d.Fragment,{children:[p,m]}),t[10]=p,t[11]=m,t[12]=g):g=t[12],g}function h(e){let[t,n]=e;return`${n} ${t}`}var g=f;export{g as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{t as i}from"./button.js";import{Ft as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";import{t as c}from"./state-badge.js";var l=t(),u=e();function d(){let e=(0,l.c)(5),{data:t}=n(a),s;e[0]===t.Volumes?s=e[1]:(s=t.Volumes??[],e[0]=t.Volumes,e[1]=s);let c=s,d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(o,{actions:(0,u.jsx)(r,{to:`/ec2/create-volume`,children:(0,u.jsx)(i,{children:`Create Volume`})}),title:`Volumes`}),e[2]=d):d=e[2];let p;return e[3]===c?p=e[4]:(p=(0,u.jsxs)(u.Fragment,{children:[d,c.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:c.map(f)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No volumes found.`})]}),e[3]=c,e[4]=p),p}function f(e){return e.VolumeId?(0,u.jsx)(s,{badge:(0,u.jsx)(c,{state:e.State}),params:{id:e.VolumeId},subtitle:`${e.Size} GiB`,title:e.VolumeId,to:`/ec2/describe-volumes/$id`},e.VolumeId):null}export{d as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{t as i}from"./button.js";import{Ft as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";import{t as c}from"./state-badge.js";var l=t(),u=e();function d(){let e=(0,l.c)(5),{data:t}=n(a),s;e[0]===t.Volumes?s=e[1]:(s=t.Volumes??[],e[0]=t.Volumes,e[1]=s);let c=s,d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(o,{actions:(0,u.jsx)(r,{to:`/ec2/create-volume`,children:(0,u.jsx)(i,{children:`Create Volume`})}),title:`Volumes`}),e[2]=d):d=e[2];let p;return e[3]===c?p=e[4]:(p=(0,u.jsxs)(u.Fragment,{children:[d,c.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:c.map(f)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No volumes found.`})]}),e[3]=c,e[4]=p),p}function f(e){return e.VolumeId?(0,u.jsx)(s,{badge:(0,u.jsx)(c,{state:e.State}),params:{id:e.VolumeId},subtitle:`${e.Size} GiB`,title:e.VolumeId,to:`/ec2/describe-volumes/$id`},e.VolumeId):null}export{d as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{A as i}from"./SignatureV4.js";import{t as a}from"./button.js";import{Lt as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";import{t as l}from"./state-badge.js";var u=t(),d=e();function f(){let e=(0,u.c)(5),{data:t}=n(o),i;e[0]===t.Vpcs?i=e[1]:(i=t.Vpcs??[],e[0]=t.Vpcs,e[1]=i);let c=i,l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(r,{to:`/ec2/create-vpc`,children:(0,d.jsx)(a,{children:`Create VPC`})}),title:`VPCs`}),e[2]=l):l=e[2];let f;return e[3]===c?f=e[4]:(f=(0,d.jsxs)(d.Fragment,{children:[l,c.length>0?(0,d.jsx)(`div`,{className:`space-y-4`,children:c.map(p)}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No VPCs found.`})]}),e[3]=c,e[4]=f),f}function p(e){if(!e.VpcId)return null;let t=i(e.Tags);return(0,d.jsx)(c,{badge:(0,d.jsx)(l,{state:e.State}),params:{id:e.VpcId},subtitle:e.CidrBlock??``,title:t?`${e.VpcId} (${t})`:e.VpcId,to:`/ec2/describe-vpcs/$id`},e.VpcId)}export{f as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{Wt as i}from"./auth.js";import{t as a}from"./button.js";import{Lt as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";import{t as l}from"./state-badge.js";var u=t(),d=e();function f(){let e=(0,u.c)(5),{data:t}=n(o),i;e[0]===t.Vpcs?i=e[1]:(i=t.Vpcs??[],e[0]=t.Vpcs,e[1]=i);let c=i,l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(r,{to:`/ec2/create-vpc`,children:(0,d.jsx)(a,{children:`Create VPC`})}),title:`VPCs`}),e[2]=l):l=e[2];let f;return e[3]===c?f=e[4]:(f=(0,d.jsxs)(d.Fragment,{children:[l,c.length>0?(0,d.jsx)(`div`,{className:`space-y-4`,children:c.map(p)}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No VPCs found.`})]}),e[3]=c,e[4]=f),f}function p(e){if(!e.VpcId)return null;let t=i(e.Tags);return(0,d.jsx)(c,{badge:(0,d.jsx)(l,{state:e.State}),params:{id:e.VpcId},subtitle:e.CidrBlock??``,title:t?`${e.VpcId} (${t})`:e.VpcId,to:`/ec2/describe-vpcs/$id`},e.VpcId)}export{f as component};
|
||||
@@ -1 +1 @@
|
||||
import{o as e,r as t}from"./compiler-runtime.js";import{M as n}from"./SignatureV4.js";function r(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var i={};function a(e,t,n,r,i){if(!n&&!r&&!i&&!e)return s(t);let a=s(e);return t&&(a=c(a,t)),n&&(a=c(a,n)),r&&(a=c(a,r)),i&&(a=c(a,i)),a}function o(e){if(e.length===0)return i;if(e.length===1)return s(e[0]);let t=s(e[0]);for(let n=1;n<e.length;n+=1)t=c(t,e[n]);return t}function s(e){return f(e)?{...p(e,i)}:l(e)}function c(e,t){return f(t)?p(t,e):u(e,t)}function l(e){let t={...e};for(let e in t){let n=t[e];d(e,n)&&(t[e]=h(n))}return t}function u(e,t){if(!t)return e;for(let n in t){let i=t[n];switch(n){case`style`:e[n]=r(e.style,i);break;case`className`:e[n]=_(e.className,i);break;default:d(n,i)?e[n]=m(e[n],i):e[n]=i}}return e}function d(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function f(e){return typeof e==`function`}function p(e,t){return f(e)?e(t):e??i}function m(e,t){return t?e?(...n)=>{let r=n[0];if(v(r)){let i=r;g(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:h(t):e}function h(e){return e&&((...t)=>{let n=t[0];return v(n)&&g(n),e(...t)})}function g(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function _(e,t){return t?e?t+` `+e:t:e}function v(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function y(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var b=y(`https://base-ui.com/production-error`,`Base UI`),x=e(t()),S={};function C(e,t){let n=x.useRef(S);return n.current===S&&(n.current=e(t)),n}function w(e,t,n,r){let i=C(E).current;return D(i,e,t,n,r)&&k(i,[e,t,n,r]),i.callback}function T(e){let t=C(E).current;return O(t,e)&&k(t,e),t.callback}function E(){return{callback:null,cleanup:null,refs:[]}}function D(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function O(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function k(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var A=19;function j(e){return A>=e}function M(e){if(!x.isValidElement(e))return null;let t=e,n=t.props;return(j(19)?n?.ref:t.ref)??null}function N(){}var P=Object.freeze([]),F=Object.freeze({});function I(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function L(e,t){return typeof e==`function`?e(t):e}function R(e,t){return typeof e==`function`?e(t):e}function z(e,t,n={}){let r=t.render,i=B(t,n);return n.enabled===!1?null:U(e,r,i,n.state??F)}function B(e,t={}){let{className:n,style:i,render:a}=e,{state:o=F,ref:s,props:c,stateAttributesMapping:l,enabled:u=!0}=t,d=u?L(n,o):void 0,f=u?R(i,o):void 0,p=u?I(o,l):F,m=u&&c?V(c):void 0,h=u?r(p,m)??{}:F;return typeof document<`u`&&(u?Array.isArray(s)?h.ref=T([h.ref,M(a),...s]):h.ref=w(h.ref,M(a),s):w(null,null)),u?(d!==void 0&&(h.className=_(h.className,d)),f!==void 0&&(h.style=r(h.style,f)),h):F}function V(e){return Array.isArray(e)?o(e):a(void 0,e)}var H=Symbol.for(`react.lazy`);function U(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=a(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===H&&(i=x.Children.toArray(t)[0]),x.cloneElement(i,e)}if(e&&typeof e==`string`)return W(e,n);throw Error(b(8))}function W(e,t){return e===`button`?(0,x.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,x.createElement)(`img`,{alt:``,...t,key:t.key}):x.createElement(e,t)}var G=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,K=n,q=(e,t)=>n=>{if(t?.variants==null)return K(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=G(t)||G(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return K(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};export{F as a,w as c,g as d,a as f,P as i,C as l,z as n,N as o,R as r,j as s,q as t,b as u};
|
||||
import{o as e,r as t}from"./compiler-runtime.js";import{Kt as n}from"./auth.js";function r(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var i={};function a(e,t,n,r,i){if(!n&&!r&&!i&&!e)return s(t);let a=s(e);return t&&(a=c(a,t)),n&&(a=c(a,n)),r&&(a=c(a,r)),i&&(a=c(a,i)),a}function o(e){if(e.length===0)return i;if(e.length===1)return s(e[0]);let t=s(e[0]);for(let n=1;n<e.length;n+=1)t=c(t,e[n]);return t}function s(e){return f(e)?{...p(e,i)}:l(e)}function c(e,t){return f(t)?p(t,e):u(e,t)}function l(e){let t={...e};for(let e in t){let n=t[e];d(e,n)&&(t[e]=h(n))}return t}function u(e,t){if(!t)return e;for(let n in t){let i=t[n];switch(n){case`style`:e[n]=r(e.style,i);break;case`className`:e[n]=_(e.className,i);break;default:d(n,i)?e[n]=m(e[n],i):e[n]=i}}return e}function d(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function f(e){return typeof e==`function`}function p(e,t){return f(e)?e(t):e??i}function m(e,t){return t?e?(...n)=>{let r=n[0];if(v(r)){let i=r;g(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:h(t):e}function h(e){return e&&((...t)=>{let n=t[0];return v(n)&&g(n),e(...t)})}function g(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function _(e,t){return t?e?t+` `+e:t:e}function v(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function y(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var b=y(`https://base-ui.com/production-error`,`Base UI`),x=e(t()),S={};function C(e,t){let n=x.useRef(S);return n.current===S&&(n.current=e(t)),n}function w(e,t,n,r){let i=C(E).current;return D(i,e,t,n,r)&&k(i,[e,t,n,r]),i.callback}function T(e){let t=C(E).current;return O(t,e)&&k(t,e),t.callback}function E(){return{callback:null,cleanup:null,refs:[]}}function D(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function O(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function k(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var A=19;function j(e){return A>=e}function M(e){if(!x.isValidElement(e))return null;let t=e,n=t.props;return(j(19)?n?.ref:t.ref)??null}function N(){}var P=Object.freeze([]),F=Object.freeze({});function I(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function L(e,t){return typeof e==`function`?e(t):e}function R(e,t){return typeof e==`function`?e(t):e}function z(e,t,n={}){let r=t.render,i=B(t,n);return n.enabled===!1?null:U(e,r,i,n.state??F)}function B(e,t={}){let{className:n,style:i,render:a}=e,{state:o=F,ref:s,props:c,stateAttributesMapping:l,enabled:u=!0}=t,d=u?L(n,o):void 0,f=u?R(i,o):void 0,p=u?I(o,l):F,m=u&&c?V(c):void 0,h=u?r(p,m)??{}:F;return typeof document<`u`&&(u?Array.isArray(s)?h.ref=T([h.ref,M(a),...s]):h.ref=w(h.ref,M(a),s):w(null,null)),u?(d!==void 0&&(h.className=_(h.className,d)),f!==void 0&&(h.style=r(h.style,f)),h):F}function V(e){return Array.isArray(e)?o(e):a(void 0,e)}var H=Symbol.for(`react.lazy`);function U(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=a(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===H&&(i=x.Children.toArray(t)[0]),x.cloneElement(i,e)}if(e&&typeof e==`string`)return W(e,n);throw Error(b(8))}function W(e,t){return e===`button`?(0,x.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,x.createElement)(`img`,{alt:``,...t,key:t.key}):x.createElement(e,t)}var G=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,K=n,q=(e,t)=>n=>{if(t?.variants==null)return K(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=G(t)||G(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return K(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};export{F as a,w as c,g as d,a as f,P as i,C as l,z as n,N as o,R as r,j as s,q as t,b as u};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{_ as e,f as t,g as n,p as r,v as i,y as a}from"./SignatureV4.js";var o=/^(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/,s=a().min(1,`Name is required`).max(32,`Name must be 32 characters or less`).regex(o,`Name may contain only letters, digits, and hyphens; must start and end with alphanumeric`).refine(e=>!e.startsWith(`internal-`),`Name cannot start with 'internal-'`),c=a().min(1,`Name is required`).max(32,`Name must be 32 characters or less`).regex(o,`Name may contain only letters, digits, and hyphens; must start and end with alphanumeric`),l=n().int(`Port must be a whole number`).min(1,`Port must be at least 1`).max(65535,`Port must be at most 65535`),u=e({key:a().min(1,`Tag key is required`).max(128),value:a().max(256)}),d=e({protocol:t([`HTTP`,`TCP`]),path:a().min(1,`Path is required`).max(1024),port:a().min(1),intervalSeconds:n().int().min(5).max(300),timeoutSeconds:n().int().min(2).max(120),healthyThresholdCount:n().int().min(2).max(10),unhealthyThresholdCount:n().int().min(2).max(10),matcher:a().regex(/^\d{3}(?:[-,]\d{3})*$/,`Matcher must be HTTP codes like 200 or 200-299 or 200,201`)}),f=e({name:c,protocol:t([`HTTP`,`HTTPS`,`TCP`,`UDP`,`TLS`,`TCP_UDP`]),port:l,vpcId:a().min(1,`VPC is required`),healthCheck:d,tags:r(u)}),p=`ELBSecurityPolicy-2016-08`,m=[`application`,`network`],h=[`HTTP`,`HTTPS`],g=[`TCP`,`UDP`,`TLS`,`TCP_UDP`],_=[...h,...g];function v(e){return e===`network`?g:h}function y(e){return e===`network`?`TCP`:`HTTP`}function b(e){return e===`HTTPS`||e===`TLS`}var x=e({protocol:t(_),port:l,defaultTargetGroupArn:a().min(1,`Target group is required`),certificateArn:a().optional(),sslPolicy:a().optional()}).superRefine((e,t)=>{b(e.protocol)&&!e.certificateArn&&t.addIssue({code:`custom`,path:[`certificateArn`],message:`A certificate is required for HTTPS and TLS`})}),S=/^[!-~]+$/,C=e({field:t([`host-header`,`path-pattern`,`http-header`,`http-request-method`,`source-ip`,`query-string`]),httpHeaderName:a().max(40).optional(),rawValues:a().min(1,`At least one value is required`).max(640,`Too many values`)}).superRefine((e,t)=>{e.field===`http-header`&&!e.httpHeaderName&&t.addIssue({code:`custom`,path:[`httpHeaderName`],message:`Header name is required`});let n=e.rawValues.split(/[\n,]/).map(e=>e.trim()).filter(e=>e.length>0);if(n.length===0||n.length>5){t.addIssue({code:`custom`,path:[`rawValues`],message:`Enter 1 to 5 values, comma or newline separated`});return}for(let e of n)if(!S.test(e)){t.addIssue({code:`custom`,path:[`rawValues`],message:`Value "${e}" contains whitespace or non-ASCII characters`});return}}),w=e({priority:n().int(`Priority must be a whole number`).min(1,`Priority must be at least 1`).max(5e4,`Priority must be at most 50000`),conditions:r(C).min(1,`At least one condition is required`).max(5,`Up to 5 conditions per rule`),forwardTargetGroupArn:a().min(1,`Target group is required`)}),T=e({name:s,type:t(m),scheme:t([`internet-facing`,`internal`]),vpcId:a().min(1,`VPC is required`),subnetIds:r(a()).min(1,`At least 1 subnet is required`),securityGroupIds:r(a()),tags:r(u),listener:e({protocol:t(_),port:l,targetGroupMode:t([`new`,`existing`]),existingTargetGroupArn:a().optional(),certificateArn:a().optional(),sslPolicy:a().optional()}).superRefine((e,t)=>{e.targetGroupMode===`existing`&&!e.existingTargetGroupArn&&t.addIssue({code:`custom`,path:[`existingTargetGroupArn`],message:`Target group is required`}),b(e.protocol)&&!e.certificateArn&&t.addIssue({code:`custom`,path:[`certificateArn`],message:`A certificate is required for HTTPS/TLS`})})});e({targets:r(e({instanceId:a().min(1,`Instance is required`),port:l.optional()})).min(1,`At least one target is required`)}),i(a(),a());export{f as a,v as c,w as i,x as n,y as o,T as r,b as s,p as t};
|
||||
import{a as e,d as t,f as n,l as r,o as i,u as a}from"./auth.js";var o=/^(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])$/,s=n().min(1,`Name is required`).max(32,`Name must be 32 characters or less`).regex(o,`Name may contain only letters, digits, and hyphens; must start and end with alphanumeric`).refine(e=>!e.startsWith(`internal-`),`Name cannot start with 'internal-'`),c=n().min(1,`Name is required`).max(32,`Name must be 32 characters or less`).regex(o,`Name may contain only letters, digits, and hyphens; must start and end with alphanumeric`),l=r().int(`Port must be a whole number`).min(1,`Port must be at least 1`).max(65535,`Port must be at most 65535`),u=a({key:n().min(1,`Tag key is required`).max(128),value:n().max(256)}),d=a({protocol:e([`HTTP`,`TCP`]),path:n().min(1,`Path is required`).max(1024),port:n().min(1),intervalSeconds:r().int().min(5).max(300),timeoutSeconds:r().int().min(2).max(120),healthyThresholdCount:r().int().min(2).max(10),unhealthyThresholdCount:r().int().min(2).max(10),matcher:n().regex(/^\d{3}(?:[-,]\d{3})*$/,`Matcher must be HTTP codes like 200 or 200-299 or 200,201`)}),f=a({name:c,protocol:e([`HTTP`,`HTTPS`,`TCP`,`UDP`,`TLS`,`TCP_UDP`]),port:l,vpcId:n().min(1,`VPC is required`),healthCheck:d,tags:i(u)}),p=`ELBSecurityPolicy-2016-08`,m=[`application`,`network`],h=[`HTTP`,`HTTPS`],g=[`TCP`,`UDP`,`TLS`,`TCP_UDP`],_=[...h,...g];function v(e){return e===`network`?g:h}function y(e){return e===`network`?`TCP`:`HTTP`}function b(e){return e===`HTTPS`||e===`TLS`}var x=a({protocol:e(_),port:l,defaultTargetGroupArn:n().min(1,`Target group is required`),certificateArn:n().optional(),sslPolicy:n().optional()}).superRefine((e,t)=>{b(e.protocol)&&!e.certificateArn&&t.addIssue({code:`custom`,path:[`certificateArn`],message:`A certificate is required for HTTPS and TLS`})}),S=/^[!-~]+$/,C=a({field:e([`host-header`,`path-pattern`,`http-header`,`http-request-method`,`source-ip`,`query-string`]),httpHeaderName:n().max(40).optional(),rawValues:n().min(1,`At least one value is required`).max(640,`Too many values`)}).superRefine((e,t)=>{e.field===`http-header`&&!e.httpHeaderName&&t.addIssue({code:`custom`,path:[`httpHeaderName`],message:`Header name is required`});let n=e.rawValues.split(/[\n,]/).map(e=>e.trim()).filter(e=>e.length>0);if(n.length===0||n.length>5){t.addIssue({code:`custom`,path:[`rawValues`],message:`Enter 1 to 5 values, comma or newline separated`});return}for(let e of n)if(!S.test(e)){t.addIssue({code:`custom`,path:[`rawValues`],message:`Value "${e}" contains whitespace or non-ASCII characters`});return}}),w=a({priority:r().int(`Priority must be a whole number`).min(1,`Priority must be at least 1`).max(5e4,`Priority must be at most 50000`),conditions:i(C).min(1,`At least one condition is required`).max(5,`Up to 5 conditions per rule`),forwardTargetGroupArn:n().min(1,`Target group is required`)}),T=a({name:s,type:e(m),scheme:e([`internet-facing`,`internal`]),vpcId:n().min(1,`VPC is required`),subnetIds:i(n()).min(1,`At least 1 subnet is required`),securityGroupIds:i(n()),tags:i(u),listener:a({protocol:e(_),port:l,targetGroupMode:e([`new`,`existing`]),existingTargetGroupArn:n().optional(),certificateArn:n().optional(),sslPolicy:n().optional()}).superRefine((e,t)=>{e.targetGroupMode===`existing`&&!e.existingTargetGroupArn&&t.addIssue({code:`custom`,path:[`existingTargetGroupArn`],message:`Target group is required`}),b(e.protocol)&&!e.certificateArn&&t.addIssue({code:`custom`,path:[`certificateArn`],message:`A certificate is required for HTTPS/TLS`})})});a({targets:i(a({instanceId:n().min(1,`Instance is required`),port:l.optional()})).min(1,`At least one target is required`)}),t(n(),n());export{f as a,v as c,w as i,x as n,y as o,T as r,b as s,p as t};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,r as t,t as n}from"./compiler-runtime.js";import{t as r}from"./dist.js";import{w as i}from"./SignatureV4.js";import"./index.js";t();var a=n(),o=e();function s(e){let t=(0,a.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let s;t[3]===n?s=t[4]:(s=i(`group/field-group @container/field-group flex w-full flex-col gap-4 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,n),t[3]=n,t[4]=s);let c;return t[5]!==r||t[6]!==s?(c=(0,o.jsx)(`div`,{className:s,"data-slot":`field-group`,...r}),t[5]=r,t[6]=s,t[7]=c):c=t[7],c}var c=r(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col [&>*]:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col @md/field-group:flex-row @md/field-group:items-center @md/field-group:has-[>[data-slot=field-content]]:items-start [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function l(e){let t=(0,a.c)(11),n,r,s;t[0]===e?(n=t[1],r=t[2],s=t[3]):({className:n,orientation:s,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=s);let l=s===void 0?`vertical`:s,u;t[4]!==n||t[5]!==l?(u=i(c({orientation:l}),n),t[4]=n,t[5]=l,t[6]=u):u=t[6];let d;return t[7]!==l||t[8]!==r||t[9]!==u?(d=(0,o.jsx)(`div`,{className:u,"data-orientation":l,"data-slot":`field`,role:`group`,...r}),t[7]=l,t[8]=r,t[9]=u,t[10]=d):d=t[10],d}function u(e){let t=(0,a.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let s;t[3]===n?s=t[4]:(s=i(`flex w-fit items-center gap-2 text-xs/relaxed leading-snug font-medium group-data-[disabled=true]/field:opacity-50`,n),t[3]=n,t[4]=s);let c;return t[5]!==r||t[6]!==s?(c=(0,o.jsx)(`div`,{className:s,"data-slot":`field-label`,...r}),t[5]=r,t[6]=s,t[7]=c):c=t[7],c}function d(e){let t=(0,a.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let s;t[3]===n?s=t[4]:(s=i(`text-left text-xs/relaxed leading-normal font-normal text-muted-foreground group-has-data-[orientation=horizontal]/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,n),t[3]=n,t[4]=s);let c;return t[5]!==r||t[6]!==s?(c=(0,o.jsx)(`p`,{className:s,"data-slot":`field-description`,...r}),t[5]=r,t[6]=s,t[7]=c):c=t[7],c}function f(e){let t=(0,a.c)(15),n,r,s,c;t[0]===e?(n=t[1],r=t[2],s=t[3],c=t[4]):({className:r,children:n,errors:s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=s,t[4]=c);let l;bb0:{if(n){l=n;break bb0}if(!s?.length){l=null;break bb0}let e;t[5]===s?e=t[6]:(e=[...new Map(s.map(m)).values()],t[5]=s,t[6]=e);let r=e;if(r?.length===1){l=r[0]?.message;break bb0}let i;t[7]===r?i=t[8]:(i=(0,o.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:r.map(p)}),t[7]=r,t[8]=i),l=i}let u=l;if(!u)return null;let d;t[9]===r?d=t[10]:(d=i(`text-xs/relaxed font-normal text-destructive`,r),t[9]=r,t[10]=d);let f;return t[11]!==u||t[12]!==c||t[13]!==d?(f=(0,o.jsx)(`div`,{className:d,"data-slot":`field-error`,role:`alert`,...c,children:u}),t[11]=u,t[12]=c,t[13]=d,t[14]=f):f=t[14],f}function p(e){return e?.message&&(0,o.jsx)(`li`,{children:e.message},e.message)}function m(e){return[e?.message,e]}export{u as a,s as i,d as n,f as r,l as t};
|
||||
import{n as e,r as t,t as n}from"./compiler-runtime.js";import{t as r}from"./dist.js";import{Rt as i}from"./auth.js";import"./index.js";t();var a=n(),o=e();function s(e){let t=(0,a.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let s;t[3]===n?s=t[4]:(s=i(`group/field-group @container/field-group flex w-full flex-col gap-4 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,n),t[3]=n,t[4]=s);let c;return t[5]!==r||t[6]!==s?(c=(0,o.jsx)(`div`,{className:s,"data-slot":`field-group`,...r}),t[5]=r,t[6]=s,t[7]=c):c=t[7],c}var c=r(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col [&>*]:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col @md/field-group:flex-row @md/field-group:items-center @md/field-group:has-[>[data-slot=field-content]]:items-start [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function l(e){let t=(0,a.c)(11),n,r,s;t[0]===e?(n=t[1],r=t[2],s=t[3]):({className:n,orientation:s,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=s);let l=s===void 0?`vertical`:s,u;t[4]!==n||t[5]!==l?(u=i(c({orientation:l}),n),t[4]=n,t[5]=l,t[6]=u):u=t[6];let d;return t[7]!==l||t[8]!==r||t[9]!==u?(d=(0,o.jsx)(`div`,{className:u,"data-orientation":l,"data-slot":`field`,role:`group`,...r}),t[7]=l,t[8]=r,t[9]=u,t[10]=d):d=t[10],d}function u(e){let t=(0,a.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let s;t[3]===n?s=t[4]:(s=i(`flex w-fit items-center gap-2 text-xs/relaxed leading-snug font-medium group-data-[disabled=true]/field:opacity-50`,n),t[3]=n,t[4]=s);let c;return t[5]!==r||t[6]!==s?(c=(0,o.jsx)(`div`,{className:s,"data-slot":`field-label`,...r}),t[5]=r,t[6]=s,t[7]=c):c=t[7],c}function d(e){let t=(0,a.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let s;t[3]===n?s=t[4]:(s=i(`text-left text-xs/relaxed leading-normal font-normal text-muted-foreground group-has-data-[orientation=horizontal]/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,n),t[3]=n,t[4]=s);let c;return t[5]!==r||t[6]!==s?(c=(0,o.jsx)(`p`,{className:s,"data-slot":`field-description`,...r}),t[5]=r,t[6]=s,t[7]=c):c=t[7],c}function f(e){let t=(0,a.c)(15),n,r,s,c;t[0]===e?(n=t[1],r=t[2],s=t[3],c=t[4]):({className:r,children:n,errors:s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=s,t[4]=c);let l;bb0:{if(n){l=n;break bb0}if(!s?.length){l=null;break bb0}let e;t[5]===s?e=t[6]:(e=[...new Map(s.map(m)).values()],t[5]=s,t[6]=e);let r=e;if(r?.length===1){l=r[0]?.message;break bb0}let i;t[7]===r?i=t[8]:(i=(0,o.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:r.map(p)}),t[7]=r,t[8]=i),l=i}let u=l;if(!u)return null;let d;t[9]===r?d=t[10]:(d=i(`text-xs/relaxed font-normal text-destructive`,r),t[9]=r,t[10]=d);let f;return t[11]!==u||t[12]!==c||t[13]!==d?(f=(0,o.jsx)(`div`,{className:d,"data-slot":`field-error`,role:`alert`,...c,children:u}),t[11]=u,t[12]=c,t[13]=d,t[14]=f):f=t[14],f}function p(e){return e?.message&&(0,o.jsx)(`li`,{children:e.message},e.message)}function m(e){return[e?.message,e]}export{u as a,s as i,d as n,f as r,l as t};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{_ as e,y as t}from"./SignatureV4.js";var n=e({userName:t().min(1,`User name is required`).max(64,`User name must be 64 characters or less`).regex(/^[\w+=,.@-]+$/,`User name contains invalid characters`),path:t().optional()}),r=e({policyName:t().min(1,`Policy name is required`).max(128,`Policy name must be 128 characters or less`).regex(/^[\w+=,.@-]+$/,`Policy name contains invalid characters`),description:t().optional(),policyDocument:t().min(1,`Policy document is required`).refine(e=>{try{return JSON.parse(e),!0}catch{return!1}},{message:`Policy document must be valid JSON`})}),i=JSON.stringify({Version:`2012-10-17`,Statement:[{Effect:`Allow`,Principal:{Service:`ec2.amazonaws.com`},Action:`sts:AssumeRole`}]},null,2),a=e({roleName:t().min(1,`Role name is required`).max(64,`Role name must be 64 characters or less`).regex(/^[\w+=,.@-]+$/,`Role name contains invalid characters`),path:t().optional(),description:t().optional(),assumeRolePolicyDocument:t().min(1,`Trust policy is required`).refine(e=>{try{return JSON.parse(e),!0}catch{return!1}},{message:`Trust policy must be valid JSON`})}),o=e({instanceProfileName:t().min(1,`Instance profile name is required`).max(128,`Instance profile name must be 128 characters or less`).regex(/^[\w+=,.@-]+$/,`Instance profile name contains invalid characters`),path:t().optional()});export{n as a,a as i,o as n,r,i as t};
|
||||
import{f as e,u as t}from"./auth.js";var n=t({userName:e().min(1,`User name is required`).max(64,`User name must be 64 characters or less`).regex(/^[\w+=,.@-]+$/,`User name contains invalid characters`),path:e().optional()}),r=t({policyName:e().min(1,`Policy name is required`).max(128,`Policy name must be 128 characters or less`).regex(/^[\w+=,.@-]+$/,`Policy name contains invalid characters`),description:e().optional(),policyDocument:e().min(1,`Policy document is required`).refine(e=>{try{return JSON.parse(e),!0}catch{return!1}},{message:`Policy document must be valid JSON`})}),i=JSON.stringify({Version:`2012-10-17`,Statement:[{Effect:`Allow`,Principal:{Service:`ec2.amazonaws.com`},Action:`sts:AssumeRole`}]},null,2),a=t({roleName:e().min(1,`Role name is required`).max(64,`Role name must be 64 characters or less`).regex(/^[\w+=,.@-]+$/,`Role name contains invalid characters`),path:e().optional(),description:e().optional(),assumeRolePolicyDocument:e().min(1,`Trust policy is required`).refine(e=>{try{return JSON.parse(e),!0}catch{return!1}},{message:`Trust policy must be valid JSON`})}),o=t({instanceProfileName:e().min(1,`Instance profile name is required`).max(128,`Instance profile name must be 128 characters or less`).regex(/^[\w+=,.@-]+$/,`Instance profile name contains invalid characters`),path:e().optional()});export{n as a,a as i,o as n,r,i as t};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{Or as n}from"./awsClient.js";var r=t(),i=e();function a(e){let t=(0,r.c)(22),a,o,s,c,l;t[0]===e?(a=t[1],o=t[2],s=t[3],c=t[4],l=t[5]):({title:l,subtitle:c,badge:a,children:o,...s}=e,t[0]=e,t[1]=a,t[2]=o,t[3]=s,t[4]=c,t[5]=l);let u;t[6]===l?u=t[7]:(u=(0,i.jsx)(`h3`,{className:`font-semibold`,children:l}),t[6]=l,t[7]=u);let d;t[8]===c?d=t[9]:(d=c&&(0,i.jsx)(`p`,{className:`mt-1 text-sm font-medium text-muted-foreground`,children:c}),t[8]=c,t[9]=d);let f;t[10]!==o||t[11]!==u||t[12]!==d?(f=(0,i.jsxs)(`div`,{className:`flex-1`,children:[u,d,o]}),t[10]=o,t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;t[14]===a?p=t[15]:(p=a&&(0,i.jsx)(`div`,{className:`ml-4`,children:a}),t[14]=a,t[15]=p);let m;t[16]!==f||t[17]!==p?(m=(0,i.jsxs)(`div`,{className:`flex items-start justify-between`,children:[f,p]}),t[16]=f,t[17]=p,t[18]=m):m=t[18];let h;return t[19]!==s||t[20]!==m?(h=(0,i.jsx)(n,{className:`block rounded-lg border bg-card p-4 transition-colors hover:bg-accent`,...s,children:m}),t[19]=s,t[20]=m,t[21]=h):h=t[21],h}export{a as t};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{vr as n}from"./awsClient.js";var r=t(),i=e();function a(e){let t=(0,r.c)(22),a,o,s,c,l;t[0]===e?(a=t[1],o=t[2],s=t[3],c=t[4],l=t[5]):({title:l,subtitle:c,badge:a,children:o,...s}=e,t[0]=e,t[1]=a,t[2]=o,t[3]=s,t[4]=c,t[5]=l);let u;t[6]===l?u=t[7]:(u=(0,i.jsx)(`h3`,{className:`font-semibold`,children:l}),t[6]=l,t[7]=u);let d;t[8]===c?d=t[9]:(d=c&&(0,i.jsx)(`p`,{className:`mt-1 text-sm font-medium text-muted-foreground`,children:c}),t[8]=c,t[9]=d);let f;t[10]!==o||t[11]!==u||t[12]!==d?(f=(0,i.jsxs)(`div`,{className:`flex-1`,children:[u,d,o]}),t[10]=o,t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;t[14]===a?p=t[15]:(p=a&&(0,i.jsx)(`div`,{className:`ml-4`,children:a}),t[14]=a,t[15]=p);let m;t[16]!==f||t[17]!==p?(m=(0,i.jsxs)(`div`,{className:`flex items-start justify-between`,children:[f,p]}),t[16]=f,t[17]=p,t[18]=m):m=t[18];let h;return t[19]!==s||t[20]!==m?(h=(0,i.jsx)(n,{className:`block rounded-lg border bg-card p-4 transition-colors hover:bg-accent`,...s,children:m}),t[19]=s,t[20]=m,t[21]=h):h=t[21],h}export{a as t};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{t as i}from"./button.js";import{A as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=t(),l=e();function u(){let e=(0,c.c)(3),{data:t}=n(a),s;if(e[0]!==t.clusters){let n=(t.clusters??[]).toSorted(f),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,l.jsx)(o,{actions:(0,l.jsx)(r,{to:`/eks/create-cluster`,children:(0,l.jsx)(i,{children:`Create Cluster`})}),title:`Clusters`}),e[2]=a):a=e[2],s=(0,l.jsxs)(l.Fragment,{children:[a,n.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:n.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No EKS clusters found.`})]}),e[0]=t.clusters,e[1]=s}else s=e[1];return s}function d(e){return(0,l.jsx)(s,{params:{clusterName:e},title:e,to:`/eks/list-clusters/$clusterName`},e)}function f(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}var p=u;export{p as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{t as i}from"./button.js";import{A as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=t(),l=e();function u(){let e=(0,c.c)(3),{data:t}=n(a),s;if(e[0]!==t.clusters){let n=(t.clusters??[]).toSorted(f),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,l.jsx)(o,{actions:(0,l.jsx)(r,{to:`/eks/create-cluster`,children:(0,l.jsx)(i,{children:`Create Cluster`})}),title:`Clusters`}),e[2]=a):a=e[2],s=(0,l.jsxs)(l.Fragment,{children:[a,n.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:n.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No EKS clusters found.`})]}),e[0]=t.clusters,e[1]=s}else s=e[1];return s}function d(e){return(0,l.jsx)(s,{params:{clusterName:e},title:e,to:`/eks/list-clusters/$clusterName`},e)}function f(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}var p=u;export{p as component};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{t as i}from"./button.js";import{Q as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=t(),l=e();function u(){let e=(0,c.c)(3),{data:t}=n(a),s;if(e[0]!==t.InstanceProfiles){let n=(t.InstanceProfiles??[]).toSorted(f),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,l.jsx)(o,{actions:(0,l.jsx)(r,{to:`/iam/create-instance-profile`,children:(0,l.jsx)(i,{children:`Create Instance Profile`})}),title:`Instance Profiles`}),e[2]=a):a=e[2],s=(0,l.jsxs)(l.Fragment,{children:[a,n.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:n.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No instance profiles found.`})]}),e[0]=t.InstanceProfiles,e[1]=s}else s=e[1];return s}function d(e){return e.InstanceProfileName?(0,l.jsx)(s,{params:{instanceProfileName:e.InstanceProfileName},subtitle:e.Arn??``,title:e.InstanceProfileName,to:`/iam/list-instance-profiles/$instanceProfileName`},e.InstanceProfileName):null}function f(e,t){let n=e.InstanceProfileName?.toLowerCase()??``,r=t.InstanceProfileName?.toLowerCase()??``;return n.localeCompare(r)}export{u as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{t as i}from"./button.js";import{Q as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=t(),l=e();function u(){let e=(0,c.c)(3),{data:t}=n(a),s;if(e[0]!==t.InstanceProfiles){let n=(t.InstanceProfiles??[]).toSorted(f),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,l.jsx)(o,{actions:(0,l.jsx)(r,{to:`/iam/create-instance-profile`,children:(0,l.jsx)(i,{children:`Create Instance Profile`})}),title:`Instance Profiles`}),e[2]=a):a=e[2],s=(0,l.jsxs)(l.Fragment,{children:[a,n.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:n.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No instance profiles found.`})]}),e[0]=t.InstanceProfiles,e[1]=s}else s=e[1];return s}function d(e){return e.InstanceProfileName?(0,l.jsx)(s,{params:{instanceProfileName:e.InstanceProfileName},subtitle:e.Arn??``,title:e.InstanceProfileName,to:`/iam/list-instance-profiles/$instanceProfileName`},e.InstanceProfileName):null}function f(e,t){let n=e.InstanceProfileName?.toLowerCase()??``,r=t.InstanceProfileName?.toLowerCase()??``;return n.localeCompare(r)}export{u as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{t as i}from"./button.js";import{$ as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=t(),l=e();function u(){let e=(0,c.c)(3),{data:t}=n(a),s;if(e[0]!==t.Policies){let n=(t.Policies??[]).toSorted(f),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,l.jsx)(o,{actions:(0,l.jsx)(r,{to:`/iam/create-policy`,children:(0,l.jsx)(i,{children:`Create Policy`})}),title:`Policies`}),e[2]=a):a=e[2],s=(0,l.jsxs)(l.Fragment,{children:[a,n.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:n.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No IAM policies found.`})]}),e[0]=t.Policies,e[1]=s}else s=e[1];return s}function d(e){return e.Arn?(0,l.jsx)(s,{params:{policyArn:encodeURIComponent(e.Arn)},subtitle:e.Arn??``,title:e.PolicyName??``,to:`/iam/list-policies/$policyArn`},e.Arn):null}function f(e,t){let n=e.PolicyName?.toLowerCase()??``,r=t.PolicyName?.toLowerCase()??``;return n.localeCompare(r)}export{u as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{t as i}from"./button.js";import{$ as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=t(),l=e();function u(){let e=(0,c.c)(3),{data:t}=n(a),s;if(e[0]!==t.Policies){let n=(t.Policies??[]).toSorted(f),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,l.jsx)(o,{actions:(0,l.jsx)(r,{to:`/iam/create-policy`,children:(0,l.jsx)(i,{children:`Create Policy`})}),title:`Policies`}),e[2]=a):a=e[2],s=(0,l.jsxs)(l.Fragment,{children:[a,n.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:n.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No IAM policies found.`})]}),e[0]=t.Policies,e[1]=s}else s=e[1];return s}function d(e){return e.Arn?(0,l.jsx)(s,{params:{policyArn:encodeURIComponent(e.Arn)},subtitle:e.Arn??``,title:e.PolicyName??``,to:`/iam/list-policies/$policyArn`},e.Arn):null}function f(e,t){let n=e.PolicyName?.toLowerCase()??``,r=t.PolicyName?.toLowerCase()??``;return n.localeCompare(r)}export{u as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{t as i}from"./button.js";import{rt as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=t(),l=e();function u(){let e=(0,c.c)(3),{data:t}=n(a),s;if(e[0]!==t.Roles){let n=(t.Roles??[]).toSorted(f),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,l.jsx)(o,{actions:(0,l.jsx)(r,{to:`/iam/create-role`,children:(0,l.jsx)(i,{children:`Create Role`})}),title:`Roles`}),e[2]=a):a=e[2],s=(0,l.jsxs)(l.Fragment,{children:[a,n.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:n.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No IAM roles found.`})]}),e[0]=t.Roles,e[1]=s}else s=e[1];return s}function d(e){return e.RoleName?(0,l.jsx)(s,{params:{roleName:e.RoleName},subtitle:e.Arn??``,title:e.RoleName,to:`/iam/list-roles/$roleName`},e.RoleName):null}function f(e,t){let n=e.RoleName?.toLowerCase()??``,r=t.RoleName?.toLowerCase()??``;return n.localeCompare(r)}export{u as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{t as i}from"./button.js";import{rt as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=t(),l=e();function u(){let e=(0,c.c)(3),{data:t}=n(a),s;if(e[0]!==t.Roles){let n=(t.Roles??[]).toSorted(f),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,l.jsx)(o,{actions:(0,l.jsx)(r,{to:`/iam/create-role`,children:(0,l.jsx)(i,{children:`Create Role`})}),title:`Roles`}),e[2]=a):a=e[2],s=(0,l.jsxs)(l.Fragment,{children:[a,n.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:n.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No IAM roles found.`})]}),e[0]=t.Roles,e[1]=s}else s=e[1];return s}function d(e){return e.RoleName?(0,l.jsx)(s,{params:{roleName:e.RoleName},subtitle:e.Arn??``,title:e.RoleName,to:`/iam/list-roles/$roleName`},e.RoleName):null}function f(e,t){let n=e.RoleName?.toLowerCase()??``,r=t.RoleName?.toLowerCase()??``;return n.localeCompare(r)}export{u as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{t as i}from"./button.js";import{at as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=t(),l=e();function u(){let e=(0,c.c)(3),{data:t}=n(a),s;if(e[0]!==t.Users){let n=(t.Users??[]).toSorted(f),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,l.jsx)(o,{actions:(0,l.jsx)(r,{to:`/iam/create-user`,children:(0,l.jsx)(i,{children:`Create User`})}),title:`Users`}),e[2]=a):a=e[2],s=(0,l.jsxs)(l.Fragment,{children:[a,n.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:n.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No IAM users found.`})]}),e[0]=t.Users,e[1]=s}else s=e[1];return s}function d(e){return e.UserName?(0,l.jsx)(s,{params:{userName:e.UserName},subtitle:e.UserId??``,title:e.UserName,to:`/iam/list-users/$userName`},e.UserName):null}function f(e,t){let n=e.UserName?.toLowerCase()??``,r=t.UserName?.toLowerCase()??``;return n.localeCompare(r)}export{u as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{t as i}from"./button.js";import{at as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=t(),l=e();function u(){let e=(0,c.c)(3),{data:t}=n(a),s;if(e[0]!==t.Users){let n=(t.Users??[]).toSorted(f),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,l.jsx)(o,{actions:(0,l.jsx)(r,{to:`/iam/create-user`,children:(0,l.jsx)(i,{children:`Create User`})}),title:`Users`}),e[2]=a):a=e[2],s=(0,l.jsxs)(l.Fragment,{children:[a,n.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:n.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No IAM users found.`})]}),e[0]=t.Users,e[1]=s}else s=e[1];return s}function d(e){return e.UserName?(0,l.jsx)(s,{params:{userName:e.UserName},subtitle:e.UserId??``,title:e.UserName,to:`/iam/list-users/$userName`},e.UserName):null}function f(e,t){let n=e.UserName?.toLowerCase()??``,r=t.UserName?.toLowerCase()??``;return n.localeCompare(r)}export{u as component};
|
||||
@@ -1 +1 @@
|
||||
import{n as e,o as t,r as n,t as r}from"./compiler-runtime.js";import{r as i,t as a}from"./awsClient.js";import{c as o,d as s,l as c}from"./SignatureV4.js";import{t as l}from"./button.js";import{Rn as u,Rt as d,zt as f}from"./index.js";import{i as p,t as m}from"./zod.js";import{a as h,i as g,r as _,t as v}from"./field.js";import{n as y,r as b,t as x}from"./collapsible.js";import{a as S,o as C,r as w,t as T}from"./card.js";var E=r(),D=t(n()),O=e();function k(){let{reason:e}=d.useSearch(),[t,n]=(0,D.useState)(null),{register:r,handleSubmit:y,formState:{errors:b,isSubmitting:x}}=p({resolver:m(o)});async function E(e){n(null),a(),s(e);try{await i().send(new f({})),window.location.href=`/`}catch{c(),a(),n(`Invalid credentials. Please check your Access Key ID and Secret Access Key.`)}}return(0,O.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,O.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col gap-4`,children:[(0,O.jsxs)(T,{children:[(0,O.jsx)(S,{children:(0,O.jsx)(C,{children:`AWS Credentials`})}),(0,O.jsxs)(w,{children:[e===`expired`&&!t&&(0,O.jsx)(`p`,{className:`mb-4 rounded-md bg-muted p-3 text-sm text-muted-foreground`,children:`Your session is no longer valid — please sign in again.`}),t&&(0,O.jsx)(`p`,{className:`mb-4 rounded-md bg-destructive/10 p-3 text-sm text-destructive`,children:t}),(0,O.jsx)(`form`,{onSubmit:y(E),children:(0,O.jsxs)(g,{children:[(0,O.jsxs)(v,{children:[(0,O.jsx)(h,{children:(0,O.jsx)(`label`,{htmlFor:`accessKeyId`,children:`Access Key ID`})}),(0,O.jsx)(u,{"aria-invalid":!!b.accessKeyId,autoComplete:`username`,id:`accessKeyId`,placeholder:`AKIAIOSFODNN7EXAMPLE`,...r(`accessKeyId`)}),(0,O.jsx)(_,{errors:[b.accessKeyId]})]}),(0,O.jsxs)(v,{children:[(0,O.jsx)(h,{children:(0,O.jsx)(`label`,{htmlFor:`secretAccessKey`,children:`Secret Access Key`})}),(0,O.jsx)(u,{"aria-invalid":!!b.secretAccessKey,autoComplete:`current-password`,id:`secretAccessKey`,placeholder:`wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`,type:`password`,...r(`secretAccessKey`)}),(0,O.jsx)(_,{errors:[b.secretAccessKey]})]}),(0,O.jsx)(l,{className:`w-full`,disabled:x,type:`submit`,children:x?`Signing in...`:`Sign In`})]})})]})]}),(0,O.jsx)(A,{})]})})}function A(){let e=(0,E.c)(4),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`text-sm font-medium`,children:`Install Local Certificate Authority`}),(0,O.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`To avoid browser certificate warnings, download and install the Spinifex CA as a trusted root on your OS.`})]}),n=(0,O.jsx)(`a`,{className:`inline-flex h-8 w-full items-center justify-center rounded-md border border-input bg-background px-3 text-sm font-medium hover:bg-accent hover:text-accent-foreground`,download:`spinifex-ca.pem`,href:`/api/ca.pem`,children:`Download CA Certificate`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,O.jsx)(b,{className:`cursor-pointer text-xs text-muted-foreground underline-offset-4 hover:underline`,children:`Installation instructions`}),e[2]=r):r=e[2];let i;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,O.jsx)(T,{className:`border-muted bg-muted/30`,children:(0,O.jsx)(w,{className:`pt-4 pb-4`,children:(0,O.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t,n,(0,O.jsxs)(x,{children:[r,(0,O.jsx)(y,{children:(0,O.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2 text-xs text-muted-foreground`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`font-medium text-foreground`,children:`macOS`}),(0,O.jsx)(`code`,{className:`mt-1 block rounded bg-muted p-2 text-[11px] break-all`,children:`sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain spinifex-ca.pem`})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`font-medium text-foreground`,children:`Windows`}),(0,O.jsx)(`p`,{children:`Double-click the file → Install Certificate → Local Machine → Trusted Root Certification Authorities`})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`p`,{className:`font-medium text-foreground`,children:`Linux`}),(0,O.jsx)(`code`,{className:`mt-1 block rounded bg-muted p-2 text-[11px] break-all`,children:`sudo cp spinifex-ca.pem /usr/local/share/ca-certificates/spinifex-ca.crt && sudo update-ca-certificates`})]})]})})]})]})})}),e[3]=i):i=e[3],i}export{k as component};
|
||||
import{n as e,o as t,r as n,t as r}from"./compiler-runtime.js";import{t as i}from"./awsClient.js";import{i as a,t as o}from"./auth.js";import{t as s}from"./button.js";import{Bt as c,Rn as l,Rt as u}from"./index.js";import{i as d,t as f}from"./zod.js";import{a as p,i as m,r as h,t as g}from"./field.js";import{n as _,r as v,t as y}from"./collapsible.js";import{a as b,o as x,r as S,t as C}from"./card.js";var w=r(),T=t(n()),E=e();function D(){let{reason:e}=u.useSearch(),[t,n]=(0,T.useState)(null),{register:r,handleSubmit:_,formState:{errors:v,isSubmitting:y}}=d({resolver:f(o)});async function w(e){n(null);try{a(await c(e)),i(),window.location.href=`/`}catch{n(`Invalid credentials. Please check your Access Key ID and Secret Access Key.`)}}return(0,E.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,E.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col gap-4`,children:[(0,E.jsxs)(C,{children:[(0,E.jsx)(b,{children:(0,E.jsx)(x,{children:`AWS Credentials`})}),(0,E.jsxs)(S,{children:[e===`expired`&&!t&&(0,E.jsx)(`p`,{className:`mb-4 rounded-md bg-muted p-3 text-sm text-muted-foreground`,children:`Your session is no longer valid — please sign in again.`}),t&&(0,E.jsx)(`p`,{className:`mb-4 rounded-md bg-destructive/10 p-3 text-sm text-destructive`,children:t}),(0,E.jsx)(`form`,{onSubmit:_(w),children:(0,E.jsxs)(m,{children:[(0,E.jsxs)(g,{children:[(0,E.jsx)(p,{children:(0,E.jsx)(`label`,{htmlFor:`accessKeyId`,children:`Access Key ID`})}),(0,E.jsx)(l,{"aria-invalid":!!v.accessKeyId,autoComplete:`username`,id:`accessKeyId`,placeholder:`AKIAIOSFODNN7EXAMPLE`,...r(`accessKeyId`)}),(0,E.jsx)(h,{errors:[v.accessKeyId]})]}),(0,E.jsxs)(g,{children:[(0,E.jsx)(p,{children:(0,E.jsx)(`label`,{htmlFor:`secretAccessKey`,children:`Secret Access Key`})}),(0,E.jsx)(l,{"aria-invalid":!!v.secretAccessKey,autoComplete:`current-password`,id:`secretAccessKey`,placeholder:`wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`,type:`password`,...r(`secretAccessKey`)}),(0,E.jsx)(h,{errors:[v.secretAccessKey]})]}),(0,E.jsx)(s,{className:`w-full`,disabled:y,type:`submit`,children:y?`Signing in...`:`Sign In`})]})})]})]}),(0,E.jsx)(O,{})]})})}function O(){let e=(0,w.c)(4),t,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`p`,{className:`text-sm font-medium`,children:`Install Local Certificate Authority`}),(0,E.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`To avoid browser certificate warnings, download and install the Spinifex CA as a trusted root on your OS.`})]}),n=(0,E.jsx)(`a`,{className:`inline-flex h-8 w-full items-center justify-center rounded-md border border-input bg-background px-3 text-sm font-medium hover:bg-accent hover:text-accent-foreground`,download:`spinifex-ca.pem`,href:`/api/ca.pem`,children:`Download CA Certificate`}),e[0]=t,e[1]=n):(t=e[0],n=e[1]);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,E.jsx)(v,{className:`cursor-pointer text-xs text-muted-foreground underline-offset-4 hover:underline`,children:`Installation instructions`}),e[2]=r):r=e[2];let i;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,E.jsx)(C,{className:`border-muted bg-muted/30`,children:(0,E.jsx)(S,{className:`pt-4 pb-4`,children:(0,E.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t,n,(0,E.jsxs)(y,{children:[r,(0,E.jsx)(_,{children:(0,E.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2 text-xs text-muted-foreground`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`p`,{className:`font-medium text-foreground`,children:`macOS`}),(0,E.jsx)(`code`,{className:`mt-1 block rounded bg-muted p-2 text-[11px] break-all`,children:`sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain spinifex-ca.pem`})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`p`,{className:`font-medium text-foreground`,children:`Windows`}),(0,E.jsx)(`p`,{children:`Double-click the file → Install Certificate → Local Machine → Trusted Root Certification Authorities`})]}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`p`,{className:`font-medium text-foreground`,children:`Linux`}),(0,E.jsx)(`code`,{className:`mt-1 block rounded bg-muted p-2 text-[11px] break-all`,children:`sudo cp spinifex-ca.pem /usr/local/share/ca-certificates/spinifex-ca.crt && sudo update-ca-certificates`})]})]})})]})]})})}),e[3]=i):i=e[3],i}export{D as component};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{Or as r}from"./awsClient.js";import{D as i}from"./SignatureV4.js";import{t as a}from"./button.js";import{st as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";var l=t(),u=e();function d(){let e=(0,l.c)(5),{data:t}=n(o),i;e[0]===t.Buckets?i=e[1]:(i=t.Buckets??[],e[0]=t.Buckets,e[1]=i);let c=i,d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(s,{actions:(0,u.jsx)(r,{to:`/s3/create-bucket`,children:(0,u.jsx)(a,{children:`Create Bucket`})}),title:`Buckets`}),e[2]=d):d=e[2];let p;return e[3]===c?p=e[4]:(p=(0,u.jsxs)(u.Fragment,{children:[d,c.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:c.map(f)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No buckets found.`})]}),e[3]=c,e[4]=p),p}function f(e){return e.Name?(0,u.jsx)(c,{params:{bucket:e.Name},subtitle:e.CreationDate?`Created: ${i(e.CreationDate)}`:void 0,title:e.Name,to:`/s3/ls/$bucket`},e.Name):null}export{d as component};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{t as n}from"./useSuspenseQuery.js";import{vr as r}from"./awsClient.js";import{Vt as i}from"./auth.js";import{t as a}from"./button.js";import{st as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";var l=t(),u=e();function d(){let e=(0,l.c)(5),{data:t}=n(o),i;e[0]===t.Buckets?i=e[1]:(i=t.Buckets??[],e[0]=t.Buckets,e[1]=i);let c=i,d;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(s,{actions:(0,u.jsx)(r,{to:`/s3/create-bucket`,children:(0,u.jsx)(a,{children:`Create Bucket`})}),title:`Buckets`}),e[2]=d):d=e[2];let p;return e[3]===c?p=e[4]:(p=(0,u.jsxs)(u.Fragment,{children:[d,c.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:c.map(f)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No buckets found.`})]}),e[3]=c,e[4]=p),p}function f(e){return e.Name?(0,u.jsx)(c,{params:{bucket:e.Name},subtitle:e.CreationDate?`Created: ${i(e.CreationDate)}`:void 0,title:e.Name,to:`/s3/ls/$bucket`},e.Name):null}export{d as component};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{w as n}from"./SignatureV4.js";var r=t(),i=e(),a=new Set([`running`,`available`,`completed`,`Active`]),o=new Set([`stopped`,`error`]),s=new Set([`pending`,`shutting-down`,`stopping`]);function c(e){return e&&a.has(e)?`bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100`:e&&o.has(e)?`bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-100`:e&&s.has(e)?`bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100`:e===`terminated`?`bg-zinc-100 text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400`:`bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-100`}function l(e){let t=(0,r.c)(5),{state:a}=e,o;t[0]===a?o=t[1]:(o=n(`rounded-full px-2 py-1 text-xs`,c(a)),t[0]=a,t[1]=o);let s;return t[2]!==a||t[3]!==o?(s=(0,i.jsx)(`div`,{className:o,children:a}),t[2]=a,t[3]=o,t[4]=s):s=t[4],s}export{l as t};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{Rt as n}from"./auth.js";var r=t(),i=e(),a=new Set([`running`,`available`,`completed`,`Active`]),o=new Set([`stopped`,`error`]),s=new Set([`pending`,`shutting-down`,`stopping`]);function c(e){return e&&a.has(e)?`bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100`:e&&o.has(e)?`bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-100`:e&&s.has(e)?`bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100`:e===`terminated`?`bg-zinc-100 text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400`:`bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-100`}function l(e){let t=(0,r.c)(5),{state:a}=e,o;t[0]===a?o=t[1]:(o=n(`rounded-full px-2 py-1 text-xs`,c(a)),t[0]=a,t[1]=o);let s;return t[2]!==a||t[3]!==o?(s=(0,i.jsx)(`div`,{className:o,children:a}),t[2]=a,t[3]=o,t[4]=s):s=t[4],s}export{l as t};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{n as e,t}from"./compiler-runtime.js";import{w as n}from"./SignatureV4.js";var r=t(),i=e();function a(e){let t=(0,r.c)(8),a,o;t[0]===e?(a=t[1],o=t[2]):({className:a,...o}=e,t[0]=e,t[1]=a,t[2]=o);let s;t[3]===a?s=t[4]:(s=n(`flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-input/20 px-2 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground autofill:[-webkit-text-fill-color:var(--color-foreground)] autofill:[transition:background-color_9999s_ease-in-out_0s] focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,a),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,i.jsx)(`textarea`,{className:s,"data-slot":`textarea`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}export{a as t};
|
||||
import{n as e,t}from"./compiler-runtime.js";import{Rt as n}from"./auth.js";var r=t(),i=e();function a(e){let t=(0,r.c)(8),a,o;t[0]===e?(a=t[1],o=t[2]):({className:a,...o}=e,t[0]=e,t[1]=a,t[2]=o);let s;t[3]===a?s=t[4]:(s=n(`flex field-sizing-content min-h-16 w-full resize-none rounded-md border border-input bg-input/20 px-2 py-2 text-sm transition-colors outline-none placeholder:text-muted-foreground autofill:[-webkit-text-fill-color:var(--color-foreground)] autofill:[transition:background-color_9999s_ease-in-out_0s] focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,a),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,i.jsx)(`textarea`,{className:s,"data-slot":`textarea`,...o}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}export{a as t};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2
-2
@@ -9,9 +9,9 @@
|
||||
<meta name="description" content="Spinifex Control Panel" />
|
||||
<script type="module" crossorigin src="/assets/index.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/compiler-runtime.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/tslib.es6.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/auth.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/index.browser.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/index2.browser.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/SignatureV4.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/useStore.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/awsClient.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/dist.js">
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
"@aws-sdk/client-elastic-load-balancing-v2": "^3.1062.0",
|
||||
"@aws-sdk/client-iam": "^3.1062.0",
|
||||
"@aws-sdk/client-s3": "^3.1062.0",
|
||||
"@aws-sdk/client-sts": "^3.1062.0",
|
||||
"@aws-sdk/lib-storage": "^3.1062.0",
|
||||
"@base-ui/react": "^1.5.0",
|
||||
"@fontsource-variable/geist": "^5.2.9",
|
||||
|
||||
@@ -29,6 +29,9 @@ importers:
|
||||
'@aws-sdk/client-s3':
|
||||
specifier: ^3.1062.0
|
||||
version: 3.1063.0
|
||||
'@aws-sdk/client-sts':
|
||||
specifier: ^3.1062.0
|
||||
version: 3.1063.0
|
||||
'@aws-sdk/lib-storage':
|
||||
specifier: ^3.1062.0
|
||||
version: 3.1063.0(@aws-sdk/client-s3@3.1063.0)
|
||||
@@ -213,6 +216,10 @@ packages:
|
||||
resolution: {integrity: sha512-ETn+vvmZVK1MmOZwVBXmWANpmD5iTbzojIqyEIoZ86qo+8oWy35S8QyQNE/ZDI+WHgMU1dS+VSYbpRl1QkEySg==}
|
||||
engines: {node: '>=20.0.0'}
|
||||
|
||||
'@aws-sdk/client-sts@3.1063.0':
|
||||
resolution: {integrity: sha512-5SZhiVKuufk/dUcfNr6hZymQSTSnh12paXRLq+YS8OmsozpChNG0wHaKH/hXA/mdGwLxgdudqHAHxygbCiwzqQ==}
|
||||
engines: {node: '>=20.0.0'}
|
||||
|
||||
'@aws-sdk/core@3.974.18':
|
||||
resolution: {integrity: sha512-JDYCPI0j7zGrzXTDFsLB346cxss7J/AxH7+O0MzWlqppJBEyB9Qe6TQXRL6iwLUo/xZkNv9KFmBL2hqElmwW0g==}
|
||||
engines: {node: '>=20.0.0'}
|
||||
@@ -2559,6 +2566,20 @@ snapshots:
|
||||
'@smithy/types': 4.14.3
|
||||
tslib: 2.8.1
|
||||
|
||||
'@aws-sdk/client-sts@3.1063.0':
|
||||
dependencies:
|
||||
'@aws-crypto/sha256-browser': 5.2.0
|
||||
'@aws-crypto/sha256-js': 5.2.0
|
||||
'@aws-sdk/core': 3.974.18
|
||||
'@aws-sdk/credential-provider-node': 3.972.52
|
||||
'@aws-sdk/signature-v4-multi-region': 3.996.32
|
||||
'@aws-sdk/types': 3.973.11
|
||||
'@smithy/core': 3.24.6
|
||||
'@smithy/fetch-http-handler': 5.4.6
|
||||
'@smithy/node-http-handler': 4.7.7
|
||||
'@smithy/types': 4.14.3
|
||||
tslib: 2.8.1
|
||||
|
||||
'@aws-sdk/core@3.974.18':
|
||||
dependencies:
|
||||
'@aws-sdk/types': 3.973.11
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
import { renderHook, waitFor } from "@testing-library/react"
|
||||
import type { ReactNode } from "react"
|
||||
import { describe, expect, it, vi } from "vitest"
|
||||
|
||||
import type { SessionCredentials } from "@/lib/auth"
|
||||
|
||||
const mockGetCredentials = vi.fn<() => SessionCredentials | null>()
|
||||
const mockStsSend = vi.fn()
|
||||
const mockSignedFetch = vi.fn<(opts: unknown) => Promise<unknown>>()
|
||||
|
||||
vi.mock("@/lib/auth", () => ({
|
||||
getCredentials: () => mockGetCredentials(),
|
||||
}))
|
||||
|
||||
vi.mock("@/lib/sts", () => ({
|
||||
getStsClient: () => ({ send: mockStsSend }),
|
||||
}))
|
||||
|
||||
vi.mock("@/lib/signed-fetch", () => ({
|
||||
signedFetch: async (opts: unknown) => mockSignedFetch(opts),
|
||||
}))
|
||||
|
||||
vi.mock("@aws-sdk/client-sts", () => ({
|
||||
// Constructable stub: `new GetCallerIdentityCommand({})` must not throw.
|
||||
GetCallerIdentityCommand: vi.fn(),
|
||||
}))
|
||||
|
||||
import { AdminProvider, useAdmin } from "./admin-context"
|
||||
|
||||
const sessionCreds = {
|
||||
accessKeyId: "ASIAIOSFODNN7EXAMPLE",
|
||||
secretAccessKey: "secret",
|
||||
sessionToken: "token",
|
||||
expiration: new Date(Date.now() + 60 * 60 * 1000).toISOString(),
|
||||
}
|
||||
|
||||
const versionInfo = {
|
||||
version: "v1.0.0",
|
||||
commit: "abc1234",
|
||||
os: "linux",
|
||||
arch: "amd64",
|
||||
license: "open-source",
|
||||
}
|
||||
|
||||
function wrapper({ children }: { children: ReactNode }) {
|
||||
return <AdminProvider>{children}</AdminProvider>
|
||||
}
|
||||
|
||||
describe("AdminProvider", () => {
|
||||
it("marks the admin account and derives the user name from the ARN", async () => {
|
||||
mockGetCredentials.mockReturnValue(sessionCreds)
|
||||
mockStsSend.mockResolvedValue({
|
||||
Account: "000000000001",
|
||||
Arn: "arn:aws:iam::000000000001:user/admin",
|
||||
})
|
||||
mockSignedFetch.mockResolvedValue(versionInfo)
|
||||
|
||||
const { result } = renderHook(() => useAdmin(), { wrapper })
|
||||
|
||||
await waitFor(() => {
|
||||
expect(result.current.loading).toBeFalsy()
|
||||
})
|
||||
|
||||
expect(result.current.isAdmin).toBeTruthy()
|
||||
expect(result.current.accountId).toBe("000000000001")
|
||||
expect(result.current.userName).toBe("admin")
|
||||
expect(result.current.version).toStrictEqual(versionInfo)
|
||||
expect(result.current.license).toBe("open-source")
|
||||
expect(mockSignedFetch).toHaveBeenCalledWith({
|
||||
action: "GetVersion",
|
||||
credentials: sessionCreds,
|
||||
})
|
||||
})
|
||||
|
||||
it("treats a non-admin account as non-admin and skips the version fetch", async () => {
|
||||
mockGetCredentials.mockReturnValue(sessionCreds)
|
||||
mockStsSend.mockResolvedValue({
|
||||
Account: "000000000002",
|
||||
Arn: "arn:aws:iam::000000000002:user/alice",
|
||||
})
|
||||
|
||||
const { result } = renderHook(() => useAdmin(), { wrapper })
|
||||
|
||||
await waitFor(() => {
|
||||
expect(result.current.loading).toBeFalsy()
|
||||
})
|
||||
|
||||
expect(result.current.isAdmin).toBeFalsy()
|
||||
expect(result.current.accountId).toBe("000000000002")
|
||||
expect(result.current.userName).toBe("alice")
|
||||
expect(result.current.version).toBeNull()
|
||||
expect(mockSignedFetch).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it("yields a null user name when the ARN is not a user ARN", async () => {
|
||||
mockGetCredentials.mockReturnValue(sessionCreds)
|
||||
mockStsSend.mockResolvedValue({
|
||||
Account: "000000000001",
|
||||
Arn: "arn:aws:iam::000000000001:root",
|
||||
})
|
||||
mockSignedFetch.mockResolvedValue(versionInfo)
|
||||
|
||||
const { result } = renderHook(() => useAdmin(), { wrapper })
|
||||
|
||||
await waitFor(() => {
|
||||
expect(result.current.loading).toBeFalsy()
|
||||
})
|
||||
|
||||
expect(result.current.isAdmin).toBeTruthy()
|
||||
expect(result.current.userName).toBeNull()
|
||||
})
|
||||
|
||||
it("stops loading without detection when unauthenticated", async () => {
|
||||
mockGetCredentials.mockReturnValue(null)
|
||||
|
||||
const { result } = renderHook(() => useAdmin(), { wrapper })
|
||||
|
||||
await waitFor(() => {
|
||||
expect(result.current.loading).toBeFalsy()
|
||||
})
|
||||
|
||||
expect(result.current.isAdmin).toBeFalsy()
|
||||
expect(result.current.accountId).toBeNull()
|
||||
expect(mockStsSend).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
@@ -1,13 +1,21 @@
|
||||
import { GetCallerIdentityCommand } from "@aws-sdk/client-sts"
|
||||
import { createContext, useContext, useEffect, useState } from "react"
|
||||
|
||||
import { getCredentials } from "@/lib/auth"
|
||||
import { signedFetch } from "@/lib/signed-fetch"
|
||||
import { getStsClient } from "@/lib/sts"
|
||||
|
||||
const ADMIN_ACCOUNT_ID = "000000000001"
|
||||
|
||||
interface CallerIdentity {
|
||||
account_id: string
|
||||
user_name: string
|
||||
// userNameFromArn pulls the user name out of an IAM user ARN
|
||||
// (arn:aws:iam::<acct>:user/<name>); returns null for other ARN shapes.
|
||||
function userNameFromArn(arn: string | undefined): string | null {
|
||||
const marker = ":user/"
|
||||
const index = arn?.indexOf(marker) ?? -1
|
||||
if (index === -1 || arn === undefined) {
|
||||
return null
|
||||
}
|
||||
return arn.slice(index + marker.length) || null
|
||||
}
|
||||
|
||||
interface VersionInfo {
|
||||
@@ -48,12 +56,12 @@ export function AdminProvider({ children }: { children: React.ReactNode }) {
|
||||
}
|
||||
|
||||
try {
|
||||
const identity = await signedFetch<CallerIdentity>({
|
||||
action: "GetCallerIdentity",
|
||||
credentials,
|
||||
})
|
||||
const identity = await getStsClient().send(
|
||||
new GetCallerIdentityCommand({}),
|
||||
)
|
||||
|
||||
const isAdmin = identity.account_id === ADMIN_ACCOUNT_ID
|
||||
const accountId = identity.Account ?? null
|
||||
const isAdmin = accountId === ADMIN_ACCOUNT_ID
|
||||
let version: VersionInfo | null = null
|
||||
|
||||
if (isAdmin) {
|
||||
@@ -69,8 +77,8 @@ export function AdminProvider({ children }: { children: React.ReactNode }) {
|
||||
|
||||
setState({
|
||||
isAdmin,
|
||||
accountId: identity.account_id,
|
||||
userName: identity.user_name,
|
||||
accountId,
|
||||
userName: userNameFromArn(identity.Arn),
|
||||
version,
|
||||
license: version?.license ?? null,
|
||||
loading: false,
|
||||
|
||||
@@ -1,41 +1,52 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"
|
||||
|
||||
import type { AwsCredentials } from "./auth"
|
||||
import type { SessionCredentials } from "./auth"
|
||||
|
||||
const validCreds: AwsCredentials = {
|
||||
accessKeyId: "AKIAIOSFODNN7EXAMPLE",
|
||||
secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
|
||||
const STORAGE_KEY = "spinifex:v2:aws-session"
|
||||
|
||||
function sessionCreds(
|
||||
overrides: Partial<SessionCredentials> = {},
|
||||
): SessionCredentials {
|
||||
return {
|
||||
accessKeyId: "ASIAIOSFODNN7EXAMPLE",
|
||||
secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
|
||||
sessionToken: "FwoGZXIvYXdzEBYaD-session-token",
|
||||
expiration: new Date(Date.now() + 60 * 60 * 1000).toISOString(),
|
||||
...overrides,
|
||||
}
|
||||
}
|
||||
|
||||
let getCredentials: typeof import("./auth").getCredentials
|
||||
let setCredentials: typeof import("./auth").setCredentials
|
||||
let setSessionCredentials: typeof import("./auth").setSessionCredentials
|
||||
let clearCredentials: typeof import("./auth").clearCredentials
|
||||
|
||||
async function loadAuth() {
|
||||
vi.resetModules()
|
||||
const auth = await import("./auth")
|
||||
getCredentials = auth.getCredentials
|
||||
setCredentials = auth.setCredentials
|
||||
setSessionCredentials = auth.setSessionCredentials
|
||||
clearCredentials = auth.clearCredentials
|
||||
}
|
||||
|
||||
describe("setCredentials", () => {
|
||||
describe("setSessionCredentials", () => {
|
||||
beforeEach(loadAuth)
|
||||
afterEach(() => {
|
||||
localStorage.clear()
|
||||
})
|
||||
|
||||
it("stores credentials in localStorage", () => {
|
||||
setCredentials(validCreds)
|
||||
const stored = localStorage.getItem("spinifex:v1:aws-credentials")
|
||||
expect(JSON.parse(stored ?? "")).toStrictEqual(validCreds)
|
||||
it("stores session credentials in localStorage", () => {
|
||||
const creds = sessionCreds()
|
||||
setSessionCredentials(creds)
|
||||
const stored = localStorage.getItem(STORAGE_KEY)
|
||||
expect(JSON.parse(stored ?? "")).toStrictEqual(creds)
|
||||
})
|
||||
|
||||
it("caches credentials in memory", () => {
|
||||
setCredentials(validCreds)
|
||||
const creds = sessionCreds()
|
||||
setSessionCredentials(creds)
|
||||
// Clear localStorage to prove it reads from cache
|
||||
localStorage.clear()
|
||||
expect(getCredentials()).toStrictEqual(validCreds)
|
||||
expect(getCredentials()).toStrictEqual(creds)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -49,40 +60,49 @@ describe("getCredentials", () => {
|
||||
expect(getCredentials()).toBeNull()
|
||||
})
|
||||
|
||||
it("reads from localStorage on first call", () => {
|
||||
localStorage.setItem(
|
||||
"spinifex:v1:aws-credentials",
|
||||
JSON.stringify(validCreds),
|
||||
)
|
||||
expect(getCredentials()).toStrictEqual(validCreds)
|
||||
it("round-trips sessionToken and expiration from localStorage", () => {
|
||||
const creds = sessionCreds()
|
||||
localStorage.setItem(STORAGE_KEY, JSON.stringify(creds))
|
||||
expect(getCredentials()).toStrictEqual(creds)
|
||||
})
|
||||
|
||||
it("returns cached value on subsequent calls", () => {
|
||||
setCredentials(validCreds)
|
||||
const creds = sessionCreds()
|
||||
setSessionCredentials(creds)
|
||||
localStorage.clear()
|
||||
// Should still return from cache
|
||||
expect(getCredentials()).toStrictEqual(validCreds)
|
||||
expect(getCredentials()).toStrictEqual(validCreds)
|
||||
expect(getCredentials()).toStrictEqual(creds)
|
||||
expect(getCredentials()).toStrictEqual(creds)
|
||||
})
|
||||
|
||||
it("returns null for invalid JSON in localStorage", () => {
|
||||
localStorage.setItem("spinifex:v1:aws-credentials", "not-json")
|
||||
localStorage.setItem(STORAGE_KEY, "not-json")
|
||||
expect(getCredentials()).toBeNull()
|
||||
})
|
||||
|
||||
it("returns null when stored data fails schema validation", () => {
|
||||
it("returns null when the session token is missing", () => {
|
||||
localStorage.setItem(
|
||||
"spinifex:v1:aws-credentials",
|
||||
JSON.stringify({ accessKeyId: "short", secretAccessKey: "" }),
|
||||
STORAGE_KEY,
|
||||
JSON.stringify({
|
||||
accessKeyId: "ASIAIOSFODNN7EXAMPLE",
|
||||
secretAccessKey: "secret",
|
||||
expiration: new Date(Date.now() + 60_000).toISOString(),
|
||||
}),
|
||||
)
|
||||
expect(getCredentials()).toBeNull()
|
||||
})
|
||||
|
||||
it("returns null when stored object is missing fields", () => {
|
||||
localStorage.setItem(
|
||||
"spinifex:v1:aws-credentials",
|
||||
JSON.stringify({ accessKeyId: "AKIAIOSFODNN7EXAMPLE" }),
|
||||
)
|
||||
it("returns null and clears storage when the session has expired", () => {
|
||||
const expired = sessionCreds({
|
||||
expiration: new Date(Date.now() - 1000).toISOString(),
|
||||
})
|
||||
localStorage.setItem(STORAGE_KEY, JSON.stringify(expired))
|
||||
expect(getCredentials()).toBeNull()
|
||||
expect(localStorage.getItem(STORAGE_KEY)).toBeNull()
|
||||
})
|
||||
|
||||
it("returns null when the expiration is unparseable", () => {
|
||||
const bad = sessionCreds({ expiration: "not-a-date" })
|
||||
localStorage.setItem(STORAGE_KEY, JSON.stringify(bad))
|
||||
expect(getCredentials()).toBeNull()
|
||||
})
|
||||
})
|
||||
@@ -94,13 +114,13 @@ describe("clearCredentials", () => {
|
||||
})
|
||||
|
||||
it("removes credentials from localStorage", () => {
|
||||
setCredentials(validCreds)
|
||||
setSessionCredentials(sessionCreds())
|
||||
clearCredentials()
|
||||
expect(localStorage.getItem("spinifex:v1:aws-credentials")).toBeNull()
|
||||
expect(localStorage.getItem(STORAGE_KEY)).toBeNull()
|
||||
})
|
||||
|
||||
it("clears the in-memory cache", () => {
|
||||
setCredentials(validCreds)
|
||||
setSessionCredentials(sessionCreds())
|
||||
clearCredentials()
|
||||
expect(getCredentials()).toBeNull()
|
||||
})
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
import { z } from "zod"
|
||||
|
||||
// Versioned storage key - increment version when schema changes
|
||||
const STORAGE_KEY = "spinifex:v1:aws-credentials"
|
||||
// Versioned storage key - increment version when schema changes. v2 holds
|
||||
// short-lived STS session credentials; abandoned v1 long-lived entries simply
|
||||
// force a one-time re-login.
|
||||
const STORAGE_KEY = "spinifex:v2:aws-session"
|
||||
|
||||
// Long-lived credentials entered on the login form. Used once to exchange for
|
||||
// session credentials via STS GetSessionToken and never persisted.
|
||||
export const awsCredentialsSchema = z.object({
|
||||
accessKeyId: z
|
||||
.string()
|
||||
@@ -10,34 +14,53 @@ export const awsCredentialsSchema = z.object({
|
||||
secretAccessKey: z.string().min(1, "Secret Access Key is required"),
|
||||
})
|
||||
|
||||
export type AwsCredentials = z.infer<typeof awsCredentialsSchema>
|
||||
export type AwsCredentialsInput = z.infer<typeof awsCredentialsSchema>
|
||||
|
||||
// Short-lived STS session credentials persisted in localStorage.
|
||||
export const sessionCredentialsSchema = z.object({
|
||||
accessKeyId: z.string().min(1),
|
||||
secretAccessKey: z.string().min(1),
|
||||
sessionToken: z.string().min(1),
|
||||
expiration: z.string().min(1),
|
||||
})
|
||||
|
||||
export type SessionCredentials = z.infer<typeof sessionCredentialsSchema>
|
||||
|
||||
// In-memory cache to avoid repeated localStorage reads
|
||||
let credentialsCache: AwsCredentials | null | undefined
|
||||
let credentialsCache: SessionCredentials | null | undefined
|
||||
|
||||
export function getCredentials(): AwsCredentials | null {
|
||||
// Return cached value if available
|
||||
if (credentialsCache !== undefined) {
|
||||
return credentialsCache
|
||||
}
|
||||
function isExpired(expiration: string): boolean {
|
||||
const expiresAt = Date.parse(expiration)
|
||||
return Number.isNaN(expiresAt) || expiresAt <= Date.now()
|
||||
}
|
||||
|
||||
function readStoredCredentials(): SessionCredentials | null {
|
||||
try {
|
||||
const stored = localStorage.getItem(STORAGE_KEY)
|
||||
if (!stored) {
|
||||
credentialsCache = null
|
||||
return null
|
||||
}
|
||||
const parsed: unknown = JSON.parse(stored)
|
||||
const result = awsCredentialsSchema.safeParse(parsed)
|
||||
credentialsCache = result.success ? result.data : null
|
||||
return credentialsCache
|
||||
const result = sessionCredentialsSchema.safeParse(parsed)
|
||||
return result.success ? result.data : null
|
||||
} catch {
|
||||
credentialsCache = null
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
export function setCredentials(credentials: AwsCredentials): void {
|
||||
export function getCredentials(): SessionCredentials | null {
|
||||
if (credentialsCache === undefined) {
|
||||
credentialsCache = readStoredCredentials()
|
||||
}
|
||||
// Treat expired sessions as logged out so route guards redirect to /login.
|
||||
if (credentialsCache && isExpired(credentialsCache.expiration)) {
|
||||
clearCredentials()
|
||||
return null
|
||||
}
|
||||
return credentialsCache
|
||||
}
|
||||
|
||||
export function setSessionCredentials(credentials: SessionCredentials): void {
|
||||
try {
|
||||
localStorage.setItem(STORAGE_KEY, JSON.stringify(credentials))
|
||||
credentialsCache = credentials
|
||||
|
||||
@@ -36,6 +36,7 @@ export function getEc2Client(): EC2Client {
|
||||
credentials: {
|
||||
accessKeyId: credentials.accessKeyId,
|
||||
secretAccessKey: credentials.secretAccessKey,
|
||||
sessionToken: credentials.sessionToken,
|
||||
},
|
||||
})
|
||||
ec2Client.middlewareStack.add(
|
||||
@@ -65,6 +66,7 @@ export function getEksClient(): EKSClient {
|
||||
credentials: {
|
||||
accessKeyId: credentials.accessKeyId,
|
||||
secretAccessKey: credentials.secretAccessKey,
|
||||
sessionToken: credentials.sessionToken,
|
||||
},
|
||||
})
|
||||
eksClient.middlewareStack.add(
|
||||
@@ -94,6 +96,7 @@ export function getElbv2Client(): ElasticLoadBalancingV2Client {
|
||||
credentials: {
|
||||
accessKeyId: credentials.accessKeyId,
|
||||
secretAccessKey: credentials.secretAccessKey,
|
||||
sessionToken: credentials.sessionToken,
|
||||
},
|
||||
})
|
||||
elbv2Client.middlewareStack.add(
|
||||
@@ -123,6 +126,7 @@ export function getAcmClient(): ACMClient {
|
||||
credentials: {
|
||||
accessKeyId: credentials.accessKeyId,
|
||||
secretAccessKey: credentials.secretAccessKey,
|
||||
sessionToken: credentials.sessionToken,
|
||||
},
|
||||
})
|
||||
acmClient.middlewareStack.add(
|
||||
@@ -152,6 +156,7 @@ export function getIamClient(): IAMClient {
|
||||
credentials: {
|
||||
accessKeyId: credentials.accessKeyId,
|
||||
secretAccessKey: credentials.secretAccessKey,
|
||||
sessionToken: credentials.sessionToken,
|
||||
},
|
||||
})
|
||||
iamClient.middlewareStack.add(
|
||||
@@ -181,6 +186,7 @@ export function getS3Client(): S3Client {
|
||||
credentials: {
|
||||
accessKeyId: credentials.accessKeyId,
|
||||
secretAccessKey: credentials.secretAccessKey,
|
||||
sessionToken: credentials.sessionToken,
|
||||
},
|
||||
forcePathStyle: true,
|
||||
})
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user