Bundle sudo actions into system task for cleaner permissions - some users may not be comfortable with this

This commit is contained in:
James Barnsley
2018-04-16 15:51:35 +12:00
parent 55ade30130
commit b3007b7bd5
8 changed files with 25472 additions and 23500 deletions

View File

@ -8,8 +8,11 @@ export default function reducer(mopidy = {}, action){
case 'MOPIDY_CONNECTING':
return Object.assign({}, mopidy, { connected: false, connecting: true });
case 'MOPIDY_RESTARTING':
return Object.assign({}, mopidy, { connected: false, connecting: true, restarting: true });
case 'MOPIDY_CONNECTED':
return Object.assign({}, mopidy, { connected: true, connecting: false });
return Object.assign({}, mopidy, { connected: true, connecting: false, restarting: false });
case 'MOPIDY_DISCONNECTED':
return Object.assign({}, mopidy, { connected: false, connecting: false });

View File

@ -265,23 +265,6 @@ const PusherMiddleware = (function(){
})
break;
case 'PUSHER_START_UPGRADE':
ReactGA.event({ category: 'Pusher', action: 'Upgrade', label: '' })
request(store, 'upgrade')
.then(
response => {
store.dispatch(uiActions.createNotification({content: response.message}));
},
error => {
store.dispatch(coreActions.handleException(
'Could not start upgrade',
error
));
}
);
return next(action);
break;
case 'PUSHER_SET_USERNAME':
request(store, 'set_username', {username: action.username})
.then(
@ -490,6 +473,19 @@ const PusherMiddleware = (function(){
store.dispatch(uiActions.createNotification(data));
break
case 'PUSHER_START_UPGRADE':
ReactGA.event({ category: 'Pusher', action: 'Upgrade', label: '' })
request(store, 'start_upgrade')
.then(
response => {
store.dispatch(uiActions.createNotification({content: response.message}));
},
error => {
store.dispatch(uiActions.createNotification({content: error.message, type: 'bad'}));
}
);
break;
case 'PUSHER_RESTART':
// Hard reload. This doesn't strictly clear the cache, but our compiler's
// cache buster should handle that
@ -497,8 +493,16 @@ const PusherMiddleware = (function(){
break
case 'PUSHER_RESTART_MOPIDY':
store.dispatch(uiActions.createNotification({content: 'Restarting Mopidy...'}));
request(store, 'restart');
store.dispatch({type: 'MOPIDY_RESTARTING'});
request(store, 'restart')
.then(
response => {
store.dispatch(uiActions.createNotification({content: response.message}));
},
error => {
store.dispatch(uiActions.createNotification({content: error.message, type: 'bad'}));
}
);
break
case 'PUSHER_VERSION':