<commit_before><!-- Client template -->
<script id="clientTemplate" type="text/x-jquery-tmpl">
  <tr id="${name}" rel="leanModal" href="#event_details_modal">
    <td id="client_id">${name}</td><td id="public_ip">${address}</td><td id="timestamp">${timestamp}</td><td>${subscriptions}</td>
  </tr>
</script>

<!-- Client details row template  -->
<script id="clientDetailsRowTemplate" type="text/x-jquery-tmpl">
{{each $data}}
<div class="event_detail_group">
  <div class="event_detail">
    <h1>${capitaliseFirstLetter($index)}</h1>
    <p id="${$index}">${$value}</p>
  </div>
  <!--<div class="copy">Copy</div>-->
  <div style="clear: both;"></div>
</div>
{{/each}}
</script>

<script type="text/javascript">
fetchClients();

ws = new WebSocket("ws://" + location.hostname + ":9000");
ws.onmessage = function(evt) {
  fetchClients();
}

$("#remove_client").click(function() {
  var client = $("#name").html();
  var cross_img = $("#remove_client").children().first();
  cross_img.attr("src", "/img/loading_circle.gif");
  $.ajax({
    type: 'DELETE',
    contentType: 'application/json',
    url: '/client/'+client+'.json',
    success: function(data, textStatus, xhr) {
	    cross_img.attr("src", "/img/cross.png");
      $("#lean_overlay").fadeOut(200);
      $("#event_details_modal").css({'display':'none'});
      fetchClients();
    },
    error: function(xhr, textStatus, errorThrown) {
      cross_img.attr("src", "/img/cross.png");
      alert('Client was not found in sensu. This may be due to a delay in a previous removal attempt.');
    }
  });
});
</script><commit_msg>notify user that a client is being removed<commit_after><!-- Client template -->
<script id="clientTemplate" type="text/x-jquery-tmpl">
  <tr id="${name}" rel="leanModal" href="#event_details_modal">
    <td id="client_id">${name}</td><td id="public_ip">${address}</td><td id="timestamp">${timestamp}</td><td>${subscriptions}</td>
  </tr>
</script>

<!-- Client details row template  -->
<script id="clientDetailsRowTemplate" type="text/x-jquery-tmpl">
{{each $data}}
<div class="event_detail_group">
  <div class="event_detail">
    <h1>${capitaliseFirstLetter($index)}</h1>
    <p id="${$index}">${$value}</p>
  </div>
  <!--<div class="copy">Copy</div>-->
  <div style="clear: both;"></div>
</div>
{{/each}}
</script>

<script type="text/javascript">
fetchClients();

ws = new WebSocket("ws://" + location.hostname + ":9000");
ws.onmessage = function(evt) {
  fetchClients();
}

$("#remove_client").click(function() {
  var client = $("#name").html();
  var cross_img = $("#remove_client").children().first();
  cross_img.attr("src", "/img/loading_circle.gif");
  $.ajax({
    type: 'DELETE',
    contentType: 'application/json',
    url: '/client/'+client+'.json',
    success: function(data, textStatus, xhr) {
      alert('Client '+client+' is being removed, resolving events...');
	    cross_img.attr("src", "/img/cross.png");
      $("#lean_overlay").fadeOut(200);
      $("#event_details_modal").css({'display':'none'});
      fetchClients();
    },
    error: function(xhr, textStatus, errorThrown) {
      cross_img.attr("src", "/img/cross.png");
      alert('Client was not found in sensu. This may be due to a delay in a previous removal attempt.');
    }
  });
});
</script>
{'fraction_non_alphanumeric': 0.23114503816793894, 'fraction_numerical': 0.00549618320610687, 'mean_word_length': 4.496644295302014, 'pattern_counts': {'":': 2, '<': 65, '<?xml version=': 0, '>': 65, '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': '4221182', 'n_tokens_mistral': 1101, 'n_tokens_neox': 1097, 'n_words': 217}