Skip to content

Commit

Permalink
Issue #126 - Add warning message to Playback component if disabled
Browse files Browse the repository at this point in the history
Update the Playback component to display a warning banner if no valid
time ranges were returned from the backend. This can either be because
there's no valid time ranges of data in the database or (more likely)
because the database connection isn't configured or failed.
  • Loading branch information
MJJoyce committed Aug 20, 2019
1 parent dcecb64 commit 923cf61
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions ait/gui/static/js/ait/gui/Playback.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,20 @@ const Playback = {
// Display time ranges available
let range = m('div', {class: 'form-group'}, [
m('label', 'Time ranges available'),
this._range.map(function(i) {
return m('div', i[0] + ': ' + i[1] + ' to ' + i[2])
})
m('div', {'class': 'alert alert-warning'},
'No time ranges found. Is your database connection configured?'
)
])

if (this._range.length > 0) {
range = m('div', {class: 'form-group'}, [
m('label', 'Time ranges available'),
this._range.map(function(i) {
return m('div', i[0] + ': ' + i[1] + ' to ' + i[2])
})
])
}

// Packet select drop down menu
let packets = m('div', {class: 'form-group col-xs-3'}, [
m('label', 'Telemetry packet:'),
Expand Down Expand Up @@ -277,4 +286,4 @@ const Playback = {


export default Playback
export { Playback }
export { Playback }

0 comments on commit 923cf61

Please sign in to comment.