mirror of
https://git.meshkee.com/Meshkee/dashboards.git
synced 2026-08-11 22:30:58 +04:30
Show Success/Failed/Started for website deploy status.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
855f337006
commit
7374dd9978
@@ -51,6 +51,10 @@
|
||||
color: #15803d;
|
||||
}
|
||||
|
||||
.deployStarted {
|
||||
color: #b45309;
|
||||
}
|
||||
|
||||
.deployFail {
|
||||
color: #b91c1c;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user