mirror of
https://dev.azure.com/tstanciu94/ReverseProxy/_git/ReverseProxy_Frontend
synced 2025-10-03 16:49:04 +03:00
- feat: Add session management components and improve system overview - feat: Update dependencies and replace react-flags with react-country-flag - Update dependencies in package.json: reintroduce react-dom and upgrade redux to version 5.0.1 - refactor: update chatbot implementation and dependencies - refactor: migrate to Redux Toolkit and update dependencies - feat: enhance ReactCountryFlag component with SVG support - refactor: remove Bootstrap dependency and update Node engine requirement; add LabelValue component for better UI consistency - refactor: enhance LabelValue component usage in ServerSummary for improved readability and tooltip support - refactor: replace inline text with LabelValue component in ActiveSessionSummary and SessionSummary for improved consistency and readability - refactor: update components to use LabelValue for improved consistency and readability - refactor: optimize LabelValue component for improved readability and structure - refactor: improve code readability in SessionForwardsComponent by standardizing arrow function syntax and adjusting styling properties
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import * as types from "./actionTypes";
|
|
import api from "./api";
|
|
import { sendHttpRequest } from "../../../redux/actions/httpActions";
|
|
import { Dispatch } from 'redux';
|
|
|
|
export interface LoadForwardOptionsStartedAction {
|
|
type: typeof types.LOAD_FORWARD_OPTIONS_STARTED;
|
|
id: string;
|
|
}
|
|
|
|
export interface LoadForwardOptionsSuccessAction {
|
|
type: typeof types.LOAD_FORWARD_OPTIONS_SUCCESS;
|
|
payload: any;
|
|
id: string;
|
|
}
|
|
|
|
export type ForwardOptionsAction =
|
|
| LoadForwardOptionsStartedAction
|
|
| LoadForwardOptionsSuccessAction;
|
|
|
|
export function loadForwardOptions(optionId: string) {
|
|
return async function(dispatch: Dispatch, getState: () => any): Promise<void> {
|
|
try {
|
|
const options = getState().options[optionId];
|
|
if (options && (options.loading || options.loaded)) return;
|
|
|
|
dispatch({ type: types.LOAD_FORWARD_OPTIONS_STARTED, id: optionId });
|
|
const data = await dispatch(
|
|
sendHttpRequest(api.getForwardOptions(optionId)) as any
|
|
);
|
|
dispatch({
|
|
type: types.LOAD_FORWARD_OPTIONS_SUCCESS,
|
|
payload: data,
|
|
id: optionId
|
|
});
|
|
} catch (error) {
|
|
throw error;
|
|
}
|
|
};
|
|
} |