<commit_before>Select Endpoint: <%= select_tag :selected_endpoints,options_from_collection_for_select(@openbis_endpoints,:id,:title),id:'select-endpoints',include_blank:true %>

<div id="count">

</div>

<div id="contents">

</div>

<script>

  function fetchCountForSpace(spaceId) {
    $j.ajax('<%= show_item_count_project_openbis_endpoints_path(@project) %>', {
          data: {id: spaceId},
          success: function (html) {
              $j('#count').html(html);
          },
          beforeSend: function () {
            $j('#count').html('<%= image('spinner') %>');
          }
        }
    );
  }

  function fetchItemsForSpace(spaceId) {
    $j.ajax('<%= show_items_project_openbis_endpoints_path(@project) %>', {
          data: {id: spaceId},
          success: function (html) {
            $j('#contents').html(html);
          },
          beforeSend: function () {
            $j('#contents').html('<%= image('large_spinner') %>');
          }
        }
    );
  }


  function endpointChanged() {
    var id = $j('#select-endpoints option:selected').val();
    if (id.trim()) {
      $j('#contents').html('<%= image('large_spinner') %>');
      fetchCountForSpace(id);
      fetchItemsForSpace(id);
    }
    else {
      $j('#contents').html('');
      $j('#count').html('');
    }

  }
  ;

  $j('#select-endpoints').change(function () {
    endpointChanged();
  });

</script><commit_msg>OPSK-1098 default to the first openbis space<commit_after>Select Endpoint: <%= select_tag :selected_endpoints,options_from_collection_for_select(@openbis_endpoints,:id,:title),id:'select-endpoints' %>

<div id="count">

</div>

<div id="contents">

</div>

<script>

  function fetchCountForSpace(spaceId) {
    $j.ajax('<%= show_item_count_project_openbis_endpoints_path(@project) %>', {
          data: {id: spaceId},
          success: function (html) {
              $j('#count').html(html);
          },
          beforeSend: function () {
            $j('#count').html('<%= image('spinner') %>');
          }
        }
    );
  }

  function fetchItemsForSpace(spaceId) {
    $j.ajax('<%= show_items_project_openbis_endpoints_path(@project) %>', {
          data: {id: spaceId},
          success: function (html) {
            $j('#contents').html(html);
          },
          beforeSend: function () {
            $j('#contents').html('<%= image('large_spinner') %>');
          }
        }
    );
  }


  function endpointChanged() {
    var id = $j('#select-endpoints option:selected').val();
    if (id.trim()) {
      $j('#contents').html('<%= image('large_spinner') %>');
      fetchCountForSpace(id);
      fetchItemsForSpace(id);
    }
    else {
      $j('#contents').html('');
      $j('#count').html('');
    }

  }
  ;

  $j('#select-endpoints').change(function () {
    endpointChanged();
  });

  <% if @openbis_endpoints.any? %>
    $j( document ).ready(function() {
      endpointChanged();
    });
  <% end %>

</script>
{'fraction_non_alphanumeric': 0.19736397431564717, 'fraction_numerical': 0.0013518080432578573, 'mean_word_length': 2.690773067331671, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '1679556', 'n_tokens_mistral': 976, 'n_tokens_neox': 934, 'n_words': 130}