_getDetails: function()

in app/addons/databases/stores.js [111:132]


  _getDetails: function (details) {
    if (!details) {
      return {};
    }

    const sizeReporter = FauxtonAPI.getExtensions('DatabaseList:dbSizeReportFieldName');
    let fieldName = 'active';
    if (sizeReporter.length > 0) {
      fieldName = sizeReporter[0];
    }

    const {sizes} = details;
    const dataSize = (sizes && sizes[fieldName]) || (sizes && sizes.active) || (sizes && sizes.external) || details.data_size || 0;

    return {
      dataSize: Helpers.formatSize(dataSize),
      docCount: details.doc_count,
      docDelCount: details.doc_del_count,
      showTombstoneWarning: details.doc_del_count > details.doc_count,
      isPartitioned: details.props && details.props.partitioned === true
    };
  },