<commit_before>%setdefault('app', None)
%setdefault('user', None)

%username = 'anonymous'
%if user is not None:
%if hasattr(user, 'alias') and user.alias != 'none':
%username = user.alias
%else:
%username = user.get_name()
%end
%end


<!-- Header Navbar -->
<nav class="header navbar navbar-default navbar-static-top" style="margin-bottom:0px;">
   <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
         <span class="sr-only">Toggle navigation</span>
         <span class="icon-bar"></span>
         <span class="icon-bar"></span>
         <span class="icon-bar"></span>
      </button>
      <a href="#about" data-toggle="modal" data-target="#about" class="logo navbar-brand">
         <img src="/static/logo/{{app.company_logo}}" alt="Company logo" />
      </a>
   </div>

   <ul class="nav navbar-nav">
      <!-- Page filtering ... -->
      %include("_filters.tpl")
   </ul>

   <!-- Right part ... -->
%synthesis = helper.get_synthesis(app.datamgr.search_hosts_and_services(user=user))
   %s = synthesis['services']
   %h = synthesis['hosts']
   <div id="hosts-states-popover-content" class="hidden">
      <table class="table table-invisible table-condensed">
         <tbody>
            <tr>
               %for state in "up", "unreachable", "down", "pending", "unknown", "ack", "downtime":
               <td>
                 %label = "%s <i>(%s%%)</i>" % (h["nb_" + state], h["pct_" + state])
                 {{!helper.get_fa_icon_state_and_label(cls="host", state=state, label=label, disabled=(not h["nb_" + state]))}}
               </td>
               %end
            </tr>
         </tbody>
      </table>
   </div>
   <div id="services-states-popover-content" class="hidden">
      <table class="table table-invisible table-condensed">
         <tbody>
            <tr>
               %for state in "ok", "warning", "critical", "pending", "unknown", "ack", "downtime":
               <td>
                 %label = "%s <i>(%s%%)</i>" % (s["nb_" + state], s["pct_" + state])
                 {{!helper.get_fa_icon_state_and_label(cls="service", state=state, label=label, disabled=(not s["nb_" + state]))}}
               </td>
               %end
            </tr>
         </tbody>
      </table>
   </div>

   <ul class="nav navbar-top-links navbar-right">
      <!-- Do not remove the next comment!
         Everything between 'begin-hosts-states' comment and 'end-hosts-states' comment 
         is used by the layout page refresh.
      -->
      <!--begin-hosts-states-->
      <li id="overall-hosts-states">
         %host_state = app.datamgr.get_percentage_hosts_state(user, False)
         <a id="hosts-states-popover" href="/all?search=type:host" data-original-title="Hosts states" data-toggle="popover" title="Overall hosts states, {{h['nb_elts']}} hosts, {{h["nb_down"]+h["nb_unreachable"]}} problems" data-html="true" data-trigger="hover">
            <i class="fa fa-server"></i>
            %state = 100.0-h['pct_up']
            %threshold_warning=5.0
            %threshold_critical=10.0
            %label='success' if state < threshold_warning else 'warning' if state < threshold_critical else 'danger'
            <span class="label label-as-badge label-{{label}}">{{h["nb_down"]+h["nb_unreachable"]}}</span>
         </a>
      </li>
      <!--end-hosts-states-->
   
      <!--begin-services-states-->
      <li id="overall-services-states">
         %service_state = app.datamgr.get_percentage_service_state(user, False)
         <a id="services-states-popover" href="/all?search=type:service" data-original-title="Services states" data-toggle="popover popover-services" title="Overall services states, {{s['nb_elts']}} services, {{s["nb_critical"]+s["nb_warning"]}} problems" data-html="true" data-trigger="hover">
            <i class="fa fa-bars"></i>
            %state = 100-s['pct_ok']
            %threshold_warning=5.0
            %threshold_critical=10.0
            %label='success' if state < threshold_warning else 'warning' if state < threshold_critical else 'danger'
            <span class="label label-as-badge label-{{label}}">{{s["nb_critical"]+s["nb_warning"]}}</span>
         </a>
      </li>
      <!--end-services-states-->
    
      <li>
         <a class="quickinfo" data-original-title='Currently' href="/dashboard/currently" title="Dashboard currently">
            <i class="fa fa-eye"></i>
         </a>
      </li>

      %if refresh:
      <li>
         <a class="quickinfo" action="toggle-page-refresh" data-original-title='Refreshing' href="#">
            <i id="header_loading" class="fa fa-refresh"></i>
         </a>
      </li>
      %end
   
      %if app.play_sound:
      <li>
         <a class="quickinfo" action="toggle-sound-alert" data-original-title='Sound alerting' href="#">
            <span id="sound_alerting" class="fa-stack">
              <i class="fa fa-music fa-stack-1x"></i>
              <i class="fa fa-ban fa-stack-2x text-danger"></i>
            </span>
         </a>
      </li>
      %end
   
      <!-- User info -->
      <li class="dropdown user user-menu"><commit_msg>Problems number in header bar<commit_after>%setdefault('app', None)
%setdefault('user', None)

%username = 'anonymous'
%if user is not None:
%if hasattr(user, 'alias') and user.alias != 'none':
%username = user.alias
%else:
%username = user.get_name()
%end
%end


