all: sync with master; upd chlog

This commit is contained in:
Ainar Garipov
2023-04-12 14:48:42 +03:00
parent 0dad53b5f7
commit d9c57cdd9a
181 changed files with 6992 additions and 3430 deletions

View File

@@ -25,6 +25,7 @@ const dashboard = handleActions(
dns_port: dnsPort,
dns_addresses: dnsAddresses,
protection_enabled: protectionEnabled,
protection_disabled_duration: protectionDisabledDuration,
http_port: httpPort,
language,
} = payload;
@@ -36,9 +37,11 @@ const dashboard = handleActions(
dnsPort,
dnsAddresses,
protectionEnabled,
protectionDisabledDuration,
language,
httpPort,
};
return newState;
},
@@ -103,15 +106,22 @@ const dashboard = handleActions(
...state,
processingProtection: false,
}),
[actions.toggleProtectionSuccess]: (state) => {
[actions.toggleProtectionSuccess]: (state, { payload }) => {
const newState = {
...state,
protectionEnabled: !state.protectionEnabled,
processingProtection: false,
protectionDisabledDuration: payload.disabledDuration,
};
return newState;
},
[actions.setDisableDurationTime]: (state, { payload }) => ({
...state,
protectionDisabledDuration: payload.timeToEnableProtection,
}),
[actions.getClientsRequest]: (state) => ({
...state,
processingClients: true,
@@ -156,6 +166,8 @@ const dashboard = handleActions(
processingUpdate: false,
processingProfile: true,
protectionEnabled: false,
protectionDisabledDuration: null,
protectionCountdownActive: false,
processingProtection: false,
httpPort: STANDARD_WEB_PORT,
dnsPort: STANDARD_DNS_PORT,

View File

@@ -124,10 +124,11 @@ const dhcp = handleActions(
staticLeases: [],
}),
[actions.toggleLeaseModal]: (state) => {
[actions.toggleLeaseModal]: (state, { payload }) => {
const newState = {
...state,
isModalOpen: !state.isModalOpen,
leaseModalConfig: payload,
};
return newState;
},
@@ -200,6 +201,7 @@ const dhcp = handleActions(
leases: [],
staticLeases: [],
isModalOpen: false,
leaseModalConfig: undefined,
dhcp_available: false,
},
);

View File

@@ -1,7 +1,7 @@
import { handleActions } from 'redux-actions';
import * as actions from '../actions/queryLogs';
import { DEFAULT_LOGS_FILTER } from '../helpers/constants';
import { DEFAULT_LOGS_FILTER, DAY } from '../helpers/constants';
const queryLogs = handleActions(
{
@@ -86,7 +86,7 @@ const queryLogs = handleActions(
processingGetConfig: false,
processingSetConfig: false,
processingAdditionalLogs: false,
interval: 1,
interval: DAY,
logs: [],
enabled: true,
oldest: '',

View File

@@ -22,11 +22,11 @@ const settings = handleActions(
},
[actions.toggleSettingStatus]: (state, { payload }) => {
const { settingsList } = state;
const { settingKey } = payload;
const { settingKey, value } = payload;
const setting = settingsList[settingKey];
const newSetting = {
const newSetting = value || {
...setting,
enabled: !setting.enabled,
};

View File

@@ -1,5 +1,6 @@
import { handleActions } from 'redux-actions';
import { normalizeTopClients } from '../helpers/helpers';
import { DAY } from '../helpers/constants';
import * as actions from '../actions/stats';
@@ -25,7 +26,7 @@ const stats = handleActions(
[actions.getStatsConfigFailure]: (state) => ({ ...state, processingGetConfig: false }),
[actions.getStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
...payload,
processingGetConfig: false,
}),
@@ -33,7 +34,7 @@ const stats = handleActions(
[actions.setStatsConfigFailure]: (state) => ({ ...state, processingSetConfig: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
...payload,
processingSetConfig: false,
}),
@@ -91,7 +92,7 @@ const stats = handleActions(
processingSetConfig: false,
processingStats: true,
processingReset: false,
interval: 1,
interval: DAY,
...defaultStats,
},
);