Collecting output from pip upgrade and returning to user

This commit is contained in:
James Barnsley
2018-04-21 21:59:40 +12:00
parent 22ba55004e
commit fa17dafe86
10 changed files with 112 additions and 69 deletions

View File

@ -29,15 +29,21 @@ export function disconnect(){
}
}
export function startUpgrade(){
export function upgrade(){
return {
type: 'PUSHER_START_UPGRADE'
type: 'PUSHER_UPGRADE'
}
}
export function restartMopidy(){
export function reload(){
return {
type: 'PUSHER_RESTART_MOPIDY'
type: 'PUSHER_RELOAD'
}
}
export function restart(){
return {
type: 'PUSHER_RESTART'
}
}

View File

@ -93,13 +93,13 @@ const PusherMiddleware = (function(){
case 'radio_stopped':
store.dispatch(pusherActions.radioStopped());
break;
case 'refresh':
case 'reload':
window.location.reload(true);
break;
case 'update_started':
store.dispatch(uiActions.createNotification({content: 'Update running...', type: 'info'}));
case 'upgrading':
store.dispatch(uiActions.createNotification({content: 'Upgrading...', type: 'info'}));
break;
case 'restart_started':
case 'restarting':
store.dispatch(uiActions.createNotification({content: 'Restarting...', type: 'info'}));
break;
}
@ -472,17 +472,17 @@ const PusherMiddleware = (function(){
store.dispatch(uiActions.createNotification(data));
break
case 'PUSHER_RESTART':
case 'PUSHER_RELOAD':
// Hard reload. This doesn't strictly clear the cache, but our compiler's
// cache buster should handle that
window.location.reload(true);
break
case 'PUSHER_RESTART_MOPIDY':
case 'PUSHER_RESTART':
request(store, 'restart')
.then(
response => {
store.dispatch(mopidyActions.restartStarted());
store.dispatch(mopidyActions.restarting());
},
error => {
store.dispatch(uiActions.createNotification({content: error.message, description: (error.description ? error.description : null), type: 'bad'}));
@ -496,7 +496,7 @@ const PusherMiddleware = (function(){
request(store, 'upgrade')
.then(
response => {
store.dispatch(mopidyActions.upgradeStarted());
store.dispatch(mopidyActions.upgrading());
},
error => {
store.dispatch(uiActions.createNotification({content: error.message, type: 'bad'}));