<commit_before>Augury.Views.Queues.Index = Backbone.View.extend(
  el: '#integration_main'

  template: JST['admin/templates/queues/index']

  events:
    'click button[type=submit]': 'search'

  initialize: (@options) ->
    @queues = new Augury.Collections.Queues([], queue_name: @options.queue_name)
    @queues.on 'reset', @update_messages_view, @
    @stats_view = new Augury.Views.Queues.Stats
    @queues.fetch(reset: true)

  render: ->
    @

  update_messages_view: (collection) ->
    @$el.html @template(collection: collection, queue_name: @options.queue_name)
    @$el.find('#messages-queue').before @stats_view.render().el

  search: ->
    filter_state = @$el.find('#status-select').select2('data').text.toLowerCase()
    query =
      state: filter_state

    @queues.fetch(data: query, reset: true)
)
<commit_msg>Adds Messages date range filter<commit_after>Augury.Views.Queues.Index = Backbone.View.extend(
  el: '#integration_main'

  template: JST['admin/templates/queues/index']

  events:
    'click button[type=submit]': 'search'

  initialize: (@options) ->
    @queues = new Augury.Collections.Queues([], queue_name: @options.queue_name)
    @queues.on 'reset', @update_messages_view, @
    @stats_view = new Augury.Views.Queues.Stats
    @queues.fetch(reset: true)

  render: ->
    @

  update_messages_view: (collection) ->
    @$el.html @template(collection: collection, queue_name: @options.queue_name)
    @$el.find('#messages-queue').before @stats_view.render().el

  search: ->
    filter_state = @$el.find('#status-select').select2('data').text.toLowerCase()

    if $('#input-date-range').val() != ''
      start_date   = $('#input-date-range').data('daterangepicker').startDate.utc().format()
      end_date     = $('#input-date-range').data('daterangepicker').endDate.utc().format()

    query =
      state: filter_state
      start_date: start_date
      end_date: end_date

    @queues.fetch(data: query, reset: true)
)

{'fraction_non_alphanumeric': 0.16683673469387755, 'fraction_numerical': 0.0010204081632653062, 'mean_word_length': 4.002551020408164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '4666910', 'n_tokens_mistral': 665, 'n_tokens_neox': 652, 'n_words': 104}