/* eslint-disable import/no-anonymous-default-export */
import apis from "../apis";
export default (function (_ref) {
  var projectId = _ref.projectId,
      showTestTab = _ref.showTestTab;
  return {
    autoCreate: false,
    autoQuery: true,
    selection: false,
    paging: true,
    pageSize: 10,
    transport: {
      read: function read(_ref2) {
        var data = _ref2.data;
        var type = data.type,
            params = data.params,
            status = data.status;
        var newType = type || (showTestTab ? 'distribute_test' : 'deploy');
        return {
          url: apis.getLoadHostsDetailsUrl(projectId, newType),
          method: 'post',
          data: {
            searchParam: {
              type: newType,
              status: status
            },
            params: params ? [params] : []
          }
        };
      }
    }
  };
});