function displayClientDetail_(clientList) {
    // Clear the existing content.
    $(ReportingView.CLIENTS_TBODY_ID).innerHTML = '';

    var empty = clientList.length == 0;
    setNodeDisplay($(ReportingView.CLIENTS_EMPTY_ID), empty);
    setNodeDisplay($(ReportingView.CLIENTS_TABLE_ID), !empty);
    if (empty)
      return;

    for (var i = 0; i < clientList.length; ++i) {
      var client = ensureObject_(clientList[i]);
      var groups = ensureArray_(client.groups);
      if (groups.length == 0)
        continue;

      // Calculate the total number of endpoints for this origin, so that we can
      // rowspan its origin cell.
      var originHeight = 0;
      for (var j = 0; j < groups.length; ++j) {
        var group = ensureObject_(groups[j]);
        var endpoints = ensureArray_(group.endpoints);
        originHeight += group.endpoints.length;
      }
      if (originHeight == 0)
        continue;

      for (var j = 0; j < groups.length; ++j) {
        var group = ensureObject_(groups[j]);
        var endpoints = ensureArray_(group.endpoints);
        for (var k = 0; k < endpoints.length; ++k) {
          var endpoint = ensureObject_(endpoints[k]);
          var tr = addNode($(ReportingView.CLIENTS_TBODY_ID), 'tr');

          if (j == 0 && k == 0) {
            var originNode = addNode(tr, 'td');
            originNode.setAttribute('rowspan', originHeight);
            addTextNode(originNode, client.origin);
          }

          if (k == 0) {
            var groupNode = addNode(tr, 'td');
            groupNode.setAttribute('rowspan', group.endpoints.length);
            addTextNode(groupNode, group.name);

            var subdomainsNode = addNode(tr, 'td');
            subdomainsNode.classList.add('reporting-centered');
            subdomainsNode.setAttribute('rowspan', group.endpoints.length);
            addTextNode(
                subdomainsNode, !!group.includeSubdomains ? 'yes' : 'no');

            var expiresNode = addNode(tr, 'td');
            expiresNode.setAttribute('rowspan', group.endpoints.length);
            if (group.expires !== undefined) {
              var expiresDate = timeutil.convertTimeTicksToDate(group.expires);
              timeutil.addNodeWithDate(expiresNode, expiresDate);
              if (expired_(expiresDate)) {
                var expiredSpan = addNode(expiresNode, 'span');
                expiredSpan.classList.add('warning-text');
                addTextNode(expiredSpan, ' [expired]');
              }
            }
          }

          var endpointNode = addNode(tr, 'td');
          addTextNode(endpointNode, endpoint.url);

          var priorityNode = addNode(tr, 'td');
          priorityNode.classList.add('reporting-centered');
          addTextNode(priorityNode, valueOrDefault_(endpoint.priority, 0));

          var weightNode = addNode(tr, 'td');
          weightNode.classList.add('reporting-centered');
          addTextNode(weightNode, valueOrDefault_(endpoint.weight, 1));

          addUploadCount_(tr, ensureObject_(endpoint.successful));
          addUploadCount_(tr, ensureObject_(endpoint.failed));
        }
      }
    }
  }
/**
   * Displays information about each origin that has provided Reporting headers.
   * REQUIRES: |clientList| must be an array
   */
Displays information about each origin that has provided Reporting headers.
REQUIRES: |clientList| must be an array
Displays information about each origin that has provided Reporting headers . REQUIRES : |clientList| must be an array
function displayClientDetail_(clientList) {
    $(ReportingView.CLIENTS_TBODY_ID).innerHTML = '';
    var empty = clientList.length == 0;
    setNodeDisplay($(ReportingView.CLIENTS_EMPTY_ID), empty);
    setNodeDisplay($(ReportingView.CLIENTS_TABLE_ID), !empty);
    if (empty)
      return;
    for (var i = 0; i < clientList.length; ++i) {
      var client = ensureObject_(clientList[i]);
      var groups = ensureArray_(client.groups);
      if (groups.length == 0)
        continue;
      var originHeight = 0;
      for (var j = 0; j < groups.length; ++j) {
        var group = ensureObject_(groups[j]);
        var endpoints = ensureArray_(group.endpoints);
        originHeight += group.endpoints.length;
      }
      if (originHeight == 0)
        continue;
      for (var j = 0; j < groups.length; ++j) {
        var group = ensureObject_(groups[j]);
        var endpoints = ensureArray_(group.endpoints);
        for (var k = 0; k < endpoints.length; ++k) {
          var endpoint = ensureObject_(endpoints[k]);
          var tr = addNode($(ReportingView.CLIENTS_TBODY_ID), 'tr');
          if (j == 0 && k == 0) {
            var originNode = addNode(tr, 'td');
            originNode.setAttribute('rowspan', originHeight);
            addTextNode(originNode, client.origin);
          }
          if (k == 0) {
            var groupNode = addNode(tr, 'td');
            groupNode.setAttribute('rowspan', group.endpoints.length);
            addTextNode(groupNode, group.name);
            var subdomainsNode = addNode(tr, 'td');
            subdomainsNode.classList.add('reporting-centered');
            subdomainsNode.setAttribute('rowspan', group.endpoints.length);
            addTextNode(
                subdomainsNode, !!group.includeSubdomains ? 'yes' : 'no');
            var expiresNode = addNode(tr, 'td');
            expiresNode.setAttribute('rowspan', group.endpoints.length);
            if (group.expires !== undefined) {
              var expiresDate = timeutil.convertTimeTicksToDate(group.expires);
              timeutil.addNodeWithDate(expiresNode, expiresDate);
              if (expired_(expiresDate)) {
                var expiredSpan = addNode(expiresNode, 'span');
                expiredSpan.classList.add('warning-text');
                addTextNode(expiredSpan, ' [expired]');
              }
            }
          }
          var endpointNode = addNode(tr, 'td');
          addTextNode(endpointNode, endpoint.url);
          var priorityNode = addNode(tr, 'td');
          priorityNode.classList.add('reporting-centered');
          addTextNode(priorityNode, valueOrDefault_(endpoint.priority, 0));
          var weightNode = addNode(tr, 'td');
          weightNode.classList.add('reporting-centered');
          addTextNode(weightNode, valueOrDefault_(endpoint.weight, 1));
          addUploadCount_(tr, ensureObject_(endpoint.successful));
          addUploadCount_(tr, ensureObject_(endpoint.failed));
        }
      }
    }
  }
