<commit_before>%# " We should limit the number of impacts to show here. Too much is just useless "
%max_impacts = 200

%print 'Elt value?', elt
%import time

%# If got no Elt, bailout
%if not elt:
%rebase layout title='Invalid name'

Invalid element name

%else:

%helper = app.helper
%datamgr = app.datamgr

%elt_type = elt.__class__.my_type

%top_right_banner_state = datamgr.get_overall_state()

%rebase layout title=elt_type.capitalize() + ' detail about ' + elt.get_full_name(),  js=['eltdetail/js/functions.js','eltdetail/js/graphs.js', 'eltdetail/js/dollar.js','eltdetail/js/TabPane.js', 'eltdetail/js/gesture.js', 'eltdetail/js/hide.js', 'eltdetail/js/switchbuttons.js', 'eltdetail/js/multi.js'],  css=['eltdetail/css/eltdetail.css', 'eltdetail/css/hide.css', 'eltdetail/css/gesture.css'], top_right_banner_state=top_right_banner_state , user=user, app=app

%# " We will save our element name so gesture functions will be able to call for the good elements."
<script type="text/javascript">var elt_name = '{{elt.get_full_name()}}';</script>



%#  "Content Container Start"
<div id="content_container" class="span12 no-leftmargin">

	<h1 class="grid_16 state_{{elt.state.lower()}} icon_down"><img class="host_img_25" src="{{helper.get_icon_state(elt)}}" />{{elt.state}}: {{elt.get_full_name()}}</h1>

	<div class="span12 no-leftmargin box">	   
		<table class="span4 no-leftmargin">
		%#Alias, apretns and hostgroups arefor host only
		%if elt_type=='host':
			<tr>
		    	<td>Alias:</td>
		    	<td>{{elt.alias}}</td>
			</tr>
			<tr>
		    	<td>Address:</td>
		    	<td>{{elt.address}}</td>
			</tr>
			<tr>
		    	<td>Importance:</td>
		    	<td>{{!helper.get_business_impact_text(elt)}}</td>
			</tr>
		</table>
		
		<table class="span3">
			<tr>
		    	<td>Parents:</td>
		    	%if len(elt.parents) > 0:
		    	<td>{{elt.alias}}</td>
		    	%else:
		    	<td>No parents</td>
		    	%end
			</tr>
			<tr>
		    	<td>Members of:</td>
		    	%if len(elt.hostgroups) > 0:
		    	<td>{{','.join([hg.get_name() for hg in elt.hostgroups])}}</td>
		    	%else:
			    <td> No groups </td>
				%end
			</tr>
			%# End of the host only case, so now service
		    %else:
			<tr>
		    	<td>Host:</td>
		    	<td><a href="/host/{{elt.host.host_name}}" class="link">{{elt.host.host_name}}</a></td>
			</tr>
			<tr>
		    	<td>Members of:</td>
		    	%if len(elt.servicegroups) > 0:
		    	<td>{{','.join([sg.get_name() for sg in elt.servicegroups])}}</td>
				%else:
			    <td> No groups </td>
				%end
			</tr>
			%end
			<tr>
			  	<td>Notes:</td>
			    %if elt.notes != '':
			    <td>{{elt.notes}}</td>
			    %else:
			    <td>(none)</td>
			    %end
			</tr>
		</table>	    

		<div class="span4">
		    %#   " If the elements is a root problem with a huge impact and not ack, ask to ack it!"
		    %if elt.is_problem and elt.business_impact > 2 and not elt.problem_has_been_acknowledged:
			<div class="alert alert-critical no-bottommargin">
				<p>This element has got an important impact on your business, please <b>fix it</b> or <b>acknowledge it</b>.</p>
		    %# "end of the 'SOLVE THIS' highlight box"
		    %end
		    </div>
		</div>				
	</div>
	
	<!-- Switch Start -->
	<div class="switches span12">
		<ul>
		    %if elt_type=='host':
		       %title = 'This will also enable/disable this host services'
		    %else:
		       %title = ''
		    %end
			<li class="grid_4" title="{{title}}" onclick="toggle_checks('{{elt.get_full_name()}}' , '{{elt.active_checks_enabled|elt.passive_checks_enabled}}')"><span>Active/passive Checks</span> {{!helper.get_input_bool(elt.active_checks_enabled|elt.passive_checks_enabled)}}
			<li class="grid_4" onclick="toggle_notifications('{{elt.get_full_name()}}' , '{{elt.notifications_enabled}}')"><span>Notifications</span> {{!helper.get_input_bool(elt.notifications_enabled)}} </li>
			<li class="grid_4" onclick="toggle_event_handlers('{{elt.get_full_name()}}' , '{{elt.event_handler_enabled}}')" ><span>Event Handler</span> {{!helper.get_input_bool(elt.event_handler_enabled)}} </li>
			<li class="grid_4" onclick="toggle_flap_detection('{{elt.get_full_name()}}' , '{{elt.flap_detection_enabled}}')" ><span>Flap Detection</span> {{!helper.get_input_bool(elt.flap_detection_enabled)}} </li>	
		</ul>	
	</div>
    <!-- Switch End-->

    <div class="tabbable">
	    <ul class="nav nav-tabs">
	    	<li class="active"><a href="#1" data-toggle="tab">Summary</a></li>
	    	<li><a href="#2" data-toggle="tab">Services</a></li>
	    	<li><a href="#3" data-toggle="tab">Comments / Downtimes</a></li>
	    	<li><a href="#4" data-toggle="tab">GRaph</a></li>
	    </ul>
	    <div class="tab-content">
	    	<!-- Tab Summary Start-->
		    <div class="tab-pane active" id="1">
		    	<h2>Host/Service Information</h2>
		    	<table class="table table-condensed">
					<tr>
						<td class="column1">{{elt_type.capitalize()}} Status</td>
						<td><span class="state_{{elt.state.lower()}}">{{elt.state}}</span> (since {{helper.print_duration(elt.last_state_change, just_duration=True, x_elts=2)}}) </td>
					</tr>
					<tr>
						<td class="column1">Status Information</td>
						<td>{{elt.output}}</td>
					</tr>
					<tr>
						<td class="column1">Performance Data</td>
							%# "If there any perf data?"
							%if len(elt.perf_data) > 0:
						<td>{{elt.perf_data}}</td>
							%else:
						<td>&nbsp;</td>
							%end
					</tr>	
					<tr>										
						<td class="column1">Current Attempt</td>
						<td>{{elt.attempt}}/{{elt.max_check_attempts}} ({{elt.state_type}} state)</td>
					</tr>
					<tr>		
						<td class="column1">Last Check Time</td>
						<td title='Last check was at {{time.asctime(time.localtime(elt.last_chk))}}'>was {{helper.print_duration(elt.last_chk)}}</td>
					</tr>
					<tr>		
						<td class="column1">Next Scheduled Active Check</td>
						<td title='Next active check at {{time.asctime(time.localtime(elt.next_chk))}}'>{{helper.print_duration(elt.next_chk)}}</td>
					</tr>
					<tr>		
						<td class="column1">Last State Change</td>
						<td>{{time.asctime(time.localtime(elt.last_state_change))}}</td>
					</tr>
				</table>
				<hr>
				<h2>Additonal Informations</h2>
				<table class="table table-condensed">
					<tr>
						<td class="column1">Last Notification</td>
						<td>{{helper.print_date(elt.last_notification)}} (notification {{elt.current_notification_number}})</td>
					</tr>
					<tr>			
						<td class="column1">Check Latency / Duration</td>
						<td>{{'%.2f' % elt.latency}} / {{'%.2f' % elt.execution_time}} seconds</td>
					</tr>
					<tr>
						<td class="column1">Is This Host Flapping?</td>
						<td>{{helper.yes_no(elt.is_flapping)}} ({{helper.print_float(elt.percent_state_change)}}% state change)</td>
					</tr>
					<tr>
						<td class="column1">In Scheduled Downtime?</td>
						<td>{{helper.yes_no(elt.in_scheduled_downtime)}}</td>
					</tr>
				</table>
		    </div>
		    <!-- Tab Summary End-->

		    <!-- Tab Service Start -->
		    <div class="tab-pane" id="2">
	        	%# " Only print host service if elt is an host of course"
				%# " If the host is a problem, services will be print in the impacts, so don't"
				%# " print twice "
								
				%if elt_type=='host' and not elt.is_problem:
				<hr>
							<commit_msg>Fix: typo Enh: Table style<commit_after>%# " We should limit the number of impacts to show here. Too much is just useless "
