Fix finished time showing for in-progress deployments
This commit is contained in:
parent
58687e77f5
commit
a2539ebf3a
@ -134,23 +134,23 @@ func (d *Deployment) ShortCommit() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FinishedAtISO returns the finished time in ISO format for JavaScript parsing.
|
// FinishedAtISO returns the finished time in ISO format for JavaScript parsing.
|
||||||
// Falls back to started time if not finished yet.
|
// Returns empty string if not finished yet.
|
||||||
func (d *Deployment) FinishedAtISO() string {
|
func (d *Deployment) FinishedAtISO() string {
|
||||||
if d.FinishedAt.Valid {
|
if d.FinishedAt.Valid {
|
||||||
return d.FinishedAt.Time.Format(time.RFC3339)
|
return d.FinishedAt.Time.Format(time.RFC3339)
|
||||||
}
|
}
|
||||||
|
|
||||||
return d.StartedAt.Format(time.RFC3339)
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// FinishedAtFormatted returns the finished time formatted for display.
|
// FinishedAtFormatted returns the finished time formatted for display.
|
||||||
// Falls back to started time if not finished yet.
|
// Returns empty string if not finished yet.
|
||||||
func (d *Deployment) FinishedAtFormatted() string {
|
func (d *Deployment) FinishedAtFormatted() string {
|
||||||
if d.FinishedAt.Valid {
|
if d.FinishedAt.Valid {
|
||||||
return d.FinishedAt.Time.Format("2006-01-02 15:04:05")
|
return d.FinishedAt.Time.Format("2006-01-02 15:04:05")
|
||||||
}
|
}
|
||||||
|
|
||||||
return d.StartedAt.Format("2006-01-02 15:04:05")
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Deployment) insert(ctx context.Context) error {
|
func (d *Deployment) insert(ctx context.Context) error {
|
||||||
|
|||||||
@ -305,7 +305,7 @@
|
|||||||
<template x-for="d in deployments" :key="d.id">
|
<template x-for="d in deployments" :key="d.id">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-gray-500">
|
<td class="text-gray-500">
|
||||||
<span x-text="formatTime(d.finishedAtISO)" :title="d.finishedAtLabel"></span>
|
<span x-text="formatTime(d.finishedAtISO) || '-'" :title="d.finishedAtLabel"></span>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-gray-500" x-text="d.duration || '-'"></td>
|
<td class="text-gray-500" x-text="d.duration || '-'"></td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user