Show Success/Failed/Started for website deploy status.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-10 08:52:51 +03:30
co-authored by Cursor
parent 855f337006
commit 7374dd9978
3 changed files with 16 additions and 5 deletions
@@ -51,6 +51,10 @@
color: #15803d;
}
.deployStarted {
color: #b45309;
}
.deployFail {
color: #b91c1c;
}
+10 -3
View File
@@ -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
+2 -2
View File
@@ -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