UNPKG

@fntio/infra-client

Version:

Self-hosted AWS access portal: credential vending, target-account trust, and grant-driven private networking as CDK stacks and constructs.

2 lines (1 loc) • 6.77 kB
import{a as R}from"./chunk-7DUEGRIY.js";import"./chunk-BG475WXG.js";import{a as B}from"./chunk-3SC2PPSK.js";import{a as M}from"./chunk-B67EMZ2H.js";import{b as O}from"./chunk-MID2IYAR.js";import"./chunk-6GDWMGWO.js";import{a as P}from"./chunk-7A4HO4AV.js";import{c as L}from"./chunk-ZRDXKVPG.js";import{Aa as o,Ba as i,Ca as w,I as f,Ja as x,K as m,L as _,La as u,Na as c,Q as b,R as k,Rb as A,Wa as S,Xa as a,Ya as h,Za as E,_ as l,ga as D,qb as V,rb as I,ta as p,ua as d,wa as T,xa as y,ya as N,za as g}from"./chunk-FYA6QUPZ.js";import{e as v}from"./chunk-WFIHWVQO.js";function $(e,n){e&1&&w(0,"li",3)}function j(e,n){e&1&&w(0,"app-icon",6),e&2&&g("strokeWidth",2.5)}function W(e,n){if(e&1&&a(0),e&2){let t=c().$index;E(" ",t+1," ")}}function Y(e,n){if(e&1&&(p(0,$,1,0,"li",3),o(1,"li",4)(2,"span",5),p(3,j,1,1,"app-icon",6)(4,W,1,1),i(),o(5,"span"),a(6),i()()),e&2){let t=n.$implicit,s=n.$index,r=c();d(s>0?0:-1),l(2),S(r.railDot(s)),l(),d(r.stepDone(s)?3:4),l(2),S(r.railLabel(s)),l(),h(t)}}function U(e,n){e&1&&(o(0,"div",2)(1,"app-banner",7),a(2),i()()),e&2&&(l(2),h(n))}function z(e,n){e&1&&(o(0,"p",9),a(1," After installing, open Tailscale once and click Allow when macOS asks about adding a VPN configuration. You don\u2019t need a Tailscale account. "),i())}function q(e,n){e&1&&(o(0,"p",9),a(1," Still not detected \u2014 finish the installer, then check again. "),i())}function G(e,n){if(e&1){let t=x();o(0,"p",8),a(1),i(),p(2,z,2,0,"p",9),o(3,"div",10)(4,"app-button",11),u("click",function(){m(t);let r=c();return _(r.openDownload())}),a(5,"Download Tailscale"),i(),o(6,"app-button",12),u("click",function(){m(t);let r=c();return _(r.checkAgain())}),a(7," Check again "),i()(),p(8,q,2,0,"p",9)}if(e&2){let t=c();l(),h(t.installCopy),l(),d(t.platform==="darwin"?2:-1),l(4),g("loading",t.checking()),l(2),d(t.stillStuck()?8:-1)}}function H(e,n){e&1&&(o(0,"p",9),a(1,"You don\u2019t need to sign in to Tailscale."),i())}function J(e,n){e&1&&(o(0,"p",9),a(1," Still not running \u2014 open the Tailscale app, then check again. "),i())}function K(e,n){if(e&1){let t=x();o(0,"p",8),a(1),i(),p(2,H,2,0,"p",9),o(3,"div",13)(4,"app-button",12),u("click",function(){m(t);let r=c();return _(r.checkAgain())}),a(5," Check again "),i()(),p(6,J,2,0,"p",9)}if(e&2){let t=c();l(),h(t.launchCopy),l(),d(t.platform==="darwin"?2:-1),l(2),g("loading",t.checking()),l(2),d(t.stillStuck()?6:-1)}}function Q(e,n){if(e&1){let t=x();o(0,"p",8),a(1," Tailscale is ready. Connecting creates a single-use key for this device and joins your organization\u2019s private network. "),i(),o(2,"div",13)(3,"app-button",14),u("click",function(){m(t);let r=c();return _(r.store.connect())}),a(4," Connect "),i()()}if(e&2){let t=c();l(3),g("loading",t.store.state()==="connecting")}}function X(e,n){if(e&1){let t=x();o(0,"app-banner",15)(1,"strong"),a(2,"You\u2019re connected."),i(),a(3," This device is now enrolled. Access rules finish syncing within about 5 minutes of a first connection \u2014 resources may not answer until then. "),i(),o(4,"p",16),a(5," Everything you can reach is listed on the Network page. "),i(),o(6,"div",17)(7,"app-button",11),u("click",function(){m(t);let r=c();return _(r.viewResources())}),a(8,"View network resources"),i(),o(9,"app-button",18),u("click",function(){m(t);let r=c();return _(r.close())}),a(10,"Done"),i()()}}var Z="https://tailscale.com/download",ee=["install","launch","connect","done"],F=class e{store=f(R);bridge=f(L);router=f(A);LABELS=["Install","Open Tailscale","Connect"];platform=this.bridge.platform;checking=k(!1);stillStuck=k(!1);step=V(()=>{let n=this.store.setupReason();return n==="not-installed"?"install":n==="daemon-off"?"launch":this.store.state()==="connected"?"done":"connect"});installCopy=this.platform==="darwin"?"Private network access uses the Tailscale app. Download and install it \u2014 the App Store and direct-download versions both work.":this.platform==="win32"?"Private network access uses the Tailscale app. Download and run the installer \u2014 the service starts automatically.":"Private network access uses the Tailscale client. Install it for your platform, then come back.";launchCopy=this.platform==="darwin"?"Tailscale is installed but not running. Open the Tailscale app \u2014 the first time it opens, macOS asks to allow a VPN configuration. Click Allow.":this.platform==="win32"?"Tailscale is installed but not running. Start Tailscale from the Start menu, then check again.":"Tailscale is installed but not running. Start it, then check again.";constructor(){this.store.refresh();let n=setInterval(()=>{let t=this.step();(t==="install"||t==="launch")&&this.store.refresh()},3e3);f(b).onDestroy(()=>clearInterval(n)),I(()=>{this.step(),this.stillStuck.set(!1)})}stepIndex(){return ee.indexOf(this.step())}stepDone(n){return n<this.stepIndex()}railDot(n){return this.stepDone(n)?"bg-success-muted text-success":n===this.stepIndex()?"bg-brand text-brand-foreground":"bg-muted text-muted-foreground"}railLabel(n){return n===this.stepIndex()?"font-semibold text-surface-foreground":this.stepDone(n)?"text-text-secondary":"text-muted-foreground"}checkAgain(){return v(this,null,function*(){this.checking.set(!0);let n=this.step();yield this.store.refresh(),this.checking.set(!1),this.step()===n&&this.stillStuck.set(!0)})}openDownload(){this.bridge.openConsole(Z).catch(()=>{})}viewResources(){this.router.navigateByUrl("/resources"),this.close()}close(){this.store.lastError.set(null),this.store.setupOpen.set(!1)}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=D({type:e,selectors:[["app-network-setup-dialog"]],decls:9,vars:2,consts:[["title","Set up private network access",3,"closed"],[1,"mb-5","flex","items-center","gap-2","text-xs"],[1,"mb-4"],["aria-hidden","true",1,"h-px","w-5","bg-border-strong"],[1,"flex","items-center","gap-1.5"],[1,"flex","h-5","w-5","shrink-0","items-center","justify-center","rounded-full","text-[11px]","font-semibold"],["name","check",1,"h-3","w-3",3,"strokeWidth"],["tone","danger"],[1,"text-[13px]","text-muted-foreground"],[1,"mt-2","text-xs","text-placeholder"],[1,"mt-4","flex","flex-wrap","items-center","gap-2"],[3,"click"],["variant","outline",3,"click","loading"],[1,"mt-4"],[3,"click","loading"],["tone","success"],[1,"mt-3","text-xs","text-placeholder"],[1,"mt-4","flex","gap-2"],["variant","outline",3,"click"]],template:function(t,s){if(t&1&&(o(0,"app-dialog",0),u("closed",function(){return s.close()}),o(1,"ol",1),y(2,Y,7,7,null,null,T),i(),p(4,U,3,1,"div",2),p(5,G,9,4)(6,K,7,4)(7,Q,5,1)(8,X,11,0),i()),t&2){let r,C;l(2),N(s.LABELS),l(2),d((r=s.store.lastError())?4:-1,r),l(),d((C=s.step())==="install"?5:C==="launch"?6:C==="connect"?7:C==="done"?8:-1)}},dependencies:[B,P,M,O],encapsulation:2})};export{F as NetworkSetupDialogComponent};