misc_pterodactyl-panel/resources/assets/scripts/store/modules/socket.js

37 lines
841 B
JavaScript
Raw Normal View History

import Status from './../../helpers/statuses';
export default {
namespaced: true,
state: {
connected: false,
2018-08-07 04:33:43 +00:00
connectionError: false,
status: Status.STATUS_OFF,
},
actions: {
},
mutations: {
SOCKET_CONNECT: (state) => {
state.connected = true;
2018-08-07 04:33:43 +00:00
state.connectionError = false;
},
SOCKET_ERROR: (state, err) => {
2018-08-07 04:33:43 +00:00
state.connected = false;
state.connectionError = err;
},
SOCKET_CONNECT_ERROR: (state, err) => {
state.connected = false;
state.connectionError = err;
},
'SOCKET_INITIAL STATUS': (state, data) => {
state.status = data.status;
},
SOCKET_STATUS: (state, data) => {
state.status = data.status;
}
},
};