import { includes } from 'lodash';
export default (function (_ref) {
  var formatMessage = _ref.formatMessage,
      intlPrefix = _ref.intlPrefix,
      appStore = _ref.appStore;

  function handleLoad(_ref2) {
    var dataSet = _ref2.dataSet;
    dataSet.forEach(function (record) {
      if (includes(appStore.getNetworkIds, record.get('id'))) {
        record.init('expand', true);
      }
    });
    appStore.setNetworkIds([]);
  }

  return {
    selection: false,
    pageSize: 10,
    expandField: 'expand',
    transport: {},
    fields: [{
      name: 'id',
      type: 'string'
    }, {
      name: 'name',
      type: 'string',
      label: formatMessage({
        id: "".concat(intlPrefix, ".application.net.name")
      })
    }, {
      name: 'error',
      type: 'string'
    }, {
      name: 'status',
      type: 'string'
    }, {
      name: 'config',
      type: 'object'
    }, {
      name: 'type',
      type: 'string',
      label: formatMessage({
        id: "".concat(intlPrefix, ".application.net.configType")
      })
    }, {
      name: 'loadBalanceIp',
      type: 'string'
    }, {
      name: 'target',
      type: 'object'
    }, {
      name: 'appId',
      type: 'string'
    }, {
      name: 'devopsIngressVOS',
      type: 'object'
    }],
    events: {
      load: handleLoad
    }
  };
});