<commit_before># ---------------------------------------------------------------------------
# JOB OUTPUT
# ---------------------------------------------------------------------------

##
# The index page of the dashboard shows a list of job logs.
Dashboard.IndexController = Ember.Controller.extend
  needs: ['jobs']

  jobsBinding: 'controllers.jobs'

##
# The job log list is sorted by URL, minus the "www." bit if said URL has one.
# (A lot of people don't read the "www" anymore.)
Dashboard.JobsController = Ember.ArrayController.extend
  itemController: 'job'
  sortProperties: ['urlWithoutWww']

Dashboard.JobController = Ember.ObjectController.extend
  unregister: ->
    @get('messageProcessor').unregisterJob @get('ident')

  # TODO: If/when Ember.js permits links to be generated on more than model
  # IDs, remove this hack
  historyRoute: (->
    "#/histories/#{@get('url')}"
  ).property('url')

  finishedBinding: 'content.finished'

  frozenBinding: 'content.frozen'

  freeze: ->
    @get('content').addLogEntry Dashboard.FreezeUpdateEntry.create()
    @set 'frozen', true

  unfreeze: ->
    @set 'frozen', false
    Ember.run.next =>
      @get('content').addLogEntry Dashboard.UnfreezeUpdateEntry.create()

  toggleFreeze: ->
    if @get('frozen')
      @unfreeze()
    else
      @freeze()

  urlWithoutWww: (->
    (@get('url') || '').replace('www.', '')
  ).property('url')

  urlForDisplay: (->
    url = @get 'url'

    if url && url.length > 63
      url.slice(0, 61) + '...'
    else
      url
  ).property('url')

  generateCompletionMessage: (->
    if @get('finished')
      @queueSpecialMessage text: 'Job finished', classNames: 'finished'
  ).observes('finished')

  queueSpecialMessage: (params) ->
    Ember.run.next =>
      entry = Ember.Object.create params

      @get('content').addLogEntry [entry]

# ---------------------------------------------------------------------------
# HISTORY BROWSING
# ---------------------------------------------------------------------------

Dashboard.HistoryController = Ember.ArrayController.extend<commit_msg>Dashboard job sorting: just use URL.<commit_after># ---------------------------------------------------------------------------
# JOB OUTPUT
# ---------------------------------------------------------------------------

##
# The index page of the dashboard shows a list of job logs.
Dashboard.IndexController = Ember.Controller.extend
  needs: ['jobs']

  jobsBinding: 'controllers.jobs'

##
# The job log list is sorted by URL, minus the "www." bit if said URL has one.
# (A lot of people don't read the "www" anymore.)
Dashboard.JobsController = Ember.ArrayController.extend
  itemController: 'job'
  sortProperties: ['url']

Dashboard.JobController = Ember.ObjectController.extend
  unregister: ->
    @get('messageProcessor').unregisterJob @get('ident')

  # TODO: If/when Ember.js permits links to be generated on more than model
  # IDs, remove this hack
  historyRoute: (->
    "#/histories/#{@get('url')}"
  ).property('url')

  finishedBinding: 'content.finished'

  frozenBinding: 'content.frozen'

  freeze: ->
    @get('content').addLogEntry Dashboard.FreezeUpdateEntry.create()
    @set 'frozen', true

  unfreeze: ->
    @set 'frozen', false
    Ember.run.next =>
      @get('content').addLogEntry Dashboard.UnfreezeUpdateEntry.create()

  toggleFreeze: ->
    if @get('frozen')
      @unfreeze()
    else
      @freeze()

  urlForDisplay: (->
    url = @get 'url'

    if url && url.length > 63
      url.slice(0, 61) + '...'
    else
      url
  ).property('url')

  generateCompletionMessage: (->
    if @get('finished')
      @queueSpecialMessage text: 'Job finished', classNames: 'finished'
  ).observes('finished')

  queueSpecialMessage: (params) ->
    Ember.run.next =>
      entry = Ember.Object.create params

      @get('content').addLogEntry [entry]

# ---------------------------------------------------------------------------
# HISTORY BROWSING
# ---------------------------------------------------------------------------

Dashboard.HistoryController = Ember.ArrayController.extend
{'fraction_non_alphanumeric': 0.26897730046375395, 'fraction_numerical': 0.00244081034903588, 'mean_word_length': 1.9631236442516269, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 5, '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': '129316', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1130, 'n_words': 278}