PageSourceSearch

https://cloud.resilis.io/assets/deployment-status-C5ZhWPEx.js

js resilis.io collected 2026-09-24 19:38:55 UTC 4,558 bytes, 1 lines download raw bytes

1import{j as t}from"./ui-vendor-DSsww-Kv.js";import{aC as y,a2 as h,B as w,aD as E}from"./index-DAt3PBr5.js";import{f as R,g as k,a as l}from"./react-vendor-NvA41F0Y.js";import{A as S,b as L}from"./alert-CdSoCuqw.js";import{E as U}from"./external-link-DfSOzOy8.js";import{R as I}from"./refresh-cw-BSg9mvOJ.js";import{C as P}from"./circle-alert-Dt4elCXM.js";import{C as A}from"./circle-x-Ch4mwGXY.js";import{C as D}from"./circle-check-CgKWE4m6.js";const _=8;function B(i){const c=[i];let r=i;for(let n=0;n<_;n+=1){let e;try{e=decodeURIComponent(r)}catch{return null}if(e===r)return c;c.push(e),r=e}return null}function O(i,c){const r=i?.trim();if(!r)return null;let n;try{n=new URL(c)}catch{return null}if(n.protocol!=="http:"&&n.protocol!=="https:"||n.username||n.password)return null;const e=B(r);if(!e)return null;let d=null;for(const m of e){let a;try{a=new URL(m.trim(),n.origin)}catch{return null}if(a.protocol!=="http:"&&a.protocol!=="https:"||a.origin!==n.origin||a.username||a.password)return null;d??=a}return d?.href??null}const T=E("apiBaseURL","/api/v1"),K=()=>{const{subdomain:i}=R(),[c]=k(),r=O(c.get("return"),window.location.origin),n=!1,[e,d]=l.useState(null),[m,a]=l.useState(!0),[g,p]=l.useState(null),[x,j]=l.useState(0),u=l.useCallback(async()=>{if(i)try{const s=await fetch(`${T}/public/health/${i}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!s.ok)throw new Error("Failed to fetch health status");const o=await s.json();d(o),p(null)}catch(s){p(s instanceof Error?s.message:"Unknown error")}finally{a(!1)}},[i]);l.useEffect(()=>{u()},[u,n]),l.useEffect(()=>{if(e?.status!=="starting")return;const s=setInterval(()=>{u(),j(o=>o+1)},3e3);return()=>clearInterval(s)},[e?.status,u]),l.useEffect(()=>{if(e?.status==="running"&&r){const s=setTimeout(()=>{window.location.assign(r)},1500);return()=>clearTimeout(s)}},[e?.status,r]);const N=()=>{if(m)return t.jsx(h,{className:"h-16 w-16 text-status-info"});switch(e?.status){case"starting":return t.jsx("div",{className:"relative",children:t.jsx(h,{className:"h-16 w-16 text-status-info"})});case"running":return t.jsx(D,{className:"h-16 w-16 text-status-success"});case"error":return t.jsx(A,{className:"h-16 w-16 text-status-error"});case"not_found":return t.jsx(P,{className:"h-16 w-16 text-status-warning"});default:return t.jsx(h,{className:"h-16 w-16 text-muted-foreground"})}},C=()=>{switch(e?.phase){case"pending":return"Initializing";case"building":return"Building";case"deploying":return"Deploying";case"initializing":return"Initializing";case"running":return"Running";case"failed":return"Failed";case"stopped":return"Stopped";default:return e?.phase||"Unknown"}},v=()=>{const s=["pending","building","deploying","initializing","running"],o=s.indexOf(e?.phase||"pending");return t.jsx("div",{className:"flex items-center justify-center gap-2 mt-6",children:s.map((b,f)=>t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:`w-3 h-3 ${f<o?"bg-status-success":f===o?"bg-status-info animate-pulse":"bg-surface-tertiary"}`}),f<s.length-1&&t.jsx("div",{className:`w-8 h-0.5 ${f<o?"bg-status-success":"bg-surface-tertiary"}`})]},b))})};return t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:t.jsx(y,{className:"w-full max-w-md p-8 bg-card border-border",children:t.jsxs("div",{className:"flex flex-col items-center text-center space-y-6",children:[t.jsx("div",{className:"text-2xl font-bold text-foreground",children:"Resilis"}),t.jsx("div",{className:"py-4",children:N()}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:"text-xl font-semibold text-foreground",children:m?"Checking Status...":C()}),t.jsx("p",{className:"text-muted-foreground text-sm",children:e?.message||"Please wait..."})]}),e?.status==="starting"&&v(),e?.status==="starting"&&t.jsxs("p",{className:"text-muted-foreground text-xs flex items-center gap-1",children:[t.jsx(h,{className:"h-3 w-3"}),"Checking status... (",x>0?`${x} checks`:"initial",")"]}),t.jsxs("div",{className:"flex flex-col gap-3 w-full pt-4",children:[e?.status==="running"&&r&&t.jsxs(w,{onClick:()=>window.location.assign(r),className:"w-full",children:[t.jsx(U,{className:"h-4 w-4 mr-2"}),"Go to Application"]}),(e?.status==="error"||e?.status==="not_found")&&t.jsxs(w,{onClick:()=>u(),variant:"ghost",className:"w-full",children:[t.jsx(I,{className:"h-4 w-4 mr-2"}),"Retry"]})]}),g&&t.jsx(S,{className:"w-full text-left",variant:"destructive",children:t.jsx(L,{children:g})})]})})})};export{K as DeploymentStatusPage,K as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.