<commit_before>
/**
 * Routeservers Actions
 */

import axios from 'axios'

export const LOAD_ROUTESERVERS_REQUEST = '@birdseye/LOAD_ROUTESERVERS_REQUEST';
export const LOAD_ROUTESERVERS_SUCCESS = '@birdseye/LOAD_ROUTESERVERS_SUCCESS';
export const LOAD_ROUTESERVERS_ERROR   = '@birdseye/LOAD_ROUTESERVERS_ERROR';

export const LOAD_ROUTESERVER_STATUS_REQUEST = '@birdseye/LOAD_ROUTESERVER_STATUS_REQUEST';
export const LOAD_ROUTESERVER_STATUS_SUCCESS = '@birdseye/LOAD_ROUTESERVER_STATUS_SUCCESS';
export const LOAD_ROUTESERVER_STATUS_ERROR   = '@birdseye/LOAD_ROUTESERVER_STATUS_ERROR';

export const LOAD_ROUTESERVER_PROTOCOL_REQUEST = '@birdseye/LOAD_ROUTESERVER_PROTOCOL_REQUEST';
export const LOAD_ROUTESERVER_PROTOCOL_SUCCESS = '@birdseye/LOAD_ROUTESERVER_PROTOCOL_SUCCESS';
export const LOAD_ROUTESERVER_PROTOCOL_ERROR   = '@birdseye/LOAD_ROUTESERVER_PROTOCOL_ERROR';

export const LOAD_ROUTESERVER_ROUTES_REQUEST = '@birdseye/LOAD_ROUTESERVER_ROUTES_REQUEST';
export const LOAD_ROUTESERVER_ROUTES_SUCCESS = '@birdseye/LOAD_ROUTESERVER_ROUTES_SUCCESS';
export const LOAD_ROUTESERVER_ROUTES_ERROR   = '@birdseye/LOAD_ROUTESERVER_ROUTES_ERROR';

export const SET_PROTOCOLS_FILTER_VALUE = '@birdseye/SET_PROTOCOLS_FILTER_VALUE';
export const SET_ROUTES_FILTER_VALUE = '@birdseye/SET_ROUTES_FILTER_VALUE';


// Action Creators
export function loadRouteserversRequest() {
  return {
    type: LOAD_ROUTESERVERS_REQUEST
  }
}

export function loadRouteserversSuccess(routeservers) {
  return {
    type: LOAD_ROUTESERVERS_SUCCESS,
    payload: {
      routeservers: routeservers
    }
  }
}

export function loadRouteserversError(error) {
  return {
    type: LOAD_ROUTESERVERS_ERROR,
    payload: {
      error: error
    }
  }
}

export function loadRouteservers() {
  return (dispatch) => {
    dispatch(loadRouteserversRequest())

    axios.get('/birdseye/api/routeserver/')
      .then(({data}) => {
        dispatch(loadRouteserversSuccess(data["routeservers"]));
      })
      .catch(({data}) => {
        dispatch(loadRouteserversError(data));
      });
  }
}



export function loadRouteserverStatusRequest(routeserverId) {
  return {
    type: LOAD_ROUTESERVER_STATUS_REQUEST,
    payload: {
      routeserverId: routeserverId
    }
  }
}

export function loadRouteserverStatusSuccess(routeserverId, status) {
  return {
    type: LOAD_ROUTESERVER_STATUS_SUCCESS,
    payload: {
      status: status,
      routeserverId: routeserverId
    }
  }
}

export function loadRouteserverStatusError(routeserverId, error) {
  return {
    type: LOAD_ROUTESERVER_STATUS_ERROR,
    payload: {
      error: error,
      routeserverId: routeserverId
    }
  }
}

export function loadRouteserverStatus(routeserverId) {
  return (dispatch) => {
    dispatch(loadRouteserverStatusRequest(routeserverId));
    axios.get(`/birdseye/api/routeserver/${routeserverId}/status/`)
      .then(({data}) => {
        dispatch(loadRouteserverStatusSuccess(routeserverId, data));
      })
      .catch(({data}) => {
        dispatch(loadRouteserverStatusError(routeserverId, data));
      });
  }
}


export function loadRouteserverProtocolRequest(routeserverId) {
  return {
    type: LOAD_ROUTESERVER_PROTOCOL_REQUEST,
    payload: {
      routeserverId: routeserverId,
    }
  }
}

