resync status: show current status (#4604)
Also exit tea.Program when resync is canceled.
This commit is contained in:
@@ -167,6 +167,10 @@ func (m *resyncMetricsUI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
}
|
||||
case *madmin.SiteResyncMetrics:
|
||||
m.current = *msg
|
||||
if msg.ResyncStatus == "Canceled" {
|
||||
m.quitting = true
|
||||
return m, tea.Quit
|
||||
}
|
||||
if msg.Complete() {
|
||||
m.quitting = true
|
||||
return m, tea.Quit
|
||||
@@ -221,6 +225,8 @@ func (m *resyncMetricsUI) View() string {
|
||||
if m.current.ResyncID != "" {
|
||||
accElapsedTime := m.current.LastUpdate.Sub(m.current.StartTime)
|
||||
addLine("ResyncID: ", m.current.ResyncID)
|
||||
addLine("Status: ", m.current.ResyncStatus)
|
||||
|
||||
addLine("Objects: ", m.current.ReplicatedCount)
|
||||
addLine("Versions: ", m.current.ReplicatedCount)
|
||||
addLine("FailedObjects: ", m.current.FailedCount)
|
||||
|
||||
Reference in New Issue
Block a user