<commit_before>$ ->
  service = $ '#service'
  service.find 'button'
    .on 'click', (e) ->
      e.preventDefault()
      button = $ @
      prehead = if button.hasClass 'btn-success' then '' else 'un'
      $.post "/plan/#{prehead}subscribe/", JSON.stringify {
        plan: button.parent().parent().data 'type'
      }
      .success ->
        location.reload()

  ssh = $ '#ssh-input'
  ssh.find 'button'
    .on 'click', (e) ->
      e.preventDefault()
      $.post '/plugin/ssh/update_password/', JSON.stringify {
        password: ssh.find('input').val()
      }
      .success ->
        ErrorHandle.flushInfo 'success', '修改成功', ->
          location.reload()

  fpm = $ '#php-fpm'
  fpm.on 'click', (e) ->
    e.preventDefault()
    enable = if fpm.hasClass 'btn-success' then true else false
    $.post '/plugin/phpfpm/switch/', JSON.stringify {enable: enable}
    .success ->
      location.reload()
  #nginx
  # $ '.nginx-edit-button'
  #   .on 'click', (e) ->
  #     ($ '#nginxModal').modal 'show'


  $ '.nginx-remove-btn'
    .on 'click', (e) ->
      e.preventDefault()
      id = ($(@).closet 'tr').data 'id'
      $.post '/plugin/nginx/update_site', JSON.stringify {<commit_msg>fix bug<commit_after>$ ->
  service = $ '#service'
  service.find 'button'
    .on 'click', (e) ->
      e.preventDefault()
      button = $ @
      prehead = if button.hasClass 'btn-success' then '' else 'un'
      $.post "/plan/#{prehead}subscribe/", JSON.stringify {
        plan: button.parent().parent().data 'type'
      }
      .success ->
        location.reload()

  ssh = $ '#ssh-input'
  ssh.find 'button'
    .on 'click', (e) ->
      e.preventDefault()
      $.post '/plugin/ssh/update_password/', JSON.stringify {
        password: ssh.find('input').val()
      }
      .success ->
        ErrorHandle.flushInfo 'success', '修改成功', ->
          location.reload()

  fpm = $ '#php-fpm'
  fpm.on 'click', (e) ->
    e.preventDefault()
    enable = if fpm.hasClass 'btn-success' then true else false
    $.post '/plugin/phpfpm/switch/', JSON.stringify {enable: enable}
    .success ->
      location.reload()
  #nginx
  # $ '.nginx-edit-button'
  #   .on 'click', (e) ->
  #     ($ '#nginxModal').modal 'show'


  $ '.nginx-remove-btn'
    .on 'click', (e) ->
      e.preventDefault()
      id = ($(@).closest 'tr').data 'id'
      $.post '/plugin/nginx/update_site', JSON.stringify {
{'fraction_non_alphanumeric': 0.19306310071040536, 'fraction_numerical': 0.0, 'mean_word_length': 2.2091152815013406, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '4769124', 'n_tokens_mistral': 822, 'n_tokens_neox': 813, 'n_words': 167}