mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-15 17:11:30 +00:00
feat(elbv2): SetSubnets + RGT GetResources + EKS ingress toggle (LB-controller gaps) (#309)
* feat(elbv2): SetSubnets — full add+remove LB subnet re-homing
Add the ELBv2 SetSubnets operation across the interface, NATS subject,
daemon handler/subscription, and gateway route/forwarder.
Re-homing is a full add+remove: subnets new to the LB get a fresh managed
ENI, dropped subnets have their ENI deleted, then the backing system VM is
relaunched on the new ENI set. The system-instance launcher exposes only
Launch/Terminate (no live ENI hotplug for system VMs), so applying new
subnets relaunches the LB VM — a brief data-plane interruption. The record
is mutated only after the new ENIs exist and the VM is relaunched.
Extract a shared launchLBVM helper from CreateLoadBalancer so create and
SetSubnets boot the LB VM identically. Idempotent on no-op; record-only
fallback when no VPC service is wired.
Completes the elbv2 mutation-API surface (SetSubnets was the last gap).
* feat(tagging): resourcegroupstaggingapi GetResources for controller discovery
Add the Resource Groups Tagging API as a new gateway service (SigV4 scope
\"tagging\", AWS JSON 1.1 / X-Amz-Target, mirroring ACM). GetResources is a
gateway-side aggregator over the existing elbv2 and ec2 tag stores — no new
NATS subject or daemon handler.
It lists the account's load balancers and target groups (attaching tags via
batched DescribeTags) plus EC2 resources from the tag store, then applies the
request's ResourceTypeFilters (service-wide or fully-qualified) and TagFilters
(AND across filters, OR within values). Results are ARN-sorted with opaque
offset pagination.
This is how aws-load-balancer-controller v2 discovers and adopts the elbv2
resources it manages (filtering on its cluster/stack tags); DescribeLoadBalancers
has no tag-filter field, so RGT GetResources is the required path.
* fix(eks): emit canonical exception code, no doubled suffix
GenerateEKSErrorResponse appended \"Exception\" unconditionally, so codes that
already carry it (e.g. awserrors.ErrorEKSResourceNotFound =
\"ResourceNotFoundException\") serialized as ResourceNotFoundExceptionException.
SDK clients comparing eks.ErrCodeResourceNotFoundException then fail to match.
Append the suffix idempotently. Also covers the many other awserrors codes that
already end in \"Exception\" and flow through the shared JSON error envelope
(EKS, ACM, tagging).
* refactor(tagging): split GetResources fetch from orchestration for testing
Introduce a resourceLister seam: GetResources wires a NATS-backed lister, while
getResources (parse + tag-filter + sort + paginate) and buildEC2Mappings (tag
grouping + ARN synthesis) are now pure and unit-tested without a live backend.
No behaviour change.
* feat(eks): per-cluster opt-in K3s built-in ingress + enforce parity default
The runtime-rendered /etc/rancher/k3s/config.yaml emitted no disable: block, so
traefik + servicelb actually ran on every cluster — the AMI config.yaml.skel
that disables them is a never-applied boot fallback (cloud-init overrides it).
Render the disable block by default so traefik + servicelb are off for AWS
parity (Service type=LoadBalancer / Ingress are the AWS Load Balancer
Controller's job). A cluster created with tag spinifex.io/managed-ingress=true
keeps the K3s built-ins for interim in-VPC app exposure before the controller
add-on lands. The flag is derived into ClusterMeta.BuiltinIngress at
CreateCluster and threaded onto K3sServerInput.
* feat(ui): subnet editor on load balancer detail page (SetSubnets)
Add a Subnets tab to the LB detail page backed by the elbv2 SetSubnets
API. The editor mirrors the security-groups editor (checkbox list of the
VPC's subnets, dirty-tracking, Reset/Save) and warns that applying a
change re-homes the load balancer by relaunching its system VM, causing
a brief data-plane interruption.
* fix(elbv2): SetSubnets must detach ENIs before delete/relaunch + roll back on terminate failure
TerminateSystemInstance tears down the LB VM but leaves its ENIs marked
in-use, so the relaunch path could neither delete removed-subnet ENIs
(InvalidNetworkInterface.InUse leak) nor re-attach retained ENIs to the
relaunched VM (attach failed InUse, dropping the retained subnet's data
plane). Detach the existing ENIs explicitly after terminate — mirroring
DeleteLoadBalancer — before deleting removed ones and relaunching.
Also roll back the freshly-created added-subnet ENIs when the terminate
step itself fails, so a failed relaunch no longer leaks ENIs (amplified
by SDK retries).
* fix(daemon): re-arm system-instance terminate subscription on recovery
system.TerminateInstance.{id} was bound only by the system.LaunchInstance
handler at first launch, so it was lost across a daemon restart: recovery
reconnects to the surviving QEMU (or relaunches) but never re-bound the
subject, leaving system.TerminateInstance.{id} with no responder. Any LB
that predated the restart could then never be torn down — SetSubnets
relaunch and DeleteLoadBalancer both failed with 'no responders'.
Re-arm it in onInstanceUpHook, which fires on both the relaunch and the
reconnect-to-surviving-QEMU recovery paths, for ManagedByELBv2 VMs; drop
it in onInstanceDownHook. Split subscribeSystemTerminate into a locked
helper so the hook (which already holds d.mu) can reuse it.
This commit is contained in:
@@ -919,6 +919,7 @@ func (d *Daemon) subscribeAll() error {
|
||||
natsSub{"elbv2.DescribeLoadBalancerAttributes", d.handleELBv2DescribeLoadBalancerAttributes, "spinifex-workers"},
|
||||
natsSub{"elbv2.SetSecurityGroups", d.handleELBv2SetSecurityGroups, "spinifex-workers"},
|
||||
natsSub{"elbv2.SetIpAddressType", d.handleELBv2SetIpAddressType, "spinifex-workers"},
|
||||
natsSub{"elbv2.SetSubnets", d.handleELBv2SetSubnets, "spinifex-workers"},
|
||||
natsSub{"elbv2.AddListenerCertificates", d.handleELBv2AddListenerCertificates, "spinifex-workers"},
|
||||
natsSub{"elbv2.RemoveListenerCertificates", d.handleELBv2RemoveListenerCertificates, "spinifex-workers"},
|
||||
natsSub{"elbv2.DescribeListenerCertificates", d.handleELBv2DescribeListenerCertificates, "spinifex-workers"},
|
||||
|
||||
@@ -122,6 +122,10 @@ func (d *Daemon) handleELBv2SetIpAddressType(msg *nats.Msg) {
|
||||
handleNATSRequest(msg, d.elbv2Service.SetIpAddressType)
|
||||
}
|
||||
|
||||
func (d *Daemon) handleELBv2SetSubnets(msg *nats.Msg) {
|
||||
handleNATSRequest(msg, d.elbv2Service.SetSubnets)
|
||||
}
|
||||
|
||||
func (d *Daemon) handleELBv2AddListenerCertificates(msg *nats.Msg) {
|
||||
handleNATSRequest(msg, d.elbv2Service.AddListenerCertificates)
|
||||
}
|
||||
|
||||
@@ -67,6 +67,15 @@ func (d *Daemon) subscribeSystemTerminate(instanceID string) error {
|
||||
}
|
||||
d.mu.Lock()
|
||||
defer d.mu.Unlock()
|
||||
return d.subscribeSystemTerminateLocked(instanceID)
|
||||
}
|
||||
|
||||
// subscribeSystemTerminateLocked is the body of subscribeSystemTerminate for
|
||||
// callers that already hold d.mu (e.g. onInstanceUpHook). Idempotent.
|
||||
func (d *Daemon) subscribeSystemTerminateLocked(instanceID string) error {
|
||||
if d.natsConn == nil {
|
||||
return nil
|
||||
}
|
||||
subject := fmt.Sprintf("system.TerminateInstance.%s", instanceID)
|
||||
if _, exists := d.natsSubscriptions[subject]; exists {
|
||||
return nil
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/mulgadc/spinifex/spinifex/awserrors"
|
||||
handlers_ec2_placementgroup "github.com/mulgadc/spinifex/spinifex/handlers/ec2/placementgroup"
|
||||
"github.com/mulgadc/spinifex/spinifex/network/topology"
|
||||
"github.com/mulgadc/spinifex/spinifex/tags"
|
||||
"github.com/mulgadc/spinifex/spinifex/types"
|
||||
"github.com/mulgadc/spinifex/spinifex/utils"
|
||||
"github.com/mulgadc/spinifex/spinifex/vm"
|
||||
@@ -398,6 +399,19 @@ func (d *Daemon) onInstanceUpHook() func(*vm.VM) error {
|
||||
}
|
||||
d.natsSubscriptions[consoleSubKey] = consoleSub
|
||||
|
||||
// Re-arm the per-instance terminate subscription for system-managed VMs
|
||||
// (ELBv2 load balancers). The launch handler binds it at first launch,
|
||||
// but it is lost across a daemon restart; OnInstanceUp fires on both the
|
||||
// relaunch and the reconnect-to-surviving-QEMU recovery paths, so without
|
||||
// this system.TerminateInstance.{id} has no responder and the VM can
|
||||
// never be torn down (SetSubnets relaunch, DeleteLoadBalancer).
|
||||
if instance.ManagedBy == tags.ManagedByELBv2 {
|
||||
if subErr := d.subscribeSystemTerminateLocked(instance.ID); subErr != nil {
|
||||
slog.Error("OnInstanceUp: failed to re-arm system terminate subscription",
|
||||
"instanceId", instance.ID, "err", subErr)
|
||||
}
|
||||
}
|
||||
|
||||
// Re-claim GPU(s) after a daemon restart with a still-running QEMU
|
||||
// process: the manager's reconnect path fires OnInstanceUp without
|
||||
// going through the handler-side Claim, so the GPU pool would
|
||||
@@ -469,6 +483,16 @@ func (d *Daemon) onInstanceDownHook() func(string) {
|
||||
}
|
||||
delete(d.natsSubscriptions, consoleSubKey)
|
||||
}
|
||||
// Drop the system terminate subscription (system VMs only; a no-op for
|
||||
// regular instances that never registered one).
|
||||
terminateSubKey := fmt.Sprintf("system.TerminateInstance.%s", instanceID)
|
||||
if sub, ok := d.natsSubscriptions[terminateSubKey]; ok {
|
||||
if err := sub.Unsubscribe(); err != nil {
|
||||
slog.Error("OnInstanceDown: failed to unsubscribe system terminate topic",
|
||||
"instanceId", instanceID, "err", err)
|
||||
}
|
||||
delete(d.natsSubscriptions, terminateSubKey)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,45 @@ func TestOnInstanceUpHook_RegistersBothPerInstanceTopics(t *testing.T) {
|
||||
assert.Equal(t, "ec2.i-up-basic.GetConsoleOutput", consoleSub.Subject)
|
||||
}
|
||||
|
||||
func TestOnInstanceUpHook_ReArmsSystemTerminateForELBv2(t *testing.T) {
|
||||
d, _ := newHookTestDaemon(t)
|
||||
instance := &vm.VM{ID: "i-up-sys", ManagedBy: tags.ManagedByELBv2}
|
||||
|
||||
require.NoError(t, d.onInstanceUpHook()(instance))
|
||||
|
||||
// OnInstanceUp fires on both the relaunch and reconnect recovery paths, so
|
||||
// the terminate subject must be re-bound or the recovered LB VM can never
|
||||
// be torn down (SetSubnets relaunch, DeleteLoadBalancer).
|
||||
sub, ok := d.natsSubscriptions["system.TerminateInstance.i-up-sys"]
|
||||
require.True(t, ok, "system terminate subscription must be re-armed for ELBv2 VMs")
|
||||
assert.Equal(t, "system.TerminateInstance.i-up-sys", sub.Subject)
|
||||
}
|
||||
|
||||
func TestOnInstanceUpHook_NoSystemTerminateForRegularInstance(t *testing.T) {
|
||||
d, _ := newHookTestDaemon(t)
|
||||
instance := &vm.VM{ID: "i-up-regular"}
|
||||
|
||||
require.NoError(t, d.onInstanceUpHook()(instance))
|
||||
|
||||
_, ok := d.natsSubscriptions["system.TerminateInstance.i-up-regular"]
|
||||
assert.False(t, ok, "regular instances must not register a system terminate subscription")
|
||||
}
|
||||
|
||||
func TestOnInstanceDownHook_DropsSystemTerminateSubscription(t *testing.T) {
|
||||
d, _ := newHookTestDaemon(t)
|
||||
instance := &vm.VM{ID: "i-down-sys", ManagedBy: tags.ManagedByELBv2}
|
||||
|
||||
require.NoError(t, d.onInstanceUpHook()(instance))
|
||||
termSub := d.natsSubscriptions["system.TerminateInstance.i-down-sys"]
|
||||
require.NotNil(t, termSub)
|
||||
|
||||
d.onInstanceDownHook()(instance.ID)
|
||||
|
||||
_, present := d.natsSubscriptions["system.TerminateInstance.i-down-sys"]
|
||||
assert.False(t, present, "system terminate sub must be deleted from map")
|
||||
assert.False(t, termSub.IsValid(), "system terminate sub must be unsubscribed")
|
||||
}
|
||||
|
||||
func TestOnInstanceUpHook_ReplacesExistingSubsOnDoubleUp(t *testing.T) {
|
||||
d, _ := newHookTestDaemon(t)
|
||||
instance := &vm.VM{ID: "i-up-twice"}
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"io"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/aws/aws-sdk-go/private/protocol/json/jsonutil"
|
||||
"github.com/mulgadc/spinifex/spinifex/awserrors"
|
||||
@@ -28,11 +29,18 @@ type EKSJSONError struct {
|
||||
}
|
||||
|
||||
// GenerateEKSErrorResponse marshals the AWS REST-JSON error envelope.
|
||||
// The trailing "Exception" suffix matches the convention AWS uses
|
||||
// (e.g. ResourceNotFoundException, InvalidParameterException).
|
||||
// The wire __type carries the trailing "Exception" suffix AWS uses
|
||||
// (e.g. ResourceNotFoundException, InvalidParameterException). The suffix is
|
||||
// appended idempotently: many awserrors codes already end in "Exception"
|
||||
// (e.g. ErrorEKSResourceNotFound = "ResourceNotFoundException"), and adding a
|
||||
// second would emit ResourceNotFoundExceptionException, which SDK clients
|
||||
// reject when matching eks.ErrCodeResourceNotFoundException.
|
||||
func GenerateEKSErrorResponse(code, message string) []byte {
|
||||
if !strings.HasSuffix(code, "Exception") {
|
||||
code += "Exception"
|
||||
}
|
||||
body, err := json.Marshal(EKSJSONError{
|
||||
Type: code + "Exception",
|
||||
Type: code,
|
||||
Message: message,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -21,6 +21,16 @@ func TestGenerateEKSErrorResponse_ShapesExceptionSuffix(t *testing.T) {
|
||||
assert.Equal(t, "Cluster does not exist", env.Message)
|
||||
}
|
||||
|
||||
// Codes that already carry the "Exception" suffix (e.g.
|
||||
// awserrors.ErrorEKSResourceNotFound = "ResourceNotFoundException") must not be
|
||||
// doubled into ResourceNotFoundExceptionException, which SDK clients reject.
|
||||
func TestGenerateEKSErrorResponse_DoesNotDoubleExceptionSuffix(t *testing.T) {
|
||||
body := GenerateEKSErrorResponse("ResourceNotFoundException", "Cluster does not exist")
|
||||
var env EKSJSONError
|
||||
require.NoError(t, json.Unmarshal(body, &env))
|
||||
assert.Equal(t, eks.ErrCodeResourceNotFoundException, env.Type)
|
||||
}
|
||||
|
||||
func TestWriteJSONError_SetsContentTypeAndStatus(t *testing.T) {
|
||||
w := httptest.NewRecorder()
|
||||
WriteJSONError(w, "NotImplemented", "Operation not implemented", http.StatusNotImplemented)
|
||||
|
||||
@@ -132,6 +132,9 @@ var elbv2Actions = map[string]ELBv2Handler{
|
||||
"SetIpAddressType": elbv2Handler(func(input *elbv2.SetIpAddressTypeInput, gw *GatewayConfig, accountID string) (any, error) {
|
||||
return gateway_elbv2.SetIpAddressType(input, gw.NATSConn, accountID)
|
||||
}),
|
||||
"SetSubnets": elbv2Handler(func(input *elbv2.SetSubnetsInput, gw *GatewayConfig, accountID string) (any, error) {
|
||||
return gateway_elbv2.SetSubnets(input, gw.NATSConn, accountID)
|
||||
}),
|
||||
"AddListenerCertificates": elbv2Handler(func(input *elbv2.AddListenerCertificatesInput, gw *GatewayConfig, accountID string) (any, error) {
|
||||
return gateway_elbv2.AddListenerCertificates(input, gw.NATSConn, accountID)
|
||||
}),
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package gateway_elbv2
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/aws/aws-sdk-go/service/elbv2"
|
||||
"github.com/mulgadc/spinifex/spinifex/awserrors"
|
||||
handlers_elbv2 "github.com/mulgadc/spinifex/spinifex/handlers/elbv2"
|
||||
"github.com/nats-io/nats.go"
|
||||
)
|
||||
|
||||
// SetSubnets handles the ELBv2 SetSubnets API call. It enables the subnets (and
|
||||
// their backing ENIs) for the load balancer, adding and removing them to match
|
||||
// the request.
|
||||
func SetSubnets(input *elbv2.SetSubnetsInput, natsConn *nats.Conn, accountID string) (elbv2.SetSubnetsOutput, error) {
|
||||
var output elbv2.SetSubnetsOutput
|
||||
|
||||
if input == nil || input.LoadBalancerArn == nil || *input.LoadBalancerArn == "" {
|
||||
return output, errors.New(awserrors.ErrorMissingParameter)
|
||||
}
|
||||
if len(input.Subnets) == 0 && len(input.SubnetMappings) == 0 {
|
||||
return output, errors.New(awserrors.ErrorMissingParameter)
|
||||
}
|
||||
|
||||
svc := handlers_elbv2.NewNATSELBv2Service(natsConn)
|
||||
result, err := svc.SetSubnets(input, accountID)
|
||||
if err != nil {
|
||||
return output, err
|
||||
}
|
||||
|
||||
return *result, nil
|
||||
}
|
||||
@@ -56,6 +56,7 @@ func TestELBv2ActionsMap_AllActionsRegistered(t *testing.T) {
|
||||
"RemoveTags",
|
||||
"SetSecurityGroups",
|
||||
"SetIpAddressType",
|
||||
"SetSubnets",
|
||||
"LBAgentHeartbeat",
|
||||
"GetLBConfig",
|
||||
"ModifyTargetGroupAttributes",
|
||||
|
||||
@@ -76,6 +76,7 @@ var supportedServices = map[string]bool{
|
||||
"elasticloadbalancing": true,
|
||||
"eks": true,
|
||||
"acm": true,
|
||||
"tagging": true,
|
||||
"spinifex": true,
|
||||
}
|
||||
|
||||
@@ -326,6 +327,8 @@ func (gw *GatewayConfig) Request(w http.ResponseWriter, r *http.Request) {
|
||||
err = gw.EKS_Request(w, r)
|
||||
case "acm":
|
||||
err = gw.ACM_Request(w, r)
|
||||
case "tagging":
|
||||
err = gw.Tagging_Request(w, r)
|
||||
case "spinifex":
|
||||
err = gw.Spinifex_Request(w, r)
|
||||
default:
|
||||
@@ -478,10 +481,10 @@ func (gw *GatewayConfig) ErrorHandler(w http.ResponseWriter, r *http.Request, er
|
||||
errorMsg.HTTPCode = 500
|
||||
}
|
||||
|
||||
// EKS and ACM both use the AWS JSON 1.1 error envelope
|
||||
// ({"__type":"<Code>Exception","message":...}, Content-Type
|
||||
// EKS, ACM, and the Resource Groups Tagging API all use the AWS JSON 1.1
|
||||
// error envelope ({"__type":"<Code>Exception","message":...}, Content-Type
|
||||
// application/x-amz-json-1.1). Query/XML services fall through below.
|
||||
if svc == "eks" || svc == "acm" {
|
||||
if svc == "eks" || svc == "acm" || svc == "tagging" {
|
||||
body := GenerateEKSErrorResponse(err.Error(), errorMsg.Message, requestId)
|
||||
slog.Debug("Generated JSON error response", "service", svc, "error", err.Error(), "json", string(body), "requestId", requestId)
|
||||
w.Header().Set("Content-Type", eksJSONContentType)
|
||||
|
||||
@@ -508,6 +508,11 @@ func TestGetService(t *testing.T) {
|
||||
ctxVal: "account",
|
||||
wantSvc: "account",
|
||||
},
|
||||
{
|
||||
name: "tagging service",
|
||||
ctxVal: "tagging",
|
||||
wantSvc: "tagging",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package gateway
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/mulgadc/spinifex/spinifex/awserrors"
|
||||
gateway_tagging "github.com/mulgadc/spinifex/spinifex/gateway/tagging"
|
||||
)
|
||||
|
||||
// taggingHandler invokes a per-action Resource Groups Tagging API function: it
|
||||
// receives the parent gateway config, the caller's accountID, and the raw JSON
|
||||
// request body, and returns a typed *resourcegroupstaggingapi.<X>Output (as
|
||||
// any) or an error whose Error() is an awserrors code.
|
||||
type taggingHandler func(gw *GatewayConfig, accountID string, body []byte) (any, error)
|
||||
|
||||
// taggingActions maps a tagging action (the suffix of the X-Amz-Target header)
|
||||
// to its handler. The Resource Groups Tagging API speaks AWS JSON 1.1: the
|
||||
// action is carried in "X-Amz-Target: ResourceGroupsTaggingAPI_20170126.<Action>".
|
||||
var taggingActions = map[string]taggingHandler{
|
||||
"GetResources": func(gw *GatewayConfig, acct string, b []byte) (any, error) {
|
||||
return gateway_tagging.GetResources(gw.NATSConn, gw.Region, acct, b)
|
||||
},
|
||||
}
|
||||
|
||||
// taggingActionFromTarget extracts the bare action name from an X-Amz-Target
|
||||
// header value of the form "ResourceGroupsTaggingAPI_20170126.<Action>".
|
||||
func taggingActionFromTarget(target string) string {
|
||||
if i := strings.LastIndex(target, "."); i >= 0 {
|
||||
return target[i+1:]
|
||||
}
|
||||
return target
|
||||
}
|
||||
|
||||
// Tagging_Request dispatches AWS JSON 1.1 Resource Groups Tagging API requests.
|
||||
// The action is read from the X-Amz-Target header; the body is the JSON-encoded
|
||||
// operation input. Errors are returned as plain awserrors codes; the caller
|
||||
// (gateway.Request) routes them through ErrorHandler, which emits the JSON
|
||||
// error envelope.
|
||||
func (gw *GatewayConfig) Tagging_Request(w http.ResponseWriter, r *http.Request) error {
|
||||
action := taggingActionFromTarget(r.Header.Get("X-Amz-Target"))
|
||||
if action == "" {
|
||||
return errors.New(awserrors.ErrorMissingAction)
|
||||
}
|
||||
|
||||
handler, ok := taggingActions[action]
|
||||
if !ok {
|
||||
slog.Debug("tagging: unknown action", "action", action)
|
||||
return errors.New(awserrors.ErrorInvalidAction)
|
||||
}
|
||||
|
||||
if err := gw.checkPolicy(r, "tagging", action); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if gw.NATSConn == nil {
|
||||
return errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
|
||||
accountID, _ := r.Context().Value(ctxAccountID).(string)
|
||||
if accountID == "" {
|
||||
slog.Error("Tagging_Request: no account ID in auth context")
|
||||
return errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
|
||||
body, err := io.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
slog.Error("Tagging_Request: failed to read body", "err", err)
|
||||
return errors.New(awserrors.ErrorInvalidParameterValue)
|
||||
}
|
||||
|
||||
output, err := handler(gw, accountID, body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
gateway_tagging.WriteJSONResponse(w, output)
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,334 @@
|
||||
package gateway_tagging
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
"github.com/aws/aws-sdk-go/service/elbv2"
|
||||
rgt "github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi"
|
||||
"github.com/mulgadc/spinifex/spinifex/awserrors"
|
||||
handlers_ec2_tags "github.com/mulgadc/spinifex/spinifex/handlers/ec2/tags"
|
||||
handlers_elbv2 "github.com/mulgadc/spinifex/spinifex/handlers/elbv2"
|
||||
"github.com/nats-io/nats.go"
|
||||
)
|
||||
|
||||
// describeTagsBatchSize is the AWS ceiling on ARNs per ELBv2 DescribeTags call.
|
||||
const describeTagsBatchSize = 20
|
||||
|
||||
// defaultResourcesPerPage caps a page when the caller omits ResourcesPerPage.
|
||||
// AWS allows up to 100; matching that keeps the controller's reconcile fast.
|
||||
const defaultResourcesPerPage = 100
|
||||
|
||||
// resourceLister fetches an account's tagged resources by family, already
|
||||
// shaped as RGT mappings. Splitting the fetch out of getResources keeps the
|
||||
// filter/sort/paginate orchestration testable without a live NATS backend.
|
||||
type resourceLister interface {
|
||||
listELBv2(typeFilters map[string]bool) ([]*rgt.ResourceTagMapping, error)
|
||||
listEC2(typeFilters map[string]bool) ([]*rgt.ResourceTagMapping, error)
|
||||
}
|
||||
|
||||
// GetResources implements the Resource Groups Tagging API GetResources call by
|
||||
// aggregating tagged ELBv2 (load balancers + target groups) and EC2 resources
|
||||
// for the account, applying the request's resource-type and tag filters. The
|
||||
// aws-load-balancer-controller uses this to discover and adopt the resources it
|
||||
// manages (filtering on its cluster/stack tags). Pagination is an opaque
|
||||
// integer offset into a deterministically ARN-sorted result set.
|
||||
func GetResources(natsConn *nats.Conn, region, accountID string, body []byte) (any, error) {
|
||||
return getResources(&natsLister{natsConn: natsConn, region: region, accountID: accountID}, body)
|
||||
}
|
||||
|
||||
// getResources is the protocol-independent core: it parses the request, asks
|
||||
// the lister for the in-scope resource families, then applies tag filters,
|
||||
// stable ordering, and pagination.
|
||||
func getResources(lister resourceLister, body []byte) (any, error) {
|
||||
var input rgt.GetResourcesInput
|
||||
if err := unmarshalIfBody(body, &input); err != nil {
|
||||
return nil, errors.New(awserrors.ErrorInvalidParameterValue)
|
||||
}
|
||||
|
||||
typeFilters := lowerStringSlice(input.ResourceTypeFilters)
|
||||
|
||||
var mappings []*rgt.ResourceTagMapping
|
||||
|
||||
elbMappings, err := lister.listELBv2(typeFilters)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mappings = append(mappings, elbMappings...)
|
||||
|
||||
ec2Mappings, err := lister.listEC2(typeFilters)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mappings = append(mappings, ec2Mappings...)
|
||||
|
||||
mappings = filterByTags(mappings, input.TagFilters)
|
||||
|
||||
// Deterministic order so pagination tokens are stable across pages.
|
||||
sort.Slice(mappings, func(i, j int) bool {
|
||||
return aws.StringValue(mappings[i].ResourceARN) < aws.StringValue(mappings[j].ResourceARN)
|
||||
})
|
||||
|
||||
page, next, err := paginate(mappings, input.PaginationToken, input.ResourcesPerPage)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out := &rgt.GetResourcesOutput{ResourceTagMappingList: page}
|
||||
// AWS returns an empty (not absent) token on the last page.
|
||||
out.PaginationToken = aws.String(next)
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// natsLister fetches tagged resources from the elbv2 and ec2 tag stores over
|
||||
// NATS.
|
||||
type natsLister struct {
|
||||
natsConn *nats.Conn
|
||||
region string
|
||||
accountID string
|
||||
}
|
||||
|
||||
func (l *natsLister) listELBv2(typeFilters map[string]bool) ([]*rgt.ResourceTagMapping, error) {
|
||||
return elbv2Resources(l.natsConn, l.accountID, typeFilters)
|
||||
}
|
||||
|
||||
func (l *natsLister) listEC2(typeFilters map[string]bool) ([]*rgt.ResourceTagMapping, error) {
|
||||
svc := handlers_ec2_tags.NewNATSTagsService(l.natsConn)
|
||||
tagsOut, err := svc.DescribeTags(&ec2.DescribeTagsInput{}, l.accountID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return buildEC2Mappings(tagsOut.Tags, l.region, l.accountID, typeFilters), nil
|
||||
}
|
||||
|
||||
// elbv2Resources lists the account's load balancers and target groups (when the
|
||||
// type filters admit them) and attaches their tags via batched DescribeTags.
|
||||
func elbv2Resources(natsConn *nats.Conn, accountID string, typeFilters map[string]bool) ([]*rgt.ResourceTagMapping, error) {
|
||||
wantLB := matchesType(typeFilters, "elasticloadbalancing:loadbalancer")
|
||||
wantTG := matchesType(typeFilters, "elasticloadbalancing:targetgroup")
|
||||
if !wantLB && !wantTG {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
svc := handlers_elbv2.NewNATSELBv2Service(natsConn)
|
||||
var arns []string
|
||||
|
||||
if wantLB {
|
||||
lbs, err := svc.DescribeLoadBalancers(&elbv2.DescribeLoadBalancersInput{}, accountID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, lb := range lbs.LoadBalancers {
|
||||
if lb.LoadBalancerArn != nil {
|
||||
arns = append(arns, *lb.LoadBalancerArn)
|
||||
}
|
||||
}
|
||||
}
|
||||
if wantTG {
|
||||
tgs, err := svc.DescribeTargetGroups(&elbv2.DescribeTargetGroupsInput{}, accountID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, tg := range tgs.TargetGroups {
|
||||
if tg.TargetGroupArn != nil {
|
||||
arns = append(arns, *tg.TargetGroupArn)
|
||||
}
|
||||
}
|
||||
}
|
||||
if len(arns) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
mappings := make([]*rgt.ResourceTagMapping, 0, len(arns))
|
||||
for start := 0; start < len(arns); start += describeTagsBatchSize {
|
||||
end := min(start+describeTagsBatchSize, len(arns))
|
||||
tagsOut, err := svc.DescribeTags(&elbv2.DescribeTagsInput{
|
||||
ResourceArns: aws.StringSlice(arns[start:end]),
|
||||
}, accountID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, td := range tagsOut.TagDescriptions {
|
||||
mappings = append(mappings, &rgt.ResourceTagMapping{
|
||||
ResourceARN: td.ResourceArn,
|
||||
Tags: elbv2TagsToRGT(td.Tags),
|
||||
})
|
||||
}
|
||||
}
|
||||
return mappings, nil
|
||||
}
|
||||
|
||||
// buildEC2Mappings groups EC2 tag descriptions by resource, synthesises an ARN
|
||||
// per resource, and keeps those that pass the type filters. EC2 tags carry a
|
||||
// bare resource ID and a type word (e.g. "subnet"); the RGT type string is
|
||||
// "ec2:<type>". Pure (no NATS) so the grouping/ARN logic is unit-tested.
|
||||
func buildEC2Mappings(tagDescriptions []*ec2.TagDescription, region, accountID string, typeFilters map[string]bool) []*rgt.ResourceTagMapping {
|
||||
type resourceTags struct {
|
||||
fullType string
|
||||
tags map[string]string
|
||||
}
|
||||
byResource := make(map[string]*resourceTags)
|
||||
for _, td := range tagDescriptions {
|
||||
id := aws.StringValue(td.ResourceId)
|
||||
if id == "" {
|
||||
continue
|
||||
}
|
||||
fullType := "ec2:" + aws.StringValue(td.ResourceType)
|
||||
rt := byResource[id]
|
||||
if rt == nil {
|
||||
rt = &resourceTags{fullType: fullType, tags: map[string]string{}}
|
||||
byResource[id] = rt
|
||||
}
|
||||
rt.tags[aws.StringValue(td.Key)] = aws.StringValue(td.Value)
|
||||
}
|
||||
|
||||
var mappings []*rgt.ResourceTagMapping
|
||||
for id, rt := range byResource {
|
||||
if !matchesType(typeFilters, rt.fullType) {
|
||||
continue
|
||||
}
|
||||
mappings = append(mappings, &rgt.ResourceTagMapping{
|
||||
ResourceARN: aws.String(ec2ARN(region, accountID, rt.fullType, id)),
|
||||
Tags: tagMapToRGT(rt.tags),
|
||||
})
|
||||
}
|
||||
return mappings
|
||||
}
|
||||
|
||||
// ec2ARN builds an arn:aws:ec2 ARN for a resource. fullType is "ec2:<type>".
|
||||
func ec2ARN(region, accountID, fullType, id string) string {
|
||||
resourceType := strings.TrimPrefix(fullType, "ec2:")
|
||||
return fmt.Sprintf("arn:aws:ec2:%s:%s:%s/%s", region, accountID, resourceType, id)
|
||||
}
|
||||
|
||||
// matchesType reports whether a resource of fullType (e.g.
|
||||
// "elasticloadbalancing:loadbalancer") passes the request's type filters. An
|
||||
// empty filter set admits everything. A service-only filter ("ec2") admits all
|
||||
// of that service's types; a fully-qualified filter must match exactly.
|
||||
func matchesType(typeFilters map[string]bool, fullType string) bool {
|
||||
if len(typeFilters) == 0 {
|
||||
return true
|
||||
}
|
||||
if typeFilters[fullType] {
|
||||
return true
|
||||
}
|
||||
if svc, _, ok := strings.Cut(fullType, ":"); ok {
|
||||
if typeFilters[svc] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// filterByTags keeps only resources matching every TagFilter (AND across
|
||||
// filters). Within a filter, a non-empty Values list is an OR over values; an
|
||||
// empty Values list matches any value for that key.
|
||||
func filterByTags(mappings []*rgt.ResourceTagMapping, filters []*rgt.TagFilter) []*rgt.ResourceTagMapping {
|
||||
if len(filters) == 0 {
|
||||
return mappings
|
||||
}
|
||||
out := mappings[:0]
|
||||
for _, m := range mappings {
|
||||
if matchesAllTagFilters(m.Tags, filters) {
|
||||
out = append(out, m)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func matchesAllTagFilters(tags []*rgt.Tag, filters []*rgt.TagFilter) bool {
|
||||
tagMap := make(map[string]string, len(tags))
|
||||
for _, t := range tags {
|
||||
tagMap[aws.StringValue(t.Key)] = aws.StringValue(t.Value)
|
||||
}
|
||||
for _, f := range filters {
|
||||
key := aws.StringValue(f.Key)
|
||||
if key == "" {
|
||||
continue
|
||||
}
|
||||
val, ok := tagMap[key]
|
||||
if !ok {
|
||||
return false
|
||||
}
|
||||
if len(f.Values) == 0 {
|
||||
continue
|
||||
}
|
||||
matched := false
|
||||
for _, v := range f.Values {
|
||||
if aws.StringValue(v) == val {
|
||||
matched = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !matched {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// paginate slices an offset-token page out of the sorted mappings and returns
|
||||
// the page plus the next token ("" when exhausted).
|
||||
func paginate(mappings []*rgt.ResourceTagMapping, token *string, perPage *int64) ([]*rgt.ResourceTagMapping, string, error) {
|
||||
start := 0
|
||||
if token != nil && *token != "" {
|
||||
n, err := strconv.Atoi(*token)
|
||||
if err != nil || n < 0 {
|
||||
return nil, "", errors.New(awserrors.ErrorInvalidParameterValue)
|
||||
}
|
||||
start = n
|
||||
}
|
||||
if start > len(mappings) {
|
||||
start = len(mappings)
|
||||
}
|
||||
|
||||
size := defaultResourcesPerPage
|
||||
if perPage != nil && *perPage > 0 {
|
||||
size = int(*perPage)
|
||||
}
|
||||
|
||||
end := start + size
|
||||
if end >= len(mappings) {
|
||||
return mappings[start:], "", nil
|
||||
}
|
||||
return mappings[start:end], strconv.Itoa(end), nil
|
||||
}
|
||||
|
||||
func elbv2TagsToRGT(tags []*elbv2.Tag) []*rgt.Tag {
|
||||
out := make([]*rgt.Tag, 0, len(tags))
|
||||
for _, t := range tags {
|
||||
out = append(out, &rgt.Tag{Key: t.Key, Value: t.Value})
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func tagMapToRGT(tags map[string]string) []*rgt.Tag {
|
||||
keys := make([]string, 0, len(tags))
|
||||
for k := range tags {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
out := make([]*rgt.Tag, 0, len(keys))
|
||||
for _, k := range keys {
|
||||
out = append(out, &rgt.Tag{Key: aws.String(k), Value: aws.String(tags[k])})
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func lowerStringSlice(in []*string) map[string]bool {
|
||||
if len(in) == 0 {
|
||||
return nil
|
||||
}
|
||||
out := make(map[string]bool, len(in))
|
||||
for _, s := range in {
|
||||
if s != nil {
|
||||
out[strings.ToLower(*s)] = true
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
@@ -0,0 +1,231 @@
|
||||
package gateway_tagging
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
rgt "github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// fakeLister returns canned mappings so getResources can be exercised without a
|
||||
// NATS backend.
|
||||
type fakeLister struct {
|
||||
elbv2 []*rgt.ResourceTagMapping
|
||||
ec2 []*rgt.ResourceTagMapping
|
||||
elbv2Err error
|
||||
ec2Err error
|
||||
gotFilter map[string]bool
|
||||
}
|
||||
|
||||
func (f *fakeLister) listELBv2(typeFilters map[string]bool) ([]*rgt.ResourceTagMapping, error) {
|
||||
f.gotFilter = typeFilters
|
||||
return f.elbv2, f.elbv2Err
|
||||
}
|
||||
|
||||
func (f *fakeLister) listEC2(typeFilters map[string]bool) ([]*rgt.ResourceTagMapping, error) {
|
||||
return f.ec2, f.ec2Err
|
||||
}
|
||||
|
||||
func mustJSON(t *testing.T, v any) []byte {
|
||||
t.Helper()
|
||||
b, err := json.Marshal(v)
|
||||
require.NoError(t, err)
|
||||
return b
|
||||
}
|
||||
|
||||
func TestMatchesType(t *testing.T) {
|
||||
// Empty filter set admits everything.
|
||||
assert.True(t, matchesType(nil, "elasticloadbalancing:loadbalancer"))
|
||||
|
||||
exact := map[string]bool{"elasticloadbalancing:loadbalancer": true}
|
||||
assert.True(t, matchesType(exact, "elasticloadbalancing:loadbalancer"))
|
||||
assert.False(t, matchesType(exact, "elasticloadbalancing:targetgroup"))
|
||||
assert.False(t, matchesType(exact, "ec2:subnet"))
|
||||
|
||||
// Service-only filter admits all of that service's types.
|
||||
svcOnly := map[string]bool{"ec2": true}
|
||||
assert.True(t, matchesType(svcOnly, "ec2:subnet"))
|
||||
assert.True(t, matchesType(svcOnly, "ec2:security-group"))
|
||||
assert.False(t, matchesType(svcOnly, "elasticloadbalancing:loadbalancer"))
|
||||
}
|
||||
|
||||
func TestEC2ARN(t *testing.T) {
|
||||
assert.Equal(t,
|
||||
"arn:aws:ec2:us-east-1:123456789012:subnet/subnet-abc",
|
||||
ec2ARN("us-east-1", "123456789012", "ec2:subnet", "subnet-abc"))
|
||||
}
|
||||
|
||||
func mapping(arn string, kv ...string) *rgt.ResourceTagMapping {
|
||||
var tags []*rgt.Tag
|
||||
for i := 0; i+1 < len(kv); i += 2 {
|
||||
tags = append(tags, &rgt.Tag{Key: aws.String(kv[i]), Value: aws.String(kv[i+1])})
|
||||
}
|
||||
return &rgt.ResourceTagMapping{ResourceARN: aws.String(arn), Tags: tags}
|
||||
}
|
||||
|
||||
func tagFilter(key string, values ...string) *rgt.TagFilter {
|
||||
return &rgt.TagFilter{Key: aws.String(key), Values: aws.StringSlice(values)}
|
||||
}
|
||||
|
||||
func TestFilterByTags(t *testing.T) {
|
||||
in := []*rgt.ResourceTagMapping{
|
||||
mapping("arn:a", "elbv2.k8s.aws/cluster", "prod", "env", "live"),
|
||||
mapping("arn:b", "elbv2.k8s.aws/cluster", "dev"),
|
||||
mapping("arn:c", "env", "live"),
|
||||
}
|
||||
|
||||
// No filters: passthrough.
|
||||
assert.Len(t, filterByTags(in, nil), 3)
|
||||
|
||||
// Key-only filter: any value for the key.
|
||||
got := filterByTags(in, []*rgt.TagFilter{tagFilter("elbv2.k8s.aws/cluster")})
|
||||
require.Len(t, got, 2)
|
||||
|
||||
// Key+value filter: exact value match (OR over values).
|
||||
got = filterByTags(in, []*rgt.TagFilter{tagFilter("elbv2.k8s.aws/cluster", "prod", "staging")})
|
||||
require.Len(t, got, 1)
|
||||
assert.Equal(t, "arn:a", aws.StringValue(got[0].ResourceARN))
|
||||
|
||||
// AND across filters.
|
||||
got = filterByTags(in, []*rgt.TagFilter{
|
||||
tagFilter("elbv2.k8s.aws/cluster", "prod"),
|
||||
tagFilter("env", "live"),
|
||||
})
|
||||
require.Len(t, got, 1)
|
||||
assert.Equal(t, "arn:a", aws.StringValue(got[0].ResourceARN))
|
||||
|
||||
// Filter on a key no resource has: empty result.
|
||||
assert.Empty(t, filterByTags(in, []*rgt.TagFilter{tagFilter("missing")}))
|
||||
}
|
||||
|
||||
func TestPaginate(t *testing.T) {
|
||||
all := []*rgt.ResourceTagMapping{
|
||||
mapping("arn:0"), mapping("arn:1"), mapping("arn:2"), mapping("arn:3"), mapping("arn:4"),
|
||||
}
|
||||
|
||||
// First page of 2, expect a next token.
|
||||
page, next, err := paginate(all, nil, aws.Int64(2))
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, page, 2)
|
||||
assert.Equal(t, "2", next)
|
||||
|
||||
// Follow the token to the middle page.
|
||||
page, next, err = paginate(all, aws.String("2"), aws.Int64(2))
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, page, 2)
|
||||
assert.Equal(t, "4", next)
|
||||
|
||||
// Last partial page: no next token.
|
||||
page, next, err = paginate(all, aws.String("4"), aws.Int64(2))
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, page, 1)
|
||||
assert.Equal(t, "", next)
|
||||
|
||||
// Default page size returns everything in one page.
|
||||
page, next, err = paginate(all, nil, nil)
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, page, 5)
|
||||
assert.Equal(t, "", next)
|
||||
|
||||
// Bad token is rejected.
|
||||
_, _, err = paginate(all, aws.String("not-a-number"), nil)
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
func TestGetResources_MergesFiltersSortsPaginates(t *testing.T) {
|
||||
lister := &fakeLister{
|
||||
elbv2: []*rgt.ResourceTagMapping{
|
||||
mapping("arn:elb:c", "elbv2.k8s.aws/cluster", "prod"),
|
||||
mapping("arn:elb:a", "elbv2.k8s.aws/cluster", "dev"),
|
||||
},
|
||||
ec2: []*rgt.ResourceTagMapping{
|
||||
mapping("arn:ec2:b", "elbv2.k8s.aws/cluster", "prod"),
|
||||
},
|
||||
}
|
||||
|
||||
// Tag-filter to prod + page size 1: two matches (arn:ec2:b, arn:elb:c),
|
||||
// ARN-sorted, first page returns arn:ec2:b with a next token.
|
||||
body := mustJSON(t, rgt.GetResourcesInput{
|
||||
TagFilters: []*rgt.TagFilter{tagFilter("elbv2.k8s.aws/cluster", "prod")},
|
||||
ResourcesPerPage: aws.Int64(1),
|
||||
})
|
||||
out, err := getResources(lister, body)
|
||||
require.NoError(t, err)
|
||||
res, ok := out.(*rgt.GetResourcesOutput)
|
||||
require.True(t, ok)
|
||||
require.Len(t, res.ResourceTagMappingList, 1)
|
||||
assert.Equal(t, "arn:ec2:b", aws.StringValue(res.ResourceTagMappingList[0].ResourceARN))
|
||||
assert.Equal(t, "1", aws.StringValue(res.PaginationToken))
|
||||
|
||||
// Follow the token: last page, arn:elb:c, empty token.
|
||||
body = mustJSON(t, rgt.GetResourcesInput{
|
||||
TagFilters: []*rgt.TagFilter{tagFilter("elbv2.k8s.aws/cluster", "prod")},
|
||||
ResourcesPerPage: aws.Int64(1),
|
||||
PaginationToken: aws.String("1"),
|
||||
})
|
||||
out, err = getResources(lister, body)
|
||||
require.NoError(t, err)
|
||||
res, ok = out.(*rgt.GetResourcesOutput)
|
||||
require.True(t, ok)
|
||||
require.Len(t, res.ResourceTagMappingList, 1)
|
||||
assert.Equal(t, "arn:elb:c", aws.StringValue(res.ResourceTagMappingList[0].ResourceARN))
|
||||
assert.Equal(t, "", aws.StringValue(res.PaginationToken))
|
||||
}
|
||||
|
||||
func TestGetResources_ResourceTypeFiltersLowercasedAndPassed(t *testing.T) {
|
||||
lister := &fakeLister{}
|
||||
body := mustJSON(t, rgt.GetResourcesInput{
|
||||
ResourceTypeFilters: aws.StringSlice([]string{"ElasticLoadBalancing:LoadBalancer"}),
|
||||
})
|
||||
_, err := getResources(lister, body)
|
||||
require.NoError(t, err)
|
||||
assert.True(t, lister.gotFilter["elasticloadbalancing:loadbalancer"])
|
||||
}
|
||||
|
||||
func TestGetResources_ListerErrorPropagates(t *testing.T) {
|
||||
lister := &fakeLister{elbv2Err: assert.AnError}
|
||||
_, err := getResources(lister, []byte("{}"))
|
||||
require.ErrorIs(t, err, assert.AnError)
|
||||
}
|
||||
|
||||
func TestGetResources_InvalidBody(t *testing.T) {
|
||||
_, err := getResources(&fakeLister{}, []byte("not-json"))
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
func TestBuildEC2Mappings(t *testing.T) {
|
||||
tags := []*ec2.TagDescription{
|
||||
{ResourceId: aws.String("subnet-1"), ResourceType: aws.String("subnet"), Key: aws.String("Name"), Value: aws.String("a")},
|
||||
{ResourceId: aws.String("subnet-1"), ResourceType: aws.String("subnet"), Key: aws.String("env"), Value: aws.String("prod")},
|
||||
{ResourceId: aws.String("sg-1"), ResourceType: aws.String("security-group"), Key: aws.String("Name"), Value: aws.String("b")},
|
||||
{ResourceId: aws.String(""), ResourceType: aws.String("subnet"), Key: aws.String("skip"), Value: aws.String("me")},
|
||||
}
|
||||
|
||||
// No type filter: both resources, tags merged per resource.
|
||||
all := buildEC2Mappings(tags, "us-east-1", "123456789012", nil)
|
||||
require.Len(t, all, 2)
|
||||
bySubnet := map[string]*rgt.ResourceTagMapping{}
|
||||
for _, m := range all {
|
||||
bySubnet[aws.StringValue(m.ResourceARN)] = m
|
||||
}
|
||||
subnet := bySubnet["arn:aws:ec2:us-east-1:123456789012:subnet/subnet-1"]
|
||||
require.NotNil(t, subnet)
|
||||
assert.Len(t, subnet.Tags, 2)
|
||||
|
||||
// Type filter narrows to subnets only.
|
||||
onlySubnets := buildEC2Mappings(tags, "us-east-1", "123456789012", map[string]bool{"ec2:subnet": true})
|
||||
require.Len(t, onlySubnets, 1)
|
||||
assert.Equal(t, "arn:aws:ec2:us-east-1:123456789012:subnet/subnet-1", aws.StringValue(onlySubnets[0].ResourceARN))
|
||||
}
|
||||
|
||||
func TestTagMapToRGT_SortedDeterministic(t *testing.T) {
|
||||
out := tagMapToRGT(map[string]string{"b": "2", "a": "1", "c": "3"})
|
||||
require.Len(t, out, 3)
|
||||
assert.Equal(t, "a", aws.StringValue(out[0].Key))
|
||||
assert.Equal(t, "b", aws.StringValue(out[1].Key))
|
||||
assert.Equal(t, "c", aws.StringValue(out[2].Key))
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// Package gateway_tagging is the HTTP-side glue between awsgw and the Resource
|
||||
// Groups Tagging API. Like ACM it speaks AWS JSON 1.1 (X-Amz-Target dispatch,
|
||||
// Content-Type application/x-amz-json-1.1). GetResources is answered by
|
||||
// aggregating the elbv2 and ec2 tag stores over NATS — there is no dedicated
|
||||
// tagging store. Error envelopes are emitted centrally by the shared gateway
|
||||
// ErrorHandler.
|
||||
package gateway_tagging
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
|
||||
"github.com/aws/aws-sdk-go/private/protocol/json/jsonutil"
|
||||
"github.com/mulgadc/spinifex/spinifex/awserrors"
|
||||
)
|
||||
|
||||
// JSONContentType is the AWS JSON 1.1 content type tagging clients expect.
|
||||
const JSONContentType = "application/x-amz-json-1.1"
|
||||
|
||||
// WriteJSONResponse serialises obj as a 200 AWS JSON 1.1 response using the
|
||||
// SDK's own marshaler (epoch-seconds timestamps), the same path ACM uses.
|
||||
func WriteJSONResponse(w http.ResponseWriter, obj any) {
|
||||
body, err := jsonutil.BuildJSON(obj)
|
||||
if err != nil {
|
||||
slog.Error("tagging: failed to marshal response JSON", "err", err)
|
||||
http.Error(w, awserrors.ErrorInternalError, http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Type", JSONContentType)
|
||||
w.WriteHeader(http.StatusOK)
|
||||
if _, err := w.Write(body); err != nil {
|
||||
slog.Error("tagging: failed to write response", "err", err)
|
||||
}
|
||||
}
|
||||
|
||||
// unmarshalIfBody decodes body into out only when body is non-empty.
|
||||
func unmarshalIfBody(body []byte, out any) error {
|
||||
if len(body) == 0 {
|
||||
return nil
|
||||
}
|
||||
return json.Unmarshal(body, out)
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package gateway
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/mulgadc/spinifex/spinifex/awserrors"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func setupTaggingRequest(target, body string) *http.Request {
|
||||
req := httptest.NewRequest(http.MethodPost, "/", strings.NewReader(body))
|
||||
if target != "" {
|
||||
req.Header.Set("X-Amz-Target", target)
|
||||
}
|
||||
ctx := context.WithValue(req.Context(), ctxService, "tagging")
|
||||
ctx = context.WithValue(ctx, ctxAccountID, "123456789012")
|
||||
return req.WithContext(ctx)
|
||||
}
|
||||
|
||||
func TestTaggingActionFromTarget(t *testing.T) {
|
||||
assert.Equal(t, "GetResources", taggingActionFromTarget("ResourceGroupsTaggingAPI_20170126.GetResources"))
|
||||
assert.Equal(t, "GetResources", taggingActionFromTarget("GetResources"))
|
||||
assert.Equal(t, "", taggingActionFromTarget(""))
|
||||
}
|
||||
|
||||
func TestTaggingActionsMap_AllActionsRegistered(t *testing.T) {
|
||||
expected := []string{
|
||||
"GetResources",
|
||||
}
|
||||
for _, action := range expected {
|
||||
_, ok := taggingActions[action]
|
||||
assert.True(t, ok, "action %q should be registered in taggingActions", action)
|
||||
}
|
||||
assert.Len(t, taggingActions, len(expected))
|
||||
}
|
||||
|
||||
func TestTaggingRequest_MissingTarget(t *testing.T) {
|
||||
gw := &GatewayConfig{DisableLogging: true}
|
||||
w := httptest.NewRecorder()
|
||||
err := gw.Tagging_Request(w, setupTaggingRequest("", ""))
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, awserrors.ErrorMissingAction, err.Error())
|
||||
}
|
||||
|
||||
func TestTaggingRequest_UnknownAction(t *testing.T) {
|
||||
gw := &GatewayConfig{DisableLogging: true}
|
||||
w := httptest.NewRecorder()
|
||||
err := gw.Tagging_Request(w, setupTaggingRequest("ResourceGroupsTaggingAPI_20170126.TagResources", "{}"))
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, awserrors.ErrorInvalidAction, err.Error())
|
||||
}
|
||||
|
||||
// A known action with no NATS connection passes routing + policy and fails at
|
||||
// the NATS-availability guard.
|
||||
func TestTaggingRequest_KnownActionNoNATS(t *testing.T) {
|
||||
gw := &GatewayConfig{DisableLogging: true}
|
||||
w := httptest.NewRecorder()
|
||||
err := gw.Tagging_Request(w, setupTaggingRequest("ResourceGroupsTaggingAPI_20170126.GetResources", "{}"))
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, awserrors.ErrorServerInternal, err.Error())
|
||||
}
|
||||
@@ -73,6 +73,11 @@ type ClusterMeta struct {
|
||||
// report (server + joined agents). Surfaces nodegroup join/scale progress
|
||||
// without the host needing apiserver reachability.
|
||||
NodeCount int `json:"nodeCount,omitempty"`
|
||||
// BuiltinIngress records whether the cluster opted into K3s' bundled
|
||||
// traefik + servicelb (dev / interim in-VPC app exposure), derived from the
|
||||
// managed-ingress tag at CreateCluster. Default false = AWS parity (built-ins
|
||||
// disabled; ingress via the AWS Load Balancer Controller).
|
||||
BuiltinIngress bool `json:"builtinIngress,omitempty"`
|
||||
}
|
||||
|
||||
// ErrClusterNotFound is returned by GetClusterMeta / SetClusterStatus /
|
||||
|
||||
@@ -24,6 +24,30 @@ func createInput(name string) *eks.CreateClusterInput {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateCluster_BuiltinIngressDefaultsOff(t *testing.T) {
|
||||
f := newEKSServiceFixture(t)
|
||||
|
||||
_, err := f.svc.CreateCluster(createInput("alpha"), testAccountID, "")
|
||||
require.NoError(t, err)
|
||||
|
||||
meta, err := GetClusterMeta(f.kv, "alpha")
|
||||
require.NoError(t, err)
|
||||
assert.False(t, meta.BuiltinIngress, "parity default: built-in ingress off")
|
||||
}
|
||||
|
||||
func TestCreateCluster_BuiltinIngressFromTag(t *testing.T) {
|
||||
f := newEKSServiceFixture(t)
|
||||
|
||||
in := createInput("alpha")
|
||||
in.Tags = map[string]*string{managedIngressTagKey: aws.String("true")}
|
||||
_, err := f.svc.CreateCluster(in, testAccountID, "")
|
||||
require.NoError(t, err)
|
||||
|
||||
meta, err := GetClusterMeta(f.kv, "alpha")
|
||||
require.NoError(t, err)
|
||||
assert.True(t, meta.BuiltinIngress, "managed-ingress tag opts into built-in ingress")
|
||||
}
|
||||
|
||||
// A create that fails after the NLB is provisioned must leave the NLB ARNs
|
||||
// persisted on the (now FAILED) meta, otherwise the resources leak with no
|
||||
// owning record and DeleteCluster cannot reclaim them (bead 165.3).
|
||||
|
||||
@@ -132,6 +132,11 @@ type K3sServerInput struct {
|
||||
SecretKey string
|
||||
GatewayCACert string
|
||||
InstanceType string
|
||||
// BuiltinIngress keeps K3s' bundled traefik + servicelb enabled (dev /
|
||||
// interim in-VPC app exposure). Default false disables them for AWS parity,
|
||||
// where Service type=LoadBalancer / Ingress are satisfied by the AWS Load
|
||||
// Balancer Controller instead.
|
||||
BuiltinIngress bool
|
||||
}
|
||||
|
||||
// K3sServerOutput carries the identifiers the caller needs to persist into
|
||||
@@ -405,23 +410,34 @@ func buildK3sUserData(in K3sServerInput) string {
|
||||
// probes https://<NLB>/healthz anonymously to gate ACTIVE, so it must be
|
||||
// reachable; the default RBAC binds only the health/version non-resource
|
||||
// paths to system:unauthenticated, so this exposes nothing else.
|
||||
k3sConfig := strings.Join([]string{
|
||||
// In real EKS neither traefik nor servicelb exists; Service type=LoadBalancer
|
||||
// and Ingress are reconciled by the AWS Load Balancer Controller. Disable the
|
||||
// K3s built-ins by default for parity. A cluster opted into built-in ingress
|
||||
// (dev / interim) keeps them so apps are reachable in-VPC before the
|
||||
// controller add-on lands.
|
||||
configLines := []string{
|
||||
"cluster-init: true",
|
||||
"etcd-expose-metrics: true",
|
||||
}
|
||||
if !in.BuiltinIngress {
|
||||
configLines = append(configLines, "disable:", " - traefik", " - servicelb")
|
||||
}
|
||||
configLines = append(configLines,
|
||||
"tls-san:",
|
||||
" - " + in.NLBDNS,
|
||||
" - "+in.NLBDNS,
|
||||
"kube-apiserver-arg:",
|
||||
" - service-account-key-file=" + k3sOIDCPublicKeyPath,
|
||||
" - service-account-signing-key-file=" + k3sOIDCSigningKeyPath,
|
||||
" - service-account-issuer=" + in.OIDCIssuer,
|
||||
" - service-account-key-file="+k3sOIDCPublicKeyPath,
|
||||
" - service-account-signing-key-file="+k3sOIDCSigningKeyPath,
|
||||
" - service-account-issuer="+in.OIDCIssuer,
|
||||
" - api-audiences=sts.amazonaws.com",
|
||||
" - anonymous-auth=true",
|
||||
" - authentication-token-webhook-config-file=" + k3sTokenWebhookKubeconfigPath,
|
||||
" - authentication-token-webhook-config-file="+k3sTokenWebhookKubeconfigPath,
|
||||
" - authentication-token-webhook-cache-ttl=5m",
|
||||
// Pin v1 so the apiserver decodes the webhook's authentication.k8s.io/v1
|
||||
// TokenReview response; the default v1beta1 rejects the GVK mismatch (401).
|
||||
" - authentication-token-webhook-version=v1",
|
||||
}, "\n")
|
||||
)
|
||||
k3sConfig := strings.Join(configLines, "\n")
|
||||
|
||||
files := []userDataFile{
|
||||
// first-boot.env carries the system SigV4 secret key, so keep it
|
||||
|
||||
@@ -291,6 +291,11 @@ func TestLaunchK3sServerVM_UserDataContainsAllArtifacts(t *testing.T) {
|
||||
assert.Contains(t, udata, "FAKEPUB")
|
||||
|
||||
assert.Contains(t, udata, "path: "+k3sConfigPath)
|
||||
// Parity default (BuiltinIngress=false): K3s' bundled traefik + servicelb are
|
||||
// disabled; Service type=LoadBalancer / Ingress are the AWS LB Controller's job.
|
||||
assert.Contains(t, udata, "disable:")
|
||||
assert.Contains(t, udata, " - traefik")
|
||||
assert.Contains(t, udata, " - servicelb")
|
||||
assert.Contains(t, udata, "tls-san:")
|
||||
assert.Contains(t, udata, " - eks-alpha-lb-001.us-east-1.elb.spinifex.local")
|
||||
// service-account-key-file must point at the PUBLIC key; the signing key
|
||||
@@ -325,6 +330,22 @@ func TestLaunchK3sServerVM_UserDataContainsAllArtifacts(t *testing.T) {
|
||||
assert.Equal(t, 1, strings.Count(udata, "\nruncmd:"))
|
||||
}
|
||||
|
||||
func TestLaunchK3sServerVM_BuiltinIngressOptInKeepsK3sDefaults(t *testing.T) {
|
||||
vpc, inst, ami := &fakeK3sVPC{}, &fakeK3sInst{}, &fakeK3sAMI{}
|
||||
|
||||
in := validK3sInput()
|
||||
in.BuiltinIngress = true
|
||||
_, err := LaunchK3sServerVM(vpc, inst, ami, in)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, inst.launchCalls, 1)
|
||||
|
||||
udata := inst.launchCalls[0].UserData
|
||||
// Opted in: leave K3s' traefik + servicelb running, so no disable block.
|
||||
assert.NotContains(t, udata, "disable:")
|
||||
assert.NotContains(t, udata, "- traefik")
|
||||
assert.NotContains(t, udata, "- servicelb")
|
||||
}
|
||||
|
||||
func TestLaunchK3sServerVM_UsesEmbeddedEtcd(t *testing.T) {
|
||||
vpc, inst, ami := &fakeK3sVPC{}, &fakeK3sInst{}, &fakeK3sAMI{}
|
||||
|
||||
|
||||
@@ -274,6 +274,18 @@ func logCreateErr(name, accountID, stage string, err error) error {
|
||||
return fmt.Errorf("%s: %w", stage, err)
|
||||
}
|
||||
|
||||
// managedIngressTagKey is the CreateCluster tag that opts a cluster into K3s'
|
||||
// bundled traefik + servicelb (dev / interim in-VPC app exposure). Value "true"
|
||||
// (case-insensitive) enables it; absent or any other value keeps AWS parity
|
||||
// (built-ins disabled, ingress via the AWS Load Balancer Controller).
|
||||
const managedIngressTagKey = "spinifex.io/managed-ingress"
|
||||
|
||||
// builtinIngressEnabled reports whether the CreateCluster tags opt into the K3s
|
||||
// built-in ingress stack.
|
||||
func builtinIngressEnabled(tags map[string]*string) bool {
|
||||
return strings.EqualFold(aws.StringValue(tags[managedIngressTagKey]), "true")
|
||||
}
|
||||
|
||||
func (s *EKSServiceImpl) CreateCluster(input *eks.CreateClusterInput, accountID, callerPrincipalARN string) (*eks.CreateClusterOutput, error) {
|
||||
if err := s.requireOrchestrationDeps("CreateCluster"); err != nil {
|
||||
return nil, err
|
||||
@@ -337,7 +349,8 @@ func (s *EKSServiceImpl) CreateCluster(input *eks.CreateClusterInput, accountID,
|
||||
SubnetIds: subnetIDs,
|
||||
VpcId: vpcID,
|
||||
},
|
||||
CreatedAt: time.Now().UTC(),
|
||||
BuiltinIngress: builtinIngressEnabled(input.Tags),
|
||||
CreatedAt: time.Now().UTC(),
|
||||
}
|
||||
if err := PutClusterMeta(acctKV, meta); err != nil {
|
||||
return nil, logCreateErr(name, accountID, "persist initial meta", err)
|
||||
@@ -401,6 +414,7 @@ func (s *EKSServiceImpl) CreateCluster(input *eks.CreateClusterInput, accountID,
|
||||
AccessKey: s.deps.SystemAccessKey,
|
||||
SecretKey: s.deps.SystemSecretKey,
|
||||
GatewayCACert: s.deps.GatewayCACert,
|
||||
BuiltinIngress: meta.BuiltinIngress,
|
||||
})
|
||||
if err != nil {
|
||||
s.markFailed(acctKV, name)
|
||||
|
||||
@@ -11,6 +11,7 @@ type ELBv2Service interface {
|
||||
DescribeLoadBalancerAttributes(input *elbv2.DescribeLoadBalancerAttributesInput, accountID string) (*elbv2.DescribeLoadBalancerAttributesOutput, error)
|
||||
SetSecurityGroups(input *elbv2.SetSecurityGroupsInput, accountID string) (*elbv2.SetSecurityGroupsOutput, error)
|
||||
SetIpAddressType(input *elbv2.SetIpAddressTypeInput, accountID string) (*elbv2.SetIpAddressTypeOutput, error)
|
||||
SetSubnets(input *elbv2.SetSubnetsInput, accountID string) (*elbv2.SetSubnetsOutput, error)
|
||||
|
||||
CreateTargetGroup(input *elbv2.CreateTargetGroupInput, accountID string) (*elbv2.CreateTargetGroupOutput, error)
|
||||
ModifyTargetGroup(input *elbv2.ModifyTargetGroupInput, accountID string) (*elbv2.ModifyTargetGroupOutput, error)
|
||||
|
||||
@@ -436,6 +436,81 @@ func buildExtraENIInputs(eniIDs []string, eniDetails map[string]*ec2.NetworkInte
|
||||
return extras
|
||||
}
|
||||
|
||||
// lbVMLaunch is the outcome of booting the system VM that backs a load
|
||||
// balancer. failed is true when the VM could not be launched (missing system
|
||||
// credentials or a launcher error) so the caller can mark the LB failed.
|
||||
type lbVMLaunch struct {
|
||||
instanceID string
|
||||
vpcIP string
|
||||
publicIP string
|
||||
hostPorts map[int]int
|
||||
failed bool
|
||||
}
|
||||
|
||||
// launchLBVM boots the system VM backing a load balancer with the given ENI
|
||||
// set. The first ENI is the primary NIC; any additional ENIs are passed as
|
||||
// ExtraENIs so the daemon sets up a tap + QEMU NIC per subnet, giving the LB VM
|
||||
// data-plane presence in every subnet it spans. When no launcher is configured
|
||||
// the call is a no-op (zero value, failed=false) so launcher-less deployments
|
||||
// keep the LB Active. Shared by CreateLoadBalancer and the SetSubnets relaunch.
|
||||
func (s *ELBv2ServiceImpl) launchLBVM(lbID, scheme string, eniIDs, subnets []string, accountID string) lbVMLaunch {
|
||||
var res lbVMLaunch
|
||||
if s.InstanceLauncher == nil || len(eniIDs) == 0 || len(subnets) == 0 {
|
||||
return res
|
||||
}
|
||||
|
||||
eniDetails := s.describeENIs(eniIDs, accountID)
|
||||
primary := eniDetails[eniIDs[0]]
|
||||
primaryIP := ""
|
||||
primaryMAC := ""
|
||||
if primary != nil {
|
||||
primaryIP = aws.StringValue(primary.PrivateIpAddress)
|
||||
primaryMAC = aws.StringValue(primary.MacAddress)
|
||||
}
|
||||
|
||||
extraENIInputs := buildExtraENIInputs(eniIDs, eniDetails)
|
||||
|
||||
if s.GatewayURL == "" || s.SystemAccessKey == "" || s.SystemSecretKey == "" {
|
||||
slog.Error("launchLBVM: system credentials not configured — cannot launch LB VM", "lbId", lbID)
|
||||
res.failed = true
|
||||
return res
|
||||
}
|
||||
|
||||
nics := s.buildMicrovmNICs(primaryIP, primaryMAC, subnets[0], eniIDs[0], scheme, extraENIInputs, accountID)
|
||||
launchInput := &SystemInstanceInput{
|
||||
InstanceType: s.getSystemInstanceType(),
|
||||
SubnetID: subnets[0],
|
||||
ENIID: eniIDs[0],
|
||||
ENIMac: primaryMAC,
|
||||
ENIIP: primaryIP,
|
||||
ExtraENIs: extraENIInputs,
|
||||
Scheme: scheme,
|
||||
AccountID: accountID,
|
||||
NICs: nics,
|
||||
LBAgentEnv: s.buildLBAgentEnv(lbID),
|
||||
CACert: s.CACert,
|
||||
}
|
||||
// Dev-mode only: forward HTTP/HTTPS ports from host for local testing.
|
||||
// In production (VPC networking), traffic reaches the LB VM's VPC IP directly.
|
||||
if s.config != nil && s.config.Daemon.DevNetworking {
|
||||
launchInput.HostfwdPorts = []int{80, 443}
|
||||
}
|
||||
|
||||
out, launchErr := s.InstanceLauncher.LaunchSystemInstance(launchInput)
|
||||
if launchErr != nil {
|
||||
slog.Error("launchLBVM: failed to launch LB VM", "lbId", lbID, "err", launchErr)
|
||||
res.failed = true
|
||||
return res
|
||||
}
|
||||
|
||||
res.instanceID = out.InstanceID
|
||||
res.vpcIP = out.PrivateIP
|
||||
res.publicIP = out.PublicIP
|
||||
res.hostPorts = out.HostfwdMap
|
||||
slog.Info("launchLBVM: LB VM launched", "lbId", lbID, "instanceId", out.InstanceID, "ip", out.PrivateIP, "publicIp", out.PublicIP, "hostfwd", out.HostfwdMap)
|
||||
return res
|
||||
}
|
||||
|
||||
// loadRecoveryLBIndex returns the instanceID->LB map, populated lazily on
|
||||
// first successful call. Errors are not cached: a transient JetStream
|
||||
// failure at startup must not condemn every subsequent recovery candidate
|
||||
@@ -1143,64 +1218,14 @@ func (s *ELBv2ServiceImpl) CreateLoadBalancer(input *elbv2.CreateLoadBalancerInp
|
||||
// The first ENI is the primary NIC; any additional ENIs are passed as
|
||||
// ExtraENIs so the daemon sets up a tap + QEMU NIC for each, giving the
|
||||
// ALB VM data-plane presence in every subnet the LB spans.
|
||||
var albInstanceID string
|
||||
var albVPCIP string
|
||||
var hostPorts map[int]int
|
||||
var launchFailed bool
|
||||
if s.InstanceLauncher != nil && len(eniIDs) > 0 && len(subnets) > 0 {
|
||||
eniDetails := s.describeENIs(eniIDs, accountID)
|
||||
|
||||
primary := eniDetails[eniIDs[0]]
|
||||
primaryIP := ""
|
||||
primaryMAC := ""
|
||||
if primary != nil {
|
||||
primaryIP = aws.StringValue(primary.PrivateIpAddress)
|
||||
primaryMAC = aws.StringValue(primary.MacAddress)
|
||||
}
|
||||
|
||||
extraENIInputs := buildExtraENIInputs(eniIDs, eniDetails)
|
||||
|
||||
var launchInput *SystemInstanceInput
|
||||
if s.GatewayURL == "" || s.SystemAccessKey == "" || s.SystemSecretKey == "" {
|
||||
slog.Error("CreateLoadBalancer: system credentials not configured — cannot launch ALB VM", "lbId", lbID)
|
||||
launchFailed = true
|
||||
} else {
|
||||
nics := s.buildMicrovmNICs(primaryIP, primaryMAC, subnets[0], eniIDs[0], scheme, extraENIInputs, accountID)
|
||||
launchInput = &SystemInstanceInput{
|
||||
InstanceType: s.getSystemInstanceType(),
|
||||
SubnetID: subnets[0],
|
||||
ENIID: eniIDs[0],
|
||||
ENIMac: primaryMAC,
|
||||
ENIIP: primaryIP,
|
||||
ExtraENIs: extraENIInputs,
|
||||
Scheme: scheme,
|
||||
AccountID: accountID,
|
||||
NICs: nics,
|
||||
LBAgentEnv: s.buildLBAgentEnv(lbID),
|
||||
CACert: s.CACert,
|
||||
}
|
||||
}
|
||||
if !launchFailed && launchInput != nil {
|
||||
// Dev-mode only: forward HTTP/HTTPS ports from host for local testing.
|
||||
// In production (VPC networking), traffic reaches the ALB VM's VPC IP directly.
|
||||
if s.config != nil && s.config.Daemon.DevNetworking {
|
||||
launchInput.HostfwdPorts = []int{80, 443}
|
||||
}
|
||||
out, launchErr := s.InstanceLauncher.LaunchSystemInstance(launchInput)
|
||||
if launchErr != nil {
|
||||
slog.Error("CreateLoadBalancer: failed to launch ALB VM", "lbId", lbID, "err", launchErr)
|
||||
launchFailed = true
|
||||
} else {
|
||||
albInstanceID = out.InstanceID
|
||||
albVPCIP = out.PrivateIP
|
||||
hostPorts = out.HostfwdMap
|
||||
// Record public IP on the first AZ entry for internet-facing ALBs.
|
||||
if out.PublicIP != "" && len(availZones) > 0 {
|
||||
availZones[0].PublicIP = out.PublicIP
|
||||
}
|
||||
slog.Info("CreateLoadBalancer: ALB VM launched", "lbId", lbID, "instanceId", albInstanceID, "ip", out.PrivateIP, "publicIp", out.PublicIP, "hostfwd", hostPorts)
|
||||
}
|
||||
}
|
||||
launch := s.launchLBVM(lbID, scheme, eniIDs, subnets, accountID)
|
||||
albInstanceID := launch.instanceID
|
||||
albVPCIP := launch.vpcIP
|
||||
hostPorts := launch.hostPorts
|
||||
launchFailed := launch.failed
|
||||
// Record public IP on the first AZ entry for internet-facing LBs.
|
||||
if launch.publicIP != "" && len(availZones) > 0 {
|
||||
availZones[0].PublicIP = launch.publicIP
|
||||
}
|
||||
|
||||
// ALB starts in provisioning until the agent inside the VM connects and
|
||||
|
||||
@@ -2,6 +2,7 @@ package handlers_elbv2
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
@@ -107,3 +108,266 @@ func (s *ELBv2ServiceImpl) SetSecurityGroups(input *elbv2.SetSecurityGroupsInput
|
||||
SecurityGroupIds: aws.StringSlice(sgs),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// SetSubnets enables the subnets (and their backing ENIs) for a load balancer.
|
||||
// It is a full add+remove: a subnet in the request but not on the LB gets a new
|
||||
// managed ENI; a subnet on the LB but absent from the request has its ENI
|
||||
// removed. The system VM binds its data-plane taps at boot and the launcher
|
||||
// exposes no live ENI hotplug, so the new ENI set is applied by relaunching the
|
||||
// LB VM — a brief data-plane interruption. The record is mutated only after the
|
||||
// new ENIs exist and the VM has been relaunched.
|
||||
func (s *ELBv2ServiceImpl) SetSubnets(input *elbv2.SetSubnetsInput, accountID string) (*elbv2.SetSubnetsOutput, error) {
|
||||
if input == nil || input.LoadBalancerArn == nil || *input.LoadBalancerArn == "" {
|
||||
return nil, errors.New(awserrors.ErrorMissingParameter)
|
||||
}
|
||||
|
||||
desired := desiredSubnetSet(input)
|
||||
if len(desired) == 0 {
|
||||
return nil, errors.New(awserrors.ErrorMissingParameter)
|
||||
}
|
||||
|
||||
lb, err := s.store.GetLoadBalancerByArn(*input.LoadBalancerArn)
|
||||
if err != nil {
|
||||
slog.Error("SetSubnets: failed to get LB", "arn", *input.LoadBalancerArn, "err", err)
|
||||
return nil, errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
if lb == nil || lb.AccountID != accountID {
|
||||
return nil, errors.New(awserrors.ErrorELBv2LoadBalancerNotFound)
|
||||
}
|
||||
|
||||
current := subnetENIMap(lb)
|
||||
desiredSet := make(map[string]bool, len(desired))
|
||||
for _, sn := range desired {
|
||||
desiredSet[sn] = true
|
||||
}
|
||||
|
||||
var toAdd, toRemove []string
|
||||
for _, sn := range desired {
|
||||
if _, ok := current[sn]; !ok {
|
||||
toAdd = append(toAdd, sn)
|
||||
}
|
||||
}
|
||||
for sn := range current {
|
||||
if !desiredSet[sn] {
|
||||
toRemove = append(toRemove, sn)
|
||||
}
|
||||
}
|
||||
|
||||
if len(toAdd) == 0 && len(toRemove) == 0 {
|
||||
return s.setSubnetsOutput(lb), nil // idempotent — no change
|
||||
}
|
||||
|
||||
// Without a VPC service we cannot manage ENIs; record the requested subnet
|
||||
// set so the API stays consistent for launcher-less / test deployments.
|
||||
if s.VPCService == nil {
|
||||
lb.Subnets = desired
|
||||
lb.AvailZones = rebuildAvailZones(desired, lb.AvailZones, nil)
|
||||
if err := s.store.PutLoadBalancer(lb); err != nil {
|
||||
slog.Error("SetSubnets: failed to persist LB", "arn", *input.LoadBalancerArn, "err", err)
|
||||
return nil, errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
return s.setSubnetsOutput(lb), nil
|
||||
}
|
||||
|
||||
// Create ENIs for the added subnets first; roll them back on any failure so
|
||||
// a partial apply never leaks ENIs or mutates the live LB.
|
||||
newENIBySubnet := make(map[string]string, len(toAdd))
|
||||
newAZBySubnet := make(map[string]string, len(toAdd))
|
||||
rollbackNewENIs := func() {
|
||||
for _, created := range newENIBySubnet {
|
||||
if _, delErr := s.VPCService.DeleteNetworkInterface(&ec2.DeleteNetworkInterfaceInput{
|
||||
NetworkInterfaceId: aws.String(created),
|
||||
}, accountID); delErr != nil {
|
||||
slog.Error("SetSubnets: rollback failed to delete ENI", "eni", created, "err", delErr)
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, subnetID := range toAdd {
|
||||
eniID, az, eniErr := s.createLBENI(subnetID, lb, accountID)
|
||||
if eniErr != nil {
|
||||
rollbackNewENIs()
|
||||
slog.Error("SetSubnets: failed to create ENI", "subnet", subnetID, "err", eniErr)
|
||||
return nil, errors.New(awserrors.ErrorELBv2SubnetNotFound)
|
||||
}
|
||||
newENIBySubnet[subnetID] = eniID
|
||||
newAZBySubnet[subnetID] = az
|
||||
}
|
||||
|
||||
// Assemble the new ENI set in desired-subnet order (primary = first subnet).
|
||||
newENIs := make([]string, 0, len(desired))
|
||||
for _, sn := range desired {
|
||||
if eniID, ok := current[sn]; ok {
|
||||
newENIs = append(newENIs, eniID)
|
||||
} else {
|
||||
newENIs = append(newENIs, newENIBySubnet[sn])
|
||||
}
|
||||
}
|
||||
|
||||
// Terminate the LB VM before reshaping its ENI set, then relaunch it on the
|
||||
// new set.
|
||||
if lb.InstanceID != "" && s.InstanceLauncher != nil {
|
||||
if err := s.InstanceLauncher.TerminateSystemInstance(lb.InstanceID); err != nil {
|
||||
rollbackNewENIs()
|
||||
slog.Error("SetSubnets: failed to terminate LB VM for relaunch", "arn", *input.LoadBalancerArn, "instanceId", lb.InstanceID, "err", err)
|
||||
return nil, errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
}
|
||||
|
||||
// TerminateSystemInstance tears down the VM but leaves its ENIs marked
|
||||
// in-use, so detach the existing ENIs explicitly: retained ones must be free
|
||||
// to re-attach to the relaunched VM, and removed ones must be detached before
|
||||
// they can be deleted.
|
||||
for _, eniID := range current {
|
||||
if detachErr := s.VPCService.DetachENI(accountID, eniID); detachErr != nil {
|
||||
slog.Warn("SetSubnets: failed to detach ENI before relaunch", "eni", eniID, "err", detachErr)
|
||||
}
|
||||
}
|
||||
|
||||
// Delete ENIs for removed subnets now that they are detached.
|
||||
for _, sn := range toRemove {
|
||||
eniID := current[sn]
|
||||
if _, delErr := s.VPCService.DeleteNetworkInterface(&ec2.DeleteNetworkInterfaceInput{
|
||||
NetworkInterfaceId: aws.String(eniID),
|
||||
}, accountID); delErr != nil {
|
||||
slog.Error("SetSubnets: failed to delete removed ENI", "subnet", sn, "eni", eniID, "err", delErr)
|
||||
}
|
||||
}
|
||||
|
||||
launch := s.launchLBVM(lb.LoadBalancerID, lb.Scheme, newENIs, desired, accountID)
|
||||
availZones := rebuildAvailZones(desired, lb.AvailZones, newAZBySubnet)
|
||||
if launch.publicIP != "" && len(availZones) > 0 {
|
||||
availZones[0].PublicIP = launch.publicIP
|
||||
}
|
||||
|
||||
lb.Subnets = desired
|
||||
lb.ENIs = newENIs
|
||||
lb.AvailZones = availZones
|
||||
lb.InstanceID = launch.instanceID
|
||||
lb.VPCIP = launch.vpcIP
|
||||
lb.HostPorts = launch.hostPorts
|
||||
lb.State = s.lbStateAfterLaunch(launch, lb.Scheme)
|
||||
|
||||
if err := s.store.PutLoadBalancer(lb); err != nil {
|
||||
slog.Error("SetSubnets: failed to persist LB", "arn", *input.LoadBalancerArn, "err", err)
|
||||
return nil, errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
|
||||
slog.Info("SetSubnets completed", "arn", *input.LoadBalancerArn, "subnets", len(desired), "added", len(toAdd), "removed", len(toRemove), "state", lb.State)
|
||||
return s.setSubnetsOutput(lb), nil
|
||||
}
|
||||
|
||||
// desiredSubnetSet flattens the request's Subnets and SubnetMappings into a
|
||||
// de-duplicated, order-preserving subnet-ID list.
|
||||
func desiredSubnetSet(input *elbv2.SetSubnetsInput) []string {
|
||||
seen := make(map[string]bool)
|
||||
var out []string
|
||||
add := func(sn string) {
|
||||
if sn != "" && !seen[sn] {
|
||||
seen[sn] = true
|
||||
out = append(out, sn)
|
||||
}
|
||||
}
|
||||
for _, sn := range input.Subnets {
|
||||
if sn != nil {
|
||||
add(*sn)
|
||||
}
|
||||
}
|
||||
for _, m := range input.SubnetMappings {
|
||||
if m != nil && m.SubnetId != nil {
|
||||
add(*m.SubnetId)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// subnetENIMap pairs each of the LB's current subnets with its backing ENI.
|
||||
// CreateLoadBalancer and SetSubnets write Subnets and ENIs in lockstep, so the
|
||||
// parallel arrays are authoritative for which ENI lives in which subnet.
|
||||
func subnetENIMap(lb *LoadBalancerRecord) map[string]string {
|
||||
m := make(map[string]string, len(lb.Subnets))
|
||||
for i, sn := range lb.Subnets {
|
||||
if i < len(lb.ENIs) {
|
||||
m[sn] = lb.ENIs[i]
|
||||
}
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
// createLBENI creates a single managed ENI for the LB in the given subnet,
|
||||
// tagged and security-grouped like the create-time ENIs. Returns the ENI ID and
|
||||
// its availability zone.
|
||||
func (s *ELBv2ServiceImpl) createLBENI(subnetID string, lb *LoadBalancerRecord, accountID string) (eniID, az string, err error) {
|
||||
eniIn := &ec2.CreateNetworkInterfaceInput{
|
||||
SubnetId: aws.String(subnetID),
|
||||
Description: aws.String(fmt.Sprintf("ELB %s/%s", lb.Name, lb.LoadBalancerID)),
|
||||
TagSpecifications: []*ec2.TagSpecification{
|
||||
{
|
||||
ResourceType: aws.String("network-interface"),
|
||||
Tags: []*ec2.Tag{
|
||||
{Key: aws.String(elbv2ManagedByTag), Value: aws.String(elbv2ManagedByValue)},
|
||||
{Key: aws.String(elbv2LBTag), Value: aws.String(lb.LoadBalancerArn)},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
if len(lb.SecurityGroups) > 0 {
|
||||
eniIn.Groups = aws.StringSlice(lb.SecurityGroups)
|
||||
}
|
||||
out, err := s.VPCService.CreateNetworkInterface(eniIn, accountID)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
eni := out.NetworkInterface
|
||||
return aws.StringValue(eni.NetworkInterfaceId), aws.StringValue(eni.AvailabilityZone), nil
|
||||
}
|
||||
|
||||
// rebuildAvailZones produces the AvailZoneInfo list for the new subnet set in
|
||||
// order, preserving the existing zone name for retained subnets and using
|
||||
// newAZBySubnet for added ones. PublicIP is cleared — it is re-derived from the
|
||||
// relaunched VM by the caller.
|
||||
func rebuildAvailZones(subnets []string, existing []AvailZoneInfo, newAZBySubnet map[string]string) []AvailZoneInfo {
|
||||
bySubnet := make(map[string]AvailZoneInfo, len(existing))
|
||||
for _, az := range existing {
|
||||
bySubnet[az.SubnetId] = az
|
||||
}
|
||||
out := make([]AvailZoneInfo, 0, len(subnets))
|
||||
for _, sn := range subnets {
|
||||
if az, ok := bySubnet[sn]; ok {
|
||||
out = append(out, AvailZoneInfo{ZoneName: az.ZoneName, SubnetId: sn})
|
||||
continue
|
||||
}
|
||||
out = append(out, AvailZoneInfo{ZoneName: newAZBySubnet[sn], SubnetId: sn})
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// lbStateAfterLaunch mirrors CreateLoadBalancer's post-launch state gate: a VM
|
||||
// that came up enters provisioning until the lb-agent heartbeats; an internal
|
||||
// LB with no mgmt return route is failed loud; a failed launch is failed.
|
||||
func (s *ELBv2ServiceImpl) lbStateAfterLaunch(launch lbVMLaunch, scheme string) string {
|
||||
if launch.instanceID == "" {
|
||||
if launch.failed {
|
||||
return StateFailed
|
||||
}
|
||||
return StateActive
|
||||
}
|
||||
if scheme == SchemeInternal {
|
||||
if gw, tgt := s.resolveMgmtRoute(scheme); gw == "" || tgt == "" {
|
||||
slog.Error("SetSubnets: internal LB has no mgmt return route; marking failed (lb-agent cannot heartbeat AWSGW)",
|
||||
"mgmtBridgeIP", s.MgmtBridgeIP, "advertiseIP", s.AdvertiseIP)
|
||||
return StateFailed
|
||||
}
|
||||
}
|
||||
return StateProvisioning
|
||||
}
|
||||
|
||||
// setSubnetsOutput builds the SetSubnets response from the persisted record,
|
||||
// reusing the SDK availability-zone projection (which surfaces per-AZ private
|
||||
// IPs) so the response matches DescribeLoadBalancers.
|
||||
func (s *ELBv2ServiceImpl) setSubnetsOutput(lb *LoadBalancerRecord) *elbv2.SetSubnetsOutput {
|
||||
sdk := s.lbRecordToSDK(lb)
|
||||
return &elbv2.SetSubnetsOutput{
|
||||
AvailabilityZones: sdk.AvailabilityZones,
|
||||
IpAddressType: aws.String(lb.IPAddressType),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package handlers_elbv2
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
"github.com/aws/aws-sdk-go/service/elbv2"
|
||||
"github.com/mulgadc/spinifex/spinifex/awserrors"
|
||||
handlers_ec2_vpc "github.com/mulgadc/spinifex/spinifex/handlers/ec2/vpc"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -134,3 +137,263 @@ func TestSetSecurityGroups_CrossAccount(t *testing.T) {
|
||||
require.Error(t, err)
|
||||
assert.Contains(t, err.Error(), awserrors.ErrorELBv2LoadBalancerNotFound)
|
||||
}
|
||||
|
||||
// setupSubnetTestService wires a VPC-backed ELBv2 service with a launcher mock
|
||||
// so SetSubnets can exercise ENI create/delete plus the LB-VM relaunch.
|
||||
func setupSubnetTestService(t *testing.T) (*ELBv2ServiceImpl, *handlers_ec2_vpc.VPCServiceImpl, *mockSystemInstanceLauncher) {
|
||||
t.Helper()
|
||||
svc, vpcSvc := setupTestServiceWithVPC(t)
|
||||
mock := &mockSystemInstanceLauncher{
|
||||
launchResult: &SystemInstanceOutput{InstanceID: "i-lb", PrivateIP: "10.0.1.5"},
|
||||
}
|
||||
svc.InstanceLauncher = mock
|
||||
svc.GatewayURL = "https://10.0.0.1:9999"
|
||||
svc.SystemAccessKey = "AKID"
|
||||
svc.SystemSecretKey = "SECRET"
|
||||
return svc, vpcSvc, mock
|
||||
}
|
||||
|
||||
func countManagedENIs(t *testing.T, vpcSvc *handlers_ec2_vpc.VPCServiceImpl) int {
|
||||
t.Helper()
|
||||
out, err := vpcSvc.DescribeNetworkInterfaces(&ec2.DescribeNetworkInterfacesInput{}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
n := 0
|
||||
for _, eni := range out.NetworkInterfaces {
|
||||
if eni.RequesterManaged != nil && *eni.RequesterManaged {
|
||||
n++
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func vpcID(t *testing.T, vpcSvc *handlers_ec2_vpc.VPCServiceImpl) string {
|
||||
t.Helper()
|
||||
vpcs, err := vpcSvc.DescribeVpcs(&ec2.DescribeVpcsInput{}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
require.NotEmpty(t, vpcs.Vpcs)
|
||||
return *vpcs.Vpcs[0].VpcId
|
||||
}
|
||||
|
||||
func TestSetSubnets_AddSubnet(t *testing.T) {
|
||||
svc, vpcSvc, mock := setupSubnetTestService(t)
|
||||
vid := vpcID(t, vpcSvc)
|
||||
sub1 := getTestSubnetID(t, vpcSvc, vid, "10.0.20.0/24", "us-east-1a")
|
||||
sub2 := getTestSubnetID(t, vpcSvc, vid, "10.0.21.0/24", "us-east-1b")
|
||||
|
||||
out, err := svc.CreateLoadBalancer(&elbv2.CreateLoadBalancerInput{
|
||||
Name: aws.String("add-lb"),
|
||||
Subnets: []*string{aws.String(sub1)},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
arn := *out.LoadBalancers[0].LoadBalancerArn
|
||||
require.Equal(t, 1, countManagedENIs(t, vpcSvc))
|
||||
require.Len(t, mock.launchCalls, 1)
|
||||
|
||||
res, err := svc.SetSubnets(&elbv2.SetSubnetsInput{
|
||||
LoadBalancerArn: aws.String(arn),
|
||||
Subnets: []*string{aws.String(sub1), aws.String(sub2)},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, res.AvailabilityZones, 2)
|
||||
|
||||
// New ENI created in sub2; LB VM relaunched on the new set.
|
||||
assert.Equal(t, 2, countManagedENIs(t, vpcSvc))
|
||||
assert.Len(t, mock.terminateCalls, 1)
|
||||
require.Len(t, mock.launchCalls, 2)
|
||||
assert.Len(t, mock.launchCalls[1].ExtraENIs, 1, "relaunch must carry the added subnet as an ExtraENI")
|
||||
|
||||
lb := describeLB(t, svc, arn)
|
||||
assert.ElementsMatch(t, []string{sub1, sub2}, subnetIDsOfLB(lb))
|
||||
}
|
||||
|
||||
func TestSetSubnets_RemoveSubnet(t *testing.T) {
|
||||
svc, vpcSvc, mock := setupSubnetTestService(t)
|
||||
vid := vpcID(t, vpcSvc)
|
||||
sub1 := getTestSubnetID(t, vpcSvc, vid, "10.0.22.0/24", "us-east-1a")
|
||||
sub2 := getTestSubnetID(t, vpcSvc, vid, "10.0.23.0/24", "us-east-1b")
|
||||
|
||||
out, err := svc.CreateLoadBalancer(&elbv2.CreateLoadBalancerInput{
|
||||
Name: aws.String("rm-lb"),
|
||||
Subnets: []*string{aws.String(sub1), aws.String(sub2)},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
arn := *out.LoadBalancers[0].LoadBalancerArn
|
||||
require.Equal(t, 2, countManagedENIs(t, vpcSvc))
|
||||
|
||||
res, err := svc.SetSubnets(&elbv2.SetSubnetsInput{
|
||||
LoadBalancerArn: aws.String(arn),
|
||||
Subnets: []*string{aws.String(sub1)},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, res.AvailabilityZones, 1)
|
||||
|
||||
// sub2's ENI is deleted; only sub1's remains.
|
||||
assert.Equal(t, 1, countManagedENIs(t, vpcSvc))
|
||||
assert.Len(t, mock.terminateCalls, 1)
|
||||
lb := describeLB(t, svc, arn)
|
||||
assert.Equal(t, []string{sub1}, subnetIDsOfLB(lb))
|
||||
}
|
||||
|
||||
func TestSetSubnets_Replace(t *testing.T) {
|
||||
svc, vpcSvc, _ := setupSubnetTestService(t)
|
||||
vid := vpcID(t, vpcSvc)
|
||||
sub1 := getTestSubnetID(t, vpcSvc, vid, "10.0.24.0/24", "us-east-1a")
|
||||
sub2 := getTestSubnetID(t, vpcSvc, vid, "10.0.25.0/24", "us-east-1b")
|
||||
|
||||
out, err := svc.CreateLoadBalancer(&elbv2.CreateLoadBalancerInput{
|
||||
Name: aws.String("swap-lb"),
|
||||
Subnets: []*string{aws.String(sub1)},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
arn := *out.LoadBalancers[0].LoadBalancerArn
|
||||
|
||||
_, err = svc.SetSubnets(&elbv2.SetSubnetsInput{
|
||||
LoadBalancerArn: aws.String(arn),
|
||||
Subnets: []*string{aws.String(sub2)},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
|
||||
// One ENI swapped for another — still a single managed ENI, now in sub2.
|
||||
assert.Equal(t, 1, countManagedENIs(t, vpcSvc))
|
||||
lb := describeLB(t, svc, arn)
|
||||
assert.Equal(t, []string{sub2}, subnetIDsOfLB(lb))
|
||||
}
|
||||
|
||||
func TestSetSubnets_TerminateFailureRollsBackNewENIs(t *testing.T) {
|
||||
svc, vpcSvc, mock := setupSubnetTestService(t)
|
||||
vid := vpcID(t, vpcSvc)
|
||||
sub1 := getTestSubnetID(t, vpcSvc, vid, "10.0.26.0/24", "us-east-1a")
|
||||
sub2 := getTestSubnetID(t, vpcSvc, vid, "10.0.27.0/24", "us-east-1b")
|
||||
|
||||
out, err := svc.CreateLoadBalancer(&elbv2.CreateLoadBalancerInput{
|
||||
Name: aws.String("rollback-lb"),
|
||||
Subnets: []*string{aws.String(sub1)},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
arn := *out.LoadBalancers[0].LoadBalancerArn
|
||||
require.Equal(t, 1, countManagedENIs(t, vpcSvc))
|
||||
|
||||
// Terminate fails mid-relaunch (e.g. owning daemon unreachable). The ENI
|
||||
// created for the added subnet must be rolled back, not leaked.
|
||||
mock.terminateErr = errors.New("no responders available")
|
||||
|
||||
_, err = svc.SetSubnets(&elbv2.SetSubnetsInput{
|
||||
LoadBalancerArn: aws.String(arn),
|
||||
Subnets: []*string{aws.String(sub1), aws.String(sub2)},
|
||||
}, testAccountID)
|
||||
require.Error(t, err)
|
||||
|
||||
// No leak: still the single original ENI; LB record unchanged; no relaunch.
|
||||
assert.Equal(t, 1, countManagedENIs(t, vpcSvc))
|
||||
assert.Len(t, mock.launchCalls, 1)
|
||||
lb := describeLB(t, svc, arn)
|
||||
assert.Equal(t, []string{sub1}, subnetIDsOfLB(lb))
|
||||
}
|
||||
|
||||
func TestSetSubnets_Idempotent(t *testing.T) {
|
||||
svc, vpcSvc, mock := setupSubnetTestService(t)
|
||||
vid := vpcID(t, vpcSvc)
|
||||
sub1 := getTestSubnetID(t, vpcSvc, vid, "10.0.26.0/24", "us-east-1a")
|
||||
|
||||
out, err := svc.CreateLoadBalancer(&elbv2.CreateLoadBalancerInput{
|
||||
Name: aws.String("idem-lb"),
|
||||
Subnets: []*string{aws.String(sub1)},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
arn := *out.LoadBalancers[0].LoadBalancerArn
|
||||
|
||||
_, err = svc.SetSubnets(&elbv2.SetSubnetsInput{
|
||||
LoadBalancerArn: aws.String(arn),
|
||||
Subnets: []*string{aws.String(sub1)},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
|
||||
// No change: no relaunch, no terminate, ENI count unchanged.
|
||||
assert.Equal(t, 1, countManagedENIs(t, vpcSvc))
|
||||
assert.Empty(t, mock.terminateCalls)
|
||||
assert.Len(t, mock.launchCalls, 1)
|
||||
}
|
||||
|
||||
func TestSetSubnets_SubnetMappings(t *testing.T) {
|
||||
svc, vpcSvc, _ := setupSubnetTestService(t)
|
||||
vid := vpcID(t, vpcSvc)
|
||||
sub1 := getTestSubnetID(t, vpcSvc, vid, "10.0.27.0/24", "us-east-1a")
|
||||
sub2 := getTestSubnetID(t, vpcSvc, vid, "10.0.28.0/24", "us-east-1b")
|
||||
|
||||
out, err := svc.CreateLoadBalancer(&elbv2.CreateLoadBalancerInput{
|
||||
Name: aws.String("mapping-lb"),
|
||||
Subnets: []*string{aws.String(sub1)},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
arn := *out.LoadBalancers[0].LoadBalancerArn
|
||||
|
||||
_, err = svc.SetSubnets(&elbv2.SetSubnetsInput{
|
||||
LoadBalancerArn: aws.String(arn),
|
||||
SubnetMappings: []*elbv2.SubnetMapping{
|
||||
{SubnetId: aws.String(sub1)},
|
||||
{SubnetId: aws.String(sub2)},
|
||||
},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, 2, countManagedENIs(t, vpcSvc))
|
||||
}
|
||||
|
||||
func TestSetSubnets_WithoutVPCService(t *testing.T) {
|
||||
svc := setupTestService(t)
|
||||
arn := createLBArn(t, svc, "novpc-subnets")
|
||||
|
||||
res, err := svc.SetSubnets(&elbv2.SetSubnetsInput{
|
||||
LoadBalancerArn: aws.String(arn),
|
||||
Subnets: []*string{aws.String("subnet-aaa"), aws.String("subnet-bbb")},
|
||||
}, testAccountID)
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, res.AvailabilityZones, 2)
|
||||
assert.ElementsMatch(t, []string{"subnet-aaa", "subnet-bbb"}, subnetIDsOfLB(describeLB(t, svc, arn)))
|
||||
}
|
||||
|
||||
func TestSetSubnets_MissingParams(t *testing.T) {
|
||||
svc := setupTestService(t)
|
||||
arn := createLBArn(t, svc, "subnets-mp")
|
||||
|
||||
_, err := svc.SetSubnets(&elbv2.SetSubnetsInput{
|
||||
LoadBalancerArn: aws.String(arn),
|
||||
}, testAccountID)
|
||||
require.Error(t, err)
|
||||
assert.Contains(t, err.Error(), awserrors.ErrorMissingParameter)
|
||||
|
||||
_, err = svc.SetSubnets(&elbv2.SetSubnetsInput{
|
||||
Subnets: []*string{aws.String("subnet-aaa")},
|
||||
}, testAccountID)
|
||||
require.Error(t, err)
|
||||
assert.Contains(t, err.Error(), awserrors.ErrorMissingParameter)
|
||||
}
|
||||
|
||||
func TestSetSubnets_NotFound(t *testing.T) {
|
||||
svc := setupTestService(t)
|
||||
_, err := svc.SetSubnets(&elbv2.SetSubnetsInput{
|
||||
LoadBalancerArn: aws.String("arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/app/missing/lb-deadbeef"),
|
||||
Subnets: []*string{aws.String("subnet-aaa")},
|
||||
}, testAccountID)
|
||||
require.Error(t, err)
|
||||
assert.Contains(t, err.Error(), awserrors.ErrorELBv2LoadBalancerNotFound)
|
||||
}
|
||||
|
||||
func TestSetSubnets_CrossAccount(t *testing.T) {
|
||||
svc := setupTestService(t)
|
||||
arn := createLBArn(t, svc, "subnets-xacct")
|
||||
|
||||
_, err := svc.SetSubnets(&elbv2.SetSubnetsInput{
|
||||
LoadBalancerArn: aws.String(arn),
|
||||
Subnets: []*string{aws.String("subnet-aaa")},
|
||||
}, "999999999999")
|
||||
require.Error(t, err)
|
||||
assert.Contains(t, err.Error(), awserrors.ErrorELBv2LoadBalancerNotFound)
|
||||
}
|
||||
|
||||
func subnetIDsOfLB(lb *elbv2.LoadBalancer) []string {
|
||||
out := make([]string, 0, len(lb.AvailabilityZones))
|
||||
for _, az := range lb.AvailabilityZones {
|
||||
out = append(out, aws.StringValue(az.SubnetId))
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
@@ -143,6 +143,10 @@ func (s *NATSELBv2Service) SetIpAddressType(input *elbv2.SetIpAddressTypeInput,
|
||||
return utils.NATSRequest[elbv2.SetIpAddressTypeOutput](s.natsConn, "elbv2.SetIpAddressType", input, defaultTimeout, accountID)
|
||||
}
|
||||
|
||||
func (s *NATSELBv2Service) SetSubnets(input *elbv2.SetSubnetsInput, accountID string) (*elbv2.SetSubnetsOutput, error) {
|
||||
return utils.NATSRequest[elbv2.SetSubnetsOutput](s.natsConn, "elbv2.SetSubnets", input, defaultTimeout, accountID)
|
||||
}
|
||||
|
||||
func (s *NATSELBv2Service) AddListenerCertificates(input *elbv2.AddListenerCertificatesInput, accountID string) (*elbv2.AddListenerCertificatesOutput, error) {
|
||||
return utils.NATSRequest[elbv2.AddListenerCertificatesOutput](s.natsConn, "elbv2.AddListenerCertificates", input, defaultTimeout, accountID)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{n as r,r as i,t as a}from"./upload-button.js";import{r as o}from"./s3.js";import{Lo as s,Mo as c,Y as l,fs as u,jo as d,ko as f,ms as p,x as m,ys as h}from"./index.js";var g=u(),_=h();function v(){let u=(0,g.c)(24),{bucket:h,_splat:v}=m.useParams(),y=d(v??``),{data:b}=t(l(h,y)),x=o(),S;u[0]===b.Contents?S=u[1]:(S=b.Contents??[],u[0]=b.Contents,u[1]=S);let C=S,w;u[2]===b.CommonPrefixes?w=u[3]:(w=b.CommonPrefixes??[],u[2]=b.CommonPrefixes,u[3]=w);let T=w,E=y.split(`/`).filter(Boolean),D=[{name:h,path:`/s3/ls/${h}`},...E.map((e,t)=>({name:e,path:`/s3/ls/${h}/${`${E.slice(0,t+1).join(`/`)}/`}`}))],O=E.length>1?`/s3/ls/${h}/${E.slice(0,-1).join(`/`)}/`:`/s3/ls/${h}`,k;u[4]===O?k=u[5]:(k=(0,_.jsx)(n,{to:O,children:`Back`}),u[4]=O,u[5]=k);let A;u[6]!==h||u[7]!==y||u[8]!==x.isPending||u[9]!==x.mutateAsync?(A=(0,_.jsx)(a,{bucket:h,isPending:x.isPending,onUpload:x.mutateAsync,prefix:y}),u[6]=h,u[7]=y,u[8]=x.isPending,u[9]=x.mutateAsync,u[10]=A):A=u[10];let j;u[11]===x.error?j=u[12]:(j=x.error&&(0,_.jsx)(e,{error:x.error,msg:`Failed to upload object`}),u[11]=x.error,u[12]=j);let M;u[13]!==h||u[14]!==T||u[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)(i,{bucketName:h,folderName:s(c(e.Prefix,y)),fullPrefix:f(e.Prefix,y)},e.Prefix):null)})]}),u[13]=h,u[14]=T,u[15]=y,u[16]=M):M=u[16];let N;u[17]!==h||u[18]!==C||u[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)(r,{bucketName:h,displayName:c(e.Key,y),fullKey:f(e.Key,y),object:e},e.Key):null)]}),u[17]=h,u[18]=C,u[19]=y,u[20]=N):N=u[20];let P;return u[21]!==T.length||u[22]!==C.length?(P=C.length===0&&T.length===0&&(0,_.jsx)(`p`,{className:`text-muted-foreground`,children:`No objects found in this folder.`}),u[21]=T.length,u[22]=C.length,u[23]=P):P=u[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)(p,{className:`hover:text-foreground`,to:e.path,children:e.name})]},e.path))}),A]})}),j,M,N,P]})}export{v as component};
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{n as r,r as i,t as a}from"./upload-button.js";import{r as o}from"./s3.js";import{Ao as s,Mo as c,No as l,Ro as u,Y as d,bs as f,hs as p,ps as m,x as h}from"./index.js";var g=m(),_=f();function v(){let f=(0,g.c)(24),{bucket:m,_splat:v}=h.useParams(),y=c(v??``),{data:b}=t(d(m,y)),x=o(),S;f[0]===b.Contents?S=f[1]:(S=b.Contents??[],f[0]=b.Contents,f[1]=S);let C=S,w;f[2]===b.CommonPrefixes?w=f[3]:(w=b.CommonPrefixes??[],f[2]=b.CommonPrefixes,f[3]=w);let T=w,E=y.split(`/`).filter(Boolean),D=[{name:m,path:`/s3/ls/${m}`},...E.map((e,t)=>({name:e,path:`/s3/ls/${m}/${`${E.slice(0,t+1).join(`/`)}/`}`}))],O=E.length>1?`/s3/ls/${m}/${E.slice(0,-1).join(`/`)}/`:`/s3/ls/${m}`,k;f[4]===O?k=f[5]:(k=(0,_.jsx)(n,{to:O,children:`Back`}),f[4]=O,f[5]=k);let A;f[6]!==m||f[7]!==y||f[8]!==x.isPending||f[9]!==x.mutateAsync?(A=(0,_.jsx)(a,{bucket:m,isPending:x.isPending,onUpload:x.mutateAsync,prefix:y}),f[6]=m,f[7]=y,f[8]=x.isPending,f[9]=x.mutateAsync,f[10]=A):A=f[10];let j;f[11]===x.error?j=f[12]:(j=x.error&&(0,_.jsx)(e,{error:x.error,msg:`Failed to upload object`}),f[11]=x.error,f[12]=j);let M;f[13]!==m||f[14]!==T||f[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)(i,{bucketName:m,folderName:u(l(e.Prefix,y)),fullPrefix:s(e.Prefix,y)},e.Prefix):null)})]}),f[13]=m,f[14]=T,f[15]=y,f[16]=M):M=f[16];let N;f[17]!==m||f[18]!==C||f[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)(r,{bucketName:m,displayName:l(e.Key,y),fullKey:s(e.Key,y),object:e},e.Key):null)]}),f[17]=m,f[18]=C,f[19]=y,f[20]=N):N=f[20];let P;return f[21]!==T.length||f[22]!==C.length?(P=C.length===0&&T.length===0&&(0,_.jsx)(`p`,{className:`text-muted-foreground`,children:`No objects found in this folder.`}),f[21]=T.length,f[22]=C.length,f[23]=P):P=f[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)(p,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{n as r,r as i,t as a}from"./upload-button.js";import{r as o}from"./s3.js";import{F as s,Lo as c,Y as l,fs as u,ys as d}from"./index.js";import{t as f}from"./page-heading.js";var p=u(),m=d();function h(){let u=(0,p.c)(31),{bucket:d}=s.useParams(),h;u[0]===d?h=u[1]:(h=l(d),u[0]=d,u[1]=h);let{data:g}=t(h),_=o(),v;u[2]===g.Contents?v=u[3]:(v=g.Contents??[],u[2]=g.Contents,u[3]=v);let y=v,b;u[4]===g.CommonPrefixes?b=u[5]:(b=g.CommonPrefixes??[],u[4]=g.CommonPrefixes,u[5]=b);let x=b,S;u[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,m.jsx)(n,{to:`/s3/ls`,children:`Back to buckets`}),u[6]=S):S=u[6];let C;u[7]!==d||u[8]!==_.isPending||u[9]!==_.mutateAsync?(C=(0,m.jsx)(a,{bucket:d,isPending:_.isPending,onUpload:_.mutateAsync}),u[7]=d,u[8]=_.isPending,u[9]=_.mutateAsync,u[10]=C):C=u[10];let w;u[11]!==d||u[12]!==C?(w=(0,m.jsx)(f,{actions:C,title:d}),u[11]=d,u[12]=C,u[13]=w):w=u[13];let T;u[14]===_.error?T=u[15]:(T=_.error&&(0,m.jsx)(e,{error:_.error,msg:`Failed to upload object`}),u[14]=_.error,u[15]=T);let E;u[16]!==d||u[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)(i,{bucketName:d,folderName:c(e.Prefix),fullPrefix:e.Prefix},e.Prefix):null)})]}),u[16]=d,u[17]=x,u[18]=E):E=u[18];let D;u[19]!==d||u[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)(r,{bucketName:d,displayName:e.Key,fullKey:e.Key,object:e},e.Key):null)]}),u[19]=d,u[20]=y,u[21]=D):D=u[21];let O;u[22]!==x.length||u[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.`}),u[22]=x.length,u[23]=y.length,u[24]=O):O=u[24];let k;return u[25]!==w||u[26]!==T||u[27]!==E||u[28]!==D||u[29]!==O?(k=(0,m.jsxs)(m.Fragment,{children:[S,w,T,E,D,O]}),u[25]=w,u[26]=T,u[27]=E,u[28]=D,u[29]=O,u[30]=k):k=u[30],k}export{h as component};
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{n as r,r as i,t as a}from"./upload-button.js";import{r as o}from"./s3.js";import{F as s,Ro as c,Y as l,bs as u,ps as d}from"./index.js";import{t as f}from"./page-heading.js";var p=d(),m=u();function h(){let u=(0,p.c)(31),{bucket:d}=s.useParams(),h;u[0]===d?h=u[1]:(h=l(d),u[0]=d,u[1]=h);let{data:g}=t(h),_=o(),v;u[2]===g.Contents?v=u[3]:(v=g.Contents??[],u[2]=g.Contents,u[3]=v);let y=v,b;u[4]===g.CommonPrefixes?b=u[5]:(b=g.CommonPrefixes??[],u[4]=g.CommonPrefixes,u[5]=b);let x=b,S;u[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,m.jsx)(n,{to:`/s3/ls`,children:`Back to buckets`}),u[6]=S):S=u[6];let C;u[7]!==d||u[8]!==_.isPending||u[9]!==_.mutateAsync?(C=(0,m.jsx)(a,{bucket:d,isPending:_.isPending,onUpload:_.mutateAsync}),u[7]=d,u[8]=_.isPending,u[9]=_.mutateAsync,u[10]=C):C=u[10];let w;u[11]!==d||u[12]!==C?(w=(0,m.jsx)(f,{actions:C,title:d}),u[11]=d,u[12]=C,u[13]=w):w=u[13];let T;u[14]===_.error?T=u[15]:(T=_.error&&(0,m.jsx)(e,{error:_.error,msg:`Failed to upload object`}),u[14]=_.error,u[15]=T);let E;u[16]!==d||u[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)(i,{bucketName:d,folderName:c(e.Prefix),fullPrefix:e.Prefix},e.Prefix):null)})]}),u[16]=d,u[17]=x,u[18]=E):E=u[18];let D;u[19]!==d||u[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)(r,{bucketName:d,displayName:e.Key,fullKey:e.Key,object:e},e.Key):null)]}),u[19]=d,u[20]=y,u[21]=D):D=u[21];let O;u[22]!==x.length||u[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.`}),u[22]=x.length,u[23]=y.length,u[24]=O):O=u[24];let k;return u[25]!==w||u[26]!==T||u[27]!==E||u[28]!==D||u[29]!==O?(k=(0,m.jsxs)(m.Fragment,{children:[S,w,T,E,D,O]}),u[25]=w,u[26]=T,u[27]=E,u[28]=D,u[29]=O,u[30]=k):k=u[30],k}export{h as component};
|
||||
@@ -1 +1 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{c as r,i,n as a,s as o,t as s}from"./select.js";import{t as c}from"./trash-2.js";import{G as l,L as u,n as d}from"./ec2.js";import{Do as f,Io as p,Z as m,at as h,bs as g,hs as _,t as v,ys as y,zs 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=b(g()),E=y();function D(){let{id:g}=v.useParams(),y=_(),{data:b}=t(m(g)),{data:D}=t(h),O=d(),k=u(),A=l(),[j,M]=(0,T.useState)(!1),[N,P]=(0,T.useState)(``),F=b.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(g),y({to:`/ec2/describe-addresses`})}finally{M(!1)}},R=async()=>{N&&await O.mutateAsync({allocationId:g,instanceId:N})},z=async()=>{F?.AssociationId&&await k.mutateAsync(F.AssociationId)};if(!F?.AllocationId)return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(n,{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=p(F.Tags);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(n,{to:`/ec2/describe-addresses`,children:`Back to Elastic IPs`}),(A.error??O.error??k.error)&&(0,E.jsx)(e,{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)(f,{disabled:B||A.isPending,onClick:()=>M(!0),size:`sm`,variant:`destructive`,children:[(0,E.jsx)(c,{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)(f,{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)(s,{onValueChange:e=>P(e??``),value:N,children:[(0,E.jsx)(o,{className:`w-full`,children:(0,E.jsx)(r,{placeholder:`Select an instance`})}),(0,E.jsx)(a,{children:I.map(e=>{let t=p(e.Tags);return(0,E.jsx)(i,{value:e.InstanceId??``,children:t?`${e.InstanceId} (${t})`:e.InstanceId},e.InstanceId)})})]})}),(0,E.jsx)(f,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{c as r,i,n as a,s as o,t as s}from"./select.js";import{t as c}from"./trash-2.js";import{G as l,L as u,n as d}from"./ec2.js";import{Bs as f,Lo as p,Oo as m,Z as h,at as g,bs as _,gs as v,t as y,xs 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=f(b()),E=_();function D(){let{id:f}=y.useParams(),_=v(),{data:b}=t(h(f)),{data:D}=t(g),O=d(),k=u(),A=l(),[j,M]=(0,T.useState)(!1),[N,P]=(0,T.useState)(``),F=b.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(f),_({to:`/ec2/describe-addresses`})}finally{M(!1)}},R=async()=>{N&&await O.mutateAsync({allocationId:f,instanceId:N})},z=async()=>{F?.AssociationId&&await k.mutateAsync(F.AssociationId)};if(!F?.AllocationId)return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(n,{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=p(F.Tags);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(n,{to:`/ec2/describe-addresses`,children:`Back to Elastic IPs`}),(A.error??O.error??k.error)&&(0,E.jsx)(e,{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)(m,{disabled:B||A.isPending,onClick:()=>M(!0),size:`sm`,variant:`destructive`,children:[(0,E.jsx)(c,{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)(m,{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)(s,{onValueChange:e=>P(e??``),value:N,children:[(0,E.jsx)(o,{className:`w-full`,children:(0,E.jsx)(r,{placeholder:`Select an instance`})}),(0,E.jsx)(a,{children:I.map(e=>{let t=p(e.Tags);return(0,E.jsx)(i,{value:e.InstanceId??``,children:t?`${e.InstanceId} (${t})`:e.InstanceId},e.InstanceId)})})]})}),(0,E.jsx)(m,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./copy.js";import{t as i}from"./trash-2.js";import{j as a,l as o}from"./ec2.js";import{Da as s,Do as c,No as l,bs as u,d,hs as f,ms as p,mt as m,ys as h,yt as g,zs 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=_(u()),P=h();function F(){let{id:u}=d.useParams(),h=f(),{data:_}=t(g(u)),{data:F}=t(m),I=_.Snapshots?.[0],L=a(),R=o(),[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(u),h({to:`/ec2/describe-snapshots`})}finally{B(!1)}},J=async()=>{try{await R.mutateAsync({sourceSnapshotId:u,sourceRegion:G,description:U||void 0}),H(!1),W(``)}catch{}};if(!I?.SnapshotId)return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(n,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:`Snapshot not found.`})]});let Y=l(I.StartTime);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(n,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),L.error&&(0,P.jsx)(e,{error:L.error,msg:`Failed to delete snapshot`}),R.error&&(0,P.jsx)(e,{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)(c,{disabled:!K,onClick:()=>B(!0),size:`sm`,variant:`destructive`,children:[(0,P.jsx)(i,{className:`size-4`}),`Delete`]}),(0,P.jsxs)(c,{disabled:!K,onClick:()=>H(!0),size:`sm`,variant:`outline`,children:[(0,P.jsx)(r,{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)(p,{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)(s,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./copy.js";import{t as i}from"./trash-2.js";import{j as a,l as o}from"./ec2.js";import{Bs as s,Oa as c,Oo as l,Po as u,bs as d,d as f,gs as p,hs as m,mt as h,xs as g,yt 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=s(g()),P=d();function F(){let{id:s}=f.useParams(),d=p(),{data:g}=t(_(s)),{data:F}=t(h),I=g.Snapshots?.[0],L=a(),R=o(),[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(s),d({to:`/ec2/describe-snapshots`})}finally{B(!1)}},J=async()=>{try{await R.mutateAsync({sourceSnapshotId:s,sourceRegion:G,description:U||void 0}),H(!1),W(``)}catch{}};if(!I?.SnapshotId)return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(n,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),(0,P.jsx)(`p`,{className:`text-muted-foreground`,children:`Snapshot not found.`})]});let Y=u(I.StartTime);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(n,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),L.error&&(0,P.jsx)(e,{error:L.error,msg:`Failed to delete snapshot`}),R.error&&(0,P.jsx)(e,{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)(l,{disabled:!K,onClick:()=>B(!0),size:`sm`,variant:`destructive`,children:[(0,P.jsx)(i,{className:`size-4`}),`Delete`]}),(0,P.jsxs)(l,{disabled:!K,onClick:()=>H(!0),size:`sm`,variant:`outline`,children:[(0,P.jsx)(r,{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)(m,{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)(c,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./trash-2.js";import{M as i}from"./ec2.js";import{Do as a,Io as o,bs as s,f as c,hs as l,ms as u,xt as d,ys as f,zs 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=p(s()),b=f();function x(){let{id:s}=c.useParams(),f=l(),{data:p}=t(d(s)),x=p.Subnets?.[0],S=i(),[C,w]=(0,y.useState)(!1),T=async()=>{try{await S.mutateAsync(s),f({to:`/ec2/describe-subnets`})}finally{w(!1)}};if(!x?.SubnetId)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n,{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)(n,{to:`/ec2/describe-subnets`,children:`Back to Subnets`}),S.error&&(0,b.jsx)(e,{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)(a,{onClick:()=>w(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(r,{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)(u,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./trash-2.js";import{M as i}from"./ec2.js";import{Bs as a,Lo as o,Oo as s,bs as c,f as l,gs as u,hs as d,xs 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=a(f()),b=c();function x(){let{id:a}=l.useParams(),c=u(),{data:f}=t(p(a)),x=f.Subnets?.[0],S=i(),[C,w]=(0,y.useState)(!1),T=async()=>{try{await S.mutateAsync(a),c({to:`/ec2/describe-subnets`})}finally{w(!1)}};if(!x?.SubnetId)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n,{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)(n,{to:`/ec2/describe-subnets`,children:`Back to Subnets`}),S.error&&(0,b.jsx)(e,{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)(s,{onClick:()=>w(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(r,{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)(d,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{U as r}from"./ec2.js";import{Ct as i,Da as a,fs as o,h as s,hs as c,ys as l}from"./index.js";import{i as u,t as d}from"./zod.js";import{t as f}from"./form-actions.js";import{t as p}from"./page-heading.js";import{a as m,r as h,t as g}from"./field.js";import{_}from"./ec22.js";var v=o(),y=l();function b(){let o=(0,v.c)(53),{id:l}=s.useParams(),b=c(),x;o[0]===l?x=o[1]:(x=i(l),o[0]=l,o[1]=x);let{data:S}=t(x),C=S.Volumes?.[0],w=C?.VolumeId,T=r(),E=C?.Size??1,D;o[2]===E?D=o[3]:(D=d(_.refine(e=>e.size>E,{message:`New size must be greater than current size (${E} GiB)`,path:[`size`]})),o[2]=E,o[3]=D);let O;o[4]===E?O=o[5]:(O={size:E},o[4]=E,o[5]=O);let k;o[6]!==D||o[7]!==O?(k={resolver:D,defaultValues:O},o[6]=D,o[7]=O,o[8]=k):k=o[8];let{handleSubmit:A,register:j,formState:M}=u(k),{errors:N,isSubmitting:P}=M;if(!w){let e;return o[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(n,{to:`/ec2/describe-volumes`,children:`Back to volumes`}),(0,y.jsx)(`p`,{className:`text-muted-foreground`,children:`Volume not found.`})]}),o[9]=e):e=o[9],e}let F;o[10]!==T||o[11]!==b||o[12]!==w?(F=async e=>{await T.mutateAsync({...e,volumeId:w}),b({to:`/ec2/describe-volumes/$id`,params:{id:w}})},o[10]=T,o[11]=b,o[12]=w,o[13]=F):F=o[13];let I=F,L,R;o[14]===w?(L=o[15],R=o[16]):(L=(0,y.jsx)(n,{params:{id:w},to:`/ec2/describe-volumes/$id`,children:`Back to volume`}),R=(0,y.jsx)(p,{subtitle:w,title:`Resize Volume`}),o[14]=w,o[15]=L,o[16]=R);let z;o[17]===T.error?z=o[18]:(z=T.error&&(0,y.jsx)(e,{error:T.error,msg:`Failed to resize volume`}),o[17]=T.error,o[18]=z);let B;o[19]!==A||o[20]!==I?(B=A(I),o[19]=A,o[20]=I,o[21]=B):B=o[21];let V;o[22]===E?V=o[23]:(V=(0,y.jsx)(`div`,{className:`space-y-2`,children:(0,y.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Current size: `,E,` GiB`]})}),o[22]=E,o[23]=V);let H;o[24]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,y.jsx)(m,{children:(0,y.jsx)(`label`,{htmlFor:`size`,children:`New size (GiB)`})}),o[24]=H):H=o[24];let U=!!N.size,W=E+1,G;o[25]===j?G=o[26]:(G=j(`size`,{valueAsNumber:!0}),o[25]=j,o[26]=G);let K;o[27]!==U||o[28]!==W||o[29]!==G?(K=(0,y.jsx)(a,{"aria-invalid":U,id:`size`,min:W,type:`number`,...G}),o[27]=U,o[28]=W,o[29]=G,o[30]=K):K=o[30];let q;o[31]===N.size?q=o[32]:(q=(0,y.jsx)(h,{errors:[N.size]}),o[31]=N.size,o[32]=q);let J;o[33]!==K||o[34]!==q?(J=(0,y.jsxs)(g,{children:[H,K,q]}),o[33]=K,o[34]=q,o[35]=J):J=o[35];let Y;o[36]!==b||o[37]!==w?(Y=async()=>await b({to:`/ec2/describe-volumes/$id`,params:{id:w}}),o[36]=b,o[37]=w,o[38]=Y):Y=o[38];let X;o[39]!==P||o[40]!==T.isPending||o[41]!==Y?(X=(0,y.jsx)(f,{isPending:T.isPending,isSubmitting:P,onCancel:Y,pendingLabel:`Resizing\\u2026`,submitLabel:`Resize Volume`}),o[39]=P,o[40]=T.isPending,o[41]=Y,o[42]=X):X=o[42];let Z;o[43]!==V||o[44]!==J||o[45]!==X||o[46]!==B?(Z=(0,y.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:B,children:[V,J,X]}),o[43]=V,o[44]=J,o[45]=X,o[46]=B,o[47]=Z):Z=o[47];let Q;return o[48]!==Z||o[49]!==L||o[50]!==R||o[51]!==z?(Q=(0,y.jsxs)(y.Fragment,{children:[L,R,z,Z]}),o[48]=Z,o[49]=L,o[50]=R,o[51]=z,o[52]=Q):Q=o[52],Q}export{b as component};
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{U as r}from"./ec2.js";import{Ct as i,Oa as a,bs as o,gs as s,h as c,ps as l}from"./index.js";import{i as u,t as d}from"./zod.js";import{t as f}from"./form-actions.js";import{t as p}from"./page-heading.js";import{a as m,r as h,t as g}from"./field.js";import{_}from"./ec22.js";var v=l(),y=o();function b(){let o=(0,v.c)(53),{id:l}=c.useParams(),b=s(),x;o[0]===l?x=o[1]:(x=i(l),o[0]=l,o[1]=x);let{data:S}=t(x),C=S.Volumes?.[0],w=C?.VolumeId,T=r(),E=C?.Size??1,D;o[2]===E?D=o[3]:(D=d(_.refine(e=>e.size>E,{message:`New size must be greater than current size (${E} GiB)`,path:[`size`]})),o[2]=E,o[3]=D);let O;o[4]===E?O=o[5]:(O={size:E},o[4]=E,o[5]=O);let k;o[6]!==D||o[7]!==O?(k={resolver:D,defaultValues:O},o[6]=D,o[7]=O,o[8]=k):k=o[8];let{handleSubmit:A,register:j,formState:M}=u(k),{errors:N,isSubmitting:P}=M;if(!w){let e;return o[9]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(n,{to:`/ec2/describe-volumes`,children:`Back to volumes`}),(0,y.jsx)(`p`,{className:`text-muted-foreground`,children:`Volume not found.`})]}),o[9]=e):e=o[9],e}let F;o[10]!==T||o[11]!==b||o[12]!==w?(F=async e=>{await T.mutateAsync({...e,volumeId:w}),b({to:`/ec2/describe-volumes/$id`,params:{id:w}})},o[10]=T,o[11]=b,o[12]=w,o[13]=F):F=o[13];let I=F,L,R;o[14]===w?(L=o[15],R=o[16]):(L=(0,y.jsx)(n,{params:{id:w},to:`/ec2/describe-volumes/$id`,children:`Back to volume`}),R=(0,y.jsx)(p,{subtitle:w,title:`Resize Volume`}),o[14]=w,o[15]=L,o[16]=R);let z;o[17]===T.error?z=o[18]:(z=T.error&&(0,y.jsx)(e,{error:T.error,msg:`Failed to resize volume`}),o[17]=T.error,o[18]=z);let B;o[19]!==A||o[20]!==I?(B=A(I),o[19]=A,o[20]=I,o[21]=B):B=o[21];let V;o[22]===E?V=o[23]:(V=(0,y.jsx)(`div`,{className:`space-y-2`,children:(0,y.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Current size: `,E,` GiB`]})}),o[22]=E,o[23]=V);let H;o[24]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,y.jsx)(m,{children:(0,y.jsx)(`label`,{htmlFor:`size`,children:`New size (GiB)`})}),o[24]=H):H=o[24];let U=!!N.size,W=E+1,G;o[25]===j?G=o[26]:(G=j(`size`,{valueAsNumber:!0}),o[25]=j,o[26]=G);let K;o[27]!==U||o[28]!==W||o[29]!==G?(K=(0,y.jsx)(a,{"aria-invalid":U,id:`size`,min:W,type:`number`,...G}),o[27]=U,o[28]=W,o[29]=G,o[30]=K):K=o[30];let q;o[31]===N.size?q=o[32]:(q=(0,y.jsx)(h,{errors:[N.size]}),o[31]=N.size,o[32]=q);let J;o[33]!==K||o[34]!==q?(J=(0,y.jsxs)(g,{children:[H,K,q]}),o[33]=K,o[34]=q,o[35]=J):J=o[35];let Y;o[36]!==b||o[37]!==w?(Y=async()=>await b({to:`/ec2/describe-volumes/$id`,params:{id:w}}),o[36]=b,o[37]=w,o[38]=Y):Y=o[38];let X;o[39]!==P||o[40]!==T.isPending||o[41]!==Y?(X=(0,y.jsx)(f,{isPending:T.isPending,isSubmitting:P,onCancel:Y,pendingLabel:`Resizing\\u2026`,submitLabel:`Resize Volume`}),o[39]=P,o[40]=T.isPending,o[41]=Y,o[42]=X):X=o[42];let Z;o[43]!==V||o[44]!==J||o[45]!==X||o[46]!==B?(Z=(0,y.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:B,children:[V,J,X]}),o[43]=V,o[44]=J,o[45]=X,o[46]=B,o[47]=Z):Z=o[47];let Q;return o[48]!==Z||o[49]!==L||o[50]!==R||o[51]!==z?(Q=(0,y.jsxs)(y.Fragment,{children:[L,R,z,Z]}),o[48]=Z,o[49]=L,o[50]=R,o[51]=z,o[52]=Q):Q=o[52],Q}export{b as component};
|
||||
@@ -1 +1 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./trash-2.js";import{P as i}from"./ec2.js";import{Do as a,Io as o,St as s,Tt as c,bs as l,g as u,hs as d,ms as f,ys as p,zs 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=m(l()),x=p();function S(){let{id:l}=u.useParams(),p=d(),{data:m}=t(c(l)),{data:S}=t(s),C=m.Vpcs?.[0],w=i(),[T,E]=(0,b.useState)(!1),D=S.Subnets?.filter(e=>e.VpcId===l)??[],O=async()=>{try{await w.mutateAsync(l),p({to:`/ec2/describe-vpcs`})}finally{E(!1)}};if(!C?.VpcId)return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(n,{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)(n,{to:`/ec2/describe-vpcs`,children:`Back to VPCs`}),w.error&&(0,x.jsx)(e,{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)(a,{onClick:()=>E(!0),size:`sm`,variant:`destructive`,children:[(0,x.jsx)(r,{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)(f,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./trash-2.js";import{P as i}from"./ec2.js";import{Bs as a,Lo as o,Oo as s,St as c,Tt as l,bs as u,g as d,gs as f,hs as p,xs 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=a(m()),x=u();function S(){let{id:a}=d.useParams(),u=f(),{data:m}=t(l(a)),{data:S}=t(c),C=m.Vpcs?.[0],w=i(),[T,E]=(0,b.useState)(!1),D=S.Subnets?.filter(e=>e.VpcId===a)??[],O=async()=>{try{await w.mutateAsync(a),u({to:`/ec2/describe-vpcs`})}finally{E(!1)}};if(!C?.VpcId)return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(n,{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)(n,{to:`/ec2/describe-vpcs`,children:`Back to VPCs`}),w.error&&(0,x.jsx)(e,{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)(s,{onClick:()=>E(!0),size:`sm`,variant:`destructive`,children:[(0,x.jsx)(r,{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)(p,{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};
|
||||
@@ -1 +1 @@
|
||||
import{t as e}from"./useSuspenseQuery.js";import{t}from"./back-link.js";import{fs as n,n as r,tt as i,ys as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./state-badge.js";import{t as c}from"./system-managed.js";import{t as l}from"./ami-details.js";var u=n(),d=a();function f(){let n=(0,u.c)(14),{id:a}=r.useParams(),f;n[0]===a?f=n[1]:(f=i(a),n[0]=a,n[1]=f);let{data:p}=e(f),m=p?.Images?.[0];if(!m?.ImageId||c(m)){let e;return n[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(t,{to:`/ec2/describe-images`,children:`Back to images`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Image not found.`})]}),n[2]=e):e=n[2],e}let h;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,d.jsx)(t,{to:`/ec2/describe-images`,children:`Back to images`}),n[3]=h):h=n[3];let g;n[4]===m.State?g=n[5]:(g=(0,d.jsx)(s,{state:m.State}),n[4]=m.State,n[5]=g);let _;n[6]!==m.ImageId||n[7]!==g?(_=(0,d.jsx)(o,{actions:g,subtitle:`Image Details`,title:m.ImageId}),n[6]=m.ImageId,n[7]=g,n[8]=_):_=n[8];let v;n[9]===m?v=n[10]:(v=(0,d.jsx)(l,{image:m,showExtendedDetails:!0}),n[9]=m,n[10]=v);let y;return n[11]!==_||n[12]!==v?(y=(0,d.jsxs)(d.Fragment,{children:[h,(0,d.jsxs)(`div`,{className:`space-y-6`,children:[_,v]})]}),n[11]=_,n[12]=v,n[13]=y):y=n[13],y}export{f as component};
|
||||
import{t as e}from"./useSuspenseQuery.js";import{t}from"./back-link.js";import{bs as n,n as r,ps as i,tt as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./state-badge.js";import{t as c}from"./system-managed.js";import{t as l}from"./ami-details.js";var u=i(),d=n();function f(){let n=(0,u.c)(14),{id:i}=r.useParams(),f;n[0]===i?f=n[1]:(f=a(i),n[0]=i,n[1]=f);let{data:p}=e(f),m=p?.Images?.[0];if(!m?.ImageId||c(m)){let e;return n[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(t,{to:`/ec2/describe-images`,children:`Back to images`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Image not found.`})]}),n[2]=e):e=n[2],e}let h;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,d.jsx)(t,{to:`/ec2/describe-images`,children:`Back to images`}),n[3]=h):h=n[3];let g;n[4]===m.State?g=n[5]:(g=(0,d.jsx)(s,{state:m.State}),n[4]=m.State,n[5]=g);let _;n[6]!==m.ImageId||n[7]!==g?(_=(0,d.jsx)(o,{actions:g,subtitle:`Image Details`,title:m.ImageId}),n[6]=m.ImageId,n[7]=g,n[8]=_):_=n[8];let v;n[9]===m?v=n[10]:(v=(0,d.jsx)(l,{image:m,showExtendedDetails:!0}),n[9]=m,n[10]=v);let y;return n[11]!==_||n[12]!==v?(y=(0,d.jsxs)(d.Fragment,{children:[h,(0,d.jsxs)(`div`,{className:`space-y-6`,children:[_,v]})]}),n[11]=_,n[12]=v,n[13]=y):y=n[13],y}export{f as component};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{c as r,i,n as a,s as o,t as s}from"./select.js";import{t as c}from"./trash-2.js";import{F as l,a as u,w as d}from"./ec2.js";import{Do as f,Et as p,Io as m,bs as h,hs as g,i as _,ms as v,ot as y,ys as b,zs 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=x(h()),D=b();function O(){let{id:h}=_.useParams(),b=g(),{data:x}=t(y(h)),{data:O}=t(p),k=u(),A=l(),j=d(),[M,N]=(0,E.useState)(!1),[P,F]=(0,E.useState)(``),I=x.InternetGateways?.[0],L=O.Vpcs??[],R=async()=>{try{await j.mutateAsync(h),b({to:`/ec2/describe-internet-gateways`})}finally{N(!1)}},z=async()=>{P&&await k.mutateAsync({internetGatewayId:h,vpcId:P})},B=async e=>{await A.mutateAsync({internetGatewayId:h,vpcId:e})};if(!I?.InternetGatewayId)return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(n,{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=m(I.Tags);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(n,{to:`/ec2/describe-internet-gateways`,children:`Back to Internet Gateways`}),(j.error??k.error??A.error)&&(0,D.jsx)(e,{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)(f,{disabled:H||j.isPending,onClick:()=>N(!0),size:`sm`,variant:`destructive`,children:[(0,D.jsx)(c,{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)(v,{className:`text-primary hover:underline`,params:{id:V.VpcId??``},to:`/ec2/describe-vpcs/$id`,children:V.VpcId}),(0,D.jsx)(f,{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)(s,{onValueChange:e=>F(e??``),value:P,children:[(0,D.jsx)(o,{className:`w-full`,children:(0,D.jsx)(r,{placeholder:`Select a VPC`})}),(0,D.jsx)(a,{children:L.map(e=>{let t=m(e.Tags);return(0,D.jsx)(i,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)})})]})}),(0,D.jsx)(f,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{c as r,i,n as a,s as o,t as s}from"./select.js";import{t as c}from"./trash-2.js";import{F as l,a as u,w as d}from"./ec2.js";import{Bs as f,Et as p,Lo as m,Oo as h,bs as g,gs as _,hs as v,i as y,ot as b,xs 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=f(x()),D=g();function O(){let{id:f}=y.useParams(),g=_(),{data:x}=t(b(f)),{data:O}=t(p),k=u(),A=l(),j=d(),[M,N]=(0,E.useState)(!1),[P,F]=(0,E.useState)(``),I=x.InternetGateways?.[0],L=O.Vpcs??[],R=async()=>{try{await j.mutateAsync(f),g({to:`/ec2/describe-internet-gateways`})}finally{N(!1)}},z=async()=>{P&&await k.mutateAsync({internetGatewayId:f,vpcId:P})},B=async e=>{await A.mutateAsync({internetGatewayId:f,vpcId:e})};if(!I?.InternetGatewayId)return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(n,{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=m(I.Tags);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(n,{to:`/ec2/describe-internet-gateways`,children:`Back to Internet Gateways`}),(j.error??k.error??A.error)&&(0,D.jsx)(e,{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)(h,{disabled:H||j.isPending,onClick:()=>N(!0),size:`sm`,variant:`destructive`,children:[(0,D.jsx)(c,{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)(v,{className:`text-primary hover:underline`,params:{id:V.VpcId??``},to:`/ec2/describe-vpcs/$id`,children:V.VpcId}),(0,D.jsx)(h,{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)(s,{onValueChange:e=>F(e??``),value:P,children:[(0,D.jsx)(o,{className:`w-full`,children:(0,D.jsx)(r,{placeholder:`Select a VPC`})}),(0,D.jsx)(a,{children:L.map(e=>{let t=m(e.Tags);return(0,D.jsx)(i,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)})})]})}),(0,D.jsx)(h,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./trash-2.js";import{T as i}from"./ec2.js";import{Do as a,No as o,a as s,bs as c,ct as l,hs as u,ys as d,zs 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 _=f(c()),v=d();function y(){let{id:c}=s.useParams(),d=u(),{data:f}=t(l(c)),y=f.KeyPairs?.[0],b=i(),[x,S]=(0,_.useState)(!1),C=async()=>{try{await b.mutateAsync(c),d({to:`/ec2/describe-key-pairs`})}finally{S(!1)}};if(!y?.KeyPairId)return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(n,{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=o(y.CreateTime);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(n,{to:`/ec2/describe-key-pairs`,children:`Back to key pairs`}),b.error&&(0,v.jsx)(e,{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)(a,{onClick:()=>S(!0),size:`sm`,variant:`destructive`,children:[(0,v.jsx)(r,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./trash-2.js";import{T as i}from"./ec2.js";import{Bs as a,Oo as o,Po as s,a as c,bs as l,ct as u,gs as d,xs 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 _=a(f()),v=l();function y(){let{id:a}=c.useParams(),l=d(),{data:f}=t(u(a)),y=f.KeyPairs?.[0],b=i(),[x,S]=(0,_.useState)(!1),C=async()=>{try{await b.mutateAsync(a),l({to:`/ec2/describe-key-pairs`})}finally{S(!1)}};if(!y?.KeyPairId)return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(n,{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=s(y.CreateTime);return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(n,{to:`/ec2/describe-key-pairs`,children:`Back to key pairs`}),b.error&&(0,v.jsx)(e,{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)(o,{onClick:()=>S(!0),size:`sm`,variant:`destructive`,children:[(0,v.jsx)(r,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./trash-2.js";import{E as i}from"./ec2.js";import{Do as a,Io as o,bs as s,hs as c,ms as l,s as u,ut as d,ys as f,zs 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=p(s()),b=f();function x(){let{id:s}=u.useParams(),f=c(),{data:p}=t(d(s)),x=i(),[S,C]=(0,y.useState)(!1),w=p.NatGateways?.[0],T=async()=>{try{await x.mutateAsync(s),f({to:`/ec2/describe-nat-gateways`})}finally{C(!1)}};if(!w?.NatGatewayId)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n,{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)(n,{to:`/ec2/describe-nat-gateways`,children:`Back to NAT Gateways`}),x.error&&(0,b.jsx)(e,{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)(a,{disabled:x.isPending,onClick:()=>C(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(r,{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)(l,{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)(l,{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)(l,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./trash-2.js";import{E as i}from"./ec2.js";import{Bs as a,Lo as o,Oo as s,bs as c,gs as l,hs as u,s as d,ut as f,xs 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=a(p()),b=c();function x(){let{id:a}=d.useParams(),c=l(),{data:p}=t(f(a)),x=i(),[S,C]=(0,y.useState)(!1),w=p.NatGateways?.[0],T=async()=>{try{await x.mutateAsync(a),c({to:`/ec2/describe-nat-gateways`})}finally{C(!1)}};if(!w?.NatGatewayId)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n,{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)(n,{to:`/ec2/describe-nat-gateways`,children:`Back to NAT Gateways`}),x.error&&(0,b.jsx)(e,{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)(s,{disabled:x.isPending,onClick:()=>C(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(r,{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)(u,{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)(u,{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)(u,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./trash-2.js";import{D as i}from"./ec2.js";import{Do as a,at as o,bs as s,c,ft as l,hs as u,ms as d,ys as f,zs 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=p(s()),b=f();function x(){let{id:s}=c.useParams(),f=u(),{data:p}=t(l(s)),{data:x}=t(o),S=i(),[C,w]=(0,y.useState)(!1),T=p.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)(n,{to:`/ec2/describe-placement-groups`,children:`Back to placement groups`}),S.error&&(0,b.jsx)(e,{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)(a,{onClick:()=>w(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(r,{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)(d,{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),f({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)(n,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./trash-2.js";import{D as i}from"./ec2.js";import{Bs as a,Oo as o,at as s,bs as c,c as l,ft as u,gs as d,hs as f,xs 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=a(p()),b=c();function x(){let{id:a}=l.useParams(),c=d(),{data:p}=t(u(a)),{data:x}=t(s),S=i(),[C,w]=(0,y.useState)(!1),T=p.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)(n,{to:`/ec2/describe-placement-groups`,children:`Back to placement groups`}),S.error&&(0,b.jsx)(e,{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)(o,{onClick:()=>w(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(r,{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)(f,{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),c({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)(n,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./trash-2.js";import{g as i,t as a,u as o}from"./iam.js";import{Do as s,M as c,No as l,T as u,_ as d,bs as f,hs as p,ms as m,ys as h,zs 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=g(f()),S=h();function C(){let{instanceProfileName:f}=d.useParams(),h=p(),{data:g}=t(u(f)),{data:C}=t(c),w=o(),T=a(),E=i(),[D,O]=(0,x.useState)(!1),[k,A]=(0,x.useState)(!1),[j,M]=(0,x.useState)(null),N=g.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(f),h({to:`/iam/list-instance-profiles`})}finally{O(!1)}},z=async e=>{await T.mutateAsync({instanceProfileName:f,roleName:e}),A(!1)},B=async e=>{M(e);try{await E.mutateAsync({instanceProfileName:f,roleName:e})}finally{M(null)}};return N?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(n,{to:`/iam/list-instance-profiles`,children:`Back to instance profiles`}),w.error&&(0,S.jsx)(e,{error:w.error,msg:`Failed to delete instance profile`}),T.error&&(0,S.jsx)(e,{error:T.error,msg:`Failed to add role`}),E.error&&(0,S.jsx)(e,{error:E.error,msg:`Failed to remove role`}),(0,S.jsxs)(`div`,{className:`space-y-6`,children:[(0,S.jsx)(_,{actions:(0,S.jsxs)(s,{onClick:()=>O(!0),size:`sm`,variant:`destructive`,children:[(0,S.jsx)(r,{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:l(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)(s,{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)(m,{className:`text-sm font-medium text-primary hover:underline`,params:{roleName:e.RoleName??``},to:`/iam/list-roles/$roleName`,children:e.RoleName}),(0,S.jsx)(s,{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 "${f}"? 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)(n,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./trash-2.js";import{g as i,t as a,u as o}from"./iam.js";import{Bs as s,M as c,Oo as l,Po as u,T as d,_ as f,bs as p,gs as m,hs as h,xs 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=s(g()),S=p();function C(){let{instanceProfileName:s}=f.useParams(),p=m(),{data:g}=t(d(s)),{data:C}=t(c),w=o(),T=a(),E=i(),[D,O]=(0,x.useState)(!1),[k,A]=(0,x.useState)(!1),[j,M]=(0,x.useState)(null),N=g.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(s),p({to:`/iam/list-instance-profiles`})}finally{O(!1)}},z=async e=>{await T.mutateAsync({instanceProfileName:s,roleName:e}),A(!1)},B=async e=>{M(e);try{await E.mutateAsync({instanceProfileName:s,roleName:e})}finally{M(null)}};return N?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(n,{to:`/iam/list-instance-profiles`,children:`Back to instance profiles`}),w.error&&(0,S.jsx)(e,{error:w.error,msg:`Failed to delete instance profile`}),T.error&&(0,S.jsx)(e,{error:T.error,msg:`Failed to add role`}),E.error&&(0,S.jsx)(e,{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)(r,{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:u(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)(h,{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 "${s}"? 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)(n,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./trash-2.js";import{d as i}from"./iam.js";import{A as a,Do as o,No as s,bs as c,hs as l,k as u,v as d,ys as f,zs 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=p(c()),b=f();function x(){let{policyArn:c}=d.useParams(),f=decodeURIComponent(c),p=l(),{data:x}=t(u(f)),S=x.Policy,C=i(),[w,T]=(0,y.useState)(!1),{data:E}=t(a(f,S?.DefaultVersionId??`v1`)),D=E?.PolicyVersion?.Document?decodeURIComponent(E.PolicyVersion.Document):null;return S?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n,{to:`/iam/list-policies`,children:`Back to policies`}),C.error&&(0,b.jsx)(e,{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)(o,{onClick:()=>T(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(r,{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:s(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(f),p({to:`/iam/list-policies`})}finally{T(!1)}},onOpenChange:T,open:w,title:`Delete Policy`})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n,{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{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./trash-2.js";import{d as i}from"./iam.js";import{A as a,Bs as o,Oo as s,Po as c,bs as l,gs as u,k as d,v as f,xs 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=o(p()),b=l();function x(){let{policyArn:o}=f.useParams(),l=decodeURIComponent(o),p=u(),{data:x}=t(d(l)),S=x.Policy,C=i(),[w,T]=(0,y.useState)(!1),{data:E}=t(a(l,S?.DefaultVersionId??`v1`)),D=E?.PolicyVersion?.Document?decodeURIComponent(E.PolicyVersion.Document):null;return S?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n,{to:`/iam/list-policies`,children:`Back to policies`}),C.error&&(0,b.jsx)(e,{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)(s,{onClick:()=>T(!0),size:`sm`,variant:`destructive`,children:[(0,b.jsx)(r,{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:c(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(l),p({to:`/iam/list-policies`})}finally{T(!1)}},onOpenChange:T,open:w,title:`Delete Policy`})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(n,{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{Jr as e,_s as t,di as n}from"./index.js";var r=t({queryKey:[`admin`,`nodes`],queryFn:async()=>{let t=n();if(!t)throw Error(`Not authenticated`);return await e({action:`GetNodes`,credentials:t})},staleTime:1e4}),i=t({queryKey:[`admin`,`vms`],queryFn:async()=>{let t=n();if(!t)throw Error(`Not authenticated`);return await e({action:`GetVMs`,credentials:t})},staleTime:1e4}),a=t({queryKey:[`admin`,`storageStatus`],queryFn:async()=>{let t=n();if(!t)throw Error(`Not authenticated`);return await e({action:`GetStorageStatus`,credentials:t})},staleTime:1e4});export{a as n,i as r,r as t};
|
||||
import{Yr as e,fi as t,vs as n}from"./index.js";var r=n({queryKey:[`admin`,`nodes`],queryFn:async()=>{let n=t();if(!n)throw Error(`Not authenticated`);return await e({action:`GetNodes`,credentials:n})},staleTime:1e4}),i=n({queryKey:[`admin`,`vms`],queryFn:async()=>{let n=t();if(!n)throw Error(`Not authenticated`);return await e({action:`GetVMs`,credentials:n})},staleTime:1e4}),a=n({queryKey:[`admin`,`storageStatus`],queryFn:async()=>{let n=t();if(!n)throw Error(`Not authenticated`);return await e({action:`GetStorageStatus`,credentials:n})},staleTime:1e4});export{a as n,i as r,r as t};
|
||||
File diff suppressed because one or more lines are too long
@@ -1,3 +1,3 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{t as n}from"./cli-command-panel.js";import{t as r}from"./ec2.js";import{Da as i,fs as a,hs as o,ys as s}from"./index.js";import{a as c,i as l,t as u}from"./zod.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{a as p,t as m}from"./field.js";import{n as h}from"./ec22.js";var g=a(),_=s();function v(){let a=(0,g.c)(36),s=o(),v=r(),b;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={resolver:u(h),defaultValues:{name:``}},a[0]=b):b=a[0];let{control:x,handleSubmit:S,register:C,formState:w}=l(b),{isSubmitting:T}=w,E;a[1]===x?E=a[2]:(E={control:x},a[1]=x,a[2]=E);let D=c(E),O;a[3]!==v||a[4]!==s?(O=async e=>{let t=(await v.mutateAsync({name:e.name?.trim()??void 0})).AllocationId;s(t?{to:`/ec2/describe-addresses/$id`,params:{id:t}}:{to:`/ec2/describe-addresses`})},a[3]=v,a[4]=s,a[5]=O):O=a[5];let k=O,A,j;a[6]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,_.jsx)(t,{to:`/ec2/describe-addresses`,children:`Back to Elastic IPs`}),j=(0,_.jsx)(f,{title:`Allocate Elastic IP`}),a[6]=A,a[7]=j):(A=a[6],j=a[7]);let M;a[8]===v.error?M=a[9]:(M=v.error&&(0,_.jsx)(e,{error:v.error,msg:`Failed to allocate Elastic IP`}),a[8]=v.error,a[9]=M);let N;a[10]!==S||a[11]!==k?(N=S(k),a[10]=S,a[11]=k,a[12]=N):N=a[12];let P;a[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,_.jsx)(p,{children:(0,_.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),a[13]=P):P=a[13];let F;a[14]===C?F=a[15]:(F=C(`name`),a[14]=C,a[15]=F);let I;a[16]===F?I=a[17]:(I=(0,_.jsxs)(m,{children:[P,(0,_.jsx)(i,{id:`name`,placeholder:`my-elastic-ip`,...F})]}),a[16]=F,a[17]=I);let L=D.name??``,R;a[18]===L?R=a[19]:(R=y(L),a[18]=L,a[19]=R);let z;a[20]===R?z=a[21]:(z=(0,_.jsx)(n,{commands:R}),a[20]=R,a[21]=z);let B;a[22]===s?B=a[23]:(B=async()=>await s({to:`/ec2/describe-addresses`}),a[22]=s,a[23]=B);let V;a[24]!==v.isPending||a[25]!==T||a[26]!==B?(V=(0,_.jsx)(d,{isPending:v.isPending,isSubmitting:T,onCancel:B,pendingLabel:`Allocating…`,submitLabel:`Allocate`}),a[24]=v.isPending,a[25]=T,a[26]=B,a[27]=V):V=a[27];let H;a[28]!==I||a[29]!==z||a[30]!==V||a[31]!==N?(H=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:N,children:[I,z,V]}),a[28]=I,a[29]=z,a[30]=V,a[31]=N,a[32]=H):H=a[32];let U;return a[33]!==H||a[34]!==M?(U=(0,_.jsxs)(_.Fragment,{children:[A,j,M,H]}),a[33]=H,a[34]=M,a[35]=U):U=a[35],U}function y(e){let t=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 allocate-address`},{type:`flag`,value:` \\
|
||||
import{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{t as n}from"./cli-command-panel.js";import{t as r}from"./ec2.js";import{Oa as i,bs as a,gs as o,ps as s}from"./index.js";import{a as c,i as l,t as u}from"./zod.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{a as p,t as m}from"./field.js";import{n as h}from"./ec22.js";var g=s(),_=a();function v(){let a=(0,g.c)(36),s=o(),v=r(),b;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={resolver:u(h),defaultValues:{name:``}},a[0]=b):b=a[0];let{control:x,handleSubmit:S,register:C,formState:w}=l(b),{isSubmitting:T}=w,E;a[1]===x?E=a[2]:(E={control:x},a[1]=x,a[2]=E);let D=c(E),O;a[3]!==v||a[4]!==s?(O=async e=>{let t=(await v.mutateAsync({name:e.name?.trim()??void 0})).AllocationId;s(t?{to:`/ec2/describe-addresses/$id`,params:{id:t}}:{to:`/ec2/describe-addresses`})},a[3]=v,a[4]=s,a[5]=O):O=a[5];let k=O,A,j;a[6]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,_.jsx)(t,{to:`/ec2/describe-addresses`,children:`Back to Elastic IPs`}),j=(0,_.jsx)(f,{title:`Allocate Elastic IP`}),a[6]=A,a[7]=j):(A=a[6],j=a[7]);let M;a[8]===v.error?M=a[9]:(M=v.error&&(0,_.jsx)(e,{error:v.error,msg:`Failed to allocate Elastic IP`}),a[8]=v.error,a[9]=M);let N;a[10]!==S||a[11]!==k?(N=S(k),a[10]=S,a[11]=k,a[12]=N):N=a[12];let P;a[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,_.jsx)(p,{children:(0,_.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),a[13]=P):P=a[13];let F;a[14]===C?F=a[15]:(F=C(`name`),a[14]=C,a[15]=F);let I;a[16]===F?I=a[17]:(I=(0,_.jsxs)(m,{children:[P,(0,_.jsx)(i,{id:`name`,placeholder:`my-elastic-ip`,...F})]}),a[16]=F,a[17]=I);let L=D.name??``,R;a[18]===L?R=a[19]:(R=y(L),a[18]=L,a[19]=R);let z;a[20]===R?z=a[21]:(z=(0,_.jsx)(n,{commands:R}),a[20]=R,a[21]=z);let B;a[22]===s?B=a[23]:(B=async()=>await s({to:`/ec2/describe-addresses`}),a[22]=s,a[23]=B);let V;a[24]!==v.isPending||a[25]!==T||a[26]!==B?(V=(0,_.jsx)(d,{isPending:v.isPending,isSubmitting:T,onCancel:B,pendingLabel:`Allocating…`,submitLabel:`Allocate`}),a[24]=v.isPending,a[25]=T,a[26]=B,a[27]=V):V=a[27];let H;a[28]!==I||a[29]!==z||a[30]!==V||a[31]!==N?(H=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:N,children:[I,z,V]}),a[28]=I,a[29]=z,a[30]=V,a[31]=N,a[32]=H):H=a[32];let U;return a[33]!==H||a[34]!==M?(U=(0,_.jsxs)(_.Fragment,{children:[A,j,M,H]}),a[33]=H,a[34]=M,a[35]=U):U=a[35],U}function y(e){let t=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 allocate-address`},{type:`flag`,value:` \\
|
||||
--domain`},{type:`value`,value:` vpc`}];return e.trim()&&t.push({type:`flag`,value:` \\
|
||||
--tag-specifications`},{type:`value`,value:` 'ResourceType=elastic-ip,Tags=[{Key=Name,Value=${e.trim()}}]'`}),[{label:`Allocate Elastic IP`,parts:t}]}export{v as component};
|
||||
@@ -1 +1 @@
|
||||
import{No as e,fs as t,ms as n,ys as r}from"./index.js";import{n as i,t as a}from"./detail-row.js";var o=t(),s=r();function c(t){let r=(0,o.c)(58),{image:c,showExtendedDetails:u}=t,d=u===void 0?!1:u,f;r[0]===c.CreationDate?f=r[1]:(f=e(c.CreationDate),r[0]=c.CreationDate,r[1]=f);let p=f,m=d?`AMI Information`:`AMI Details`,h;r[2]===m?h=r[3]:(h=(0,s.jsx)(i.Header,{children:m}),r[2]=m,r[3]=h);let g;r[4]!==c.ImageId||r[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,r[4]=c.ImageId,r[5]=d,r[6]=g):g=r[6];let _;r[7]===g?_=r[8]:(_=(0,s.jsx)(a,{label:`AMI ID`,value:g}),r[7]=g,r[8]=_);let v;r[9]===c.Name?v=r[10]:(v=(0,s.jsx)(a,{label:`AMI Name`,value:c.Name}),r[9]=c.Name,r[10]=v);let y;r[11]===c.Description?y=r[12]:(y=(0,s.jsx)(a,{label:`Description`,value:c.Description}),r[11]=c.Description,r[12]=y);let b;r[13]===c.Architecture?b=r[14]:(b=(0,s.jsx)(a,{label:`Architecture`,value:c.Architecture}),r[13]=c.Architecture,r[14]=b);let x;r[15]===c.VirtualizationType?x=r[16]:(x=(0,s.jsx)(a,{label:`Virtualization Type`,value:c.VirtualizationType}),r[15]=c.VirtualizationType,r[16]=x);let S=c.Platform??`Linux`,C;r[17]===S?C=r[18]:(C=(0,s.jsx)(a,{label:`Platform`,value:S}),r[17]=S,r[18]=C);let w;r[19]===c.PlatformDetails?w=r[20]:(w=(0,s.jsx)(a,{label:`Platform Details`,value:c.PlatformDetails}),r[19]=c.PlatformDetails,r[20]=w);let T;r[21]===c.ImageType?T=r[22]:(T=(0,s.jsx)(a,{label:`Image Type`,value:c.ImageType}),r[21]=c.ImageType,r[22]=T);let E;r[23]===c.RootDeviceType?E=r[24]:(E=(0,s.jsx)(a,{label:`Root Device Type`,value:c.RootDeviceType}),r[23]=c.RootDeviceType,r[24]=E);let D;r[25]===c.RootDeviceName?D=r[26]:(D=(0,s.jsx)(a,{label:`Root Device Name`,value:c.RootDeviceName}),r[25]=c.RootDeviceName,r[26]=D);let O;r[27]===c.OwnerId?O=r[28]:(O=(0,s.jsx)(a,{label:`Owner`,value:c.OwnerId}),r[27]=c.OwnerId,r[28]=O);let k;r[29]===c.State?k=r[30]:(k=(0,s.jsx)(a,{label:`State`,value:c.State}),r[29]=c.State,r[30]=k);let A;r[31]!==p||r[32]!==c.Public||r[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`})]}),r[31]=p,r[32]=c.Public,r[33]=d,r[34]=A):A=r[34];let j;r[35]!==x||r[36]!==C||r[37]!==w||r[38]!==T||r[39]!==E||r[40]!==D||r[41]!==O||r[42]!==k||r[43]!==A||r[44]!==_||r[45]!==v||r[46]!==y||r[47]!==b?(j=(0,s.jsxs)(i.Content,{children:[_,v,y,b,x,C,w,T,E,D,O,k,A]}),r[35]=x,r[36]=C,r[37]=w,r[38]=T,r[39]=E,r[40]=D,r[41]=O,r[42]=k,r[43]=A,r[44]=_,r[45]=v,r[46]=y,r[47]=b,r[48]=j):j=r[48];let M;r[49]!==j||r[50]!==h?(M=(0,s.jsxs)(i,{children:[h,j]}),r[49]=j,r[50]=h,r[51]=M):M=r[51];let N;r[52]!==c.BlockDeviceMappings||r[53]!==d?(N=d&&c.BlockDeviceMappings&&c.BlockDeviceMappings.length>0&&c.BlockDeviceMappings.map(l),r[52]=c.BlockDeviceMappings,r[53]=d,r[54]=N):N=r[54];let P;return r[55]!==M||r[56]!==N?(P=(0,s.jsxs)(s.Fragment,{children:[M,N]}),r[55]=M,r[56]=N,r[57]=P):P=r[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{Po as e,bs as t,hs as n,ps as r}from"./index.js";import{n as i,t as a}from"./detail-row.js";var o=r(),s=t();function c(t){let r=(0,o.c)(58),{image:c,showExtendedDetails:u}=t,d=u===void 0?!1:u,f;r[0]===c.CreationDate?f=r[1]:(f=e(c.CreationDate),r[0]=c.CreationDate,r[1]=f);let p=f,m=d?`AMI Information`:`AMI Details`,h;r[2]===m?h=r[3]:(h=(0,s.jsx)(i.Header,{children:m}),r[2]=m,r[3]=h);let g;r[4]!==c.ImageId||r[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,r[4]=c.ImageId,r[5]=d,r[6]=g):g=r[6];let _;r[7]===g?_=r[8]:(_=(0,s.jsx)(a,{label:`AMI ID`,value:g}),r[7]=g,r[8]=_);let v;r[9]===c.Name?v=r[10]:(v=(0,s.jsx)(a,{label:`AMI Name`,value:c.Name}),r[9]=c.Name,r[10]=v);let y;r[11]===c.Description?y=r[12]:(y=(0,s.jsx)(a,{label:`Description`,value:c.Description}),r[11]=c.Description,r[12]=y);let b;r[13]===c.Architecture?b=r[14]:(b=(0,s.jsx)(a,{label:`Architecture`,value:c.Architecture}),r[13]=c.Architecture,r[14]=b);let x;r[15]===c.VirtualizationType?x=r[16]:(x=(0,s.jsx)(a,{label:`Virtualization Type`,value:c.VirtualizationType}),r[15]=c.VirtualizationType,r[16]=x);let S=c.Platform??`Linux`,C;r[17]===S?C=r[18]:(C=(0,s.jsx)(a,{label:`Platform`,value:S}),r[17]=S,r[18]=C);let w;r[19]===c.PlatformDetails?w=r[20]:(w=(0,s.jsx)(a,{label:`Platform Details`,value:c.PlatformDetails}),r[19]=c.PlatformDetails,r[20]=w);let T;r[21]===c.ImageType?T=r[22]:(T=(0,s.jsx)(a,{label:`Image Type`,value:c.ImageType}),r[21]=c.ImageType,r[22]=T);let E;r[23]===c.RootDeviceType?E=r[24]:(E=(0,s.jsx)(a,{label:`Root Device Type`,value:c.RootDeviceType}),r[23]=c.RootDeviceType,r[24]=E);let D;r[25]===c.RootDeviceName?D=r[26]:(D=(0,s.jsx)(a,{label:`Root Device Name`,value:c.RootDeviceName}),r[25]=c.RootDeviceName,r[26]=D);let O;r[27]===c.OwnerId?O=r[28]:(O=(0,s.jsx)(a,{label:`Owner`,value:c.OwnerId}),r[27]=c.OwnerId,r[28]=O);let k;r[29]===c.State?k=r[30]:(k=(0,s.jsx)(a,{label:`State`,value:c.State}),r[29]=c.State,r[30]=k);let A;r[31]!==p||r[32]!==c.Public||r[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`})]}),r[31]=p,r[32]=c.Public,r[33]=d,r[34]=A):A=r[34];let j;r[35]!==x||r[36]!==C||r[37]!==w||r[38]!==T||r[39]!==E||r[40]!==D||r[41]!==O||r[42]!==k||r[43]!==A||r[44]!==_||r[45]!==v||r[46]!==y||r[47]!==b?(j=(0,s.jsxs)(i.Content,{children:[_,v,y,b,x,C,w,T,E,D,O,k,A]}),r[35]=x,r[36]=C,r[37]=w,r[38]=T,r[39]=E,r[40]=D,r[41]=O,r[42]=k,r[43]=A,r[44]=_,r[45]=v,r[46]=y,r[47]=b,r[48]=j):j=r[48];let M;r[49]!==j||r[50]!==h?(M=(0,s.jsxs)(i,{children:[h,j]}),r[49]=j,r[50]=h,r[51]=M):M=r[51];let N;r[52]!==c.BlockDeviceMappings||r[53]!==d?(N=d&&c.BlockDeviceMappings&&c.BlockDeviceMappings.length>0&&c.BlockDeviceMappings.map(l),r[52]=c.BlockDeviceMappings,r[53]=d,r[54]=N):N=r[54];let P;return r[55]!==M||r[56]!==N?(P=(0,s.jsxs)(s.Fragment,{children:[M,N]}),r[55]=M,r[56]=N,r[57]=P):P=r[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};
|
||||
@@ -1 +1 @@
|
||||
import{fs as e,ms as t,ts as n,ys as r}from"./index.js";var i=n(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),a=e(),o=r();function s(e){let n=(0,a.c)(7),r,s;n[0]===e?(r=n[1],s=n[2]):({children:r,...s}=e,n[0]=e,n[1]=r,n[2]=s);let c;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,o.jsx)(i,{className:`size-4`}),n[3]=c):c=n[3];let l;return n[4]!==r||n[5]!==s?(l=(0,o.jsxs)(t,{className:`mb-6 inline-flex items-center gap-2 text-sm`,...s,children:[c,r]}),n[4]=r,n[5]=s,n[6]=l):l=n[6],l}export{s as t};
|
||||
import{bs as e,hs as t,ns as n,ps as r}from"./index.js";var i=n(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),a=r(),o=e();function s(e){let n=(0,a.c)(7),r,s;n[0]===e?(r=n[1],s=n[2]):({children:r,...s}=e,n[0]=e,n[1]=r,n[2]=s);let c;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,o.jsx)(i,{className:`size-4`}),n[3]=c):c=n[3];let l;return n[4]!==r||n[5]!==s?(l=(0,o.jsxs)(t,{className:`mb-6 inline-flex items-center gap-2 text-sm`,...s,children:[c,r]}),n[4]=r,n[5]=s,n[6]=l):l=n[6],l}export{s as t};
|
||||
@@ -1 +1 @@
|
||||
import{Ao as e,ds as t,fs as n,ns as r,rs as i}from"./index.js";var a=n(),o=r(`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(n){let r=(0,a.c)(13),s,c,l,u,d;if(r[0]!==n){let{className:a,variant:f,render:p,...m}=n;s=p,d=f===void 0?`default`:f,u=i,c=`span`,l=t({className:e(o({className:a,variant:d}))},m),r[0]=n,r[1]=s,r[2]=c,r[3]=l,r[4]=u,r[5]=d}else s=r[1],c=r[2],l=r[3],u=r[4],d=r[5];let f;r[6]===d?f=r[7]:(f={slot:`badge`,variant:d},r[6]=d,r[7]=f);let p;return r[8]!==s||r[9]!==c||r[10]!==l||r[11]!==f?(p={defaultTagName:c,props:l,render:s,state:f},r[8]=s,r[9]=c,r[10]=l,r[11]=f,r[12]=p):p=r[12],u(p)}export{s as t};
|
||||
import{fs as e,is as t,jo as n,ps as r,rs as i}from"./index.js";var a=r(),o=i(`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(r){let i=(0,a.c)(13),s,c,l,u,d;if(i[0]!==r){let{className:a,variant:f,render:p,...m}=r;s=p,d=f===void 0?`default`:f,u=t,c=`span`,l=e({className:n(o({className:a,variant:d}))},m),i[0]=r,i[1]=s,i[2]=c,i[3]=l,i[4]=u,i[5]=d}else s=i[1],c=i[2],l=i[3],u=i[4],d=i[5];let f;i[6]===d?f=i[7]:(f={slot:`badge`,variant:d},i[6]=d,i[7]=f);let p;return i[8]!==s||i[9]!==c||i[10]!==l||i[11]!==f?(p={defaultTagName:c,props:l,render:s,state:f},i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=p):p=i[12],u(p)}export{s as t};
|
||||
@@ -1 +1 @@
|
||||
import{Ao as e,fs as t,ys as n}from"./index.js";var r=t(),i=n();function a(t){let n=(0,r.c)(10),a,o,s;n[0]===t?(a=n[1],o=n[2],s=n[3]):({className:a,size:s,...o}=t,n[0]=t,n[1]=a,n[2]=o,n[3]=s);let c=s===void 0?`default`:s,l;n[4]===a?l=n[5]:(l=e(`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),n[4]=a,n[5]=l);let u;return n[6]!==o||n[7]!==c||n[8]!==l?(u=(0,i.jsx)(`div`,{className:l,"data-size":c,"data-slot":`card`,...o}),n[6]=o,n[7]=c,n[8]=l,n[9]=u):u=n[9],u}function o(t){let n=(0,r.c)(8),a,o;n[0]===t?(a=n[1],o=n[2]):({className:a,...o}=t,n[0]=t,n[1]=a,n[2]=o);let s;n[3]===a?s=n[4]:(s=e(`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),n[3]=a,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-header`,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}function s(t){let n=(0,r.c)(8),a,o;n[0]===t?(a=n[1],o=n[2]):({className:a,...o}=t,n[0]=t,n[1]=a,n[2]=o);let s;n[3]===a?s=n[4]:(s=e(`text-sm font-medium`,a),n[3]=a,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-title`,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}function c(t){let n=(0,r.c)(8),a,o;n[0]===t?(a=n[1],o=n[2]):({className:a,...o}=t,n[0]=t,n[1]=a,n[2]=o);let s;n[3]===a?s=n[4]:(s=e(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,a),n[3]=a,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-action`,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}function l(t){let n=(0,r.c)(8),a,o;n[0]===t?(a=n[1],o=n[2]):({className:a,...o}=t,n[0]=t,n[1]=a,n[2]=o);let s;n[3]===a?s=n[4]:(s=e(`px-4 group-data-[size=sm]/card:px-3`,a),n[3]=a,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-content`,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}function u(t){let n=(0,r.c)(8),a,o;n[0]===t?(a=n[1],o=n[2]):({className:a,...o}=t,n[0]=t,n[1]=a,n[2]=o);let s;n[3]===a?s=n[4]:(s=e(`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),n[3]=a,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-footer`,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}export{o as a,u as i,c as n,s as o,l as r,a as t};
|
||||
import{bs as e,jo as t,ps as n}from"./index.js";var r=n(),i=e();function a(e){let n=(0,r.c)(10),a,o,s;n[0]===e?(a=n[1],o=n[2],s=n[3]):({className:a,size:s,...o}=e,n[0]=e,n[1]=a,n[2]=o,n[3]=s);let c=s===void 0?`default`:s,l;n[4]===a?l=n[5]:(l=t(`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),n[4]=a,n[5]=l);let u;return n[6]!==o||n[7]!==c||n[8]!==l?(u=(0,i.jsx)(`div`,{className:l,"data-size":c,"data-slot":`card`,...o}),n[6]=o,n[7]=c,n[8]=l,n[9]=u):u=n[9],u}function o(e){let n=(0,r.c)(8),a,o;n[0]===e?(a=n[1],o=n[2]):({className:a,...o}=e,n[0]=e,n[1]=a,n[2]=o);let s;n[3]===a?s=n[4]:(s=t(`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),n[3]=a,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-header`,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}function s(e){let n=(0,r.c)(8),a,o;n[0]===e?(a=n[1],o=n[2]):({className:a,...o}=e,n[0]=e,n[1]=a,n[2]=o);let s;n[3]===a?s=n[4]:(s=t(`text-sm font-medium`,a),n[3]=a,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-title`,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}function c(e){let n=(0,r.c)(8),a,o;n[0]===e?(a=n[1],o=n[2]):({className:a,...o}=e,n[0]=e,n[1]=a,n[2]=o);let s;n[3]===a?s=n[4]:(s=t(`col-start-2 row-span-2 row-start-1 self-start justify-self-end`,a),n[3]=a,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-action`,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}function l(e){let n=(0,r.c)(8),a,o;n[0]===e?(a=n[1],o=n[2]):({className:a,...o}=e,n[0]=e,n[1]=a,n[2]=o);let s;n[3]===a?s=n[4]:(s=t(`px-4 group-data-[size=sm]/card:px-3`,a),n[3]=a,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-content`,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c}function u(e){let n=(0,r.c)(8),a,o;n[0]===e?(a=n[1],o=n[2]):({className:a,...o}=e,n[0]=e,n[1]=a,n[2]=o);let s;n[3]===a?s=n[4]:(s=t(`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),n[3]=a,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=(0,i.jsx)(`div`,{className:s,"data-slot":`card-footer`,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[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,t}from"./error-banner.js";import{Hr as n,Kr as r,Ur as i,Vr as a,bs as o,fs as s,kt as c,vs as l,ys as u,zs 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 r.classBuilder().ep(n).m(function(e,t,n,r){return[i(n,e.getEndpointParameterInstructions())]}).s(`CertificateManager`,`ImportCertificate`,{}).n(`ACMClient`,`ImportCertificateCommand`).sc(a).build(){},S=d(o(),1),C=s(),w=new TextEncoder;function T(){let t=(0,C.c)(2),n=l(),r;return t[0]===n?r=t[1]:(r={mutationFn:E,onSuccess:()=>{n.invalidateQueries({queryKey:[`acm`,`certificates`]})}},t[0]=n,t[1]=r),e(r)}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=u();function O(e){let n=(0,C.c)(54),{open:r,onOpenChange:i,onImported:a}=e,[o,s]=(0,S.useState)(``),[c,l]=(0,S.useState)(``),[u,d]=(0,S.useState)(``),x=T(),w;n[0]===x?w=n[1]:(w=()=>{s(``),l(``),d(``),x.reset()},n[0]=x,n[1]=w);let E=w,O;n[2]!==i||n[3]!==E?(O=e=>{e||E(),i(e)},n[2]=i,n[3]=E,n[4]=O):O=n[4];let k=O,A;n[5]!==o||n[6]!==c?(A=o.trim().length>0&&c.trim().length>0,n[5]=o,n[6]=c,n[7]=A):A=n[7];let j=A,M;n[8]!==j||n[9]!==o||n[10]!==u||n[11]!==x||n[12]!==a||n[13]!==i||n[14]!==c||n[15]!==E?(M=async()=>{if(j)try{let e=await x.mutateAsync({certificate:o,privateKey:c,certificateChain:u});e.CertificateArn&&a(e.CertificateArn),E(),i(!1)}catch{}},n[8]=j,n[9]=o,n[10]=u,n[11]=x,n[12]=a,n[13]=i,n[14]=c,n[15]=E,n[16]=M):M=n[16];let N=M,P;n[17]===Symbol.for(`react.memo_cache_sentinel`)?(P={maxWidth:`36rem`,width:`calc(100vw - 2rem)`},n[17]=P):P=n[17];let F;n[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.`})]}),n[18]=F):F=n[18];let I;n[19]===x.error?I=n[20]:(I=x.error&&(0,D.jsx)(t,{error:x.error,msg:`Failed to import certificate`}),n[19]=x.error,n[20]=I);let L;n[21]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-body`,children:`Certificate body`})}),n[21]=L):L=n[21];let R;n[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>s(e.target.value),n[22]=R):R=n[22];let z;n[23]===o?z=n[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})]}),n[23]=o,n[24]=z);let B;n[25]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-key`,children:`Private key`})}),n[25]=B):B=n[25];let V;n[26]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>l(e.target.value),n[26]=V):V=n[26];let H;n[27]===c?H=n[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})]}),n[27]=c,n[28]=H);let U;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-chain`,children:`Certificate chain (optional)`})}),n[29]=U):U=n[29];let W;n[30]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>d(e.target.value),n[30]=W):W=n[30];let G;n[31]===u?G=n[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})]}),n[31]=u,n[32]=G);let K;n[33]!==z||n[34]!==H||n[35]!==G?(K=(0,D.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[z,H,G]}),n[33]=z,n[34]=H,n[35]=G,n[36]=K):K=n[36];let q;n[37]===x.isPending?q=n[38]:(q=(0,D.jsx)(y,{disabled:x.isPending,children:`Cancel`}),n[37]=x.isPending,n[38]=q);let J=!j||x.isPending,Y=x.isPending?`Importing…`:`Import`,X;n[39]!==N||n[40]!==J||n[41]!==Y?(X=(0,D.jsx)(_,{disabled:J,onClick:N,children:Y}),n[39]=N,n[40]=J,n[41]=Y,n[42]=X):X=n[42];let Z;n[43]!==q||n[44]!==X?(Z=(0,D.jsxs)(v,{children:[q,X]}),n[43]=q,n[44]=X,n[45]=Z):Z=n[45];let Q;n[46]!==K||n[47]!==Z||n[48]!==I?(Q=(0,D.jsxs)(h,{className:`grid-cols-[minmax(0,1fr)]`,style:P,children:[F,I,K,Z]}),n[46]=K,n[47]=Z,n[48]=I,n[49]=Q):Q=n[49];let $;return n[50]!==k||n[51]!==r||n[52]!==Q?($=(0,D.jsx)(te,{onOpenChange:k,open:r,children:Q}),n[50]=k,n[51]=r,n[52]=Q,n[53]=$):$=n[53],$}export{O as t};
|
||||
import{n as e,t}from"./error-banner.js";import{Bs as n,Hr as r,Ur as i,Wr as a,bs as o,kt as s,ps as c,qr as l,xs as u,ys 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(i).m(function(e,t,n,r){return[a(n,e.getEndpointParameterInstructions())]}).s(`CertificateManager`,`ImportCertificate`,{}).n(`ACMClient`,`ImportCertificateCommand`).sc(r).build(){},S=n(u(),1),C=c(),w=new TextEncoder;function T(){let t=(0,C.c)(2),n=d(),r;return t[0]===n?r=t[1]:(r={mutationFn:E,onSuccess:()=>{n.invalidateQueries({queryKey:[`acm`,`certificates`]})}},t[0]=n,t[1]=r),e(r)}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 s().send(t)}var D=o();function O(e){let n=(0,C.c)(54),{open:r,onOpenChange:i,onImported:a}=e,[o,s]=(0,S.useState)(``),[c,l]=(0,S.useState)(``),[u,d]=(0,S.useState)(``),x=T(),w;n[0]===x?w=n[1]:(w=()=>{s(``),l(``),d(``),x.reset()},n[0]=x,n[1]=w);let E=w,O;n[2]!==i||n[3]!==E?(O=e=>{e||E(),i(e)},n[2]=i,n[3]=E,n[4]=O):O=n[4];let k=O,A;n[5]!==o||n[6]!==c?(A=o.trim().length>0&&c.trim().length>0,n[5]=o,n[6]=c,n[7]=A):A=n[7];let j=A,M;n[8]!==j||n[9]!==o||n[10]!==u||n[11]!==x||n[12]!==a||n[13]!==i||n[14]!==c||n[15]!==E?(M=async()=>{if(j)try{let e=await x.mutateAsync({certificate:o,privateKey:c,certificateChain:u});e.CertificateArn&&a(e.CertificateArn),E(),i(!1)}catch{}},n[8]=j,n[9]=o,n[10]=u,n[11]=x,n[12]=a,n[13]=i,n[14]=c,n[15]=E,n[16]=M):M=n[16];let N=M,P;n[17]===Symbol.for(`react.memo_cache_sentinel`)?(P={maxWidth:`36rem`,width:`calc(100vw - 2rem)`},n[17]=P):P=n[17];let F;n[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.`})]}),n[18]=F):F=n[18];let I;n[19]===x.error?I=n[20]:(I=x.error&&(0,D.jsx)(t,{error:x.error,msg:`Failed to import certificate`}),n[19]=x.error,n[20]=I);let L;n[21]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-body`,children:`Certificate body`})}),n[21]=L):L=n[21];let R;n[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>s(e.target.value),n[22]=R):R=n[22];let z;n[23]===o?z=n[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})]}),n[23]=o,n[24]=z);let B;n[25]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-key`,children:`Private key`})}),n[25]=B):B=n[25];let V;n[26]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>l(e.target.value),n[26]=V):V=n[26];let H;n[27]===c?H=n[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})]}),n[27]=c,n[28]=H);let U;n[29]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,D.jsx)(f,{children:(0,D.jsx)(`label`,{htmlFor:`cert-chain`,children:`Certificate chain (optional)`})}),n[29]=U):U=n[29];let W;n[30]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>d(e.target.value),n[30]=W):W=n[30];let G;n[31]===u?G=n[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})]}),n[31]=u,n[32]=G);let K;n[33]!==z||n[34]!==H||n[35]!==G?(K=(0,D.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[z,H,G]}),n[33]=z,n[34]=H,n[35]=G,n[36]=K):K=n[36];let q;n[37]===x.isPending?q=n[38]:(q=(0,D.jsx)(y,{disabled:x.isPending,children:`Cancel`}),n[37]=x.isPending,n[38]=q);let J=!j||x.isPending,Y=x.isPending?`Importing…`:`Import`,X;n[39]!==N||n[40]!==J||n[41]!==Y?(X=(0,D.jsx)(_,{disabled:J,onClick:N,children:Y}),n[39]=N,n[40]=J,n[41]=Y,n[42]=X):X=n[42];let Z;n[43]!==q||n[44]!==X?(Z=(0,D.jsxs)(v,{children:[q,X]}),n[43]=q,n[44]=X,n[45]=Z):Z=n[45];let Q;n[46]!==K||n[47]!==Z||n[48]!==I?(Q=(0,D.jsxs)(h,{className:`grid-cols-[minmax(0,1fr)]`,style:P,children:[F,I,K,Z]}),n[46]=K,n[47]=Z,n[48]=I,n[49]=Q):Q=n[49];let $;return n[50]!==k||n[51]!==r||n[52]!==Q?($=(0,D.jsx)(te,{onOpenChange:k,open:r,children:Q}),n[50]=k,n[51]=r,n[52]=Q,n[53]=$):$=n[53],$}export{O as t};
|
||||
@@ -1 +1 @@
|
||||
import{ts as e}from"./index.js";var t=e(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);export{t};
|
||||
import{ns as e}from"./index.js";var t=e(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);export{t};
|
||||
@@ -1 +1 @@
|
||||
import{ts as e}from"./index.js";var t=e(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]);export{t};
|
||||
import{ns as e}from"./index.js";var t=e(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]);export{t};
|
||||
@@ -1 +1 @@
|
||||
import{ts as e}from"./index.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{t};
|
||||
import{ns as e}from"./index.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);export{t};
|
||||
@@ -1,3 +1,3 @@
|
||||
import{t as e}from"./check.js";import{t}from"./chevron-down.js";import{t as n}from"./copy.js";import{Ao as r,Do as i,bs as a,fs as o,ts as s,ys as c,zs as l}from"./index.js";import{t as u}from"./use-copy-to-clipboard.js";var d=s(`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=o(),p=l(a(),1),m=c(),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{t as e}from"./check.js";import{t}from"./chevron-down.js";import{t as n}from"./copy.js";import{Bs as r,Oo as i,bs as a,jo as o,ns as s,ps as c,xs as l}from"./index.js";import{t as u}from"./use-copy-to-clipboard.js";var d=s(`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=c(),p=r(l(),1),m=a(),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 _(a){let o=(0,f.c)(18),{commands:s}=a,[c,l]=(0,p.useState)(!1),{copied:h,copy:_}=u();if(s.length===0)return null;let b;o[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>l(y),o[0]=b):b=o[0];let x,S;o[1]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,m.jsx)(d,{className:`size-3.5`}),S=(0,m.jsx)(`span`,{children:`AWS CLI`}),o[1]=x,o[2]=S):(x=o[1],S=o[2]);let C=c&&`rotate-180`,w;o[3]===C?w=o[4]:(w=r(`ml-auto size-3.5 transition-transform`,C),o[3]=C,o[4]=w);let T;o[5]===w?T=o[6]:(T=(0,m.jsx)(t,{className:w}),o[5]=w,o[6]=T);let E;o[7]!==c||o[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":c,children:[x,S,T]}),o[7]=c,o[8]=T,o[9]=E):E=o[9];let D;o[10]!==s||o[11]!==h||o[12]!==_||o[13]!==c?(D=c&&(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:s.length>1?`${s.length} commands`:`command`}),(0,m.jsxs)(i,{type:`button`,variant:`ghost`,size:`xs`,onClick:async()=>await _(g(s)),children:[h?(0,m.jsx)(e,{className:`size-2.5`}):(0,m.jsx)(n,{className:`size-2.5`}),h?`Copied`:`Copy`]})]}),(0,m.jsx)(`div`,{className:`overflow-x-auto p-3`,children:s.map((e,t)=>(0,m.jsxs)(`div`,{children:[s.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<s.length-1&&(0,m.jsx)(`div`,{className:`my-2`})]},e.label))})]}),o[10]=s,o[11]=h,o[12]=_,o[13]=c,o[14]=D):D=o[14];let O;return o[15]!==E||o[16]!==D?(O=(0,m.jsxs)(`div`,{className:`rounded-md border border-border`,children:[E,D]}),o[15]=E,o[16]=D,o[17]=O):O=o[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};
|
||||
`)}function _(r){let a=(0,f.c)(18),{commands:s}=r,[c,l]=(0,p.useState)(!1),{copied:h,copy:_}=u();if(s.length===0)return null;let b;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>l(y),a[0]=b):b=a[0];let x,S;a[1]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,m.jsx)(d,{className:`size-3.5`}),S=(0,m.jsx)(`span`,{children:`AWS CLI`}),a[1]=x,a[2]=S):(x=a[1],S=a[2]);let C=c&&`rotate-180`,w;a[3]===C?w=a[4]:(w=o(`ml-auto size-3.5 transition-transform`,C),a[3]=C,a[4]=w);let T;a[5]===w?T=a[6]:(T=(0,m.jsx)(t,{className:w}),a[5]=w,a[6]=T);let E;a[7]!==c||a[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":c,children:[x,S,T]}),a[7]=c,a[8]=T,a[9]=E):E=a[9];let D;a[10]!==s||a[11]!==h||a[12]!==_||a[13]!==c?(D=c&&(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:s.length>1?`${s.length} commands`:`command`}),(0,m.jsxs)(i,{type:`button`,variant:`ghost`,size:`xs`,onClick:async()=>await _(g(s)),children:[h?(0,m.jsx)(e,{className:`size-2.5`}):(0,m.jsx)(n,{className:`size-2.5`}),h?`Copied`:`Copy`]})]}),(0,m.jsx)(`div`,{className:`overflow-x-auto p-3`,children:s.map((e,t)=>(0,m.jsxs)(`div`,{children:[s.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<s.length-1&&(0,m.jsx)(`div`,{className:`my-2`})]},e.label))})]}),a[10]=s,a[11]=h,a[12]=_,a[13]=c,a[14]=D):D=a[14];let O;return a[15]!==E||a[16]!==D?(O=(0,m.jsxs)(`div`,{className:`rounded-md border border-border`,children:[E,D]}),a[15]=E,a[16]=D,a[17]=O):O=a[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};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{ts as e}from"./index.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]);export{t};
|
||||
import{ns as e}from"./index.js";var t=e(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]);export{t};
|
||||
@@ -1 +1 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{t as n}from"./cli-command-panel.js";import{t as r}from"./s3.js";import{Da as i,bi as a,fs as o,hs as s,vi as c,ys 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=o(),y=c({bucketName:a().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=l();function x(){let a=(0,v.c)(44),o=s(),c=r(),l;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={resolver:f(y)},a[0]=l):l=a[0];let{handleSubmit:x,register:C,control:w,formState:T}=d(l),{errors:E,isSubmitting:D}=T,O;a[1]===w?O=a[2]:(O={control:w},a[1]=w,a[2]=O);let k=u(O),A;a[3]===k?A=a[4]:(A=e=>e?k[e]:void 0,a[3]=k,a[4]=A);let j=A,M;a[5]!==c||a[6]!==o?(M=async e=>{await c.mutateAsync(e),o({to:`/s3/ls`})},a[5]=c,a[6]=o,a[7]=M):M=a[7];let N=M,P,F;a[8]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,b.jsx)(t,{to:`/s3/ls`,children:`Back to buckets`}),F=(0,b.jsx)(m,{title:`Create Bucket`}),a[8]=P,a[9]=F):(P=a[8],F=a[9]);let I;a[10]===c.error?I=a[11]:(I=c.error&&(0,b.jsx)(e,{error:c.error,msg:`Failed to create bucket`}),a[10]=c.error,a[11]=I);let L;a[12]!==x||a[13]!==N?(L=x(N),a[12]=x,a[13]=N,a[14]=L):L=a[14];let R;a[15]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,b.jsx)(h,{children:(0,b.jsx)(`label`,{htmlFor:`bucketName`,children:`Bucket Name`})}),a[15]=R):R=a[15];let z=!!E.bucketName,B;a[16]===C?B=a[17]:(B=C(`bucketName`),a[16]=C,a[17]=B);let V;a[18]!==z||a[19]!==B?(V=(0,b.jsx)(i,{"aria-invalid":z,id:`bucketName`,placeholder:`my-bucket`,type:`text`,...B}),a[18]=z,a[19]=B,a[20]=V):V=a[20];let H;a[21]===E.bucketName?H=a[22]:(H=(0,b.jsx)(g,{errors:[E.bucketName]}),a[21]=E.bucketName,a[22]=H);let U;a[23]!==V||a[24]!==H?(U=(0,b.jsxs)(_,{children:[R,V,H]}),a[23]=V,a[24]=H,a[25]=U):U=a[25];let W;a[26]===j?W=a[27]:(W=S(j),a[26]=j,a[27]=W);let G;a[28]===W?G=a[29]:(G=(0,b.jsx)(n,{commands:W}),a[28]=W,a[29]=G);let K;a[30]===o?K=a[31]:(K=async()=>await o({to:`/s3/ls`}),a[30]=o,a[31]=K);let q;a[32]!==c.isPending||a[33]!==D||a[34]!==K?(q=(0,b.jsx)(p,{isPending:c.isPending,isSubmitting:D,onCancel:K,pendingLabel:`Creating…`,submitLabel:`Create Bucket`}),a[32]=c.isPending,a[33]=D,a[34]=K,a[35]=q):q=a[35];let J;a[36]!==U||a[37]!==G||a[38]!==q||a[39]!==L?(J=(0,b.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:L,children:[U,G,q]}),a[36]=U,a[37]=G,a[38]=q,a[39]=L,a[40]=J):J=a[40];let Y;return a[41]!==J||a[42]!==I?(Y=(0,b.jsxs)(b.Fragment,{children:[P,F,I,J]}),a[41]=J,a[42]=I,a[43]=Y):Y=a[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{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{t as n}from"./cli-command-panel.js";import{t as r}from"./s3.js";import{Oa as i,bs as a,gs as o,ps as s,xi as c,yi 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=s(),y=l({bucketName:c().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=a();function x(){let a=(0,v.c)(44),s=o(),c=r(),l;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={resolver:f(y)},a[0]=l):l=a[0];let{handleSubmit:x,register:C,control:w,formState:T}=d(l),{errors:E,isSubmitting:D}=T,O;a[1]===w?O=a[2]:(O={control:w},a[1]=w,a[2]=O);let k=u(O),A;a[3]===k?A=a[4]:(A=e=>e?k[e]:void 0,a[3]=k,a[4]=A);let j=A,M;a[5]!==c||a[6]!==s?(M=async e=>{await c.mutateAsync(e),s({to:`/s3/ls`})},a[5]=c,a[6]=s,a[7]=M):M=a[7];let N=M,P,F;a[8]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,b.jsx)(t,{to:`/s3/ls`,children:`Back to buckets`}),F=(0,b.jsx)(m,{title:`Create Bucket`}),a[8]=P,a[9]=F):(P=a[8],F=a[9]);let I;a[10]===c.error?I=a[11]:(I=c.error&&(0,b.jsx)(e,{error:c.error,msg:`Failed to create bucket`}),a[10]=c.error,a[11]=I);let L;a[12]!==x||a[13]!==N?(L=x(N),a[12]=x,a[13]=N,a[14]=L):L=a[14];let R;a[15]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,b.jsx)(h,{children:(0,b.jsx)(`label`,{htmlFor:`bucketName`,children:`Bucket Name`})}),a[15]=R):R=a[15];let z=!!E.bucketName,B;a[16]===C?B=a[17]:(B=C(`bucketName`),a[16]=C,a[17]=B);let V;a[18]!==z||a[19]!==B?(V=(0,b.jsx)(i,{"aria-invalid":z,id:`bucketName`,placeholder:`my-bucket`,type:`text`,...B}),a[18]=z,a[19]=B,a[20]=V):V=a[20];let H;a[21]===E.bucketName?H=a[22]:(H=(0,b.jsx)(g,{errors:[E.bucketName]}),a[21]=E.bucketName,a[22]=H);let U;a[23]!==V||a[24]!==H?(U=(0,b.jsxs)(_,{children:[R,V,H]}),a[23]=V,a[24]=H,a[25]=U):U=a[25];let W;a[26]===j?W=a[27]:(W=S(j),a[26]=j,a[27]=W);let G;a[28]===W?G=a[29]:(G=(0,b.jsx)(n,{commands:W}),a[28]=W,a[29]=G);let K;a[30]===s?K=a[31]:(K=async()=>await s({to:`/s3/ls`}),a[30]=s,a[31]=K);let q;a[32]!==c.isPending||a[33]!==D||a[34]!==K?(q=(0,b.jsx)(p,{isPending:c.isPending,isSubmitting:D,onCancel:K,pendingLabel:`Creating…`,submitLabel:`Create Bucket`}),a[32]=c.isPending,a[33]=D,a[34]=K,a[35]=q):q=a[35];let J;a[36]!==U||a[37]!==G||a[38]!==q||a[39]!==L?(J=(0,b.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:L,children:[U,G,q]}),a[36]=U,a[37]=G,a[38]=q,a[39]=L,a[40]=J):J=a[40];let Y;return a[41]!==J||a[42]!==I?(Y=(0,b.jsxs)(b.Fragment,{children:[P,F,I,J]}),a[41]=J,a[42]=I,a[43]=Y):Y=a[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};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{t as n}from"./cli-command-panel.js";import{a as r}from"./iam.js";import{Da as i,fs as a,hs as o,ys as s}from"./index.js";import{a as c,i as ee,t as l}from"./zod.js";import{t as u}from"./form-actions.js";import{t as d}from"./page-heading.js";import{a as f,r as p,t as m}from"./field.js";import{n as h}from"./iam2.js";var g=a(),_=s();function v(){let a=(0,g.c)(55),s=o(),v=r(),b;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={resolver:l(h)},a[0]=b):b=a[0];let{handleSubmit:x,register:S,control:C,formState:w}=ee(b),{errors:T,isSubmitting:E}=w,D;a[1]===C?D=a[2]:(D={control:C},a[1]=C,a[2]=D);let O=c(D),k;a[3]===O?k=a[4]:(k=e=>e?O[e]:void 0,a[3]=O,a[4]=k);let A=k,j;a[5]!==v||a[6]!==s?(j=async e=>{await v.mutateAsync(e),s({to:`/iam/list-instance-profiles`})},a[5]=v,a[6]=s,a[7]=j):j=a[7];let M=j,N,P;a[8]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,_.jsx)(t,{to:`/iam/list-instance-profiles`,children:`Back to instance profiles`}),P=(0,_.jsx)(d,{title:`Create Instance Profile`}),a[8]=N,a[9]=P):(N=a[8],P=a[9]);let F;a[10]===v.error?F=a[11]:(F=v.error&&(0,_.jsx)(e,{error:v.error,msg:`Failed to create instance profile`}),a[10]=v.error,a[11]=F);let I;a[12]!==x||a[13]!==M?(I=x(M),a[12]=x,a[13]=M,a[14]=I):I=a[14];let L;a[15]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,_.jsx)(f,{children:(0,_.jsx)(`label`,{htmlFor:`instanceProfileName`,children:`Instance Profile Name`})}),a[15]=L):L=a[15];let R=!!T.instanceProfileName,z;a[16]===S?z=a[17]:(z=S(`instanceProfileName`),a[16]=S,a[17]=z);let B;a[18]!==R||a[19]!==z?(B=(0,_.jsx)(i,{"aria-invalid":R,id:`instanceProfileName`,placeholder:`my-instance-profile...`,...z}),a[18]=R,a[19]=z,a[20]=B):B=a[20];let V;a[21]===T.instanceProfileName?V=a[22]:(V=(0,_.jsx)(p,{errors:[T.instanceProfileName]}),a[21]=T.instanceProfileName,a[22]=V);let H;a[23]!==B||a[24]!==V?(H=(0,_.jsxs)(m,{children:[L,B,V]}),a[23]=B,a[24]=V,a[25]=H):H=a[25];let U;a[26]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,_.jsx)(f,{children:(0,_.jsx)(`label`,{htmlFor:`path`,children:`Path (optional)`})}),a[26]=U):U=a[26];let W;a[27]===S?W=a[28]:(W=S(`path`),a[27]=S,a[28]=W);let G;a[29]===W?G=a[30]:(G=(0,_.jsx)(i,{id:`path`,placeholder:`/`,...W}),a[29]=W,a[30]=G);let K;a[31]===T.path?K=a[32]:(K=(0,_.jsx)(p,{errors:[T.path]}),a[31]=T.path,a[32]=K);let q;a[33]!==G||a[34]!==K?(q=(0,_.jsxs)(m,{children:[U,G,K]}),a[33]=G,a[34]=K,a[35]=q):q=a[35];let J;a[36]===A?J=a[37]:(J=y(A),a[36]=A,a[37]=J);let Y;a[38]===J?Y=a[39]:(Y=(0,_.jsx)(n,{commands:J}),a[38]=J,a[39]=Y);let X;a[40]===s?X=a[41]:(X=async()=>await s({to:`/iam/list-instance-profiles`}),a[40]=s,a[41]=X);let Z;a[42]!==v.isPending||a[43]!==E||a[44]!==X?(Z=(0,_.jsx)(u,{isPending:v.isPending,isSubmitting:E,onCancel:X,pendingLabel:`Creating...`,submitLabel:`Create Instance Profile`}),a[42]=v.isPending,a[43]=E,a[44]=X,a[45]=Z):Z=a[45];let Q;a[46]!==H||a[47]!==q||a[48]!==Y||a[49]!==Z||a[50]!==I?(Q=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:I,children:[H,q,Y,Z]}),a[46]=H,a[47]=q,a[48]=Y,a[49]=Z,a[50]=I,a[51]=Q):Q=a[51];let $;return a[52]!==Q||a[53]!==F?($=(0,_.jsxs)(_.Fragment,{children:[N,P,F,Q]}),a[52]=Q,a[53]=F,a[54]=$):$=a[54],$}function y(e){let t=e(`instanceProfileName`),n=typeof t==`string`?t:``,r=e(`path`),i=typeof r==`string`?r:``,a=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-instance-profile`},{type:`flag`,value:` --instance-profile-name`},{type:`value`,value:` ${n||`<InstanceProfileName>`}`}];return i&&i!==`/`&&a.push({type:`flag`,value:` --path`},{type:`value`,value:` ${i}`}),[{label:`Create Instance Profile`,parts:a}]}export{v as component};
|
||||
import{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{t as n}from"./cli-command-panel.js";import{a as r}from"./iam.js";import{Oa as i,bs as a,gs as o,ps as s}from"./index.js";import{a as c,i as ee,t as l}from"./zod.js";import{t as u}from"./form-actions.js";import{t as d}from"./page-heading.js";import{a as f,r as p,t as m}from"./field.js";import{n as h}from"./iam2.js";var g=s(),_=a();function v(){let a=(0,g.c)(55),s=o(),v=r(),b;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={resolver:l(h)},a[0]=b):b=a[0];let{handleSubmit:x,register:S,control:C,formState:w}=ee(b),{errors:T,isSubmitting:E}=w,D;a[1]===C?D=a[2]:(D={control:C},a[1]=C,a[2]=D);let O=c(D),k;a[3]===O?k=a[4]:(k=e=>e?O[e]:void 0,a[3]=O,a[4]=k);let A=k,j;a[5]!==v||a[6]!==s?(j=async e=>{await v.mutateAsync(e),s({to:`/iam/list-instance-profiles`})},a[5]=v,a[6]=s,a[7]=j):j=a[7];let M=j,N,P;a[8]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,_.jsx)(t,{to:`/iam/list-instance-profiles`,children:`Back to instance profiles`}),P=(0,_.jsx)(d,{title:`Create Instance Profile`}),a[8]=N,a[9]=P):(N=a[8],P=a[9]);let F;a[10]===v.error?F=a[11]:(F=v.error&&(0,_.jsx)(e,{error:v.error,msg:`Failed to create instance profile`}),a[10]=v.error,a[11]=F);let I;a[12]!==x||a[13]!==M?(I=x(M),a[12]=x,a[13]=M,a[14]=I):I=a[14];let L;a[15]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,_.jsx)(f,{children:(0,_.jsx)(`label`,{htmlFor:`instanceProfileName`,children:`Instance Profile Name`})}),a[15]=L):L=a[15];let R=!!T.instanceProfileName,z;a[16]===S?z=a[17]:(z=S(`instanceProfileName`),a[16]=S,a[17]=z);let B;a[18]!==R||a[19]!==z?(B=(0,_.jsx)(i,{"aria-invalid":R,id:`instanceProfileName`,placeholder:`my-instance-profile...`,...z}),a[18]=R,a[19]=z,a[20]=B):B=a[20];let V;a[21]===T.instanceProfileName?V=a[22]:(V=(0,_.jsx)(p,{errors:[T.instanceProfileName]}),a[21]=T.instanceProfileName,a[22]=V);let H;a[23]!==B||a[24]!==V?(H=(0,_.jsxs)(m,{children:[L,B,V]}),a[23]=B,a[24]=V,a[25]=H):H=a[25];let U;a[26]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,_.jsx)(f,{children:(0,_.jsx)(`label`,{htmlFor:`path`,children:`Path (optional)`})}),a[26]=U):U=a[26];let W;a[27]===S?W=a[28]:(W=S(`path`),a[27]=S,a[28]=W);let G;a[29]===W?G=a[30]:(G=(0,_.jsx)(i,{id:`path`,placeholder:`/`,...W}),a[29]=W,a[30]=G);let K;a[31]===T.path?K=a[32]:(K=(0,_.jsx)(p,{errors:[T.path]}),a[31]=T.path,a[32]=K);let q;a[33]!==G||a[34]!==K?(q=(0,_.jsxs)(m,{children:[U,G,K]}),a[33]=G,a[34]=K,a[35]=q):q=a[35];let J;a[36]===A?J=a[37]:(J=y(A),a[36]=A,a[37]=J);let Y;a[38]===J?Y=a[39]:(Y=(0,_.jsx)(n,{commands:J}),a[38]=J,a[39]=Y);let X;a[40]===s?X=a[41]:(X=async()=>await s({to:`/iam/list-instance-profiles`}),a[40]=s,a[41]=X);let Z;a[42]!==v.isPending||a[43]!==E||a[44]!==X?(Z=(0,_.jsx)(u,{isPending:v.isPending,isSubmitting:E,onCancel:X,pendingLabel:`Creating...`,submitLabel:`Create Instance Profile`}),a[42]=v.isPending,a[43]=E,a[44]=X,a[45]=Z):Z=a[45];let Q;a[46]!==H||a[47]!==q||a[48]!==Y||a[49]!==Z||a[50]!==I?(Q=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:I,children:[H,q,Y,Z]}),a[46]=H,a[47]=q,a[48]=Y,a[49]=Z,a[50]=I,a[51]=Q):Q=a[51];let $;return a[52]!==Q||a[53]!==F?($=(0,_.jsxs)(_.Fragment,{children:[N,P,F,Q]}),a[52]=Q,a[53]=F,a[54]=$):$=a[54],$}function y(e){let t=e(`instanceProfileName`),n=typeof t==`string`?t:``,r=e(`path`),i=typeof r==`string`?r:``,a=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-instance-profile`},{type:`flag`,value:` --instance-profile-name`},{type:`value`,value:` ${n||`<InstanceProfileName>`}`}];return i&&i!==`/`&&a.push({type:`flag`,value:` --path`},{type:`value`,value:` ${i}`}),[{label:`Create Instance Profile`,parts:a}]}export{v as component};
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{t as n}from"./cli-command-panel.js";import{f as r}from"./ec2.js";import{Da as i,fs as a,hs as o,ys as s}from"./index.js";import{a as c,i as l,t as u}from"./zod.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{a as p,t as m}from"./field.js";import{a as h}from"./ec22.js";var g=a(),_=s();function v(){let a=(0,g.c)(36),s=o(),v=r(),b;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={resolver:u(h),defaultValues:{name:``}},a[0]=b):b=a[0];let{control:x,handleSubmit:S,register:C,formState:w}=l(b),{isSubmitting:T}=w,E;a[1]===x?E=a[2]:(E={control:x},a[1]=x,a[2]=E);let D=c(E),O;a[3]!==v||a[4]!==s?(O=async e=>{let t=(await v.mutateAsync({name:e.name?.trim()??void 0})).InternetGateway?.InternetGatewayId;s(t?{to:`/ec2/describe-internet-gateways/$id`,params:{id:t}}:{to:`/ec2/describe-internet-gateways`})},a[3]=v,a[4]=s,a[5]=O):O=a[5];let k=O,A,j;a[6]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,_.jsx)(t,{to:`/ec2/describe-internet-gateways`,children:`Back to Internet Gateways`}),j=(0,_.jsx)(f,{title:`Create Internet Gateway`}),a[6]=A,a[7]=j):(A=a[6],j=a[7]);let M;a[8]===v.error?M=a[9]:(M=v.error&&(0,_.jsx)(e,{error:v.error,msg:`Failed to create Internet Gateway`}),a[8]=v.error,a[9]=M);let N;a[10]!==S||a[11]!==k?(N=S(k),a[10]=S,a[11]=k,a[12]=N):N=a[12];let P;a[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,_.jsx)(p,{children:(0,_.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),a[13]=P):P=a[13];let F;a[14]===C?F=a[15]:(F=C(`name`),a[14]=C,a[15]=F);let I;a[16]===F?I=a[17]:(I=(0,_.jsxs)(m,{children:[P,(0,_.jsx)(i,{id:`name`,placeholder:`my-internet-gateway`,...F})]}),a[16]=F,a[17]=I);let L=D.name??``,R;a[18]===L?R=a[19]:(R=y(L),a[18]=L,a[19]=R);let z;a[20]===R?z=a[21]:(z=(0,_.jsx)(n,{commands:R}),a[20]=R,a[21]=z);let B;a[22]===s?B=a[23]:(B=async()=>await s({to:`/ec2/describe-internet-gateways`}),a[22]=s,a[23]=B);let V;a[24]!==v.isPending||a[25]!==T||a[26]!==B?(V=(0,_.jsx)(d,{isPending:v.isPending,isSubmitting:T,onCancel:B,pendingLabel:`Creating…`,submitLabel:`Create`}),a[24]=v.isPending,a[25]=T,a[26]=B,a[27]=V):V=a[27];let H;a[28]!==I||a[29]!==z||a[30]!==V||a[31]!==N?(H=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:N,children:[I,z,V]}),a[28]=I,a[29]=z,a[30]=V,a[31]=N,a[32]=H):H=a[32];let U;return a[33]!==H||a[34]!==M?(U=(0,_.jsxs)(_.Fragment,{children:[A,j,M,H]}),a[33]=H,a[34]=M,a[35]=U):U=a[35],U}function y(e){let t=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-internet-gateway`}];return e.trim()&&t.push({type:`flag`,value:` \\
|
||||
import{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{t as n}from"./cli-command-panel.js";import{f as r}from"./ec2.js";import{Oa as i,bs as a,gs as o,ps as s}from"./index.js";import{a as c,i as l,t as u}from"./zod.js";import{t as d}from"./form-actions.js";import{t as f}from"./page-heading.js";import{a as p,t as m}from"./field.js";import{a as h}from"./ec22.js";var g=s(),_=a();function v(){let a=(0,g.c)(36),s=o(),v=r(),b;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={resolver:u(h),defaultValues:{name:``}},a[0]=b):b=a[0];let{control:x,handleSubmit:S,register:C,formState:w}=l(b),{isSubmitting:T}=w,E;a[1]===x?E=a[2]:(E={control:x},a[1]=x,a[2]=E);let D=c(E),O;a[3]!==v||a[4]!==s?(O=async e=>{let t=(await v.mutateAsync({name:e.name?.trim()??void 0})).InternetGateway?.InternetGatewayId;s(t?{to:`/ec2/describe-internet-gateways/$id`,params:{id:t}}:{to:`/ec2/describe-internet-gateways`})},a[3]=v,a[4]=s,a[5]=O):O=a[5];let k=O,A,j;a[6]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,_.jsx)(t,{to:`/ec2/describe-internet-gateways`,children:`Back to Internet Gateways`}),j=(0,_.jsx)(f,{title:`Create Internet Gateway`}),a[6]=A,a[7]=j):(A=a[6],j=a[7]);let M;a[8]===v.error?M=a[9]:(M=v.error&&(0,_.jsx)(e,{error:v.error,msg:`Failed to create Internet Gateway`}),a[8]=v.error,a[9]=M);let N;a[10]!==S||a[11]!==k?(N=S(k),a[10]=S,a[11]=k,a[12]=N):N=a[12];let P;a[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,_.jsx)(p,{children:(0,_.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),a[13]=P):P=a[13];let F;a[14]===C?F=a[15]:(F=C(`name`),a[14]=C,a[15]=F);let I;a[16]===F?I=a[17]:(I=(0,_.jsxs)(m,{children:[P,(0,_.jsx)(i,{id:`name`,placeholder:`my-internet-gateway`,...F})]}),a[16]=F,a[17]=I);let L=D.name??``,R;a[18]===L?R=a[19]:(R=y(L),a[18]=L,a[19]=R);let z;a[20]===R?z=a[21]:(z=(0,_.jsx)(n,{commands:R}),a[20]=R,a[21]=z);let B;a[22]===s?B=a[23]:(B=async()=>await s({to:`/ec2/describe-internet-gateways`}),a[22]=s,a[23]=B);let V;a[24]!==v.isPending||a[25]!==T||a[26]!==B?(V=(0,_.jsx)(d,{isPending:v.isPending,isSubmitting:T,onCancel:B,pendingLabel:`Creating…`,submitLabel:`Create`}),a[24]=v.isPending,a[25]=T,a[26]=B,a[27]=V):V=a[27];let H;a[28]!==I||a[29]!==z||a[30]!==V||a[31]!==N?(H=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:N,children:[I,z,V]}),a[28]=I,a[29]=z,a[30]=V,a[31]=N,a[32]=H):H=a[32];let U;return a[33]!==H||a[34]!==M?(U=(0,_.jsxs)(_.Fragment,{children:[A,j,M,H]}),a[33]=H,a[34]=M,a[35]=U):U=a[35],U}function y(e){let t=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-internet-gateway`}];return e.trim()&&t.push({type:`flag`,value:` \\
|
||||
--tag-specifications`},{type:`value`,value:` 'ResourceType=internet-gateway,Tags=[{Key=Name,Value=${e.trim()}}]'`}),[{label:`Create Internet Gateway`,parts:t}]}export{v 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
@@ -1,3 +1,3 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{c as n,i as r,n as i,s as a,t as ee}from"./select.js";import{t as o}from"./cli-command-panel.js";import{h as s}from"./ec2.js";import{Da as c,fs as l,hs as u,ys as d}from"./index.js";import{a as f,i as p,n as te,t as ne}from"./zod.js";import{t as re}from"./form-actions.js";import{t as ie}from"./page-heading.js";import{a as m,r as h,t as g}from"./field.js";import{c as _}from"./ec22.js";var v=l(),y=d();function b(){let l=(0,v.c)(56),d=u(),b=s(),x;l[0]===Symbol.for(`react.memo_cache_sentinel`)?(x={resolver:ne(_),defaultValues:{groupName:``,strategy:`spread`}},l[0]=x):x=l[0];let{control:S,handleSubmit:C,register:w,formState:oe}=p(x),{errors:T,isSubmitting:E}=oe,D;l[1]===S?D=l[2]:(D={control:S},l[1]=S,l[2]=D);let O=f(D),k;l[3]===O?k=l[4]:(k=e=>e?O[e]:void 0,l[3]=O,l[4]=k);let A=k,j;l[5]!==b||l[6]!==d?(j=async e=>{d({to:`/ec2/describe-placement-groups/$id`,params:{id:(await b.mutateAsync(e)).PlacementGroup?.GroupId??``}})},l[5]=b,l[6]=d,l[7]=j):j=l[7];let M=j,N,P;l[8]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,y.jsx)(t,{to:`/ec2/describe-placement-groups`,children:`Back to placement groups`}),P=(0,y.jsx)(ie,{title:`Create Placement Group`}),l[8]=N,l[9]=P):(N=l[8],P=l[9]);let F;l[10]===b.error?F=l[11]:(F=b.error&&(0,y.jsx)(e,{error:b.error,msg:`Failed to create placement group`}),l[10]=b.error,l[11]=F);let I;l[12]!==C||l[13]!==M?(I=C(M),l[12]=C,l[13]=M,l[14]=I):I=l[14];let L;l[15]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,y.jsx)(m,{children:(0,y.jsx)(`label`,{htmlFor:`groupName`,children:`Group Name`})}),l[15]=L):L=l[15];let R=!!T.groupName,z;l[16]===w?z=l[17]:(z=w(`groupName`),l[16]=w,l[17]=z);let B;l[18]!==R||l[19]!==z?(B=(0,y.jsx)(c,{"aria-invalid":R,id:`groupName`,placeholder:`my-placement-group`,...z}),l[18]=R,l[19]=z,l[20]=B):B=l[20];let V;l[21]===T.groupName?V=l[22]:(V=(0,y.jsx)(h,{errors:[T.groupName]}),l[21]=T.groupName,l[22]=V);let H;l[23]!==B||l[24]!==V?(H=(0,y.jsxs)(g,{children:[L,B,V]}),l[23]=B,l[24]=V,l[25]=H):H=l[25];let U;l[26]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,y.jsx)(m,{children:(0,y.jsx)(`label`,{htmlFor:`strategy`,children:`Strategy`})}),l[26]=U):U=l[26];let W;l[27]===T.strategy?W=l[28]:(W=e=>{let{field:t}=e;return(0,y.jsxs)(ee,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,y.jsx)(a,{"aria-invalid":!!T.strategy,className:`w-full`,id:`strategy`,children:(0,y.jsx)(n,{})}),(0,y.jsxs)(i,{children:[(0,y.jsx)(r,{value:`spread`,children:`spread`}),(0,y.jsx)(r,{value:`cluster`,children:`cluster`})]})]})},l[27]=T.strategy,l[28]=W);let G;l[29]!==S||l[30]!==W?(G=(0,y.jsx)(te,{control:S,name:`strategy`,render:W}),l[29]=S,l[30]=W,l[31]=G):G=l[31];let K;l[32]===T.strategy?K=l[33]:(K=(0,y.jsx)(h,{errors:[T.strategy]}),l[32]=T.strategy,l[33]=K);let q;l[34]!==G||l[35]!==K?(q=(0,y.jsxs)(g,{children:[U,G,K]}),l[34]=G,l[35]=K,l[36]=q):q=l[36];let J;l[37]===A?J=l[38]:(J=ae(A),l[37]=A,l[38]=J);let Y;l[39]===J?Y=l[40]:(Y=(0,y.jsx)(o,{commands:J}),l[39]=J,l[40]=Y);let X;l[41]===d?X=l[42]:(X=async()=>await d({to:`/ec2/describe-placement-groups`}),l[41]=d,l[42]=X);let Z;l[43]!==b.isPending||l[44]!==E||l[45]!==X?(Z=(0,y.jsx)(re,{isPending:b.isPending,isSubmitting:E,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Placement Group`}),l[43]=b.isPending,l[44]=E,l[45]=X,l[46]=Z):Z=l[46];let Q;l[47]!==H||l[48]!==q||l[49]!==Y||l[50]!==Z||l[51]!==I?(Q=(0,y.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:I,children:[H,q,Y,Z]}),l[47]=H,l[48]=q,l[49]=Y,l[50]=Z,l[51]=I,l[52]=Q):Q=l[52];let $;return l[53]!==Q||l[54]!==F?($=(0,y.jsxs)(y.Fragment,{children:[N,P,F,Q]}),l[53]=Q,l[54]=F,l[55]=$):$=l[55],$}function x(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}function ae(e){let t=e(`groupName`),n=typeof t==`string`?t:``,r=e(`strategy`),i=typeof r==`string`?r:``;return[{label:`Create Placement Group`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-placement-group`},{type:`flag`,value:` \\
|
||||
import{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{c as n,i as r,n as i,s as a,t as ee}from"./select.js";import{t as o}from"./cli-command-panel.js";import{h as s}from"./ec2.js";import{Oa as c,bs as l,gs as u,ps as d}from"./index.js";import{a as f,i as p,n as te,t as ne}from"./zod.js";import{t as re}from"./form-actions.js";import{t as ie}from"./page-heading.js";import{a as m,r as h,t as g}from"./field.js";import{c as _}from"./ec22.js";var v=d(),y=l();function b(){let l=(0,v.c)(56),d=u(),b=s(),x;l[0]===Symbol.for(`react.memo_cache_sentinel`)?(x={resolver:ne(_),defaultValues:{groupName:``,strategy:`spread`}},l[0]=x):x=l[0];let{control:S,handleSubmit:C,register:w,formState:oe}=p(x),{errors:T,isSubmitting:E}=oe,D;l[1]===S?D=l[2]:(D={control:S},l[1]=S,l[2]=D);let O=f(D),k;l[3]===O?k=l[4]:(k=e=>e?O[e]:void 0,l[3]=O,l[4]=k);let A=k,j;l[5]!==b||l[6]!==d?(j=async e=>{d({to:`/ec2/describe-placement-groups/$id`,params:{id:(await b.mutateAsync(e)).PlacementGroup?.GroupId??``}})},l[5]=b,l[6]=d,l[7]=j):j=l[7];let M=j,N,P;l[8]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,y.jsx)(t,{to:`/ec2/describe-placement-groups`,children:`Back to placement groups`}),P=(0,y.jsx)(ie,{title:`Create Placement Group`}),l[8]=N,l[9]=P):(N=l[8],P=l[9]);let F;l[10]===b.error?F=l[11]:(F=b.error&&(0,y.jsx)(e,{error:b.error,msg:`Failed to create placement group`}),l[10]=b.error,l[11]=F);let I;l[12]!==C||l[13]!==M?(I=C(M),l[12]=C,l[13]=M,l[14]=I):I=l[14];let L;l[15]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,y.jsx)(m,{children:(0,y.jsx)(`label`,{htmlFor:`groupName`,children:`Group Name`})}),l[15]=L):L=l[15];let R=!!T.groupName,z;l[16]===w?z=l[17]:(z=w(`groupName`),l[16]=w,l[17]=z);let B;l[18]!==R||l[19]!==z?(B=(0,y.jsx)(c,{"aria-invalid":R,id:`groupName`,placeholder:`my-placement-group`,...z}),l[18]=R,l[19]=z,l[20]=B):B=l[20];let V;l[21]===T.groupName?V=l[22]:(V=(0,y.jsx)(h,{errors:[T.groupName]}),l[21]=T.groupName,l[22]=V);let H;l[23]!==B||l[24]!==V?(H=(0,y.jsxs)(g,{children:[L,B,V]}),l[23]=B,l[24]=V,l[25]=H):H=l[25];let U;l[26]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,y.jsx)(m,{children:(0,y.jsx)(`label`,{htmlFor:`strategy`,children:`Strategy`})}),l[26]=U):U=l[26];let W;l[27]===T.strategy?W=l[28]:(W=e=>{let{field:t}=e;return(0,y.jsxs)(ee,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,y.jsx)(a,{"aria-invalid":!!T.strategy,className:`w-full`,id:`strategy`,children:(0,y.jsx)(n,{})}),(0,y.jsxs)(i,{children:[(0,y.jsx)(r,{value:`spread`,children:`spread`}),(0,y.jsx)(r,{value:`cluster`,children:`cluster`})]})]})},l[27]=T.strategy,l[28]=W);let G;l[29]!==S||l[30]!==W?(G=(0,y.jsx)(te,{control:S,name:`strategy`,render:W}),l[29]=S,l[30]=W,l[31]=G):G=l[31];let K;l[32]===T.strategy?K=l[33]:(K=(0,y.jsx)(h,{errors:[T.strategy]}),l[32]=T.strategy,l[33]=K);let q;l[34]!==G||l[35]!==K?(q=(0,y.jsxs)(g,{children:[U,G,K]}),l[34]=G,l[35]=K,l[36]=q):q=l[36];let J;l[37]===A?J=l[38]:(J=ae(A),l[37]=A,l[38]=J);let Y;l[39]===J?Y=l[40]:(Y=(0,y.jsx)(o,{commands:J}),l[39]=J,l[40]=Y);let X;l[41]===d?X=l[42]:(X=async()=>await d({to:`/ec2/describe-placement-groups`}),l[41]=d,l[42]=X);let Z;l[43]!==b.isPending||l[44]!==E||l[45]!==X?(Z=(0,y.jsx)(re,{isPending:b.isPending,isSubmitting:E,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Placement Group`}),l[43]=b.isPending,l[44]=E,l[45]=X,l[46]=Z):Z=l[46];let Q;l[47]!==H||l[48]!==q||l[49]!==Y||l[50]!==Z||l[51]!==I?(Q=(0,y.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:I,children:[H,q,Y,Z]}),l[47]=H,l[48]=q,l[49]=Y,l[50]=Z,l[51]=I,l[52]=Q):Q=l[52];let $;return l[53]!==Q||l[54]!==F?($=(0,y.jsxs)(y.Fragment,{children:[N,P,F,Q]}),l[53]=Q,l[54]=F,l[55]=$):$=l[55],$}function x(e){return`'${e.replaceAll(`'`,`'"'"'`)}'`}function ae(e){let t=e(`groupName`),n=typeof t==`string`?t:``,r=e(`strategy`),i=typeof r==`string`?r:``;return[{label:`Create Placement Group`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-placement-group`},{type:`flag`,value:` \\
|
||||
--group-name`},{type:`value`,value:` ${n?x(n):`<GroupName>`}`},{type:`flag`,value:` \\
|
||||
--strategy`},{type:`value`,value:` ${i||`spread`}`}]}]}export{b as component};
|
||||
@@ -1,4 +1,4 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{t as n}from"./cli-command-panel.js";import{o as r}from"./iam.js";import{Da as i,fs as a,hs as o,ys as s}from"./index.js";import{a as c,i as ee,t as te}from"./zod.js";import{t as ne}from"./form-actions.js";import{t as re}from"./page-heading.js";import{a as l,r as u,t as d}from"./field.js";import{t as ie}from"./textarea.js";import{r as f}from"./iam2.js";var ae=a(),p=s(),oe=JSON.stringify({Version:`2012-10-17`,Statement:[{Effect:`Allow`,Action:`*`,Resource:`*`}]},null,2);function m(){let a=(0,ae.c)(67),s=o(),m=r(),h;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(h={resolver:te(f),defaultValues:{policyDocument:oe}},a[0]=h):h=a[0];let{handleSubmit:g,register:_,control:v,formState:ce}=ee(h),{errors:y,isSubmitting:b}=ce,x;a[1]===v?x=a[2]:(x={control:v},a[1]=v,a[2]=x);let S=c(x),C;a[3]===S?C=a[4]:(C=e=>e?S[e]:void 0,a[3]=S,a[4]=C);let w=C,T;a[5]!==m||a[6]!==s?(T=async e=>{await m.mutateAsync(e),s({to:`/iam/list-policies`})},a[5]=m,a[6]=s,a[7]=T):T=a[7];let E=T,D,O;a[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,p.jsx)(t,{to:`/iam/list-policies`,children:`Back to policies`}),O=(0,p.jsx)(re,{title:`Create Policy`}),a[8]=D,a[9]=O):(D=a[8],O=a[9]);let k;a[10]===m.error?k=a[11]:(k=m.error&&(0,p.jsx)(e,{error:m.error,msg:`Failed to create policy`}),a[10]=m.error,a[11]=k);let A;a[12]!==g||a[13]!==E?(A=g(E),a[12]=g,a[13]=E,a[14]=A):A=a[14];let j;a[15]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,p.jsx)(l,{children:(0,p.jsx)(`label`,{htmlFor:`policyName`,children:`Policy Name`})}),a[15]=j):j=a[15];let M=!!y.policyName,N;a[16]===_?N=a[17]:(N=_(`policyName`),a[16]=_,a[17]=N);let P;a[18]!==M||a[19]!==N?(P=(0,p.jsx)(i,{"aria-invalid":M,id:`policyName`,placeholder:`my-policy...`,...N}),a[18]=M,a[19]=N,a[20]=P):P=a[20];let F;a[21]===y.policyName?F=a[22]:(F=(0,p.jsx)(u,{errors:[y.policyName]}),a[21]=y.policyName,a[22]=F);let I;a[23]!==P||a[24]!==F?(I=(0,p.jsxs)(d,{children:[j,P,F]}),a[23]=P,a[24]=F,a[25]=I):I=a[25];let L;a[26]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,p.jsx)(l,{children:(0,p.jsx)(`label`,{htmlFor:`description`,children:`Description (optional)`})}),a[26]=L):L=a[26];let R;a[27]===_?R=a[28]:(R=_(`description`),a[27]=_,a[28]=R);let z;a[29]===R?z=a[30]:(z=(0,p.jsx)(i,{id:`description`,placeholder:`A brief description of this policy...`,...R}),a[29]=R,a[30]=z);let B;a[31]===y.description?B=a[32]:(B=(0,p.jsx)(u,{errors:[y.description]}),a[31]=y.description,a[32]=B);let V;a[33]!==z||a[34]!==B?(V=(0,p.jsxs)(d,{children:[L,z,B]}),a[33]=z,a[34]=B,a[35]=V):V=a[35];let H;a[36]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsx)(l,{children:(0,p.jsx)(`label`,{htmlFor:`policyDocument`,children:`Policy Document (JSON)`})}),a[36]=H):H=a[36];let U=!!y.policyDocument,W;a[37]===_?W=a[38]:(W=_(`policyDocument`),a[37]=_,a[38]=W);let G;a[39]!==U||a[40]!==W?(G=(0,p.jsx)(ie,{"aria-invalid":U,className:`font-mono text-sm`,id:`policyDocument`,rows:15,...W}),a[39]=U,a[40]=W,a[41]=G):G=a[41];let K;a[42]===y.policyDocument?K=a[43]:(K=(0,p.jsx)(u,{errors:[y.policyDocument]}),a[42]=y.policyDocument,a[43]=K);let q;a[44]!==G||a[45]!==K?(q=(0,p.jsxs)(d,{children:[H,G,K]}),a[44]=G,a[45]=K,a[46]=q):q=a[46];let J;a[47]===w?J=a[48]:(J=se(w),a[47]=w,a[48]=J);let Y;a[49]===J?Y=a[50]:(Y=(0,p.jsx)(n,{commands:J}),a[49]=J,a[50]=Y);let X;a[51]===s?X=a[52]:(X=async()=>await s({to:`/iam/list-policies`}),a[51]=s,a[52]=X);let Z;a[53]!==m.isPending||a[54]!==b||a[55]!==X?(Z=(0,p.jsx)(ne,{isPending:m.isPending,isSubmitting:b,onCancel:X,pendingLabel:`Creating...`,submitLabel:`Create Policy`}),a[53]=m.isPending,a[54]=b,a[55]=X,a[56]=Z):Z=a[56];let Q;a[57]!==I||a[58]!==V||a[59]!==q||a[60]!==Y||a[61]!==Z||a[62]!==A?(Q=(0,p.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:A,children:[I,V,q,Y,Z]}),a[57]=I,a[58]=V,a[59]=q,a[60]=Y,a[61]=Z,a[62]=A,a[63]=Q):Q=a[63];let $;return a[64]!==Q||a[65]!==k?($=(0,p.jsxs)(p.Fragment,{children:[D,O,k,Q]}),a[64]=Q,a[65]=k,a[66]=$):$=a[66],$}function se(e){let t=e(`policyName`),n=typeof t==`string`?t:``,r=e(`description`),i=typeof r==`string`?r:``,a=e(`policyDocument`),o=typeof a==`string`?a:``,s=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-policy`},{type:`flag`,value:` \\
|
||||
import{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{t as n}from"./cli-command-panel.js";import{o as r}from"./iam.js";import{Oa as i,bs as a,gs as o,ps as s}from"./index.js";import{a as c,i as ee,t as te}from"./zod.js";import{t as ne}from"./form-actions.js";import{t as re}from"./page-heading.js";import{a as l,r as u,t as d}from"./field.js";import{t as ie}from"./textarea.js";import{r as f}from"./iam2.js";var ae=s(),p=a(),oe=JSON.stringify({Version:`2012-10-17`,Statement:[{Effect:`Allow`,Action:`*`,Resource:`*`}]},null,2);function m(){let a=(0,ae.c)(67),s=o(),m=r(),h;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(h={resolver:te(f),defaultValues:{policyDocument:oe}},a[0]=h):h=a[0];let{handleSubmit:g,register:_,control:v,formState:ce}=ee(h),{errors:y,isSubmitting:b}=ce,x;a[1]===v?x=a[2]:(x={control:v},a[1]=v,a[2]=x);let S=c(x),C;a[3]===S?C=a[4]:(C=e=>e?S[e]:void 0,a[3]=S,a[4]=C);let w=C,T;a[5]!==m||a[6]!==s?(T=async e=>{await m.mutateAsync(e),s({to:`/iam/list-policies`})},a[5]=m,a[6]=s,a[7]=T):T=a[7];let E=T,D,O;a[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,p.jsx)(t,{to:`/iam/list-policies`,children:`Back to policies`}),O=(0,p.jsx)(re,{title:`Create Policy`}),a[8]=D,a[9]=O):(D=a[8],O=a[9]);let k;a[10]===m.error?k=a[11]:(k=m.error&&(0,p.jsx)(e,{error:m.error,msg:`Failed to create policy`}),a[10]=m.error,a[11]=k);let A;a[12]!==g||a[13]!==E?(A=g(E),a[12]=g,a[13]=E,a[14]=A):A=a[14];let j;a[15]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,p.jsx)(l,{children:(0,p.jsx)(`label`,{htmlFor:`policyName`,children:`Policy Name`})}),a[15]=j):j=a[15];let M=!!y.policyName,N;a[16]===_?N=a[17]:(N=_(`policyName`),a[16]=_,a[17]=N);let P;a[18]!==M||a[19]!==N?(P=(0,p.jsx)(i,{"aria-invalid":M,id:`policyName`,placeholder:`my-policy...`,...N}),a[18]=M,a[19]=N,a[20]=P):P=a[20];let F;a[21]===y.policyName?F=a[22]:(F=(0,p.jsx)(u,{errors:[y.policyName]}),a[21]=y.policyName,a[22]=F);let I;a[23]!==P||a[24]!==F?(I=(0,p.jsxs)(d,{children:[j,P,F]}),a[23]=P,a[24]=F,a[25]=I):I=a[25];let L;a[26]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,p.jsx)(l,{children:(0,p.jsx)(`label`,{htmlFor:`description`,children:`Description (optional)`})}),a[26]=L):L=a[26];let R;a[27]===_?R=a[28]:(R=_(`description`),a[27]=_,a[28]=R);let z;a[29]===R?z=a[30]:(z=(0,p.jsx)(i,{id:`description`,placeholder:`A brief description of this policy...`,...R}),a[29]=R,a[30]=z);let B;a[31]===y.description?B=a[32]:(B=(0,p.jsx)(u,{errors:[y.description]}),a[31]=y.description,a[32]=B);let V;a[33]!==z||a[34]!==B?(V=(0,p.jsxs)(d,{children:[L,z,B]}),a[33]=z,a[34]=B,a[35]=V):V=a[35];let H;a[36]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsx)(l,{children:(0,p.jsx)(`label`,{htmlFor:`policyDocument`,children:`Policy Document (JSON)`})}),a[36]=H):H=a[36];let U=!!y.policyDocument,W;a[37]===_?W=a[38]:(W=_(`policyDocument`),a[37]=_,a[38]=W);let G;a[39]!==U||a[40]!==W?(G=(0,p.jsx)(ie,{"aria-invalid":U,className:`font-mono text-sm`,id:`policyDocument`,rows:15,...W}),a[39]=U,a[40]=W,a[41]=G):G=a[41];let K;a[42]===y.policyDocument?K=a[43]:(K=(0,p.jsx)(u,{errors:[y.policyDocument]}),a[42]=y.policyDocument,a[43]=K);let q;a[44]!==G||a[45]!==K?(q=(0,p.jsxs)(d,{children:[H,G,K]}),a[44]=G,a[45]=K,a[46]=q):q=a[46];let J;a[47]===w?J=a[48]:(J=se(w),a[47]=w,a[48]=J);let Y;a[49]===J?Y=a[50]:(Y=(0,p.jsx)(n,{commands:J}),a[49]=J,a[50]=Y);let X;a[51]===s?X=a[52]:(X=async()=>await s({to:`/iam/list-policies`}),a[51]=s,a[52]=X);let Z;a[53]!==m.isPending||a[54]!==b||a[55]!==X?(Z=(0,p.jsx)(ne,{isPending:m.isPending,isSubmitting:b,onCancel:X,pendingLabel:`Creating...`,submitLabel:`Create Policy`}),a[53]=m.isPending,a[54]=b,a[55]=X,a[56]=Z):Z=a[56];let Q;a[57]!==I||a[58]!==V||a[59]!==q||a[60]!==Y||a[61]!==Z||a[62]!==A?(Q=(0,p.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:A,children:[I,V,q,Y,Z]}),a[57]=I,a[58]=V,a[59]=q,a[60]=Y,a[61]=Z,a[62]=A,a[63]=Q):Q=a[63];let $;return a[64]!==Q||a[65]!==k?($=(0,p.jsxs)(p.Fragment,{children:[D,O,k,Q]}),a[64]=Q,a[65]=k,a[66]=$):$=a[66],$}function se(e){let t=e(`policyName`),n=typeof t==`string`?t:``,r=e(`description`),i=typeof r==`string`?r:``,a=e(`policyDocument`),o=typeof a==`string`?a:``,s=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-policy`},{type:`flag`,value:` \\
|
||||
--policy-name`},{type:`value`,value:` ${n||`<PolicyName>`}`}];return i&&s.push({type:`flag`,value:` \\
|
||||
--description`},{type:`value`,value:` "${i}"`}),s.push({type:`flag`,value:` \\
|
||||
--policy-document`},{type:`value`,value:` '${o||`<PolicyDocument>`}'`}),[{label:`Create Policy`,parts:s}]}export{m as component};
|
||||
@@ -1,4 +1,4 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{t as n}from"./cli-command-panel.js";import{s as r}from"./iam.js";import{Da as i,fs as a,hs as o,ys as s}from"./index.js";import{a as c,i as ee,t as te}from"./zod.js";import{t as ne}from"./form-actions.js";import{t as re}from"./page-heading.js";import{a as l,r as u,t as d}from"./field.js";import{t as ie}from"./textarea.js";import{i as f,t as ae}from"./iam2.js";var oe=a(),p=s();function m(){let a=(0,oe.c)(67),s=o(),m=r(),h;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(h={resolver:te(f),defaultValues:{assumeRolePolicyDocument:ae}},a[0]=h):h=a[0];let{handleSubmit:g,register:_,control:v,formState:ce}=ee(h),{errors:y,isSubmitting:b}=ce,x;a[1]===v?x=a[2]:(x={control:v},a[1]=v,a[2]=x);let S=c(x),C;a[3]===S?C=a[4]:(C=e=>e?S[e]:void 0,a[3]=S,a[4]=C);let w=C,T;a[5]!==m||a[6]!==s?(T=async e=>{await m.mutateAsync(e),s({to:`/iam/list-roles`})},a[5]=m,a[6]=s,a[7]=T):T=a[7];let E=T,D,O;a[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,p.jsx)(t,{to:`/iam/list-roles`,children:`Back to roles`}),O=(0,p.jsx)(re,{title:`Create Role`}),a[8]=D,a[9]=O):(D=a[8],O=a[9]);let k;a[10]===m.error?k=a[11]:(k=m.error&&(0,p.jsx)(e,{error:m.error,msg:`Failed to create role`}),a[10]=m.error,a[11]=k);let A;a[12]!==g||a[13]!==E?(A=g(E),a[12]=g,a[13]=E,a[14]=A):A=a[14];let j;a[15]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,p.jsx)(l,{children:(0,p.jsx)(`label`,{htmlFor:`roleName`,children:`Role Name`})}),a[15]=j):j=a[15];let M=!!y.roleName,N;a[16]===_?N=a[17]:(N=_(`roleName`),a[16]=_,a[17]=N);let P;a[18]!==M||a[19]!==N?(P=(0,p.jsx)(i,{"aria-invalid":M,id:`roleName`,placeholder:`my-role...`,...N}),a[18]=M,a[19]=N,a[20]=P):P=a[20];let F;a[21]===y.roleName?F=a[22]:(F=(0,p.jsx)(u,{errors:[y.roleName]}),a[21]=y.roleName,a[22]=F);let I;a[23]!==P||a[24]!==F?(I=(0,p.jsxs)(d,{children:[j,P,F]}),a[23]=P,a[24]=F,a[25]=I):I=a[25];let L;a[26]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,p.jsx)(l,{children:(0,p.jsx)(`label`,{htmlFor:`description`,children:`Description (optional)`})}),a[26]=L):L=a[26];let R;a[27]===_?R=a[28]:(R=_(`description`),a[27]=_,a[28]=R);let z;a[29]===R?z=a[30]:(z=(0,p.jsx)(i,{id:`description`,placeholder:`A brief description of this role...`,...R}),a[29]=R,a[30]=z);let B;a[31]===y.description?B=a[32]:(B=(0,p.jsx)(u,{errors:[y.description]}),a[31]=y.description,a[32]=B);let V;a[33]!==z||a[34]!==B?(V=(0,p.jsxs)(d,{children:[L,z,B]}),a[33]=z,a[34]=B,a[35]=V):V=a[35];let H;a[36]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsx)(l,{children:(0,p.jsx)(`label`,{htmlFor:`assumeRolePolicyDocument`,children:`Trust Policy (JSON)`})}),a[36]=H):H=a[36];let U=!!y.assumeRolePolicyDocument,W;a[37]===_?W=a[38]:(W=_(`assumeRolePolicyDocument`),a[37]=_,a[38]=W);let G;a[39]!==U||a[40]!==W?(G=(0,p.jsx)(ie,{"aria-invalid":U,className:`font-mono text-sm`,id:`assumeRolePolicyDocument`,rows:15,...W}),a[39]=U,a[40]=W,a[41]=G):G=a[41];let K;a[42]===y.assumeRolePolicyDocument?K=a[43]:(K=(0,p.jsx)(u,{errors:[y.assumeRolePolicyDocument]}),a[42]=y.assumeRolePolicyDocument,a[43]=K);let q;a[44]!==G||a[45]!==K?(q=(0,p.jsxs)(d,{children:[H,G,K]}),a[44]=G,a[45]=K,a[46]=q):q=a[46];let J;a[47]===w?J=a[48]:(J=se(w),a[47]=w,a[48]=J);let Y;a[49]===J?Y=a[50]:(Y=(0,p.jsx)(n,{commands:J}),a[49]=J,a[50]=Y);let X;a[51]===s?X=a[52]:(X=async()=>await s({to:`/iam/list-roles`}),a[51]=s,a[52]=X);let Z;a[53]!==m.isPending||a[54]!==b||a[55]!==X?(Z=(0,p.jsx)(ne,{isPending:m.isPending,isSubmitting:b,onCancel:X,pendingLabel:`Creating...`,submitLabel:`Create Role`}),a[53]=m.isPending,a[54]=b,a[55]=X,a[56]=Z):Z=a[56];let Q;a[57]!==I||a[58]!==V||a[59]!==q||a[60]!==Y||a[61]!==Z||a[62]!==A?(Q=(0,p.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:A,children:[I,V,q,Y,Z]}),a[57]=I,a[58]=V,a[59]=q,a[60]=Y,a[61]=Z,a[62]=A,a[63]=Q):Q=a[63];let $;return a[64]!==Q||a[65]!==k?($=(0,p.jsxs)(p.Fragment,{children:[D,O,k,Q]}),a[64]=Q,a[65]=k,a[66]=$):$=a[66],$}function se(e){let t=e(`roleName`),n=typeof t==`string`?t:``,r=e(`description`),i=typeof r==`string`?r:``,a=e(`assumeRolePolicyDocument`),o=typeof a==`string`?a:``,s=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-role`},{type:`flag`,value:` \\
|
||||
import{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{t as n}from"./cli-command-panel.js";import{s as r}from"./iam.js";import{Oa as i,bs as a,gs as o,ps as s}from"./index.js";import{a as c,i as ee,t as te}from"./zod.js";import{t as ne}from"./form-actions.js";import{t as re}from"./page-heading.js";import{a as l,r as u,t as d}from"./field.js";import{t as ie}from"./textarea.js";import{i as f,t as ae}from"./iam2.js";var oe=s(),p=a();function m(){let a=(0,oe.c)(67),s=o(),m=r(),h;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(h={resolver:te(f),defaultValues:{assumeRolePolicyDocument:ae}},a[0]=h):h=a[0];let{handleSubmit:g,register:_,control:v,formState:ce}=ee(h),{errors:y,isSubmitting:b}=ce,x;a[1]===v?x=a[2]:(x={control:v},a[1]=v,a[2]=x);let S=c(x),C;a[3]===S?C=a[4]:(C=e=>e?S[e]:void 0,a[3]=S,a[4]=C);let w=C,T;a[5]!==m||a[6]!==s?(T=async e=>{await m.mutateAsync(e),s({to:`/iam/list-roles`})},a[5]=m,a[6]=s,a[7]=T):T=a[7];let E=T,D,O;a[8]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,p.jsx)(t,{to:`/iam/list-roles`,children:`Back to roles`}),O=(0,p.jsx)(re,{title:`Create Role`}),a[8]=D,a[9]=O):(D=a[8],O=a[9]);let k;a[10]===m.error?k=a[11]:(k=m.error&&(0,p.jsx)(e,{error:m.error,msg:`Failed to create role`}),a[10]=m.error,a[11]=k);let A;a[12]!==g||a[13]!==E?(A=g(E),a[12]=g,a[13]=E,a[14]=A):A=a[14];let j;a[15]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,p.jsx)(l,{children:(0,p.jsx)(`label`,{htmlFor:`roleName`,children:`Role Name`})}),a[15]=j):j=a[15];let M=!!y.roleName,N;a[16]===_?N=a[17]:(N=_(`roleName`),a[16]=_,a[17]=N);let P;a[18]!==M||a[19]!==N?(P=(0,p.jsx)(i,{"aria-invalid":M,id:`roleName`,placeholder:`my-role...`,...N}),a[18]=M,a[19]=N,a[20]=P):P=a[20];let F;a[21]===y.roleName?F=a[22]:(F=(0,p.jsx)(u,{errors:[y.roleName]}),a[21]=y.roleName,a[22]=F);let I;a[23]!==P||a[24]!==F?(I=(0,p.jsxs)(d,{children:[j,P,F]}),a[23]=P,a[24]=F,a[25]=I):I=a[25];let L;a[26]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,p.jsx)(l,{children:(0,p.jsx)(`label`,{htmlFor:`description`,children:`Description (optional)`})}),a[26]=L):L=a[26];let R;a[27]===_?R=a[28]:(R=_(`description`),a[27]=_,a[28]=R);let z;a[29]===R?z=a[30]:(z=(0,p.jsx)(i,{id:`description`,placeholder:`A brief description of this role...`,...R}),a[29]=R,a[30]=z);let B;a[31]===y.description?B=a[32]:(B=(0,p.jsx)(u,{errors:[y.description]}),a[31]=y.description,a[32]=B);let V;a[33]!==z||a[34]!==B?(V=(0,p.jsxs)(d,{children:[L,z,B]}),a[33]=z,a[34]=B,a[35]=V):V=a[35];let H;a[36]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsx)(l,{children:(0,p.jsx)(`label`,{htmlFor:`assumeRolePolicyDocument`,children:`Trust Policy (JSON)`})}),a[36]=H):H=a[36];let U=!!y.assumeRolePolicyDocument,W;a[37]===_?W=a[38]:(W=_(`assumeRolePolicyDocument`),a[37]=_,a[38]=W);let G;a[39]!==U||a[40]!==W?(G=(0,p.jsx)(ie,{"aria-invalid":U,className:`font-mono text-sm`,id:`assumeRolePolicyDocument`,rows:15,...W}),a[39]=U,a[40]=W,a[41]=G):G=a[41];let K;a[42]===y.assumeRolePolicyDocument?K=a[43]:(K=(0,p.jsx)(u,{errors:[y.assumeRolePolicyDocument]}),a[42]=y.assumeRolePolicyDocument,a[43]=K);let q;a[44]!==G||a[45]!==K?(q=(0,p.jsxs)(d,{children:[H,G,K]}),a[44]=G,a[45]=K,a[46]=q):q=a[46];let J;a[47]===w?J=a[48]:(J=se(w),a[47]=w,a[48]=J);let Y;a[49]===J?Y=a[50]:(Y=(0,p.jsx)(n,{commands:J}),a[49]=J,a[50]=Y);let X;a[51]===s?X=a[52]:(X=async()=>await s({to:`/iam/list-roles`}),a[51]=s,a[52]=X);let Z;a[53]!==m.isPending||a[54]!==b||a[55]!==X?(Z=(0,p.jsx)(ne,{isPending:m.isPending,isSubmitting:b,onCancel:X,pendingLabel:`Creating...`,submitLabel:`Create Role`}),a[53]=m.isPending,a[54]=b,a[55]=X,a[56]=Z):Z=a[56];let Q;a[57]!==I||a[58]!==V||a[59]!==q||a[60]!==Y||a[61]!==Z||a[62]!==A?(Q=(0,p.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:A,children:[I,V,q,Y,Z]}),a[57]=I,a[58]=V,a[59]=q,a[60]=Y,a[61]=Z,a[62]=A,a[63]=Q):Q=a[63];let $;return a[64]!==Q||a[65]!==k?($=(0,p.jsxs)(p.Fragment,{children:[D,O,k,Q]}),a[64]=Q,a[65]=k,a[66]=$):$=a[66],$}function se(e){let t=e(`roleName`),n=typeof t==`string`?t:``,r=e(`description`),i=typeof r==`string`?r:``,a=e(`assumeRolePolicyDocument`),o=typeof a==`string`?a:``,s=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-role`},{type:`flag`,value:` \\
|
||||
--role-name`},{type:`value`,value:` ${n||`<RoleName>`}`}];return i&&s.push({type:`flag`,value:` \\
|
||||
--description`},{type:`value`,value:` "${i}"`}),s.push({type:`flag`,value:` \\
|
||||
--assume-role-policy-document`},{type:`value`,value:` '${o||`<TrustPolicy>`}'`}),[{label:`Create Role`,parts:s}]}export{m as component};
|
||||
@@ -1 +1 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{c as r,i,n as a,s as o,t as s}from"./select.js";import{_ as c}from"./ec2.js";import{Da as l,Et as u,Io as d,fs as f,hs as p,ys 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=f(),T=m();function E(){let i=(0,w.c)(44),d=p(),{data:f}=t(u),m=c(),E;i[0]===f.Vpcs?E=i[1]:(E=f.Vpcs??[],i[0]=f.Vpcs,i[1]=E);let O=E,k;i[2]===Symbol.for(`react.memo_cache_sentinel`)?(k={resolver:_(C),defaultValues:{vpcId:``,name:``}},i[2]=k):k=i[2];let{control:A,handleSubmit:j,register:M,formState:N}=h(k),{errors:P,isSubmitting:F}=N,I;i[3]!==m||i[4]!==d?(I=async e=>{let t=(await m.mutateAsync({vpcId:e.vpcId,name:e.name?.trim()?e.name.trim():void 0})).RouteTable?.RouteTableId;d(t?{to:`/ec2/describe-route-tables/$id`,params:{id:t}}:{to:`/ec2/describe-route-tables`})},i[3]=m,i[4]=d,i[5]=I):I=i[5];let L=I,R,z;i[6]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,T.jsx)(n,{to:`/ec2/describe-route-tables`,children:`Back to Route Tables`}),z=(0,T.jsx)(y,{title:`Create Route Table`}),i[6]=R,i[7]=z):(R=i[6],z=i[7]);let B;i[8]===m.error?B=i[9]:(B=m.error&&(0,T.jsx)(e,{error:m.error,msg:`Failed to create Route Table`}),i[8]=m.error,i[9]=B);let V;i[10]!==j||i[11]!==L?(V=j(L),i[10]=j,i[11]=L,i[12]=V):V=i[12];let H;i[13]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,T.jsx)(b,{children:(0,T.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),i[13]=H):H=i[13];let U;i[14]===M?U=i[15]:(U=M(`name`),i[14]=M,i[15]=U);let W;i[16]===U?W=i[17]:(W=(0,T.jsxs)(S,{children:[H,(0,T.jsx)(l,{id:`name`,placeholder:`my-route-table`,...U})]}),i[16]=U,i[17]=W);let G;i[18]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,T.jsx)(b,{children:(0,T.jsx)(`label`,{htmlFor:`vpcId`,children:`VPC`})}),i[18]=G):G=i[18];let K;i[19]!==P.vpcId||i[20]!==O?(K=e=>{let{field:t}=e;return(0,T.jsxs)(s,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,T.jsx)(o,{"aria-invalid":!!P.vpcId,className:`w-full`,id:`vpcId`,children:(0,T.jsx)(r,{placeholder:`Select a VPC`})}),(0,T.jsx)(a,{children:O.map(D)})]})},i[19]=P.vpcId,i[20]=O,i[21]=K):K=i[21];let q;i[22]!==A||i[23]!==K?(q=(0,T.jsx)(g,{control:A,name:`vpcId`,render:K}),i[22]=A,i[23]=K,i[24]=q):q=i[24];let J;i[25]===P.vpcId?J=i[26]:(J=(0,T.jsx)(x,{errors:[P.vpcId]}),i[25]=P.vpcId,i[26]=J);let Y;i[27]!==q||i[28]!==J?(Y=(0,T.jsxs)(S,{children:[G,q,J]}),i[27]=q,i[28]=J,i[29]=Y):Y=i[29];let X;i[30]===d?X=i[31]:(X=async()=>await d({to:`/ec2/describe-route-tables`}),i[30]=d,i[31]=X);let Z;i[32]!==m.isPending||i[33]!==F||i[34]!==X?(Z=(0,T.jsx)(v,{isPending:m.isPending,isSubmitting:F,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Route Table`}),i[32]=m.isPending,i[33]=F,i[34]=X,i[35]=Z):Z=i[35];let Q;i[36]!==W||i[37]!==Y||i[38]!==Z||i[39]!==V?(Q=(0,T.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:V,children:[W,Y,Z]}),i[36]=W,i[37]=Y,i[38]=Z,i[39]=V,i[40]=Q):Q=i[40];let $;return i[41]!==Q||i[42]!==B?($=(0,T.jsxs)(T.Fragment,{children:[R,z,B,Q]}),i[41]=Q,i[42]=B,i[43]=$):$=i[43],$}function D(e){let t=d(e.Tags);return(0,T.jsx)(i,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}export{E as component};
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{c as r,i,n as a,s as o,t as s}from"./select.js";import{_ as c}from"./ec2.js";import{Et as l,Lo as u,Oa as d,bs as f,gs as p,ps 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=m(),T=f();function E(){let i=(0,w.c)(44),u=p(),{data:f}=t(l),m=c(),E;i[0]===f.Vpcs?E=i[1]:(E=f.Vpcs??[],i[0]=f.Vpcs,i[1]=E);let O=E,k;i[2]===Symbol.for(`react.memo_cache_sentinel`)?(k={resolver:_(C),defaultValues:{vpcId:``,name:``}},i[2]=k):k=i[2];let{control:A,handleSubmit:j,register:M,formState:N}=h(k),{errors:P,isSubmitting:F}=N,I;i[3]!==m||i[4]!==u?(I=async e=>{let t=(await m.mutateAsync({vpcId:e.vpcId,name:e.name?.trim()?e.name.trim():void 0})).RouteTable?.RouteTableId;u(t?{to:`/ec2/describe-route-tables/$id`,params:{id:t}}:{to:`/ec2/describe-route-tables`})},i[3]=m,i[4]=u,i[5]=I):I=i[5];let L=I,R,z;i[6]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,T.jsx)(n,{to:`/ec2/describe-route-tables`,children:`Back to Route Tables`}),z=(0,T.jsx)(y,{title:`Create Route Table`}),i[6]=R,i[7]=z):(R=i[6],z=i[7]);let B;i[8]===m.error?B=i[9]:(B=m.error&&(0,T.jsx)(e,{error:m.error,msg:`Failed to create Route Table`}),i[8]=m.error,i[9]=B);let V;i[10]!==j||i[11]!==L?(V=j(L),i[10]=j,i[11]=L,i[12]=V):V=i[12];let H;i[13]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,T.jsx)(b,{children:(0,T.jsx)(`label`,{htmlFor:`name`,children:`Name (optional)`})}),i[13]=H):H=i[13];let U;i[14]===M?U=i[15]:(U=M(`name`),i[14]=M,i[15]=U);let W;i[16]===U?W=i[17]:(W=(0,T.jsxs)(S,{children:[H,(0,T.jsx)(d,{id:`name`,placeholder:`my-route-table`,...U})]}),i[16]=U,i[17]=W);let G;i[18]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,T.jsx)(b,{children:(0,T.jsx)(`label`,{htmlFor:`vpcId`,children:`VPC`})}),i[18]=G):G=i[18];let K;i[19]!==P.vpcId||i[20]!==O?(K=e=>{let{field:t}=e;return(0,T.jsxs)(s,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,T.jsx)(o,{"aria-invalid":!!P.vpcId,className:`w-full`,id:`vpcId`,children:(0,T.jsx)(r,{placeholder:`Select a VPC`})}),(0,T.jsx)(a,{children:O.map(D)})]})},i[19]=P.vpcId,i[20]=O,i[21]=K):K=i[21];let q;i[22]!==A||i[23]!==K?(q=(0,T.jsx)(g,{control:A,name:`vpcId`,render:K}),i[22]=A,i[23]=K,i[24]=q):q=i[24];let J;i[25]===P.vpcId?J=i[26]:(J=(0,T.jsx)(x,{errors:[P.vpcId]}),i[25]=P.vpcId,i[26]=J);let Y;i[27]!==q||i[28]!==J?(Y=(0,T.jsxs)(S,{children:[G,q,J]}),i[27]=q,i[28]=J,i[29]=Y):Y=i[29];let X;i[30]===u?X=i[31]:(X=async()=>await u({to:`/ec2/describe-route-tables`}),i[30]=u,i[31]=X);let Z;i[32]!==m.isPending||i[33]!==F||i[34]!==X?(Z=(0,T.jsx)(v,{isPending:m.isPending,isSubmitting:F,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Route Table`}),i[32]=m.isPending,i[33]=F,i[34]=X,i[35]=Z):Z=i[35];let Q;i[36]!==W||i[37]!==Y||i[38]!==Z||i[39]!==V?(Q=(0,T.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:V,children:[W,Y,Z]}),i[36]=W,i[37]=Y,i[38]=Z,i[39]=V,i[40]=Q):Q=i[40];let $;return i[41]!==Q||i[42]!==B?($=(0,T.jsxs)(T.Fragment,{children:[R,z,B,Q]}),i[41]=Q,i[42]=B,i[43]=$):$=i[43],$}function D(e){let t=u(e.Tags);return(0,T.jsx)(i,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}export{E as component};
|
||||
@@ -1,4 +1,4 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as ee}from"./back-link.js";import{c as n,i as r,n as i,s as te,t as a}from"./select.js";import{t as ne}from"./cli-command-panel.js";import{v as re}from"./ec2.js";import{Da as ie,Et as ae,Io as o,fs as s,hs as oe,ys as c}from"./index.js";import{a as se,i as ce,n as le,t as ue}from"./zod.js";import{t as de}from"./form-actions.js";import{t as fe}from"./page-heading.js";import{a as l,r as u,t as d}from"./field.js";import{d as pe}from"./ec22.js";var me=s(),f=c();function p(){let r=(0,me.c)(73),o=oe(),{data:s}=t(ae),c=re(),p;r[0]===s.Vpcs?p=r[1]:(p=s.Vpcs??[],r[0]=s.Vpcs,r[1]=p);let m=p,h;r[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=ue(pe),r[2]=h):h=r[2];let g=m[0]?.VpcId??``,_;r[3]===g?_=r[4]:(_={resolver:h,defaultValues:{groupName:``,description:``,vpcId:g}},r[3]=g,r[4]=_);let{control:v,handleSubmit:y,register:b,formState:_e}=ce(_),{errors:x,isSubmitting:ve}=_e,S;r[5]===v?S=r[6]:(S={control:v},r[5]=v,r[6]=S);let ye=se(S),C;r[7]===ye?C=r[8]:(C=e=>e?ye[e]:void 0,r[7]=ye,r[8]=C);let w=C,T;r[9]!==c||r[10]!==o?(T=async e=>{let t=(await c.mutateAsync(e)).GroupId;o(t?{to:`/ec2/describe-security-groups/$id`,params:{id:t}}:{to:`/ec2/describe-security-groups`})},r[9]=c,r[10]=o,r[11]=T):T=r[11];let E=T,D,O;r[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,f.jsx)(ee,{to:`/ec2/describe-security-groups`,children:`Back to Security Groups`}),O=(0,f.jsx)(fe,{title:`Create Security Group`}),r[12]=D,r[13]=O):(D=r[12],O=r[13]);let k;r[14]===c.error?k=r[15]:(k=c.error&&(0,f.jsx)(e,{error:c.error,msg:`Failed to create security group`}),r[14]=c.error,r[15]=k);let A;r[16]!==y||r[17]!==E?(A=y(E),r[16]=y,r[17]=E,r[18]=A):A=r[18];let j;r[19]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`groupName`,children:`Group Name`})}),r[19]=j):j=r[19];let M=!!x.groupName,N;r[20]===b?N=r[21]:(N=b(`groupName`),r[20]=b,r[21]=N);let P;r[22]!==M||r[23]!==N?(P=(0,f.jsx)(ie,{"aria-invalid":M,id:`groupName`,placeholder:`my-security-group`,...N}),r[22]=M,r[23]=N,r[24]=P):P=r[24];let F;r[25]===x.groupName?F=r[26]:(F=(0,f.jsx)(u,{errors:[x.groupName]}),r[25]=x.groupName,r[26]=F);let I;r[27]!==P||r[28]!==F?(I=(0,f.jsxs)(d,{children:[j,P,F]}),r[27]=P,r[28]=F,r[29]=I):I=r[29];let L;r[30]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`description`,children:`Description`})}),r[30]=L):L=r[30];let R=!!x.description,z;r[31]===b?z=r[32]:(z=b(`description`),r[31]=b,r[32]=z);let B;r[33]!==R||r[34]!==z?(B=(0,f.jsx)(ie,{"aria-invalid":R,id:`description`,placeholder:`My security group description`,...z}),r[33]=R,r[34]=z,r[35]=B):B=r[35];let V;r[36]===x.description?V=r[37]:(V=(0,f.jsx)(u,{errors:[x.description]}),r[36]=x.description,r[37]=V);let H;r[38]!==B||r[39]!==V?(H=(0,f.jsxs)(d,{children:[L,B,V]}),r[38]=B,r[39]=V,r[40]=H):H=r[40];let U;r[41]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`vpcId`,children:`VPC`})}),r[41]=U):U=r[41];let W;r[42]!==x.vpcId||r[43]!==m?(W=e=>{let{field:t}=e;return(0,f.jsxs)(a,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,f.jsx)(te,{"aria-invalid":!!x.vpcId,className:`w-full`,id:`vpcId`,children:(0,f.jsx)(n,{})}),(0,f.jsx)(i,{children:m.map(he)})]})},r[42]=x.vpcId,r[43]=m,r[44]=W):W=r[44];let G;r[45]!==v||r[46]!==W?(G=(0,f.jsx)(le,{control:v,name:`vpcId`,render:W}),r[45]=v,r[46]=W,r[47]=G):G=r[47];let K;r[48]===x.vpcId?K=r[49]:(K=(0,f.jsx)(u,{errors:[x.vpcId]}),r[48]=x.vpcId,r[49]=K);let q;r[50]!==G||r[51]!==K?(q=(0,f.jsxs)(d,{children:[U,G,K]}),r[50]=G,r[51]=K,r[52]=q):q=r[52];let J;r[53]===w?J=r[54]:(J=ge(w),r[53]=w,r[54]=J);let Y;r[55]===J?Y=r[56]:(Y=(0,f.jsx)(ne,{commands:J}),r[55]=J,r[56]=Y);let X;r[57]===o?X=r[58]:(X=async()=>await o({to:`/ec2/describe-security-groups`}),r[57]=o,r[58]=X);let Z;r[59]!==c.isPending||r[60]!==ve||r[61]!==X?(Z=(0,f.jsx)(de,{isPending:c.isPending,isSubmitting:ve,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Security Group`}),r[59]=c.isPending,r[60]=ve,r[61]=X,r[62]=Z):Z=r[62];let Q;r[63]!==A||r[64]!==I||r[65]!==H||r[66]!==q||r[67]!==Y||r[68]!==Z?(Q=(0,f.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:A,children:[I,H,q,Y,Z]}),r[63]=A,r[64]=I,r[65]=H,r[66]=q,r[67]=Y,r[68]=Z,r[69]=Q):Q=r[69];let $;return r[70]!==k||r[71]!==Q?($=(0,f.jsxs)(f.Fragment,{children:[D,O,k,Q]}),r[70]=k,r[71]=Q,r[72]=$):$=r[72],$}function he(e){let t=o(e.Tags);return(0,f.jsx)(r,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}function ge(e){let t=e(`groupName`),ee=typeof t==`string`?t:``,n=e(`description`),r=typeof n==`string`?n:``,i=e(`vpcId`),te=typeof i==`string`?i:``,a=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-security-group`},{type:`flag`,value:` \\
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as ee}from"./back-link.js";import{c as n,i as r,n as i,s as te,t as a}from"./select.js";import{t as ne}from"./cli-command-panel.js";import{v as re}from"./ec2.js";import{Et as ie,Lo as o,Oa as ae,bs as s,gs as oe,ps as c}from"./index.js";import{a as se,i as ce,n as le,t as ue}from"./zod.js";import{t as de}from"./form-actions.js";import{t as fe}from"./page-heading.js";import{a as l,r as u,t as d}from"./field.js";import{d as pe}from"./ec22.js";var me=c(),f=s();function p(){let r=(0,me.c)(73),o=oe(),{data:s}=t(ie),c=re(),p;r[0]===s.Vpcs?p=r[1]:(p=s.Vpcs??[],r[0]=s.Vpcs,r[1]=p);let m=p,h;r[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=ue(pe),r[2]=h):h=r[2];let g=m[0]?.VpcId??``,_;r[3]===g?_=r[4]:(_={resolver:h,defaultValues:{groupName:``,description:``,vpcId:g}},r[3]=g,r[4]=_);let{control:v,handleSubmit:y,register:b,formState:_e}=ce(_),{errors:x,isSubmitting:ve}=_e,S;r[5]===v?S=r[6]:(S={control:v},r[5]=v,r[6]=S);let ye=se(S),C;r[7]===ye?C=r[8]:(C=e=>e?ye[e]:void 0,r[7]=ye,r[8]=C);let w=C,T;r[9]!==c||r[10]!==o?(T=async e=>{let t=(await c.mutateAsync(e)).GroupId;o(t?{to:`/ec2/describe-security-groups/$id`,params:{id:t}}:{to:`/ec2/describe-security-groups`})},r[9]=c,r[10]=o,r[11]=T):T=r[11];let E=T,D,O;r[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,f.jsx)(ee,{to:`/ec2/describe-security-groups`,children:`Back to Security Groups`}),O=(0,f.jsx)(fe,{title:`Create Security Group`}),r[12]=D,r[13]=O):(D=r[12],O=r[13]);let k;r[14]===c.error?k=r[15]:(k=c.error&&(0,f.jsx)(e,{error:c.error,msg:`Failed to create security group`}),r[14]=c.error,r[15]=k);let A;r[16]!==y||r[17]!==E?(A=y(E),r[16]=y,r[17]=E,r[18]=A):A=r[18];let j;r[19]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`groupName`,children:`Group Name`})}),r[19]=j):j=r[19];let M=!!x.groupName,N;r[20]===b?N=r[21]:(N=b(`groupName`),r[20]=b,r[21]=N);let P;r[22]!==M||r[23]!==N?(P=(0,f.jsx)(ae,{"aria-invalid":M,id:`groupName`,placeholder:`my-security-group`,...N}),r[22]=M,r[23]=N,r[24]=P):P=r[24];let F;r[25]===x.groupName?F=r[26]:(F=(0,f.jsx)(u,{errors:[x.groupName]}),r[25]=x.groupName,r[26]=F);let I;r[27]!==P||r[28]!==F?(I=(0,f.jsxs)(d,{children:[j,P,F]}),r[27]=P,r[28]=F,r[29]=I):I=r[29];let L;r[30]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`description`,children:`Description`})}),r[30]=L):L=r[30];let R=!!x.description,z;r[31]===b?z=r[32]:(z=b(`description`),r[31]=b,r[32]=z);let B;r[33]!==R||r[34]!==z?(B=(0,f.jsx)(ae,{"aria-invalid":R,id:`description`,placeholder:`My security group description`,...z}),r[33]=R,r[34]=z,r[35]=B):B=r[35];let V;r[36]===x.description?V=r[37]:(V=(0,f.jsx)(u,{errors:[x.description]}),r[36]=x.description,r[37]=V);let H;r[38]!==B||r[39]!==V?(H=(0,f.jsxs)(d,{children:[L,B,V]}),r[38]=B,r[39]=V,r[40]=H):H=r[40];let U;r[41]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,f.jsx)(l,{children:(0,f.jsx)(`label`,{htmlFor:`vpcId`,children:`VPC`})}),r[41]=U):U=r[41];let W;r[42]!==x.vpcId||r[43]!==m?(W=e=>{let{field:t}=e;return(0,f.jsxs)(a,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,f.jsx)(te,{"aria-invalid":!!x.vpcId,className:`w-full`,id:`vpcId`,children:(0,f.jsx)(n,{})}),(0,f.jsx)(i,{children:m.map(he)})]})},r[42]=x.vpcId,r[43]=m,r[44]=W):W=r[44];let G;r[45]!==v||r[46]!==W?(G=(0,f.jsx)(le,{control:v,name:`vpcId`,render:W}),r[45]=v,r[46]=W,r[47]=G):G=r[47];let K;r[48]===x.vpcId?K=r[49]:(K=(0,f.jsx)(u,{errors:[x.vpcId]}),r[48]=x.vpcId,r[49]=K);let q;r[50]!==G||r[51]!==K?(q=(0,f.jsxs)(d,{children:[U,G,K]}),r[50]=G,r[51]=K,r[52]=q):q=r[52];let J;r[53]===w?J=r[54]:(J=ge(w),r[53]=w,r[54]=J);let Y;r[55]===J?Y=r[56]:(Y=(0,f.jsx)(ne,{commands:J}),r[55]=J,r[56]=Y);let X;r[57]===o?X=r[58]:(X=async()=>await o({to:`/ec2/describe-security-groups`}),r[57]=o,r[58]=X);let Z;r[59]!==c.isPending||r[60]!==ve||r[61]!==X?(Z=(0,f.jsx)(de,{isPending:c.isPending,isSubmitting:ve,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Security Group`}),r[59]=c.isPending,r[60]=ve,r[61]=X,r[62]=Z):Z=r[62];let Q;r[63]!==A||r[64]!==I||r[65]!==H||r[66]!==q||r[67]!==Y||r[68]!==Z?(Q=(0,f.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:A,children:[I,H,q,Y,Z]}),r[63]=A,r[64]=I,r[65]=H,r[66]=q,r[67]=Y,r[68]=Z,r[69]=Q):Q=r[69];let $;return r[70]!==k||r[71]!==Q?($=(0,f.jsxs)(f.Fragment,{children:[D,O,k,Q]}),r[70]=k,r[71]=Q,r[72]=$):$=r[72],$}function he(e){let t=o(e.Tags);return(0,f.jsx)(r,{value:e.VpcId??``,children:t?`${e.VpcId} (${t})`:`${e.VpcId} (${e.CidrBlock})`},e.VpcId)}function ge(e){let t=e(`groupName`),ee=typeof t==`string`?t:``,n=e(`description`),r=typeof n==`string`?n:``,i=e(`vpcId`),te=typeof i==`string`?i:``,a=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-security-group`},{type:`flag`,value:` \\
|
||||
--group-name`},{type:`value`,value:` ${ee||`<GroupName>`}`},{type:`flag`,value:` \\
|
||||
--description`},{type:`value`,value:` "${r||`<Description>`}"`}];return te&&a.push({type:`flag`,value:` \\
|
||||
--vpc-id`},{type:`value`,value:` ${te}`}),[{label:`Create Security Group`,parts:a}]}export{p as component};
|
||||
@@ -1,3 +1,3 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{c as r,i,n as a,s as ee,t as o}from"./select.js";import{t as te}from"./cli-command-panel.js";import{y as s}from"./ec2.js";import{J as c,fs as l,hs as ne,wt as re,ys as u}from"./index.js";import{a as ie,i as ae,n as oe,t as se}from"./zod.js";import{t as ce}from"./form-actions.js";import{t as le}from"./page-heading.js";import{a as d,r as f,t as p}from"./field.js";import{f as m}from"./ec22.js";import{t as h}from"./textarea.js";var ue=l(),g=u();function _(){let i=(0,ue.c)(55),l=ne(),{data:u}=t(re),_=s(),v;i[0]===u.Volumes?v=i[1]:(v=u.Volumes??[],i[0]=u.Volumes,i[1]=v);let y=v,{volumeId:b}=c.useSearch(),x=b??y[0]?.VolumeId??``,S;i[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=se(m),i[2]=S):S=i[2];let C;i[3]===x?C=i[4]:(C={resolver:S,defaultValues:{volumeId:x,description:``}},i[3]=x,i[4]=C);let{control:w,handleSubmit:T,register:E,formState:D}=ae(C),{errors:O,isSubmitting:k}=D,A;i[5]===w?A=i[6]:(A={control:w},i[5]=w,i[6]=A);let j=ie(A),M;i[7]===j?M=i[8]:(M=e=>e?j[e]:void 0,i[7]=j,i[8]=M);let N=M,P;i[9]!==_||i[10]!==l?(P=async e=>{await _.mutateAsync(e),l({to:`/ec2/describe-snapshots`})},i[9]=_,i[10]=l,i[11]=P):P=i[11];let F=P,I,L;i[12]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,g.jsx)(n,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),L=(0,g.jsx)(le,{title:`Create Snapshot`}),i[12]=I,i[13]=L):(I=i[12],L=i[13]);let R;i[14]===_.error?R=i[15]:(R=_.error&&(0,g.jsx)(e,{error:_.error,msg:`Failed to create snapshot`}),i[14]=_.error,i[15]=R);let z;i[16]!==T||i[17]!==F?(z=T(F),i[16]=T,i[17]=F,i[18]=z):z=i[18];let B;i[19]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,g.jsx)(d,{children:(0,g.jsx)(`label`,{htmlFor:`volumeId`,children:`Volume`})}),i[19]=B):B=i[19];let V;i[20]!==O.volumeId||i[21]!==y?(V=e=>{let{field:t}=e;return(0,g.jsxs)(o,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,g.jsx)(ee,{"aria-invalid":!!O.volumeId,className:`w-full`,id:`volumeId`,children:(0,g.jsx)(r,{})}),(0,g.jsx)(a,{children:y.map(de)})]})},i[20]=O.volumeId,i[21]=y,i[22]=V):V=i[22];let H;i[23]!==w||i[24]!==V?(H=(0,g.jsx)(oe,{control:w,name:`volumeId`,render:V}),i[23]=w,i[24]=V,i[25]=H):H=i[25];let U;i[26]===O.volumeId?U=i[27]:(U=(0,g.jsx)(f,{errors:[O.volumeId]}),i[26]=O.volumeId,i[27]=U);let W;i[28]!==H||i[29]!==U?(W=(0,g.jsxs)(p,{children:[B,H,U]}),i[28]=H,i[29]=U,i[30]=W):W=i[30];let G;i[31]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,g.jsx)(d,{children:(0,g.jsx)(`label`,{htmlFor:`description`,children:`Description (optional)`})}),i[31]=G):G=i[31];let K;i[32]===E?K=i[33]:(K=E(`description`),i[32]=E,i[33]=K);let q;i[34]===K?q=i[35]:(q=(0,g.jsxs)(p,{children:[G,(0,g.jsx)(h,{id:`description`,placeholder:`Snapshot description`,...K})]}),i[34]=K,i[35]=q);let J;i[36]===N?J=i[37]:(J=fe(N),i[36]=N,i[37]=J);let Y;i[38]===J?Y=i[39]:(Y=(0,g.jsx)(te,{commands:J}),i[38]=J,i[39]=Y);let X;i[40]===l?X=i[41]:(X=async()=>await l({to:`/ec2/describe-snapshots`}),i[40]=l,i[41]=X);let Z;i[42]!==_.isPending||i[43]!==k||i[44]!==X?(Z=(0,g.jsx)(ce,{isPending:_.isPending,isSubmitting:k,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Snapshot`}),i[42]=_.isPending,i[43]=k,i[44]=X,i[45]=Z):Z=i[45];let Q;i[46]!==z||i[47]!==W||i[48]!==q||i[49]!==Y||i[50]!==Z?(Q=(0,g.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:z,children:[W,q,Y,Z]}),i[46]=z,i[47]=W,i[48]=q,i[49]=Y,i[50]=Z,i[51]=Q):Q=i[51];let $;return i[52]!==Q||i[53]!==R?($=(0,g.jsxs)(g.Fragment,{children:[I,L,R,Q]}),i[52]=Q,i[53]=R,i[54]=$):$=i[54],$}function de(e){return(0,g.jsxs)(i,{value:e.VolumeId??``,children:[e.VolumeId,` (`,e.Size,` GiB)`]},e.VolumeId)}function fe(e){let t=e(`volumeId`),n=typeof t==`string`?t:``,r=e(`description`),i=typeof r==`string`?r:``,a=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-snapshot`},{type:`flag`,value:` \\
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{c as r,i,n as a,s as ee,t as o}from"./select.js";import{t as te}from"./cli-command-panel.js";import{y as s}from"./ec2.js";import{J as c,bs as l,gs as ne,ps as u,wt as re}from"./index.js";import{a as ie,i as ae,n as oe,t as se}from"./zod.js";import{t as ce}from"./form-actions.js";import{t as le}from"./page-heading.js";import{a as d,r as f,t as p}from"./field.js";import{f as m}from"./ec22.js";import{t as h}from"./textarea.js";var ue=u(),g=l();function _(){let i=(0,ue.c)(55),l=ne(),{data:u}=t(re),_=s(),v;i[0]===u.Volumes?v=i[1]:(v=u.Volumes??[],i[0]=u.Volumes,i[1]=v);let y=v,{volumeId:b}=c.useSearch(),x=b??y[0]?.VolumeId??``,S;i[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=se(m),i[2]=S):S=i[2];let C;i[3]===x?C=i[4]:(C={resolver:S,defaultValues:{volumeId:x,description:``}},i[3]=x,i[4]=C);let{control:w,handleSubmit:T,register:E,formState:D}=ae(C),{errors:O,isSubmitting:k}=D,A;i[5]===w?A=i[6]:(A={control:w},i[5]=w,i[6]=A);let j=ie(A),M;i[7]===j?M=i[8]:(M=e=>e?j[e]:void 0,i[7]=j,i[8]=M);let N=M,P;i[9]!==_||i[10]!==l?(P=async e=>{await _.mutateAsync(e),l({to:`/ec2/describe-snapshots`})},i[9]=_,i[10]=l,i[11]=P):P=i[11];let F=P,I,L;i[12]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,g.jsx)(n,{to:`/ec2/describe-snapshots`,children:`Back to snapshots`}),L=(0,g.jsx)(le,{title:`Create Snapshot`}),i[12]=I,i[13]=L):(I=i[12],L=i[13]);let R;i[14]===_.error?R=i[15]:(R=_.error&&(0,g.jsx)(e,{error:_.error,msg:`Failed to create snapshot`}),i[14]=_.error,i[15]=R);let z;i[16]!==T||i[17]!==F?(z=T(F),i[16]=T,i[17]=F,i[18]=z):z=i[18];let B;i[19]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,g.jsx)(d,{children:(0,g.jsx)(`label`,{htmlFor:`volumeId`,children:`Volume`})}),i[19]=B):B=i[19];let V;i[20]!==O.volumeId||i[21]!==y?(V=e=>{let{field:t}=e;return(0,g.jsxs)(o,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,g.jsx)(ee,{"aria-invalid":!!O.volumeId,className:`w-full`,id:`volumeId`,children:(0,g.jsx)(r,{})}),(0,g.jsx)(a,{children:y.map(de)})]})},i[20]=O.volumeId,i[21]=y,i[22]=V):V=i[22];let H;i[23]!==w||i[24]!==V?(H=(0,g.jsx)(oe,{control:w,name:`volumeId`,render:V}),i[23]=w,i[24]=V,i[25]=H):H=i[25];let U;i[26]===O.volumeId?U=i[27]:(U=(0,g.jsx)(f,{errors:[O.volumeId]}),i[26]=O.volumeId,i[27]=U);let W;i[28]!==H||i[29]!==U?(W=(0,g.jsxs)(p,{children:[B,H,U]}),i[28]=H,i[29]=U,i[30]=W):W=i[30];let G;i[31]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,g.jsx)(d,{children:(0,g.jsx)(`label`,{htmlFor:`description`,children:`Description (optional)`})}),i[31]=G):G=i[31];let K;i[32]===E?K=i[33]:(K=E(`description`),i[32]=E,i[33]=K);let q;i[34]===K?q=i[35]:(q=(0,g.jsxs)(p,{children:[G,(0,g.jsx)(h,{id:`description`,placeholder:`Snapshot description`,...K})]}),i[34]=K,i[35]=q);let J;i[36]===N?J=i[37]:(J=fe(N),i[36]=N,i[37]=J);let Y;i[38]===J?Y=i[39]:(Y=(0,g.jsx)(te,{commands:J}),i[38]=J,i[39]=Y);let X;i[40]===l?X=i[41]:(X=async()=>await l({to:`/ec2/describe-snapshots`}),i[40]=l,i[41]=X);let Z;i[42]!==_.isPending||i[43]!==k||i[44]!==X?(Z=(0,g.jsx)(ce,{isPending:_.isPending,isSubmitting:k,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Snapshot`}),i[42]=_.isPending,i[43]=k,i[44]=X,i[45]=Z):Z=i[45];let Q;i[46]!==z||i[47]!==W||i[48]!==q||i[49]!==Y||i[50]!==Z?(Q=(0,g.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:z,children:[W,q,Y,Z]}),i[46]=z,i[47]=W,i[48]=q,i[49]=Y,i[50]=Z,i[51]=Q):Q=i[51];let $;return i[52]!==Q||i[53]!==R?($=(0,g.jsxs)(g.Fragment,{children:[I,L,R,Q]}),i[52]=Q,i[53]=R,i[54]=$):$=i[54],$}function de(e){return(0,g.jsxs)(i,{value:e.VolumeId??``,children:[e.VolumeId,` (`,e.Size,` GiB)`]},e.VolumeId)}function fe(e){let t=e(`volumeId`),n=typeof t==`string`?t:``,r=e(`description`),i=typeof r==`string`?r:``,a=[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-snapshot`},{type:`flag`,value:` \\
|
||||
--volume-id`},{type:`value`,value:` ${n||`<VolumeId>`}`}];return i&&a.push({type:`flag`,value:` \\
|
||||
--description`},{type:`value`,value:` "${i}"`}),[{label:`Create Snapshot`,parts:a}]}export{_ as component};
|
||||
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./cli-command-panel.js";import{i}from"./elbv2.js";import{Et as a,hs as o,ys as s}from"./index.js";import{i as c,t as l}from"./zod.js";import{t as u}from"./form-actions.js";import{t as d}from"./page-heading.js";import{t as f}from"./target-group-form.js";import{a as p}from"./elbv22.js";var m=s();function h(){let s=o(),{data:h}=t(a),_=i(),v=h.Vpcs??[],y=c({resolver:l(p),defaultValues:{name:``,protocol:`HTTP`,port:80,vpcId:v[0]?.VpcId??``,healthCheck:{protocol:`HTTP`,path:`/`,port:`traffic-port`,intervalSeconds:30,timeoutSeconds:5,healthyThresholdCount:5,unhealthyThresholdCount:2,matcher:`200`},tags:[]}}),{handleSubmit:b,watch:x,formState:{isSubmitting:S}}=y;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(n,{to:`/ec2/describe-target-groups`,children:`Back to target groups`}),(0,m.jsx)(d,{title:`Create Target Group`}),_.error&&(0,m.jsx)(e,{error:_.error,msg:`Failed to create target group`}),(0,m.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:b(async e=>{try{let t=(await _.mutateAsync(e)).TargetGroups?.[0]?.TargetGroupArn;s(t?{to:`/ec2/describe-target-groups/$id`,params:{id:encodeURIComponent(t)}}:{to:`/ec2/describe-target-groups`})}catch{}}),children:[(0,m.jsx)(f,{form:y,vpcs:v}),(0,m.jsx)(r,{commands:g(x)}),(0,m.jsx)(u,{isPending:_.isPending,isSubmitting:S,onCancel:async()=>await s({to:`/ec2/describe-target-groups`}),pendingLabel:`Creating…`,submitLabel:`Create Target Group`})]})]})}function g(e){let t=t=>{let n=e(t);return typeof n==`string`?n:``},n=t=>{let n=e(t);return typeof n==`number`&&Number.isFinite(n)?n:void 0},r=t(`name`),i=t(`protocol`)||`HTTP`,a=n(`port`),o=t(`vpcId`),s=t(`healthCheck.protocol`)||`HTTP`,c=t(`healthCheck.path`)||`/`,l=t(`healthCheck.port`)||`traffic-port`,u=n(`healthCheck.intervalSeconds`),d=n(`healthCheck.timeoutSeconds`),f=n(`healthCheck.healthyThresholdCount`),p=n(`healthCheck.unhealthyThresholdCount`),m=t(`healthCheck.matcher`)||`200`,h=[{type:`bin`,value:`AWS_PROFILE=spinifex aws elbv2 create-target-group`},{type:`flag`,value:` \\
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{t as r}from"./cli-command-panel.js";import{i}from"./elbv2.js";import{Et as a,bs as o,gs as s}from"./index.js";import{i as c,t as l}from"./zod.js";import{t as u}from"./form-actions.js";import{t as d}from"./page-heading.js";import{t as f}from"./target-group-form.js";import{a as p}from"./elbv22.js";var m=o();function h(){let o=s(),{data:h}=t(a),_=i(),v=h.Vpcs??[],y=c({resolver:l(p),defaultValues:{name:``,protocol:`HTTP`,port:80,vpcId:v[0]?.VpcId??``,healthCheck:{protocol:`HTTP`,path:`/`,port:`traffic-port`,intervalSeconds:30,timeoutSeconds:5,healthyThresholdCount:5,unhealthyThresholdCount:2,matcher:`200`},tags:[]}}),{handleSubmit:b,watch:x,formState:{isSubmitting:S}}=y;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(n,{to:`/ec2/describe-target-groups`,children:`Back to target groups`}),(0,m.jsx)(d,{title:`Create Target Group`}),_.error&&(0,m.jsx)(e,{error:_.error,msg:`Failed to create target group`}),(0,m.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:b(async e=>{try{let t=(await _.mutateAsync(e)).TargetGroups?.[0]?.TargetGroupArn;o(t?{to:`/ec2/describe-target-groups/$id`,params:{id:encodeURIComponent(t)}}:{to:`/ec2/describe-target-groups`})}catch{}}),children:[(0,m.jsx)(f,{form:y,vpcs:v}),(0,m.jsx)(r,{commands:g(x)}),(0,m.jsx)(u,{isPending:_.isPending,isSubmitting:S,onCancel:async()=>await o({to:`/ec2/describe-target-groups`}),pendingLabel:`Creating…`,submitLabel:`Create Target Group`})]})]})}function g(e){let t=t=>{let n=e(t);return typeof n==`string`?n:``},n=t=>{let n=e(t);return typeof n==`number`&&Number.isFinite(n)?n:void 0},r=t(`name`),i=t(`protocol`)||`HTTP`,a=n(`port`),o=t(`vpcId`),s=t(`healthCheck.protocol`)||`HTTP`,c=t(`healthCheck.path`)||`/`,l=t(`healthCheck.port`)||`traffic-port`,u=n(`healthCheck.intervalSeconds`),d=n(`healthCheck.timeoutSeconds`),f=n(`healthCheck.healthyThresholdCount`),p=n(`healthCheck.unhealthyThresholdCount`),m=t(`healthCheck.matcher`)||`200`,h=[{type:`bin`,value:`AWS_PROFILE=spinifex aws elbv2 create-target-group`},{type:`flag`,value:` \\
|
||||
--name`},{type:`value`,value:` ${r||`<Name>`}`},{type:`flag`,value:` \\
|
||||
--protocol`},{type:`value`,value:` ${i}`},{type:`flag`,value:` \\
|
||||
--port`},{type:`value`,value:` ${a??80}`},{type:`flag`,value:` \\
|
||||
|
||||
@@ -1 +1 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{t as n}from"./cli-command-panel.js";import{c as r}from"./iam.js";import{Da as i,fs as a,hs as o,ys as s}from"./index.js";import{a as c,i as ee,t as l}from"./zod.js";import{t as u}from"./form-actions.js";import{t as d}from"./page-heading.js";import{a as f,r as p,t as m}from"./field.js";import{a as h}from"./iam2.js";var g=a(),_=s();function v(){let a=(0,g.c)(55),s=o(),v=r(),b;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={resolver:l(h)},a[0]=b):b=a[0];let{handleSubmit:x,register:S,control:C,formState:w}=ee(b),{errors:T,isSubmitting:E}=w,D;a[1]===C?D=a[2]:(D={control:C},a[1]=C,a[2]=D);let O=c(D),k;a[3]===O?k=a[4]:(k=e=>e?O[e]:void 0,a[3]=O,a[4]=k);let A=k,j;a[5]!==v||a[6]!==s?(j=async e=>{await v.mutateAsync(e),s({to:`/iam/list-users`})},a[5]=v,a[6]=s,a[7]=j):j=a[7];let M=j,N,P;a[8]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,_.jsx)(t,{to:`/iam/list-users`,children:`Back to users`}),P=(0,_.jsx)(d,{title:`Create User`}),a[8]=N,a[9]=P):(N=a[8],P=a[9]);let F;a[10]===v.error?F=a[11]:(F=v.error&&(0,_.jsx)(e,{error:v.error,msg:`Failed to create user`}),a[10]=v.error,a[11]=F);let I;a[12]!==x||a[13]!==M?(I=x(M),a[12]=x,a[13]=M,a[14]=I):I=a[14];let L;a[15]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,_.jsx)(f,{children:(0,_.jsx)(`label`,{htmlFor:`userName`,children:`User Name`})}),a[15]=L):L=a[15];let R=!!T.userName,z;a[16]===S?z=a[17]:(z=S(`userName`),a[16]=S,a[17]=z);let B;a[18]!==R||a[19]!==z?(B=(0,_.jsx)(i,{"aria-invalid":R,id:`userName`,placeholder:`my-user...`,...z}),a[18]=R,a[19]=z,a[20]=B):B=a[20];let V;a[21]===T.userName?V=a[22]:(V=(0,_.jsx)(p,{errors:[T.userName]}),a[21]=T.userName,a[22]=V);let H;a[23]!==B||a[24]!==V?(H=(0,_.jsxs)(m,{children:[L,B,V]}),a[23]=B,a[24]=V,a[25]=H):H=a[25];let U;a[26]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,_.jsx)(f,{children:(0,_.jsx)(`label`,{htmlFor:`path`,children:`Path (optional)`})}),a[26]=U):U=a[26];let W;a[27]===S?W=a[28]:(W=S(`path`),a[27]=S,a[28]=W);let G;a[29]===W?G=a[30]:(G=(0,_.jsx)(i,{id:`path`,placeholder:`/`,...W}),a[29]=W,a[30]=G);let K;a[31]===T.path?K=a[32]:(K=(0,_.jsx)(p,{errors:[T.path]}),a[31]=T.path,a[32]=K);let q;a[33]!==G||a[34]!==K?(q=(0,_.jsxs)(m,{children:[U,G,K]}),a[33]=G,a[34]=K,a[35]=q):q=a[35];let J;a[36]===A?J=a[37]:(J=y(A),a[36]=A,a[37]=J);let Y;a[38]===J?Y=a[39]:(Y=(0,_.jsx)(n,{commands:J}),a[38]=J,a[39]=Y);let X;a[40]===s?X=a[41]:(X=async()=>await s({to:`/iam/list-users`}),a[40]=s,a[41]=X);let Z;a[42]!==v.isPending||a[43]!==E||a[44]!==X?(Z=(0,_.jsx)(u,{isPending:v.isPending,isSubmitting:E,onCancel:X,pendingLabel:`Creating...`,submitLabel:`Create User`}),a[42]=v.isPending,a[43]=E,a[44]=X,a[45]=Z):Z=a[45];let Q;a[46]!==H||a[47]!==q||a[48]!==Y||a[49]!==Z||a[50]!==I?(Q=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:I,children:[H,q,Y,Z]}),a[46]=H,a[47]=q,a[48]=Y,a[49]=Z,a[50]=I,a[51]=Q):Q=a[51];let $;return a[52]!==Q||a[53]!==F?($=(0,_.jsxs)(_.Fragment,{children:[N,P,F,Q]}),a[52]=Q,a[53]=F,a[54]=$):$=a[54],$}function y(e){let t=e(`userName`),n=typeof t==`string`?t:``,r=e(`path`),i=typeof r==`string`?r:``,a=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-user`},{type:`flag`,value:` --user-name`},{type:`value`,value:` ${n||`<UserName>`}`}];return i&&i!==`/`&&a.push({type:`flag`,value:` --path`},{type:`value`,value:` ${i}`}),[{label:`Create User`,parts:a}]}export{v as component};
|
||||
import{t as e}from"./error-banner.js";import{t}from"./back-link.js";import{t as n}from"./cli-command-panel.js";import{c as r}from"./iam.js";import{Oa as i,bs as a,gs as o,ps as s}from"./index.js";import{a as c,i as ee,t as l}from"./zod.js";import{t as u}from"./form-actions.js";import{t as d}from"./page-heading.js";import{a as f,r as p,t as m}from"./field.js";import{a as h}from"./iam2.js";var g=s(),_=a();function v(){let a=(0,g.c)(55),s=o(),v=r(),b;a[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={resolver:l(h)},a[0]=b):b=a[0];let{handleSubmit:x,register:S,control:C,formState:w}=ee(b),{errors:T,isSubmitting:E}=w,D;a[1]===C?D=a[2]:(D={control:C},a[1]=C,a[2]=D);let O=c(D),k;a[3]===O?k=a[4]:(k=e=>e?O[e]:void 0,a[3]=O,a[4]=k);let A=k,j;a[5]!==v||a[6]!==s?(j=async e=>{await v.mutateAsync(e),s({to:`/iam/list-users`})},a[5]=v,a[6]=s,a[7]=j):j=a[7];let M=j,N,P;a[8]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,_.jsx)(t,{to:`/iam/list-users`,children:`Back to users`}),P=(0,_.jsx)(d,{title:`Create User`}),a[8]=N,a[9]=P):(N=a[8],P=a[9]);let F;a[10]===v.error?F=a[11]:(F=v.error&&(0,_.jsx)(e,{error:v.error,msg:`Failed to create user`}),a[10]=v.error,a[11]=F);let I;a[12]!==x||a[13]!==M?(I=x(M),a[12]=x,a[13]=M,a[14]=I):I=a[14];let L;a[15]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,_.jsx)(f,{children:(0,_.jsx)(`label`,{htmlFor:`userName`,children:`User Name`})}),a[15]=L):L=a[15];let R=!!T.userName,z;a[16]===S?z=a[17]:(z=S(`userName`),a[16]=S,a[17]=z);let B;a[18]!==R||a[19]!==z?(B=(0,_.jsx)(i,{"aria-invalid":R,id:`userName`,placeholder:`my-user...`,...z}),a[18]=R,a[19]=z,a[20]=B):B=a[20];let V;a[21]===T.userName?V=a[22]:(V=(0,_.jsx)(p,{errors:[T.userName]}),a[21]=T.userName,a[22]=V);let H;a[23]!==B||a[24]!==V?(H=(0,_.jsxs)(m,{children:[L,B,V]}),a[23]=B,a[24]=V,a[25]=H):H=a[25];let U;a[26]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,_.jsx)(f,{children:(0,_.jsx)(`label`,{htmlFor:`path`,children:`Path (optional)`})}),a[26]=U):U=a[26];let W;a[27]===S?W=a[28]:(W=S(`path`),a[27]=S,a[28]=W);let G;a[29]===W?G=a[30]:(G=(0,_.jsx)(i,{id:`path`,placeholder:`/`,...W}),a[29]=W,a[30]=G);let K;a[31]===T.path?K=a[32]:(K=(0,_.jsx)(p,{errors:[T.path]}),a[31]=T.path,a[32]=K);let q;a[33]!==G||a[34]!==K?(q=(0,_.jsxs)(m,{children:[U,G,K]}),a[33]=G,a[34]=K,a[35]=q):q=a[35];let J;a[36]===A?J=a[37]:(J=y(A),a[36]=A,a[37]=J);let Y;a[38]===J?Y=a[39]:(Y=(0,_.jsx)(n,{commands:J}),a[38]=J,a[39]=Y);let X;a[40]===s?X=a[41]:(X=async()=>await s({to:`/iam/list-users`}),a[40]=s,a[41]=X);let Z;a[42]!==v.isPending||a[43]!==E||a[44]!==X?(Z=(0,_.jsx)(u,{isPending:v.isPending,isSubmitting:E,onCancel:X,pendingLabel:`Creating...`,submitLabel:`Create User`}),a[42]=v.isPending,a[43]=E,a[44]=X,a[45]=Z):Z=a[45];let Q;a[46]!==H||a[47]!==q||a[48]!==Y||a[49]!==Z||a[50]!==I?(Q=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:I,children:[H,q,Y,Z]}),a[46]=H,a[47]=q,a[48]=Y,a[49]=Z,a[50]=I,a[51]=Q):Q=a[51];let $;return a[52]!==Q||a[53]!==F?($=(0,_.jsxs)(_.Fragment,{children:[N,P,F,Q]}),a[52]=Q,a[53]=F,a[54]=$):$=a[54],$}function y(e){let t=e(`userName`),n=typeof t==`string`?t:``,r=e(`path`),i=typeof r==`string`?r:``,a=[{type:`bin`,value:`AWS_PROFILE=spinifex aws iam create-user`},{type:`flag`,value:` --user-name`},{type:`value`,value:` ${n||`<UserName>`}`}];return i&&i!==`/`&&a.push({type:`flag`,value:` --path`},{type:`value`,value:` ${i}`}),[{label:`Create User`,parts:a}]}export{v as component};
|
||||
@@ -1,3 +1,3 @@
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{c as r,i,n as ee,s as a,t as te}from"./select.js";import{t as o}from"./cli-command-panel.js";import{x as s}from"./ec2.js";import{$ as ne,Da as re,fs as c,hs as ie,ys as l}from"./index.js";import{i as u,n as d,t as f}from"./zod.js";import{t as p}from"./form-actions.js";import{t as ae}from"./page-heading.js";import{a as m,r as h,t as g}from"./field.js";import{m as oe}from"./ec22.js";var se=c(),_=l();function v(){let i=(0,se.c)(57),c=ie(),{data:l}=t(ne),v=s(),y;i[0]===l.AvailabilityZones?y=i[1]:(y=l.AvailabilityZones??[],i[0]=l.AvailabilityZones,i[1]=y);let b=y,x=b[0]?.ZoneName??``,S;i[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=f(oe),i[2]=S):S=i[2];let C;i[3]===x?C=i[4]:(C={resolver:S,defaultValues:{size:1,availabilityZone:x}},i[3]=x,i[4]=C);let{control:w,handleSubmit:T,register:E,watch:D,formState:O}=u(C),{errors:k,isSubmitting:A}=O,j;i[5]!==v||i[6]!==c?(j=async e=>{await v.mutateAsync(e),c({to:`/ec2/describe-volumes`})},i[5]=v,i[6]=c,i[7]=j):j=i[7];let M=j,N,P;i[8]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,_.jsx)(n,{to:`/ec2/describe-volumes`,children:`Back to volumes`}),P=(0,_.jsx)(ae,{title:`Create Volume`}),i[8]=N,i[9]=P):(N=i[8],P=i[9]);let F;i[10]===v.error?F=i[11]:(F=v.error&&(0,_.jsx)(e,{error:v.error,msg:`Failed to create volume`}),i[10]=v.error,i[11]=F);let I;i[12]!==T||i[13]!==M?(I=T(M),i[12]=T,i[13]=M,i[14]=I):I=i[14];let L;i[15]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`size`,children:`Size (GiB)`})}),i[15]=L):L=i[15];let R=!!k.size,z;i[16]===E?z=i[17]:(z=E(`size`,{valueAsNumber:!0}),i[16]=E,i[17]=z);let B;i[18]!==R||i[19]!==z?(B=(0,_.jsx)(re,{"aria-invalid":R,id:`size`,max:16384,min:1,type:`number`,...z}),i[18]=R,i[19]=z,i[20]=B):B=i[20];let V;i[21]===k.size?V=i[22]:(V=(0,_.jsx)(h,{errors:[k.size]}),i[21]=k.size,i[22]=V);let H;i[23]!==B||i[24]!==V?(H=(0,_.jsxs)(g,{children:[L,B,V]}),i[23]=B,i[24]=V,i[25]=H):H=i[25];let U;i[26]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`availabilityZone`,children:`Availability Zone`})}),i[26]=U):U=i[26];let W;i[27]!==b||i[28]!==k.availabilityZone?(W=e=>{let{field:t}=e;return(0,_.jsxs)(te,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,_.jsx)(a,{"aria-invalid":!!k.availabilityZone,className:`w-full`,id:`availabilityZone`,children:(0,_.jsx)(r,{})}),(0,_.jsx)(ee,{children:b.map(ce)})]})},i[27]=b,i[28]=k.availabilityZone,i[29]=W):W=i[29];let G;i[30]!==w||i[31]!==W?(G=(0,_.jsx)(d,{control:w,name:`availabilityZone`,render:W}),i[30]=w,i[31]=W,i[32]=G):G=i[32];let K;i[33]===k.availabilityZone?K=i[34]:(K=(0,_.jsx)(h,{errors:[k.availabilityZone]}),i[33]=k.availabilityZone,i[34]=K);let q;i[35]!==G||i[36]!==K?(q=(0,_.jsxs)(g,{children:[U,G,K]}),i[35]=G,i[36]=K,i[37]=q):q=i[37];let J;i[38]===D?J=i[39]:(J=le(D),i[38]=D,i[39]=J);let Y;i[40]===J?Y=i[41]:(Y=(0,_.jsx)(o,{commands:J}),i[40]=J,i[41]=Y);let X;i[42]===c?X=i[43]:(X=async()=>await c({to:`/ec2/describe-volumes`}),i[42]=c,i[43]=X);let Z;i[44]!==v.isPending||i[45]!==A||i[46]!==X?(Z=(0,_.jsx)(p,{isPending:v.isPending,isSubmitting:A,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Volume`}),i[44]=v.isPending,i[45]=A,i[46]=X,i[47]=Z):Z=i[47];let Q;i[48]!==H||i[49]!==q||i[50]!==Y||i[51]!==Z||i[52]!==I?(Q=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:I,children:[H,q,Y,Z]}),i[48]=H,i[49]=q,i[50]=Y,i[51]=Z,i[52]=I,i[53]=Q):Q=i[53];let $;return i[54]!==Q||i[55]!==F?($=(0,_.jsxs)(_.Fragment,{children:[N,P,F,Q]}),i[54]=Q,i[55]=F,i[56]=$):$=i[56],$}function ce(e){return(0,_.jsx)(i,{value:e.ZoneName??``,children:e.ZoneName},e.ZoneName)}function le(e){let t=e(`size`),n=typeof t==`number`?t:0,r=e(`availabilityZone`),i=typeof r==`string`?r:``;return[{label:`Create Volume`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-volume`},{type:`flag`,value:` \\
|
||||
import{t as e}from"./error-banner.js";import{t}from"./useSuspenseQuery.js";import{t as n}from"./back-link.js";import{c as r,i,n as ee,s as a,t as te}from"./select.js";import{t as o}from"./cli-command-panel.js";import{x as s}from"./ec2.js";import{$ as ne,Oa as re,bs as c,gs as ie,ps as l}from"./index.js";import{i as u,n as d,t as f}from"./zod.js";import{t as p}from"./form-actions.js";import{t as ae}from"./page-heading.js";import{a as m,r as h,t as g}from"./field.js";import{m as oe}from"./ec22.js";var se=l(),_=c();function v(){let i=(0,se.c)(57),c=ie(),{data:l}=t(ne),v=s(),y;i[0]===l.AvailabilityZones?y=i[1]:(y=l.AvailabilityZones??[],i[0]=l.AvailabilityZones,i[1]=y);let b=y,x=b[0]?.ZoneName??``,S;i[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=f(oe),i[2]=S):S=i[2];let C;i[3]===x?C=i[4]:(C={resolver:S,defaultValues:{size:1,availabilityZone:x}},i[3]=x,i[4]=C);let{control:w,handleSubmit:T,register:E,watch:D,formState:O}=u(C),{errors:k,isSubmitting:A}=O,j;i[5]!==v||i[6]!==c?(j=async e=>{await v.mutateAsync(e),c({to:`/ec2/describe-volumes`})},i[5]=v,i[6]=c,i[7]=j):j=i[7];let M=j,N,P;i[8]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,_.jsx)(n,{to:`/ec2/describe-volumes`,children:`Back to volumes`}),P=(0,_.jsx)(ae,{title:`Create Volume`}),i[8]=N,i[9]=P):(N=i[8],P=i[9]);let F;i[10]===v.error?F=i[11]:(F=v.error&&(0,_.jsx)(e,{error:v.error,msg:`Failed to create volume`}),i[10]=v.error,i[11]=F);let I;i[12]!==T||i[13]!==M?(I=T(M),i[12]=T,i[13]=M,i[14]=I):I=i[14];let L;i[15]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`size`,children:`Size (GiB)`})}),i[15]=L):L=i[15];let R=!!k.size,z;i[16]===E?z=i[17]:(z=E(`size`,{valueAsNumber:!0}),i[16]=E,i[17]=z);let B;i[18]!==R||i[19]!==z?(B=(0,_.jsx)(re,{"aria-invalid":R,id:`size`,max:16384,min:1,type:`number`,...z}),i[18]=R,i[19]=z,i[20]=B):B=i[20];let V;i[21]===k.size?V=i[22]:(V=(0,_.jsx)(h,{errors:[k.size]}),i[21]=k.size,i[22]=V);let H;i[23]!==B||i[24]!==V?(H=(0,_.jsxs)(g,{children:[L,B,V]}),i[23]=B,i[24]=V,i[25]=H):H=i[25];let U;i[26]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,_.jsx)(m,{children:(0,_.jsx)(`label`,{htmlFor:`availabilityZone`,children:`Availability Zone`})}),i[26]=U):U=i[26];let W;i[27]!==b||i[28]!==k.availabilityZone?(W=e=>{let{field:t}=e;return(0,_.jsxs)(te,{onValueChange:e=>t.onChange(e),value:t.value??``,children:[(0,_.jsx)(a,{"aria-invalid":!!k.availabilityZone,className:`w-full`,id:`availabilityZone`,children:(0,_.jsx)(r,{})}),(0,_.jsx)(ee,{children:b.map(ce)})]})},i[27]=b,i[28]=k.availabilityZone,i[29]=W):W=i[29];let G;i[30]!==w||i[31]!==W?(G=(0,_.jsx)(d,{control:w,name:`availabilityZone`,render:W}),i[30]=w,i[31]=W,i[32]=G):G=i[32];let K;i[33]===k.availabilityZone?K=i[34]:(K=(0,_.jsx)(h,{errors:[k.availabilityZone]}),i[33]=k.availabilityZone,i[34]=K);let q;i[35]!==G||i[36]!==K?(q=(0,_.jsxs)(g,{children:[U,G,K]}),i[35]=G,i[36]=K,i[37]=q):q=i[37];let J;i[38]===D?J=i[39]:(J=le(D),i[38]=D,i[39]=J);let Y;i[40]===J?Y=i[41]:(Y=(0,_.jsx)(o,{commands:J}),i[40]=J,i[41]=Y);let X;i[42]===c?X=i[43]:(X=async()=>await c({to:`/ec2/describe-volumes`}),i[42]=c,i[43]=X);let Z;i[44]!==v.isPending||i[45]!==A||i[46]!==X?(Z=(0,_.jsx)(p,{isPending:v.isPending,isSubmitting:A,onCancel:X,pendingLabel:`Creating…`,submitLabel:`Create Volume`}),i[44]=v.isPending,i[45]=A,i[46]=X,i[47]=Z):Z=i[47];let Q;i[48]!==H||i[49]!==q||i[50]!==Y||i[51]!==Z||i[52]!==I?(Q=(0,_.jsxs)(`form`,{className:`max-w-4xl space-y-6`,onSubmit:I,children:[H,q,Y,Z]}),i[48]=H,i[49]=q,i[50]=Y,i[51]=Z,i[52]=I,i[53]=Q):Q=i[53];let $;return i[54]!==Q||i[55]!==F?($=(0,_.jsxs)(_.Fragment,{children:[N,P,F,Q]}),i[54]=Q,i[55]=F,i[56]=$):$=i[56],$}function ce(e){return(0,_.jsx)(i,{value:e.ZoneName??``,children:e.ZoneName},e.ZoneName)}function le(e){let t=e(`size`),n=typeof t==`number`?t:0,r=e(`availabilityZone`),i=typeof r==`string`?r:``;return[{label:`Create Volume`,parts:[{type:`bin`,value:`AWS_PROFILE=spinifex aws ec2 create-volume`},{type:`flag`,value:` \\
|
||||
--size`},{type:`value`,value:` ${n||1}`},{type:`flag`,value:` \\
|
||||
--availability-zone`},{type:`value`,value:` ${i||`<AvailabilityZone>`}`}]}]}export{v as component};
|
||||
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{fs as e,ys as t}from"./index.js";import{a as n,i as r,l as i,n as a,o,r as s,s as c,t as l}from"./alert-dialog.js";var u=e(),d=t();function f(e){let t=(0,u.c)(19),{open:f,onOpenChange:p,title:m,description:h,isPending:g,onConfirm:_,confirmLabel:v,pendingLabel:y}=e,b=v===void 0?`Delete`:v,x=y===void 0?`Deleting…`:y,S;t[0]===m?S=t[1]:(S=(0,d.jsx)(i,{children:m}),t[0]=m,t[1]=S);let C;t[2]===h?C=t[3]:(C=(0,d.jsx)(n,{children:h}),t[2]=h,t[3]=C);let w;t[4]!==S||t[5]!==C?(w=(0,d.jsxs)(c,{children:[S,C]}),t[4]=S,t[5]=C,t[6]=w):w=t[6];let T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,d.jsx)(s,{children:`Cancel`}),t[7]=T):T=t[7];let E=g?x:b,D;t[8]!==g||t[9]!==_||t[10]!==E?(D=(0,d.jsxs)(o,{children:[T,(0,d.jsx)(a,{disabled:g,onClick:_,children:E})]}),t[8]=g,t[9]=_,t[10]=E,t[11]=D):D=t[11];let O;t[12]!==w||t[13]!==D?(O=(0,d.jsxs)(r,{children:[w,D]}),t[12]=w,t[13]=D,t[14]=O):O=t[14];let k;return t[15]!==p||t[16]!==f||t[17]!==O?(k=(0,d.jsx)(l,{onOpenChange:p,open:f,children:O}),t[15]=p,t[16]=f,t[17]=O,t[18]=k):k=t[18],k}export{f as t};
|
||||
import{bs as e,ps as t}from"./index.js";import{a as n,i as r,l as i,n as a,o,r as s,s as c,t as l}from"./alert-dialog.js";var u=t(),d=e();function f(e){let t=(0,u.c)(19),{open:f,onOpenChange:p,title:m,description:h,isPending:g,onConfirm:_,confirmLabel:v,pendingLabel:y}=e,b=v===void 0?`Delete`:v,x=y===void 0?`Deleting…`:y,S;t[0]===m?S=t[1]:(S=(0,d.jsx)(i,{children:m}),t[0]=m,t[1]=S);let C;t[2]===h?C=t[3]:(C=(0,d.jsx)(n,{children:h}),t[2]=h,t[3]=C);let w;t[4]!==S||t[5]!==C?(w=(0,d.jsxs)(c,{children:[S,C]}),t[4]=S,t[5]=C,t[6]=w):w=t[6];let T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,d.jsx)(s,{children:`Cancel`}),t[7]=T):T=t[7];let E=g?x:b,D;t[8]!==g||t[9]!==_||t[10]!==E?(D=(0,d.jsxs)(o,{children:[T,(0,d.jsx)(a,{disabled:g,onClick:_,children:E})]}),t[8]=g,t[9]=_,t[10]=E,t[11]=D):D=t[11];let O;t[12]!==w||t[13]!==D?(O=(0,d.jsxs)(r,{children:[w,D]}),t[12]=w,t[13]=D,t[14]=O):O=t[14];let k;return t[15]!==p||t[16]!==f||t[17]!==O?(k=(0,d.jsx)(l,{onOpenChange:p,open:f,children:O}),t[15]=p,t[16]=f,t[17]=O,t[18]=k):k=t[18],k}export{f as t};
|
||||
@@ -1 +1 @@
|
||||
import{t as e}from"./useSuspenseQuery.js";import{Do as t,Io as n,Q as r,fs as i,ms as a,ys as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";var l=i(),u=o();function d(){let n=(0,l.c)(5),{data:i}=e(r),o;n[0]===i.Addresses?o=n[1]:(o=i.Addresses??[],n[0]=i.Addresses,n[1]=o);let c=o,d;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(s,{actions:(0,u.jsx)(a,{to:`/ec2/allocate-address`,children:(0,u.jsx)(t,{children:`Allocate Elastic IP`})}),title:`Elastic IPs`}),n[2]=d):d=n[2];let p;return n[3]===c?p=n[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.`})]}),n[3]=c,n[4]=p),p}function f(e){if(!e.AllocationId)return null;let t=n(e.Tags),r=e.AssociationId?`${e.PublicIp} • associated`:`${e.PublicIp} • available`;return(0,u.jsx)(c,{params:{id:e.AllocationId},subtitle:r,title:t?`${e.AllocationId} (${t})`:e.AllocationId??``,to:`/ec2/describe-addresses/$id`},e.AllocationId)}export{d as component};
|
||||
import{t as e}from"./useSuspenseQuery.js";import{Lo as t,Oo as n,Q as r,bs as i,hs as a,ps as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";var l=o(),u=i();function d(){let t=(0,l.c)(5),{data:i}=e(r),o;t[0]===i.Addresses?o=t[1]:(o=i.Addresses??[],t[0]=i.Addresses,t[1]=o);let c=o,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(s,{actions:(0,u.jsx)(a,{to:`/ec2/allocate-address`,children:(0,u.jsx)(n,{children:`Allocate Elastic IP`})}),title:`Elastic IPs`}),t[2]=d):d=t[2];let p;return t[3]===c?p=t[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.`})]}),t[3]=c,t[4]=p),p}function f(e){if(!e.AllocationId)return null;let n=t(e.Tags),r=e.AssociationId?`${e.PublicIp} • associated`:`${e.PublicIp} • available`;return(0,u.jsx)(c,{params:{id:e.AllocationId},subtitle:r,title:n?`${e.AllocationId} (${n})`:e.AllocationId??``,to:`/ec2/describe-addresses/$id`},e.AllocationId)}export{d as component};
|
||||
@@ -1 +1 @@
|
||||
import{t as e}from"./useSuspenseQuery.js";import{fs as t,nt as n,ys as r}from"./index.js";import{t as i}from"./page-heading.js";import{t as a}from"./list-card.js";import{t as o}from"./state-badge.js";import{t as s}from"./system-managed.js";var c=t(),l=r();function u(){let t=(0,c.c)(3),{data:r}=e(n),a;if(t[0]!==r.Images){let e=(r.Images??[]).filter(f),n;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,l.jsx)(i,{title:`Images`}),t[2]=n):n=t[2],a=(0,l.jsxs)(l.Fragment,{children:[n,e.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:e.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No images found.`})]}),t[0]=r.Images,t[1]=a}else a=t[1];return a}function d(e){return e.ImageId?(0,l.jsx)(a,{badge:(0,l.jsx)(o,{state:e.State}),params:{id:e.ImageId},subtitle:e.ImageId??``,title:e.Name??e.ImageId??``,to:`/ec2/describe-images/$id`},e.ImageId):null}function f(e){return!s(e)}export{u as component};
|
||||
import{t as e}from"./useSuspenseQuery.js";import{bs as t,nt as n,ps as r}from"./index.js";import{t as i}from"./page-heading.js";import{t as a}from"./list-card.js";import{t as o}from"./state-badge.js";import{t as s}from"./system-managed.js";var c=r(),l=t();function u(){let t=(0,c.c)(3),{data:r}=e(n),a;if(t[0]!==r.Images){let e=(r.Images??[]).filter(f),n;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,l.jsx)(i,{title:`Images`}),t[2]=n):n=t[2],a=(0,l.jsxs)(l.Fragment,{children:[n,e.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:e.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No images found.`})]}),t[0]=r.Images,t[1]=a}else a=t[1];return a}function d(e){return e.ImageId?(0,l.jsx)(a,{badge:(0,l.jsx)(o,{state:e.State}),params:{id:e.ImageId},subtitle:e.ImageId??``,title:e.Name??e.ImageId??``,to:`/ec2/describe-images/$id`},e.ImageId):null}function f(e){return!s(e)}export{u as component};
|
||||
@@ -1 +1 @@
|
||||
import{t as e}from"./useSuspenseQuery.js";import{Do as t,at as n,fs as r,ms as i,ys 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=r(),u=a(),d={running:0,pending:1,stopping:2,"shutting-down":3,stopped:4,terminated:5};function f(){let r=(0,l.c)(3),{data:a}=e(n),s;if(r[0]!==a.Reservations){let e=(a.Reservations?.flatMap(h)??[]).toSorted(m),n;r[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(o,{actions:(0,u.jsx)(i,{to:`/ec2/run-instances`,children:(0,u.jsx)(t,{children:`Run Instances`})}),title:`Instances`}),r[2]=n):n=r[2],s=(0,u.jsxs)(u.Fragment,{children:[n,e.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:e.map(p)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No instances found.`})]}),r[0]=a.Reservations,r[1]=s}else s=r[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{t as e}from"./useSuspenseQuery.js";import{Oo as t,at as n,bs as r,hs as i,ps 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=a(),u=r(),d={running:0,pending:1,stopping:2,"shutting-down":3,stopped:4,terminated:5};function f(){let r=(0,l.c)(3),{data:a}=e(n),s;if(r[0]!==a.Reservations){let e=(a.Reservations?.flatMap(h)??[]).toSorted(m),n;r[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,u.jsx)(o,{actions:(0,u.jsx)(i,{to:`/ec2/run-instances`,children:(0,u.jsx)(t,{children:`Run Instances`})}),title:`Instances`}),r[2]=n):n=r[2],s=(0,u.jsxs)(u.Fragment,{children:[n,e.length>0?(0,u.jsx)(`div`,{className:`space-y-4`,children:e.map(p)}):(0,u.jsx)(`p`,{className:`text-muted-foreground`,children:`No instances found.`})]}),r[0]=a.Reservations,r[1]=s}else s=r[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{t as e}from"./useSuspenseQuery.js";import{Do as t,Io as n,fs as r,ms as i,st as a,ys as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";var l=r(),u=o();function d(){let n=(0,l.c)(5),{data:r}=e(a),o;n[0]===r.InternetGateways?o=n[1]:(o=r.InternetGateways??[],n[0]=r.InternetGateways,n[1]=o);let c=o,d;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(s,{actions:(0,u.jsx)(i,{to:`/ec2/create-internet-gateway`,children:(0,u.jsx)(t,{children:`Create Internet Gateway`})}),title:`Internet Gateways`}),n[2]=d):d=n[2];let p;return n[3]===c?p=n[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.`})]}),n[3]=c,n[4]=p),p}function f(e){if(!e.InternetGatewayId)return null;let t=n(e.Tags),r=e.Attachments?.[0]?.VpcId;return(0,u.jsx)(c,{params:{id:e.InternetGatewayId},subtitle:r?`attached to ${r}`:`detached`,title:t?`${e.InternetGatewayId} (${t})`:e.InternetGatewayId,to:`/ec2/describe-internet-gateways/$id`},e.InternetGatewayId)}export{d as component};
|
||||
import{t as e}from"./useSuspenseQuery.js";import{Lo as t,Oo as n,bs as r,hs as i,ps as a,st as o}from"./index.js";import{t as s}from"./page-heading.js";import{t as c}from"./list-card.js";var l=a(),u=r();function d(){let t=(0,l.c)(5),{data:r}=e(o),a;t[0]===r.InternetGateways?a=t[1]:(a=r.InternetGateways??[],t[0]=r.InternetGateways,t[1]=a);let c=a,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(s,{actions:(0,u.jsx)(i,{to:`/ec2/create-internet-gateway`,children:(0,u.jsx)(n,{children:`Create Internet Gateway`})}),title:`Internet Gateways`}),t[2]=d):d=t[2];let p;return t[3]===c?p=t[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.`})]}),t[3]=c,t[4]=p),p}function f(e){if(!e.InternetGatewayId)return null;let n=t(e.Tags),r=e.Attachments?.[0]?.VpcId;return(0,u.jsx)(c,{params:{id:e.InternetGatewayId},subtitle:r?`attached to ${r}`:`detached`,title:n?`${e.InternetGatewayId} (${n})`:e.InternetGatewayId,to:`/ec2/describe-internet-gateways/$id`},e.InternetGatewayId)}export{d as component};
|
||||
@@ -1 +1 @@
|
||||
import{t as e}from"./useSuspenseQuery.js";import{Do as t,fs as n,lt as r,ms as i,ys as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=n(),l=a();function u(){let n=(0,c.c)(4),{data:a}=e(r),s;if(n[0]!==a.KeyPairs){let e=(a.KeyPairs??[]).toSorted(f),r;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,l.jsx)(i,{to:`/ec2/import-key-pair`,children:(0,l.jsx)(t,{variant:`outline`,children:`Import Key Pair`})}),n[2]=r):r=n[2];let c;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,l.jsx)(o,{actions:(0,l.jsxs)(`div`,{className:`flex gap-2`,children:[r,(0,l.jsx)(i,{to:`/ec2/create-key-pair`,children:(0,l.jsx)(t,{children:`Create Key Pair`})})]}),title:`Key Pairs`}),n[3]=c):c=n[3],s=(0,l.jsxs)(l.Fragment,{children:[c,e.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:e.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No key pairs found.`})]}),n[0]=a.KeyPairs,n[1]=s}else s=n[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{t as e}from"./useSuspenseQuery.js";import{Oo as t,bs as n,hs as r,lt as i,ps as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=a(),l=n();function u(){let n=(0,c.c)(4),{data:a}=e(i),s;if(n[0]!==a.KeyPairs){let e=(a.KeyPairs??[]).toSorted(f),i;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,l.jsx)(r,{to:`/ec2/import-key-pair`,children:(0,l.jsx)(t,{variant:`outline`,children:`Import Key Pair`})}),n[2]=i):i=n[2];let c;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,l.jsx)(o,{actions:(0,l.jsxs)(`div`,{className:`flex gap-2`,children:[i,(0,l.jsx)(r,{to:`/ec2/create-key-pair`,children:(0,l.jsx)(t,{children:`Create Key Pair`})})]}),title:`Key Pairs`}),n[3]=c):c=n[3],s=(0,l.jsxs)(l.Fragment,{children:[c,e.length>0?(0,l.jsx)(`div`,{className:`space-y-4`,children:e.map(d)}):(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:`No key pairs found.`})]}),n[0]=a.KeyPairs,n[1]=s}else s=n[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{t as e}from"./useSuspenseQuery.js";import{B as t,Do as n,No as r,fs as i,hs as a,ms as o,ys as s}from"./index.js";import{t as c}from"./page-heading.js";import{t as l}from"./state-badge.js";var u=i(),d=s();function f(){let i=(0,u.c)(10),s=a(),{data:f}=e(t),m;i[0]===f.LoadBalancers?m=i[1]:(m=f.LoadBalancers??[],i[0]=f.LoadBalancers,i[1]=m);let h=m,g;i[2]===s?g=i[3]:(g=(0,d.jsx)(c,{actions:(0,d.jsx)(n,{onClick:async()=>await s({to:`/ec2/create-load-balancer`}),children:`Create Load Balancer`}),title:`Load Balancers`}),i[2]=s,i[3]=g);let _;i[4]!==h||i[5]!==s?(_=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 t=e.LoadBalancerArn;return(0,d.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>await s({to:`/ec2/describe-load-balancers/$id`,params:{id:encodeURIComponent(t)}}),children:[(0,d.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,d.jsx)(o,{className:`text-primary hover:underline`,onClick:p,params:{id:encodeURIComponent(t)},to:`/ec2/describe-load-balancers/$id`,children:e.LoadBalancerName??t})}),(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:r(e.CreatedTime)})]},t)})})]})}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No load balancers found.`}),i[4]=h,i[5]=s,i[6]=_):_=i[6];let v;return i[7]!==g||i[8]!==_?(v=(0,d.jsxs)(d.Fragment,{children:[g,_]}),i[7]=g,i[8]=_,i[9]=v):v=i[9],v}function p(e){return e.stopPropagation()}var m=f;export{m as component};
|
||||
import{t as e}from"./useSuspenseQuery.js";import{B as t,Oo as n,Po as r,bs as i,gs as a,hs as o,ps as s}from"./index.js";import{t as c}from"./page-heading.js";import{t as l}from"./state-badge.js";var u=s(),d=i();function f(){let i=(0,u.c)(10),s=a(),{data:f}=e(t),m;i[0]===f.LoadBalancers?m=i[1]:(m=f.LoadBalancers??[],i[0]=f.LoadBalancers,i[1]=m);let h=m,g;i[2]===s?g=i[3]:(g=(0,d.jsx)(c,{actions:(0,d.jsx)(n,{onClick:async()=>await s({to:`/ec2/create-load-balancer`}),children:`Create Load Balancer`}),title:`Load Balancers`}),i[2]=s,i[3]=g);let _;i[4]!==h||i[5]!==s?(_=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 t=e.LoadBalancerArn;return(0,d.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>await s({to:`/ec2/describe-load-balancers/$id`,params:{id:encodeURIComponent(t)}}),children:[(0,d.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,d.jsx)(o,{className:`text-primary hover:underline`,onClick:p,params:{id:encodeURIComponent(t)},to:`/ec2/describe-load-balancers/$id`,children:e.LoadBalancerName??t})}),(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:r(e.CreatedTime)})]},t)})})]})}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No load balancers found.`}),i[4]=h,i[5]=s,i[6]=_):_=i[6];let v;return i[7]!==g||i[8]!==_?(v=(0,d.jsxs)(d.Fragment,{children:[g,_]}),i[7]=g,i[8]=_,i[9]=v):v=i[9],v}function p(e){return e.stopPropagation()}var m=f;export{m as component};
|
||||
@@ -1 +1 @@
|
||||
import{t as e}from"./useSuspenseQuery.js";import{Do as t,Io as n,dt as r,fs as i,ms as a,ys 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=i(),d=o();function f(){let n=(0,u.c)(5),{data:i}=e(r),o;n[0]===i.NatGateways?o=n[1]:(o=i.NatGateways??[],n[0]=i.NatGateways,n[1]=o);let c=o,l;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(a,{to:`/ec2/create-nat-gateway`,children:(0,d.jsx)(t,{children:`Create NAT Gateway`})}),title:`NAT Gateways`}),n[2]=l):l=n[2];let f;return n[3]===c?f=n[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.`})]}),n[3]=c,n[4]=f),f}function p(e){if(!e.NatGatewayId)return null;let t=n(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{t as e}from"./useSuspenseQuery.js";import{Lo as t,Oo as n,bs as r,dt as i,hs as a,ps 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=o(),d=r();function f(){let t=(0,u.c)(5),{data:r}=e(i),o;t[0]===r.NatGateways?o=t[1]:(o=r.NatGateways??[],t[0]=r.NatGateways,t[1]=o);let c=o,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(a,{to:`/ec2/create-nat-gateway`,children:(0,d.jsx)(n,{children:`Create NAT Gateway`})}),title:`NAT Gateways`}),t[2]=l):l=t[2];let f;return t[3]===c?f=t[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.`})]}),t[3]=c,t[4]=f),f}function p(e){if(!e.NatGatewayId)return null;let n=t(e.Tags);return(0,d.jsx)(c,{badge:(0,d.jsx)(l,{state:e.State}),params:{id:e.NatGatewayId},subtitle:e.SubnetId??``,title:n?`${e.NatGatewayId} (${n})`:e.NatGatewayId,to:`/ec2/describe-nat-gateways/$id`},e.NatGatewayId)}export{f as component};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{t as e}from"./useSuspenseQuery.js";import{Do as t,fs as n,ms as r,pt as i,ys 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=n(),u=a();function d(){let n=(0,l.c)(5),{data:a}=e(i),s;n[0]===a.PlacementGroups?s=n[1]:(s=a.PlacementGroups??[],n[0]=a.PlacementGroups,n[1]=s);let c=s,d;n[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)(t,{children:`Create Placement Group`})}),title:`Placement Groups`}),n[2]=d):d=n[2];let p;return n[3]===c?p=n[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.`})]}),n[3]=c,n[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{t as e}from"./useSuspenseQuery.js";import{Oo as t,bs as n,hs as r,ps as i,pt 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=i(),u=n();function d(){let n=(0,l.c)(5),{data:i}=e(a),s;n[0]===i.PlacementGroups?s=n[1]:(s=i.PlacementGroups??[],n[0]=i.PlacementGroups,n[1]=s);let c=s,d;n[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)(t,{children:`Create Placement Group`})}),title:`Placement Groups`}),n[2]=d):d=n[2];let p;return n[3]===c?p=n[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.`})]}),n[3]=c,n[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{t as e}from"./useSuspenseQuery.js";import{Do as t,Io as n,fs as r,gt as i,ms as a,ys 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=r(),d=o();function f(){let n=(0,u.c)(5),{data:r}=e(i),o;n[0]===r.RouteTables?o=n[1]:(o=r.RouteTables??[],n[0]=r.RouteTables,n[1]=o);let c=o,l;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(a,{to:`/ec2/create-route-table`,children:(0,d.jsx)(t,{children:`Create Route Table`})}),title:`Route Tables`}),n[2]=l):l=n[2];let f;return n[3]===c?f=n[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.`})]}),n[3]=c,n[4]=f),f}function p(e){if(!e.RouteTableId)return null;let t=n(e.Tags),r=e.Associations?.some(h)??!1,i=e.Associations?.filter(m).length??0;return(0,d.jsx)(c,{badge:r?(0,d.jsx)(l,{variant:`secondary`,children:`Main`}):null,params:{id:e.RouteTableId},subtitle:`${e.VpcId??``} · ${i} subnet${i===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{t as e}from"./useSuspenseQuery.js";import{Lo as t,Oo as n,bs as r,gt as i,hs as a,ps 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=o(),d=r();function f(){let t=(0,u.c)(5),{data:r}=e(i),o;t[0]===r.RouteTables?o=t[1]:(o=r.RouteTables??[],t[0]=r.RouteTables,t[1]=o);let c=o,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(a,{to:`/ec2/create-route-table`,children:(0,d.jsx)(n,{children:`Create Route Table`})}),title:`Route Tables`}),t[2]=l):l=t[2];let f;return t[3]===c?f=t[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.`})]}),t[3]=c,t[4]=f),f}function p(e){if(!e.RouteTableId)return null;let n=t(e.Tags),r=e.Associations?.some(h)??!1,i=e.Associations?.filter(m).length??0;return(0,d.jsx)(c,{badge:r?(0,d.jsx)(l,{variant:`secondary`,children:`Main`}):null,params:{id:e.RouteTableId},subtitle:`${e.VpcId??``} · ${i} subnet${i===1?``:`s`}`,title:n?`${e.RouteTableId} (${n})`: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{t as e}from"./useSuspenseQuery.js";import{Do as t,fs as n,ms as r,vt as i,ys as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=n(),l=a();function u(){let n=(0,c.c)(5),{data:a}=e(i),s;n[0]===a.SecurityGroups?s=n[1]:(s=a.SecurityGroups??[],n[0]=a.SecurityGroups,n[1]=s);let u=s,f;n[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)(t,{children:`Create Security Group`})}),title:`Security Groups`}),n[2]=f):f=n[2];let p;return n[3]===u?p=n[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.`})]}),n[3]=u,n[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{t as e}from"./useSuspenseQuery.js";import{Oo as t,bs as n,hs as r,ps as i,vt as a}from"./index.js";import{t as o}from"./page-heading.js";import{t as s}from"./list-card.js";var c=i(),l=n();function u(){let n=(0,c.c)(5),{data:i}=e(a),s;n[0]===i.SecurityGroups?s=n[1]:(s=i.SecurityGroups??[],n[0]=i.SecurityGroups,n[1]=s);let u=s,f;n[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)(t,{children:`Create Security Group`})}),title:`Security Groups`}),n[2]=f):f=n[2];let p;return n[3]===u?p=n[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.`})]}),n[3]=u,n[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{t as e}from"./useSuspenseQuery.js";import{Do as t,bt as n,fs as r,ms as i,ys 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=r(),u=a();function d(){let r=(0,l.c)(5),{data:a}=e(n),s;r[0]===a.Snapshots?s=r[1]:(s=a.Snapshots??[],r[0]=a.Snapshots,r[1]=s);let c=s,d;r[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(o,{actions:(0,u.jsx)(i,{to:`/ec2/create-snapshot`,children:(0,u.jsx)(t,{children:`Create Snapshot`})}),title:`Snapshots`}),r[2]=d):d=r[2];let p;return r[3]===c?p=r[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.`})]}),r[3]=c,r[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{t as e}from"./useSuspenseQuery.js";import{Oo as t,bs as n,bt as r,hs as i,ps 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=a(),u=n();function d(){let n=(0,l.c)(5),{data:a}=e(r),s;n[0]===a.Snapshots?s=n[1]:(s=a.Snapshots??[],n[0]=a.Snapshots,n[1]=s);let c=s,d;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,u.jsx)(o,{actions:(0,u.jsx)(i,{to:`/ec2/create-snapshot`,children:(0,u.jsx)(t,{children:`Create Snapshot`})}),title:`Snapshots`}),n[2]=d):d=n[2];let p;return n[3]===c?p=n[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.`})]}),n[3]=c,n[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{t as e}from"./useSuspenseQuery.js";import{Do as t,Io as n,St as r,fs as i,ms as a,ys 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=i(),d=o();function f(){let n=(0,u.c)(5),{data:i}=e(r),o;n[0]===i.Subnets?o=n[1]:(o=i.Subnets??[],n[0]=i.Subnets,n[1]=o);let c=o,l;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(a,{to:`/ec2/create-subnet`,children:(0,d.jsx)(t,{children:`Create Subnet`})}),title:`Subnets`}),n[2]=l):l=n[2];let f;return n[3]===c?f=n[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.`})]}),n[3]=c,n[4]=f),f}function p(e){if(!e.SubnetId)return null;let t=n(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{t as e}from"./useSuspenseQuery.js";import{Lo as t,Oo as n,St as r,bs as i,hs as a,ps 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=o(),d=i();function f(){let t=(0,u.c)(5),{data:i}=e(r),o;t[0]===i.Subnets?o=t[1]:(o=i.Subnets??[],t[0]=i.Subnets,t[1]=o);let c=o,l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(a,{to:`/ec2/create-subnet`,children:(0,d.jsx)(n,{children:`Create Subnet`})}),title:`Subnets`}),t[2]=l):l=t[2];let f;return t[3]===c?f=t[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.`})]}),t[3]=c,t[4]=f),f}function p(e){if(!e.SubnetId)return null;let n=t(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:n?`${e.SubnetId} (${n})`:e.SubnetId,to:`/ec2/describe-subnets/$id`},e.SubnetId)}export{f as component};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{t as e}from"./useQuery.js";import{t}from"./useSuspenseQuery.js";import{Do as n,G as r,K as i,fs as a,hs as o,ms as s,ys as c}from"./index.js";import{t as l}from"./page-heading.js";var u=a(),d=c();function f(){let e=(0,u.c)(6),i=o(),{data:a}=t(r),c;e[0]===a.TargetGroups?c=e[1]:(c=a.TargetGroups??[],e[0]=a.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)(s,{to:`/ec2/create-target-group`,children:(0,d.jsx)(n,{children:`Create Target Group`})}),title:`Target Groups`}),e[2]=h):h=e[2];let g;return e[3]!==i||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 t=e.TargetGroupArn;return(0,d.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>await i({to:`/ec2/describe-target-groups/$id`,params:{id:encodeURIComponent(t)}}),children:[(0,d.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,d.jsx)(s,{className:`text-primary hover:underline`,onClick:p,params:{id:encodeURIComponent(t)},to:`/ec2/describe-target-groups/$id`,children:e.TargetGroupName??t})}),(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:t})]},t)})})]})}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No target groups found.`})]}),e[3]=i,e[4]=f,e[5]=g):g=e[5],g}function p(e){return e.stopPropagation()}function m(t){let n=(0,u.c)(13),{arn:r}=t,a;n[0]===r?a=n[1]:(a=i(r),n[0]=r,n[1]=a);let{data:o,isLoading:s}=e(a);if(s){let e;return n[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:`…`})]}),n[2]=e):e=n[2],e}let c,l;if(n[3]!==o?.TargetHealthDescriptions){c=o?.TargetHealthDescriptions??[];let e={};for(let t of c){let n=t.TargetHealth?.State??`unknown`;e[n]=(e[n]??0)+1}l=Object.entries(e).map(h).join(`, `)||`—`,n[3]=o?.TargetHealthDescriptions,n[4]=c,n[5]=l}else c=n[4],l=n[5];let f=l,p;n[6]===c.length?p=n[7]:(p=(0,d.jsx)(`td`,{className:`px-4 py-2`,children:c.length}),n[6]=c.length,n[7]=p);let m;n[8]===f?m=n[9]:(m=(0,d.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:f}),n[8]=f,n[9]=m);let g;return n[10]!==p||n[11]!==m?(g=(0,d.jsxs)(d.Fragment,{children:[p,m]}),n[10]=p,n[11]=m,n[12]=g):g=n[12],g}function h(e){let[t,n]=e;return`${n} ${t}`}var g=f;export{g as component};
|
||||
import{t as e}from"./useQuery.js";import{t}from"./useSuspenseQuery.js";import{G as n,K as r,Oo as i,bs as a,gs as o,hs as s,ps as c}from"./index.js";import{t as l}from"./page-heading.js";var u=c(),d=a();function f(){let e=(0,u.c)(6),r=o(),{data:a}=t(n),c;e[0]===a.TargetGroups?c=e[1]:(c=a.TargetGroups??[],e[0]=a.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)(s,{to:`/ec2/create-target-group`,children:(0,d.jsx)(i,{children:`Create Target Group`})}),title:`Target Groups`}),e[2]=h):h=e[2];let g;return e[3]!==r||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 t=e.TargetGroupArn;return(0,d.jsxs)(`tr`,{className:`cursor-pointer border-b transition-colors last:border-0 hover:bg-accent`,onClick:async()=>await r({to:`/ec2/describe-target-groups/$id`,params:{id:encodeURIComponent(t)}}),children:[(0,d.jsx)(`td`,{className:`px-4 py-2 font-medium`,children:(0,d.jsx)(s,{className:`text-primary hover:underline`,onClick:p,params:{id:encodeURIComponent(t)},to:`/ec2/describe-target-groups/$id`,children:e.TargetGroupName??t})}),(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:t})]},t)})})]})}):(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No target groups found.`})]}),e[3]=r,e[4]=f,e[5]=g):g=e[5],g}function p(e){return e.stopPropagation()}function m(t){let n=(0,u.c)(13),{arn:i}=t,a;n[0]===i?a=n[1]:(a=r(i),n[0]=i,n[1]=a);let{data:o,isLoading:s}=e(a);if(s){let e;return n[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:`…`})]}),n[2]=e):e=n[2],e}let c,l;if(n[3]!==o?.TargetHealthDescriptions){c=o?.TargetHealthDescriptions??[];let e={};for(let t of c){let n=t.TargetHealth?.State??`unknown`;e[n]=(e[n]??0)+1}l=Object.entries(e).map(h).join(`, `)||`—`,n[3]=o?.TargetHealthDescriptions,n[4]=c,n[5]=l}else c=n[4],l=n[5];let f=l,p;n[6]===c.length?p=n[7]:(p=(0,d.jsx)(`td`,{className:`px-4 py-2`,children:c.length}),n[6]=c.length,n[7]=p);let m;n[8]===f?m=n[9]:(m=(0,d.jsx)(`td`,{className:`px-4 py-2 text-xs`,children:f}),n[8]=f,n[9]=m);let g;return n[10]!==p||n[11]!==m?(g=(0,d.jsxs)(d.Fragment,{children:[p,m]}),n[10]=p,n[11]=m,n[12]=g):g=n[12],g}function h(e){let[t,n]=e;return`${n} ${t}`}var g=f;export{g as component};
|
||||
@@ -1 +1 @@
|
||||
import{t as e}from"./useSuspenseQuery.js";import{Do as t,fs as n,ms as r,wt as i,ys 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=n(),u=a();function d(){let n=(0,l.c)(5),{data:a}=e(i),s;n[0]===a.Volumes?s=n[1]:(s=a.Volumes??[],n[0]=a.Volumes,n[1]=s);let c=s,d;n[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)(t,{children:`Create Volume`})}),title:`Volumes`}),n[2]=d):d=n[2];let p;return n[3]===c?p=n[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.`})]}),n[3]=c,n[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{t as e}from"./useSuspenseQuery.js";import{Oo as t,bs as n,hs as r,ps as i,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=i(),u=n();function d(){let n=(0,l.c)(5),{data:i}=e(a),s;n[0]===i.Volumes?s=n[1]:(s=i.Volumes??[],n[0]=i.Volumes,n[1]=s);let c=s,d;n[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)(t,{children:`Create Volume`})}),title:`Volumes`}),n[2]=d):d=n[2];let p;return n[3]===c?p=n[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.`})]}),n[3]=c,n[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{t as e}from"./useSuspenseQuery.js";import{Do as t,Et as n,Io as r,fs as i,ms as a,ys 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=i(),d=o();function f(){let r=(0,u.c)(5),{data:i}=e(n),o;r[0]===i.Vpcs?o=r[1]:(o=i.Vpcs??[],r[0]=i.Vpcs,r[1]=o);let c=o,l;r[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(a,{to:`/ec2/create-vpc`,children:(0,d.jsx)(t,{children:`Create VPC`})}),title:`VPCs`}),r[2]=l):l=r[2];let f;return r[3]===c?f=r[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.`})]}),r[3]=c,r[4]=f),f}function p(e){if(!e.VpcId)return null;let t=r(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{t as e}from"./useSuspenseQuery.js";import{Et as t,Lo as n,Oo as r,bs as i,hs as a,ps 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=o(),d=i();function f(){let n=(0,u.c)(5),{data:i}=e(t),o;n[0]===i.Vpcs?o=n[1]:(o=i.Vpcs??[],n[0]=i.Vpcs,n[1]=o);let c=o,l;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,d.jsx)(s,{actions:(0,d.jsx)(a,{to:`/ec2/create-vpc`,children:(0,d.jsx)(r,{children:`Create VPC`})}),title:`VPCs`}),n[2]=l):l=n[2];let f;return n[3]===c?f=n[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.`})]}),n[3]=c,n[4]=f),f}function p(e){if(!e.VpcId)return null;let t=n(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{fs as e,ys as t}from"./index.js";var n=e(),r=t();function i(e){let t=(0,n.c)(2),{children:i}=e,a;return t[0]===i?a=t[1]:(a=(0,r.jsx)(`div`,{className:`rounded-lg border bg-card`,children:i}),t[0]=i,t[1]=a),a}function a(e){let t=(0,n.c)(2),{children:i}=e,a;return t[0]===i?a=t[1]:(a=(0,r.jsx)(`div`,{className:`border-b p-4`,children:(0,r.jsx)(`h2`,{className:`font-semibold`,children:i})}),t[0]=i,t[1]=a),a}function o(e){let t=(0,n.c)(2),{children:i}=e,a;return t[0]===i?a=t[1]:(a=(0,r.jsx)(`div`,{className:`grid gap-4 p-4 sm:grid-cols-2`,children:i}),t[0]=i,t[1]=a),a}var s=Object.assign(i,{Header:a,Content:o});function c(e){let t=(0,n.c)(9),{label:i,value:a}=e,o;t[0]===i?o=t[1]:(o=(0,r.jsx)(`dt`,{className:`text-sm text-muted-foreground`,children:i}),t[0]=i,t[1]=o);let s;t[2]===a?s=t[3]:(s=a||(0,r.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}),t[2]=a,t[3]=s);let c;t[4]===s?c=t[5]:(c=(0,r.jsx)(`dd`,{className:`mt-1 font-mono text-sm`,children:s}),t[4]=s,t[5]=c);let l;return t[6]!==o||t[7]!==c?(l=(0,r.jsxs)(`div`,{children:[o,c]}),t[6]=o,t[7]=c,t[8]=l):l=t[8],l}export{s as n,c as t};
|
||||
import{bs as e,ps as t}from"./index.js";var n=t(),r=e();function i(e){let t=(0,n.c)(2),{children:i}=e,a;return t[0]===i?a=t[1]:(a=(0,r.jsx)(`div`,{className:`rounded-lg border bg-card`,children:i}),t[0]=i,t[1]=a),a}function a(e){let t=(0,n.c)(2),{children:i}=e,a;return t[0]===i?a=t[1]:(a=(0,r.jsx)(`div`,{className:`border-b p-4`,children:(0,r.jsx)(`h2`,{className:`font-semibold`,children:i})}),t[0]=i,t[1]=a),a}function o(e){let t=(0,n.c)(2),{children:i}=e,a;return t[0]===i?a=t[1]:(a=(0,r.jsx)(`div`,{className:`grid gap-4 p-4 sm:grid-cols-2`,children:i}),t[0]=i,t[1]=a),a}var s=Object.assign(i,{Header:a,Content:o});function c(e){let t=(0,n.c)(9),{label:i,value:a}=e,o;t[0]===i?o=t[1]:(o=(0,r.jsx)(`dt`,{className:`text-sm text-muted-foreground`,children:i}),t[0]=i,t[1]=o);let s;t[2]===a?s=t[3]:(s=a||(0,r.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}),t[2]=a,t[3]=s);let c;t[4]===s?c=t[5]:(c=(0,r.jsx)(`dd`,{className:`mt-1 font-mono text-sm`,children:s}),t[4]=s,t[5]=c);let l;return t[6]!==o||t[7]!==c?(l=(0,r.jsxs)(`div`,{children:[o,c]}),t[6]=o,t[7]=c,t[8]=l):l=t[8],l}export{s as n,c as t};
|
||||
@@ -1 +1 @@
|
||||
import{ts as e}from"./index.js";var t=e(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]);export{t};
|
||||
import{ns as e}from"./index.js";var t=e(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]);export{t};
|
||||
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user