diff --git a/public/controllers/management/components/management/configuration/edit-configuration/edit-configuration.js b/public/controllers/management/components/management/configuration/edit-configuration/edit-configuration.js index a8a670e407..1c63bc23d1 100644 --- a/public/controllers/management/components/management/configuration/edit-configuration/edit-configuration.js +++ b/public/controllers/management/components/management/configuration/edit-configuration/edit-configuration.js @@ -193,6 +193,7 @@ class WzEditConfiguration extends Component { } } + async checkIfClusterOrManager() { try { // in case which enable/disable cluster configuration, update Redux Store diff --git a/public/redux/actions/appStateActions.js b/public/redux/actions/appStateActions.js index 2877ba7c15..1d3093a494 100644 --- a/public/redux/actions/appStateActions.js +++ b/public/redux/actions/appStateActions.js @@ -235,4 +235,52 @@ export const updateLogtestToken = (logtestToken) => { type: 'UPDATE_LOGTEST_TOKEN', logtestToken: logtestToken }; +}; + +/** + * Update restart attempt + * @param {Number} restartAttempt + * @returns + */ +export const updateRestartAttempt = (restartAttempt) => { + return { + type: 'UPDATE_RESTART_ATTEMPT', + restartAttempt + }; +}; + +/** + * Update sync check attempt + * @param {Number} syncCheckAttempt + * @returns + */ +export const updateSyncCheckAttempt = (syncCheckAttempt) => { + return { + type: 'UPDATE_SYNC_CHECK_ATTEMPT', + syncCheckAttempt + }; +} + +/** + * Update unsynchronized nodes + * @param {Array} unsynchronizedNodes + * @returns + */ +export const updateUnsynchronizedNodes = (unsynchronizedNodes) => { + return { + type: 'UPDATE_UNSYNCHRONIZED_NODES', + unsynchronizedNodes + }; +}; + +/** + * Update status of the restarting process + * @param {string} restartStatus + * @returns + */ +export const updateRestartStatus = (restartStatus) => { + return { + type: 'UPDATE_RESTART_STATUS', + restartStatus + }; }; \ No newline at end of file diff --git a/public/redux/reducers/appStateReducers.js b/public/redux/reducers/appStateReducers.js index da19614e19..f2135b6ec4 100644 --- a/public/redux/reducers/appStateReducers.js +++ b/public/redux/reducers/appStateReducers.js @@ -31,6 +31,10 @@ const initialState = { withUserLogged: false, allowedAgents: [], logtestToken: '', + restartAttempt: 0, + syncCheckAttempt: 0, + unsynchronizedNodes: [], + restartStatus: '' }; const appStateReducers = (state = initialState, action) => { @@ -155,6 +159,34 @@ const appStateReducers = (state = initialState, action) => { }; } + if (action.type === 'UPDATE_RESTART_ATTEMPT') { + return { + ...state, + restartAttempt: action.restartAttempt + }; + } + + if (action.type === 'UPDATE_SYNC_CHECK_ATTEMPT') { + return { + ...state, + syncCheckAttempt: action.syncCheckAttempt + }; + } + + if (action.type === 'UPDATE_UNSYNCHRONIZED_NODES') { + return { + ...state, + unsynchronizedNodes: action.unsynchronizedNodes + }; + } + + if (action.type === 'UPDATE_RESTART_STATUS') { + return { + ...state, + restartStatus: action.restartStatus + }; + } + return state; };