diff --git a/apps/super-admin/src/pages/WebsitesPage.module.css b/apps/super-admin/src/pages/WebsitesPage.module.css index 97c4db9..36be749 100644 --- a/apps/super-admin/src/pages/WebsitesPage.module.css +++ b/apps/super-admin/src/pages/WebsitesPage.module.css @@ -51,6 +51,10 @@ color: #15803d; } +.deployStarted { + color: #b45309; +} + .deployFail { color: #b91c1c; } diff --git a/apps/super-admin/src/pages/WebsitesPage.tsx b/apps/super-admin/src/pages/WebsitesPage.tsx index 4340081..030bdb1 100644 --- a/apps/super-admin/src/pages/WebsitesPage.tsx +++ b/apps/super-admin/src/pages/WebsitesPage.tsx @@ -74,12 +74,14 @@ function formatDeployAt(iso: string | null) { function deployStatusLabel(status: DomainListItem['lastDeployStatus']) { if (status === 'started') return 'Started' + if (status === 'success') return 'Success' if (status === 'failed') return 'Failed' return null } function deployStatusClass(status: DomainListItem['lastDeployStatus']) { - if (status === 'started') return styles.deployOk + if (status === 'started') return styles.deployStarted + if (status === 'success') return styles.deployOk if (status === 'failed') return styles.deployFail return undefined } @@ -360,9 +362,14 @@ export function WebsitesPage() { ), } }) - showToast(`Deploy started for "${result.host}".`, 'success') + showToast( + result.lastDeployStatus === 'success' + ? `Deploy succeeded for "${result.host}".` + : `Deploy finished for "${result.host}" (${result.lastDeployStatus ?? 'unknown'}).`, + result.lastDeployStatus === 'success' ? 'success' : 'info', + ) } catch (err) { - const message = err instanceof ApiError ? err.message : 'Deploy failed to start.' + const message = err instanceof ApiError ? err.message : 'Deploy failed.' setError(message) setData((prev) => { if (!prev) return prev diff --git a/apps/super-admin/src/types/domain.ts b/apps/super-admin/src/types/domain.ts index 2364beb..06642a9 100644 --- a/apps/super-admin/src/types/domain.ts +++ b/apps/super-admin/src/types/domain.ts @@ -1,4 +1,4 @@ -export type DomainDeployStatus = 'started' | 'failed' +export type DomainDeployStatus = 'started' | 'success' | 'failed' export interface DomainListItem { id: number @@ -23,7 +23,7 @@ export interface DomainsListResponse { } export interface DeployDomainResponse { - status: 'accepted' + status: 'ok' | 'accepted' slug: string host: string message: string