export function loadRouteserverProtocolSuccess(routeserverId, protocol) {
  return {
    type: LOAD_ROUTESERVER_PROTOCOL_SUCCESS,
    payload: {
      routeserverId: routeserverId,
      protocol: protocol
    }
  }
}

export function loadRouteserverProtocol(routeserverId) {
  return (dispatch) => {
    dispatch(loadRouteserverProtocolRequest(routeserverId));
    axios.get(`/birdseye/api/routeserver/${routeserverId}/protocol/`)
      .then(({data}) => {
        dispatch(setProtocolsFilterValue(""));
        dispatch(loadRouteserverProtocolSuccess(routeserverId, data));
      });
  }
}


export function loadRouteserverRoutesRequest(routeserverId, protocolId) {
  return {
    type: LOAD_ROUTESERVER_ROUTES_REQUEST,
    payload: {
      routeserverId: routeserverId,
      protocolId: protocolId,
    }
  }
}

export function loadRouteserverRoutesSuccess(routeserverId, protocolId, routes) {
  return {
    type: LOAD_ROUTESERVER_ROUTES_SUCCESS,
    payload: {
      routeserverId: routeserverId,
      protocolId: protocolId,
      routes: routes
    }
  }
}


export function loadRouteserverRoutes(routeserverId, protocolId) {
  return (dispatch) => {
    dispatch(loadRouteserverRoutesRequest(routeserverId, protocolId))

    axios.get(`/birdseye/api/routeserver/${routeserverId}/routes/?protocol=${protocolId}`)
      .then(({data}) => {
        dispatch(
          loadRouteserverRoutesSuccess(routeserverId, protocolId, data)
        );
        dispatch(setRoutesFilterValue(""));
      });
  }
}


export function setProtocolsFilterValue(value) {
  return {
    type: SET_PROTOCOLS_FILTER_VALUE,
    payload: {
      protocolsFilterValue: value
    }
  }
}


export function setRoutesFilterValue(value) {
  return {
    type: SET_ROUTES_FILTER_VALUE,
    payload: {
      routesFilterValue: value
    }
  }
}<commit_msg>backend fix with wrapped routes<commit_after>
/**
 * Routeservers Actions
 */

import axios from 'axios'

export const LOAD_ROUTESERVERS_REQUEST = '@birdseye/LOAD_ROUTESERVERS_REQUEST';
export const LOAD_ROUTESERVERS_SUCCESS = '@birdseye/LOAD_ROUTESERVERS_SUCCESS';
export const LOAD_ROUTESERVERS_ERROR   = '@birdseye/LOAD_ROUTESERVERS_ERROR';

export const LOAD_ROUTESERVER_STATUS_REQUEST = '@birdseye/LOAD_ROUTESERVER_STATUS_REQUEST';
export const LOAD_ROUTESERVER_STATUS_SUCCESS = '@birdseye/LOAD_ROUTESERVER_STATUS_SUCCESS';
export const LOAD_ROUTESERVER_STATUS_ERROR   = '@birdseye/LOAD_ROUTESERVER_STATUS_ERROR';

export const LOAD_ROUTESERVER_PROTOCOL_REQUEST = '@birdseye/LOAD_ROUTESERVER_PROTOCOL_REQUEST';
export const LOAD_ROUTESERVER_PROTOCOL_SUCCESS = '@birdseye/LOAD_ROUTESERVER_PROTOCOL_SUCCESS';
export const LOAD_ROUTESERVER_PROTOCOL_ERROR   = '@birdseye/LOAD_ROUTESERVER_PROTOCOL_ERROR';

export const LOAD_ROUTESERVER_ROUTES_REQUEST = '@birdseye/LOAD_ROUTESERVER_ROUTES_REQUEST';
export const LOAD_ROUTESERVER_ROUTES_SUCCESS = '@birdseye/LOAD_ROUTESERVER_ROUTES_SUCCESS';
export const LOAD_ROUTESERVER_ROUTES_ERROR   = '@birdseye/LOAD_ROUTESERVER_ROUTES_ERROR';

export const SET_PROTOCOLS_FILTER_VALUE = '@birdseye/SET_PROTOCOLS_FILTER_VALUE';
export const SET_ROUTES_FILTER_VALUE = '@birdseye/SET_ROUTES_FILTER_VALUE';


// Action Creators
export function loadRouteserversRequest() {
  return {
    type: LOAD_ROUTESERVERS_REQUEST
  }
}

