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; color: #15803d;
} }
.deployStarted {
color: #b45309;
}
.deployFail { .deployFail {
color: #b91c1c; color: #b91c1c;
} }
+10 -3
View File
@@ -74,12 +74,14 @@ function formatDeployAt(iso: string | null) {
function deployStatusLabel(status: DomainListItem['lastDeployStatus']) { function deployStatusLabel(status: DomainListItem['lastDeployStatus']) {
if (status === 'started') return 'Started' if (status === 'started') return 'Started'
if (status === 'success') return 'Success'
if (status === 'failed') return 'Failed' if (status === 'failed') return 'Failed'
return null return null
} }
function deployStatusClass(status: DomainListItem['lastDeployStatus']) { 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 if (status === 'failed') return styles.deployFail
return undefined 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) { } catch (err) {
const message = err instanceof ApiError ? err.message : 'Deploy failed to start.' const message = err instanceof ApiError ? err.message : 'Deploy failed.'
setError(message) setError(message)
setData((prev) => { setData((prev) => {
if (!prev) return 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 { export interface DomainListItem {
id: number id: number
@@ -23,7 +23,7 @@ export interface DomainsListResponse {
} }
export interface DeployDomainResponse { export interface DeployDomainResponse {
status: 'accepted' status: 'ok' | 'accepted'
slug: string slug: string
host: string host: string
message: string message: string