<!-- Header Navbar -->
<nav class="header navbar navbar-default navbar-static-top" style="margin-bottom:0px;">
   <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
         <span class="sr-only">Toggle navigation</span>
         <span class="icon-bar"></span>
         <span class="icon-bar"></span>
         <span class="icon-bar"></span>
      </button>
      <a href="#about" data-toggle="modal" data-target="#about" class="logo navbar-brand">
         <img src="/static/logo/{{app.company_logo}}" alt="Company logo" />
      </a>
   </div>

   <ul class="nav navbar-nav">
      <!-- Page filtering ... -->
      %include("_filters.tpl")
   </ul>

   <!-- Right part ... -->
   %synthesis = helper.get_synthesis(app.datamgr.search_hosts_and_services(user=user))
   %s = synthesis['services']
   %h = synthesis['hosts']
   <div id="hosts-states-popover-content" class="hidden">
      <table class="table table-invisible table-condensed">
         <tbody>
            <tr>
               %for state in "up", "unreachable", "down", "pending", "unknown", "ack", "downtime":
               <td>
                 %label = "%s <i>(%s%%)</i>" % (h["nb_" + state], h["pct_" + state])
                 {{!helper.get_fa_icon_state_and_label(cls="host", state=state, label=label, disabled=(not h["nb_" + state]))}}
               </td>
               %end
            </tr>
         </tbody>
      </table>
   </div>
   <div id="services-states-popover-content" class="hidden">
      <table class="table table-invisible table-condensed">
         <tbody>
            <tr>
               %for state in "ok", "warning", "critical", "pending", "unknown", "ack", "downtime":
               <td>
                 %label = "%s <i>(%s%%)</i>" % (s["nb_" + state], s["pct_" + state])
                 {{!helper.get_fa_icon_state_and_label(cls="service", state=state, label=label, disabled=(not s["nb_" + state]))}}
               </td>
               %end
            </tr>
         </tbody>
      </table>
   </div>

   <ul class="nav navbar-top-links navbar-right">
      <!-- Do not remove the next comment!
         Everything between 'begin-hosts-states' comment and 'end-hosts-states' comment 
         is used by the layout page refresh.
      -->
      <!--begin-hosts-states-->
      <li id="overall-hosts-states">
         %host_state = app.datamgr.get_percentage_hosts_state(user, False)
         <a id="hosts-states-popover" href="/all?search=type:host" data-original-title="Hosts states" data-toggle="popover" title="Overall hosts states, {{h['nb_elts']}} hosts, {{h["nb_down"]+h["nb_unreachable"]}} problems" data-html="true" data-trigger="hover">
            <i class="fa fa-server"></i>
            %state = 100.0-h['pct_up']
            %threshold_warning=5.0
            %threshold_critical=10.0
            %label='success' if state < threshold_warning else 'warning' if state < threshold_critical else 'danger'
            <span class="label label-as-badge label-{{label}}">{{ len(app.datamgr.get_problems(user=user, type='host')) }}</span>
         </a>
      </li>
      <!--end-hosts-states-->
   
      <!--begin-services-states-->
      <li id="overall-services-states">
         %service_state = app.datamgr.get_percentage_service_state(user, False)
         <a id="services-states-popover" href="/all?search=type:service" data-original-title="Services states" data-toggle="popover popover-services" title="Overall services states, {{s['nb_elts']}} services, {{s["nb_critical"]+s["nb_warning"]}} problems" data-html="true" data-trigger="hover">
            <i class="fa fa-bars"></i>
            %state = 100-s['pct_ok']
            %threshold_warning=5.0
            %threshold_critical=10.0
            %label='success' if state < threshold_warning else 'warning' if state < threshold_critical else 'danger'
            <span class="label label-as-badge label-{{label}}">{{ len(app.datamgr.get_problems(user=user, type='service')) }}</span>
         </a>
      </li>
      <!--end-services-states-->
    
      <li>
         <a class="quickinfo" data-original-title='Currently' href="/dashboard/currently" title="Dashboard currently">
            <i class="fa fa-eye"></i>
         </a>
      </li>

      %if refresh:
      <li>
         <a class="quickinfo" action="toggle-page-refresh" data-original-title='Refreshing' href="#">
            <i id="header_loading" class="fa fa-refresh"></i>
         </a>
      </li>
      %end
   
      %if app.play_sound:
      <li>
         <a class="quickinfo" action="toggle-sound-alert" data-original-title='Sound alerting' href="#">
            <span id="sound_alerting" class="fa-stack">
              <i class="fa fa-music fa-stack-1x"></i>
              <i class="fa fa-ban fa-stack-2x text-danger"></i>
            </span>
         </a>
      </li>
      %end
   
      <!-- User info -->
      <li class="dropdown user user-menu">
{'fraction_non_alphanumeric': 0.18312284730195177, 'fraction_numerical': 0.004018369690011481, 'mean_word_length': 2.491315965263861, 'pattern_counts': {'":': 4, '<': 193, '<?xml version=': 0, '>': 185, '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': '7035343', 'n_tokens_mistral': 3372, 'n_tokens_neox': 3257, 'n_words': 669}