kafka-ui/kafka-ui-react-app/src/redux/actions/actions.ts
Yevgen Taran 498eb96bee
Feature/backend init (#3)
* move react-app to its own folder inside project

* move backend to kafka-ui repo

* setup react inside netty

* make application ready in 2 commands

* update readme

* update readme

* update readme

* update readme

* update profiles for application start inside (sdp profile) and outside docker (local profile)

* broker metrics endpoint

* topics endpoint start commit

* topics details endpoint start commit //
dependencies and versions fix

* small pom updates //
continue review fixes

* fix review issues //
save errors //
save connections and update connection logic //
save jmx, zookeeper, kafka statuses //
error with getting one topic doesn't fail others //
async metrics processing //
cluster data storage refactoring

* properties version extracting

* properties versions

* topic details

* remove jmx, topic details, topic configs

* create topic

* final fixes, topic creation

* topic creation ui fixes

* add check for cases when cluster is offline
2020-02-27 15:55:53 +03:00

53 lines
1.7 KiB
TypeScript

import { createAsyncAction} from 'typesafe-actions';
import { ActionType } from 'redux/actionType';
import {
Broker,
BrokerMetrics,
Cluster,
Topic,
TopicConfig,
TopicDetails,
TopicName,
} from 'redux/interfaces';
export const fetchBrokersAction = createAsyncAction(
ActionType.GET_BROKERS__REQUEST,
ActionType.GET_BROKERS__SUCCESS,
ActionType.GET_BROKERS__FAILURE,
)<undefined, Broker[], undefined>();
export const fetchBrokerMetricsAction = createAsyncAction(
ActionType.GET_BROKER_METRICS__REQUEST,
ActionType.GET_BROKER_METRICS__SUCCESS,
ActionType.GET_BROKER_METRICS__FAILURE,
)<undefined, BrokerMetrics, undefined>();
export const fetchClusterListAction = createAsyncAction(
ActionType.GET_CLUSTERS__REQUEST,
ActionType.GET_CLUSTERS__SUCCESS,
ActionType.GET_CLUSTERS__FAILURE,
)<undefined, Cluster[], undefined>();
export const fetchTopicListAction = createAsyncAction(
ActionType.GET_TOPICS__REQUEST,
ActionType.GET_TOPICS__SUCCESS,
ActionType.GET_TOPICS__FAILURE,
)<undefined, Topic[], undefined>();
export const fetchTopicDetailsAction = createAsyncAction(
ActionType.GET_TOPIC_DETAILS__REQUEST,
ActionType.GET_TOPIC_DETAILS__SUCCESS,
ActionType.GET_TOPIC_DETAILS__FAILURE,
)<undefined, { topicName: TopicName, details: TopicDetails }, undefined>();
export const fetchTopicConfigAction = createAsyncAction(
ActionType.GET_TOPIC_CONFIG__REQUEST,
ActionType.GET_TOPIC_CONFIG__SUCCESS,
ActionType.GET_TOPIC_CONFIG__FAILURE,
)<undefined, { topicName: TopicName, config: TopicConfig[] }, undefined>();
export const createTopicAction = createAsyncAction(
ActionType.POST_TOPIC__REQUEST,
ActionType.POST_TOPIC__SUCCESS,
ActionType.POST_TOPIC__FAILURE,
)<undefined, Topic, undefined>();