Skip to content

Commit 3cfb8ce

Browse files
committed
UI: replication status: show if any errors during run
1 parent 51a3715 commit 3cfb8ce

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

frontend/pages/VolumesAndMountsPage.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ export default class VolumesAndMountsPage extends React.Component<
716716
<thead>
717717
<tr>
718718
<th>Volume</th>
719+
<th></th>
719720
<th>Progress</th>
720721
</tr>
721722
</thead>
@@ -726,6 +727,11 @@ export default class VolumesAndMountsPage extends React.Component<
726727
return (
727728
<tr key={status.VolumeId}>
728729
<td>{volume.Label}</td>
730+
<td>
731+
{status.Error ? (
732+
<Glyphicon icon="exclamation-sign" title={status.Error} />
733+
) : null}
734+
</td>
729735
<td>
730736
{status.Progress === 100 ? (
731737
'Realtime'

pkg/stoserver/restapi.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/function61/gokit/logex"
3030
"github.com/function61/varasto/pkg/blorm"
3131
"github.com/function61/varasto/pkg/duration"
32+
"github.com/function61/varasto/pkg/gokitbp"
3233
"github.com/function61/varasto/pkg/scheduler"
3334
"github.com/function61/varasto/pkg/stateresolver"
3435
"github.com/function61/varasto/pkg/stoserver/stodb"
@@ -854,6 +855,13 @@ func (h *handlers) GetReplicationStatuses(rctx *httpauth.RequestContext, w http.
854855
statuses = append(statuses, stoservertypes.ReplicationStatus{
855856
VolumeId: volID,
856857
Progress: controller.Progress(),
858+
Error: func() *string {
859+
if err := controller.Error(); err != nil {
860+
return gokitbp.Pointer(err.Error())
861+
} else {
862+
return nil
863+
}
864+
}(),
857865
})
858866
}
859867

pkg/stoserver/stoservertypes/types.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@
260260
"name": "ReplicationStatus",
261261
"type": {"_": "object", "fields": {
262262
"VolumeId": {"_": "integer"},
263+
"Error": {"_": "string", "nullable": true},
263264
"Progress": {"_": "integer"}
264265
}}
265266
},

0 commit comments

Comments
 (0)