%max_impacts = 200

%print 'Elt value?', elt
%import time

%# If got no Elt, bailout
%if not elt:
%rebase layout title='Invalid name'

Invalid element name

%else:

%helper = app.helper
%datamgr = app.datamgr

%elt_type = elt.__class__.my_type

%top_right_banner_state = datamgr.get_overall_state()

%rebase layout title=elt_type.capitalize() + ' detail about ' + elt.get_full_name(),  js=['eltdetail/js/functions.js','eltdetail/js/graphs.js', 'eltdetail/js/dollar.js','eltdetail/js/TabPane.js', 'eltdetail/js/gesture.js', 'eltdetail/js/hide.js', 'eltdetail/js/switchbuttons.js', 'eltdetail/js/multi.js'],  css=['eltdetail/css/eltdetail.css', 'eltdetail/css/hide.css', 'eltdetail/css/gesture.css'], top_right_banner_state=top_right_banner_state , user=user, app=app

%# " We will save our element name so gesture functions will be able to call for the good elements."
<script type="text/javascript">var elt_name = '{{elt.get_full_name()}}';</script>



%#  "Content Container Start"
<div id="content_container" class="span12 no-leftmargin">

	<h1 class="grid_16 state_{{elt.state.lower()}} icon_down"><img class="host_img_25" src="{{helper.get_icon_state(elt)}}" />{{elt.state}}: {{elt.get_full_name()}}</h1>

	<div class="span12 no-leftmargin box">	   
		<table class="span4 no-leftmargin">
		%#Alias, apretns and hostgroups arefor host only
		%if elt_type=='host':
			<tr>
		    	<td>Alias:</td>
		    	<td>{{elt.alias}}</td>
			</tr>
			<tr>
		    	<td>Address:</td>
		    	<td>{{elt.address}}</td>
			</tr>
			<tr>
		    	<td>Importance:</td>
		    	<td>{{!helper.get_business_impact_text(elt)}}</td>
			</tr>
		</table>
		
		<table class="span3">
			<tr>
		    	<td>Parents:</td>
		    	%if len(elt.parents) > 0:
		    	<td>{{elt.alias}}</td>
		    	%else:
		    	<td>No parents</td>
		    	%end
			</tr>
			<tr>
		    	<td>Members of:</td>
		    	%if len(elt.hostgroups) > 0:
		    	<td>{{','.join([hg.get_name() for hg in elt.hostgroups])}}</td>
		    	%else:
			    <td> No groups </td>
				%end
			</tr>
			%# End of the host only case, so now service
		    %else:
			<tr>
		    	<td>Host:</td>
		    	<td><a href="/host/{{elt.host.host_name}}" class="link">{{elt.host.host_name}}</a></td>
			</tr>
			<tr>
		    	<td>Members of:</td>
		    	%if len(elt.servicegroups) > 0:
		    	<td>{{','.join([sg.get_name() for sg in elt.servicegroups])}}</td>
				%else:
			    <td> No groups </td>
				%end
			</tr>
			%end
			<tr>
			  	<td>Notes:</td>
			    %if elt.notes != '':
			    <td>{{elt.notes}}</td>
			    %else:
			    <td>(none)</td>
			    %end
			</tr>
		</table>	    

		<div class="span4">
		    %#   " If the elements is a root problem with a huge impact and not ack, ask to ack it!"
		    %if elt.is_problem and elt.business_impact > 2 and not elt.problem_has_been_acknowledged:
			<div class="alert alert-critical no-bottommargin">
				<p>This element has got an important impact on your business, please <b>fix it</b> or <b>acknowledge it</b>.</p>
		    %# "end of the 'SOLVE THIS' highlight box"
		    %end
		    </div>
		</div>				
	</div>
	
	<!-- Switch Start -->
	<div class="switches span12">
		<ul>
		    %if elt_type=='host':
		       %title = 'This will also enable/disable this host services'
		    %else:
		       %title = ''
		    %end
			<li class="grid_4" title="{{title}}" onclick="toggle_checks('{{elt.get_full_name()}}' , '{{elt.active_checks_enabled|elt.passive_checks_enabled}}')"><span>Active/passive Checks</span> {{!helper.get_input_bool(elt.active_checks_enabled|elt.passive_checks_enabled)}}
			<li class="grid_4" onclick="toggle_notifications('{{elt.get_full_name()}}' , '{{elt.notifications_enabled}}')"><span>Notifications</span> {{!helper.get_input_bool(elt.notifications_enabled)}} </li>
			<li class="grid_4" onclick="toggle_event_handlers('{{elt.get_full_name()}}' , '{{elt.event_handler_enabled}}')" ><span>Event Handler</span> {{!helper.get_input_bool(elt.event_handler_enabled)}} </li>
			<li class="grid_4" onclick="toggle_flap_detection('{{elt.get_full_name()}}' , '{{elt.flap_detection_enabled}}')" ><span>Flap Detection</span> {{!helper.get_input_bool(elt.flap_detection_enabled)}} </li>	
		</ul>	
	</div>
    <!-- Switch End-->

    <div class="tabbable">
	    <ul class="nav nav-tabs">
	    	<li class="active"><a href="#1" data-toggle="tab">Summary</a></li>
	    	<li><a href="#2" data-toggle="tab">Services</a></li>
	    	<li><a href="#3" data-toggle="tab">Comments / Downtimes</a></li>
	    	<li><a href="#4" data-toggle="tab">Graph</a></li>
	    </ul>
	    <div class="tab-content">
	    	<!-- Tab Summary Start-->
		    <div class="tab-pane active" id="1">
		    	<h2 class="span12">Host/Service Information</h2>
		    	<table class="span6 table table-striped table-bordered table-condensed">
					<tr>
						<td class="column1">{{elt_type.capitalize()}} Status</td>
						<td><span class="state_{{elt.state.lower()}}">{{elt.state}}</span> (since {{helper.print_duration(elt.last_state_change, just_duration=True, x_elts=2)}}) </td>
					</tr>
					<tr>
						<td class="column1">Status Information</td>
						<td>{{elt.output}}</td>
					</tr>
					<tr>
						<td class="column1">Performance Data</td>
							%# "If there any perf data?"
							%if len(elt.perf_data) > 0:
						<td>{{elt.perf_data}}</td>
							%else:
						<td>&nbsp;</td>
							%end
					</tr>	
					<tr>										
						<td class="column1">Current Attempt</td>
						<td>{{elt.attempt}}/{{elt.max_check_attempts}} ({{elt.state_type}} state)</td>
					</tr>
					<tr>		
						<td class="column1">Last Check Time</td>
						<td title='Last check was at {{time.asctime(time.localtime(elt.last_chk))}}'>was {{helper.print_duration(elt.last_chk)}}</td>
					</tr>
					<tr>		
						<td class="column1">Next Scheduled Active Check</td>
						<td title='Next active check at {{time.asctime(time.localtime(elt.next_chk))}}'>{{helper.print_duration(elt.next_chk)}}</td>
					</tr>
					<tr>		
						<td class="column1">Last State Change</td>
						<td>{{time.asctime(time.localtime(elt.last_state_change))}}</td>
					</tr>
				</table>
				
				<h2 class="span12">Additonal Informations</h2>
				<table class="span6 table table-striped table-bordered table-condensed">
					<tr>
						<td class="column1">Last Notification</td>
						<td>{{helper.print_date(elt.last_notification)}} (notification {{elt.current_notification_number}})</td>
					</tr>
					<tr>			
						<td class="column1">Check Latency / Duration</td>
						<td>{{'%.2f' % elt.latency}} / {{'%.2f' % elt.execution_time}} seconds</td>
					</tr>
					<tr>
						<td class="column1">Is This Host Flapping?</td>
						<td>{{helper.yes_no(elt.is_flapping)}} ({{helper.print_float(elt.percent_state_change)}}% state change)</td>
					</tr>
					<tr>
						<td class="column1">In Scheduled Downtime?</td>
						<td>{{helper.yes_no(elt.in_scheduled_downtime)}}</td>
					</tr>
				</table>
		    </div>
		    <!-- Tab Summary End-->

		    <!-- Tab Service Start -->
		    <div class="tab-pane" id="2">
	        	%# " Only print host service if elt is an host of course"
				%# " If the host is a problem, services will be print in the impacts, so don't"
				%# " print twice "
								
				%if elt_type=='host' and not elt.is_problem:
				<hr>
							
{'fraction_non_alphanumeric': 0.19421459344867675, 'fraction_numerical': 0.007385625384667989, 'mean_word_length': 3.215624099164024, 'pattern_counts': {'":': 0, '<': 416, '<?xml version=': 0, '>': 426, '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': '1211165', 'n_tokens_mistral': 6411, 'n_tokens_neox': 5281, 'n_words': 1047}