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
+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