<commit_before><script type='text/javascript' src='<%=resource%>/js/jquery-all.js'></script>
<script type='text/javascript'>//<![CDATA[
  $(function () {
    $("input.alarm-enable:button").click(alarmEnable)
      .next("input:text").change(alarmChange).change();
     
    $("input.cbi-button-reset[type='reset']").click( function (e) {
      // The reset event is called befor reset happens so force it to
      // happen before syncing the button state
      $("form").get(0).reset();
      $("input.alarm-enable:button").next("input:text").change();
    });

    $("input.alarm-test:button").click(alarmTest);
    $("input.cbi-button-apply").attr("accesskey", "s")
      .attr("title", "Access key: S");
  });
  
function alarmEnable()
{
  var inp = $(this).next("input:text");
  var val = parseInt(inp.val());
  inp.val(-val).change();
}

function alarmChange()
{
  var btn = $(this).prev("input:button");
  var val = parseInt($(this).val());
  if (val > 0)
    btn.removeClass("cbi-input-reset").addClass("cbi-input-save")
     .val("Enabled");
  else
    btn.removeClass("cbi-input-save").addClass("cbi-input-reset")
      .val("Disabled");
}

function alarmTest()
{
  var btn = $(this);
  btn.fadeOut();
  var data = {
    pnum: btn.data("pnum"),
    type: btn.data("altype")
  };

  $.ajax({
    type: "POST",
    url: "<%=luci.dispatcher.build_url("admin/lm/altest")%>",
    data: data,
    complete: function () { btn.fadeIn(); }
  });
}

//]]></script>
<style>
  .alval { width: 4em !important; }
  .pnum0 { background: #e73; }
  .pnum1 { background: #6c3; }
  .pnum2 { background: #297; }
  .pnum3 { background: #789; }
  .col-test { width: 24px; }
  .alarm-test { background-image: url('<%=resource%>/bell.png');
    padding-left: 17px; padding-right: 1px; }
  select { width: 6em !important; }
</style>
<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
  <% if self.title and #self.title > 0 then -%>
    <legend><%=self.title%></legend>
  <%- end %>
  <div class="cbi-section-descr"><%=self.description%></div>
<table class="cbi-section-table">
  <tr class="cbi-section-table-titles">
    <th>&nbsp;</th>
    <th>Name</th>
    <th>Current</th>
    <th>&nbsp;</th>
    <th>Threshold</th>
    <th>Email</th>
    <th>SMS</th>
    <th>Push</th>
    <th><abbr title="Change Pit setpoint on alarm">Setpoint</abbr></th>
    <th>Action</th>
    <th class="col-test">Test</th>
  </tr>
  <tr class="cbi-section-table-descr"></tr>
  <% for i, k in ipairs(self:cfgsections()) do section = k -%>
<%+linkmeter/alarm-node%>
  <%- end %>
</table>
</fieldset><commit_msg>[www] Add tooltip to threshold column<commit_after><script type='text/javascript' src='<%=resource%>/js/jquery-all.js'></script>
<script type='text/javascript'>//<![CDATA[
  $(function () {
    $("input.alarm-enable:button").click(alarmEnable)
      .next("input:text").change(alarmChange).change();
     
    $("input.cbi-button-reset[type='reset']").click( function (e) {
      // The reset event is called befor reset happens so force it to
      // happen before syncing the button state
      $("form").get(0).reset();
      $("input.alarm-enable:button").next("input:text").change();
    });

    $("input.alarm-test:button").click(alarmTest);
    $("input.cbi-button-apply").attr("accesskey", "s")
      .attr("title", "Access key: S");
  });
  
function alarmEnable()
{
  var inp = $(this).next("input:text");
  var val = parseInt(inp.val());
  inp.val(-val).change();
}

function alarmChange()
{
  var btn = $(this).prev("input:button");
  var val = parseInt($(this).val());
  if (val > 0)
    btn.removeClass("cbi-input-reset").addClass("cbi-input-save")
     .val("Enabled");
  else
    btn.removeClass("cbi-input-save").addClass("cbi-input-reset")
      .val("Disabled");
}

function alarmTest()
{
  var btn = $(this);
  btn.fadeOut();
  var data = {
    pnum: btn.data("pnum"),
    type: btn.data("altype")
  };

  $.ajax({
    type: "POST",
    url: "<%=luci.dispatcher.build_url("admin/lm/altest")%>",
    data: data,
    complete: function () { btn.fadeIn(); }
  });
}

//]]></script>
<style>
  .alval { width: 4em !important; }
  .pnum0 { background: #e73; }
  .pnum1 { background: #6c3; }
  .pnum2 { background: #297; }
  .pnum3 { background: #789; }
  .col-test { width: 24px; }
  .alarm-test { background-image: url('<%=resource%>/bell.png');
    padding-left: 17px; padding-right: 1px; }
  select { width: 6em !important; }
</style>
<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
  <% if self.title and #self.title > 0 then -%>
    <legend><%=self.title%></legend>
  <%- end %>
  <div class="cbi-section-descr"><%=self.description%></div>
<table class="cbi-section-table">
  <tr class="cbi-section-table-titles">
    <th>&nbsp;</th>
    <th>Name</th>
    <th>Current</th>
    <th>&nbsp;</th>
    <th><abbr title="Alarm is triggered on passing the threshold">Threshold</abbr></th>
    <th>Email</th>
    <th>SMS</th>
    <th>Push</th>
    <th><abbr title="Change Pit setpoint on alarm">Setpoint</abbr></th>
    <th>Action</th>
    <th class="col-test">Test</th>
  </tr>
  <tr class="cbi-section-table-descr"></tr>
  <% for i, k in ipairs(self:cfgsections()) do section = k -%>
<%+linkmeter/alarm-node%>
  <%- end %>
</table>
</fieldset>
{'fraction_non_alphanumeric': 0.22886324947985626, 'fraction_numerical': 0.009078872706638926, 'mean_word_length': 3.550774526678141, 'pattern_counts': {'":': 0, '<': 115, '<?xml version=': 0, '>': 119, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '7322239', 'n_tokens_mistral': 2028, 'n_tokens_neox': 1960, 'n_words': 345}