function displayClientDetail_ ( clientList ) { $ ( ReportingView . CLIENTS_TBODY_ID ) . innerHTML = '' ; var empty = clientList . length == 0 ; setNodeDisplay ( $ ( ReportingView . CLIENTS_EMPTY_ID ) , empty ) ; setNodeDisplay ( $ ( ReportingView . CLIENTS_TABLE_ID ) , ! empty ) ; if ( empty ) return ; for ( var i = 0 ; i < clientList . length ; ++ i ) { var client = ensureObject_ ( clientList [ i ] ) ; var groups = ensureArray_ ( client . groups ) ; if ( groups . length == 0 ) continue ; var originHeight = 0 ; for ( var j = 0 ; j < groups . length ; ++ j ) { var group = ensureObject_ ( groups [ j ] ) ; var endpoints = ensureArray_ ( group . endpoints ) ; originHeight += group . endpoints . length ; } if ( originHeight == 0 ) continue ; for ( var j = 0 ; j < groups . length ; ++ j ) { var group = ensureObject_ ( groups [ j ] ) ; var endpoints = ensureArray_ ( group . endpoints ) ; for ( var k = 0 ; k < endpoints . length ; ++ k ) { var endpoint = ensureObject_ ( endpoints [ k ] ) ; var tr = addNode ( $ ( ReportingView . CLIENTS_TBODY_ID ) , 'tr' ) ; if ( j == 0 && k == 0 ) { var originNode = addNode ( tr , 'td' ) ; originNode . setAttribute ( 'rowspan' , originHeight ) ; addTextNode ( originNode , client . origin ) ; } if ( k == 0 ) { var groupNode = addNode ( tr , 'td' ) ; groupNode . setAttribute ( 'rowspan' , group . endpoints . length ) ; addTextNode ( groupNode , group . name ) ; var subdomainsNode = addNode ( tr , 'td' ) ; subdomainsNode . classList . add ( 'reporting-centered' ) ; subdomainsNode . setAttribute ( 'rowspan' , group . endpoints . length ) ; addTextNode ( subdomainsNode , ! ! group . includeSubdomains ? 'yes' : 'no' ) ; var expiresNode = addNode ( tr , 'td' ) ; expiresNode . setAttribute ( 'rowspan' , group . endpoints . length ) ; if ( group . expires !== undefined ) { var expiresDate = timeutil . convertTimeTicksToDate ( group . expires ) ; timeutil . addNodeWithDate ( expiresNode , expiresDate ) ; if ( expired_ ( expiresDate ) ) { var expiredSpan = addNode ( expiresNode , 'span' ) ; expiredSpan . classList . add ( 'warning-text' ) ; addTextNode ( expiredSpan , ' [expired]' ) ; } } } var endpointNode = addNode ( tr , 'td' ) ; addTextNode ( endpointNode , endpoint . url ) ; var priorityNode = addNode ( tr , 'td' ) ; priorityNode . classList . add ( 'reporting-centered' ) ; addTextNode ( priorityNode , valueOrDefault_ ( endpoint . priority , 0 ) ) ; var weightNode = addNode ( tr , 'td' ) ; weightNode . classList . add ( 'reporting-centered' ) ; addTextNode ( weightNode , valueOrDefault_ ( endpoint . weight , 1 ) ) ; addUploadCount_ ( tr , ensureObject_ ( endpoint . successful ) ) ; addUploadCount_ ( tr , ensureObject_ ( endpoint . failed ) ) ; } } } }
Displays information about each origin that has provided Reporting headers.
Displays information about each origin that has provided Reporting headers .
// Clear the existing content. // Calculate the total number of endpoints for this origin, so that we can // rowspan its origin cell.