export function loadRouteserversSuccess(routeservers) {
  return {
    type: LOAD_ROUTESERVERS_SUCCESS,
    payload: {
      routeservers: routeservers
    }
  }
}

export function loadRouteserversError(error) {
  return {
    type: LOAD_ROUTESERVERS_ERROR,
    payload: {
      error: error
    }
  }
}

export function loadRouteservers() {
  return (dispatch) => {
    dispatch(loadRouteserversRequest())

    axios.get('/birdseye/api/routeserver/')
      .then(({data}) => {
        dispatch(loadRouteserversSuccess(data["routeservers"]));
      })
      .catch(({data}) => {
        dispatch(loadRouteserversError(data));
      });
  }
}



export function loadRouteserverStatusRequest(routeserverId) {
  return {
    type: LOAD_ROUTESERVER_STATUS_REQUEST,
    payload: {
      routeserverId: routeserverId
    }
  }
}

export function loadRouteserverStatusSuccess(routeserverId, status) {
  return {
    type: LOAD_ROUTESERVER_STATUS_SUCCESS,
    payload: {
      status: status,
      routeserverId: routeserverId
    }
  }
}

export function loadRouteserverStatusError(routeserverId, error) {
  return {
    type: LOAD_ROUTESERVER_STATUS_ERROR,
    payload: {
      error: error,
      routeserverId: routeserverId
    }
  }
}

export function loadRouteserverStatus(routeserverId) {
  return (dispatch) => {
    dispatch(loadRouteserverStatusRequest(routeserverId));
    axios.get(`/birdseye/api/routeserver/${routeserverId}/status/`)
      .then(({data}) => {
        dispatch(loadRouteserverStatusSuccess(routeserverId, data));
      })
      .catch(({data}) => {
        dispatch(loadRouteserverStatusError(routeserverId, data));
      });
  }
}


export function loadRouteserverProtocolRequest(routeserverId) {
  return {
    type: LOAD_ROUTESERVER_PROTOCOL_REQUEST,
    payload: {
      routeserverId: routeserverId,
    }
  }
}

export function loadRouteserverProtocolSuccess(routeserverId, protocol) {
  return {
    type: LOAD_ROUTESERVER_PROTOCOL_SUCCESS,
    payload: {
      routeserverId: routeserverId,
      protocol: protocol
    }
  }
}

export function loadRouteserverProtocol(routeserverId) {
  return (dispatch) => {
    dispatch(loadRouteserverProtocolRequest(routeserverId));
    axios.get(`/birdseye/api/routeserver/${routeserverId}/protocol/`)
      .then(({data}) => {
        dispatch(setProtocolsFilterValue(""));
        dispatch(loadRouteserverProtocolSuccess(routeserverId, data));
      });
  }
}


export function loadRouteserverRoutesRequest(routeserverId, protocolId) {
  return {
    type: LOAD_ROUTESERVER_ROUTES_REQUEST,
    payload: {
      routeserverId: routeserverId,
      protocolId: protocolId,
    }
  }
}

export function loadRouteserverRoutesSuccess(routeserverId, protocolId, routes) {
  return {
    type: LOAD_ROUTESERVER_ROUTES_SUCCESS,
    payload: {
      routeserverId: routeserverId,
      protocolId: protocolId,
      routes: routes
    }
  }
}


export function loadRouteserverRoutes(routeserverId, protocolId) {
  return (dispatch) => {
    dispatch(loadRouteserverRoutesRequest(routeserverId, protocolId))

    axios.get(`/birdseye/api/routeserver/${routeserverId}/routes/?protocol=${protocolId}`)
      .then(({data}) => {
        dispatch(
          loadRouteserverRoutesSuccess(routeserverId, protocolId, data.routes)
        );
        dispatch(setRoutesFilterValue(""));
      });
  }
}


export function setProtocolsFilterValue(value) {
  return {
    type: SET_PROTOCOLS_FILTER_VALUE,
    payload: {
      protocolsFilterValue: value
    }
  }
}


export function setRoutesFilterValue(value) {
  return {
    type: SET_ROUTES_FILTER_VALUE,
    payload: {
      routesFilterValue: value
    }
  }
}
{'fraction_non_alphanumeric': 0.09684354539235805, 'fraction_numerical': 0.0, 'mean_word_length': 4.40337909186906, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7308912', 'n_tokens_mistral': 3555, 'n_tokens_neox': 3504, 'n_words': 480}