<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()

%# Look for actions if we must show them or not
%global_disabled = ''
%if app.manage_acl and not helper.can_action(user):
%global_disabled = 'disabled-link'
%end


%rebase layout title=elt_type.capitalize() + ' detail about ' + elt.get_full_name(), js=['eltdetail/js/jquery.color.js', 'eltdetail/js/jquery.Jcrop.js', 'eltdetail/js/iphone-style-checkboxes.js', 'eltdetail/js/hide.js', 'eltdetail/js/dollar.js', 'eltdetail/js/gesture.js', 'eltdetail/js/graphs.js', 'eltdetail/js/tags.js', 'eltdetail/js/depgraph.js'], css=['eltdetail/css/iphonebuttons.css_', 'eltdetail/css/eltdetail.css', 'eltdetail/css/hide.css', 'eltdetail/css/gesture.css', 'eltdetail/css/jquery.Jcrop.css'], top_right_banner_state=top_right_banner_state , user=user, app=app, refresh=True

%# " 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()}}';

var graphstart={{graphstart}};
var graphend={{graphend}};

/* Now hide canvas */
$(document).ready(function(){
	$('#gesture_panel').hide();

    // Also hide the button under IE (gesture don't work under it)
    if (navigator.appName == 'Microsoft Internet Explorer'){
    	$('#btn_show_gesture').hide();
    }
});

/* Look at the # part of the URI. If it match a nav name, go for it*/
$(document).ready(function(){
	if (window.location.hash.length > 0) {
		$('ul.nav-tabs > li > a[href="' + window.location.hash + '"]').tab('show');
	}else{
		$('ul.nav-tabs > li > a:first').tab('show');
	}
});

  // Now we hook the global search thing
  $('.typeahead').typeahead({
    // note that "value" is the default setting for the property option
    source: function (typeahead, query) {
    	$.ajax({url: "/lookup/"+query,
    		success: function (data){
    			typeahead.process(data)}
    		});
    },
    onselect: function(obj) { 
    	$("ul.typeahead.dropdown-menu").find('li.active').data(obj);
    }
	});
</script>

  %#  "Content Container Start"
  
  <div id="content_container" class="row-fluid">
  	<div class="row-fluid">
  		<h1 class="span7 state_{{elt.state.lower()}} icon_down no-margin"> <img class="imgsize3" alt="icon state" src="{{helper.get_icon_state(elt)}}" />{{elt.state}}: {{elt.get_full_name()}}</h1> 

		%if elt.action_url != '':
			<div class="span4">
				<span class="pull-right leftmargin" id="host_tags">
					%tags = elt.get_host_tags()
					%for t in tags:
					<script>add_tag_image('/static/images/sets/{{t.lower()}}/tag.png','{{t}}');</script>
					%end
				</span>
			</div>
			<div class="span1">
				<div class="btn-group">
					%action_urls = elt.action_url.split('|')
					%if len(action_urls) == 1:
					<button class="btn btn-mini"><i class="icon-cog"></i> Action</button>
					%else:
					<button class="btn btn-mini"><i class="icon-cog"></i> Actions</button>
					%end
					<button class="btn btn-mini dropdown-toggle" data-toggle="dropdown">
				 		<span class="caret"></span>
				 	</button>
					<ul class="dropdown-menu pull-right">
						%action_urls = elt.action_url.split('|')
						%if len(action_urls) > 0:
							%for triplet in action_urls:
								%if len(triplet.split(',')) == 3:
									%( action_url, icon, alt) = triplet.split(',')
									<li><a href="{{action_url}}" target=_blank><img src={{icon}} alt="{{alt}}"></a></li>
								%else:
									%if len(triplet.split(',')) == 1:
										<li><a id="action-link" href="{{triplet}}" target=_blank>{{triplet}}</a></li>
									%end
								%end
							%end
						%end
				    </ul>
			    </div>
			</div>	
		%else:
			<div class="span5">
			  	<span class="pull-right leftmargin" id="host_tags">
					%tags = elt.get_host_tags()
					%for t in tags:
					<script>add_tag_image('/static/images/sets/{{t.lower()}}/tag.png','{{t}}');</script>
					%end
				</span>
			</div>
		%end	
  	</div>

	<div class="row-fluid box">	   
		<table class="span4">
			%#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><commit_msg>Fix: Parents werent displayed in webui<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()

%# Look for actions if we must show them or not
%global_disabled = ''
%if app.manage_acl and not helper.can_action(user):
%global_disabled = 'disabled-link'
%end


%rebase layout title=elt_type.capitalize() + ' detail about ' + elt.get_full_name(), js=['eltdetail/js/jquery.color.js', 'eltdetail/js/jquery.Jcrop.js', 'eltdetail/js/iphone-style-checkboxes.js', 'eltdetail/js/hide.js', 'eltdetail/js/dollar.js', 'eltdetail/js/gesture.js', 'eltdetail/js/graphs.js', 'eltdetail/js/tags.js', 'eltdetail/js/depgraph.js'], css=['eltdetail/css/iphonebuttons.css_', 'eltdetail/css/eltdetail.css', 'eltdetail/css/hide.css', 'eltdetail/css/gesture.css', 'eltdetail/css/jquery.Jcrop.css'], top_right_banner_state=top_right_banner_state , user=user, app=app, refresh=True

%# " 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()}}';

var graphstart={{graphstart}};
var graphend={{graphend}};

/* Now hide canvas */
$(document).ready(function(){
	$('#gesture_panel').hide();

    // Also hide the button under IE (gesture don't work under it)
    if (navigator.appName == 'Microsoft Internet Explorer'){
    	$('#btn_show_gesture').hide();
    }
});

/* Look at the # part of the URI. If it match a nav name, go for it*/
$(document).ready(function(){
	if (window.location.hash.length > 0) {
		$('ul.nav-tabs > li > a[href="' + window.location.hash + '"]').tab('show');
	}else{
		$('ul.nav-tabs > li > a:first').tab('show');
	}
});

  // Now we hook the global search thing
  $('.typeahead').typeahead({
    // note that "value" is the default setting for the property option
    source: function (typeahead, query) {
    	$.ajax({url: "/lookup/"+query,
    		success: function (data){
    			typeahead.process(data)}
    		});
    },
    onselect: function(obj) { 
    	$("ul.typeahead.dropdown-menu").find('li.active').data(obj);
    }
	});
</script>

  %#  "Content Container Start"
  
  <div id="content_container" class="row-fluid">
  	<div class="row-fluid">
  		<h1 class="span7 state_{{elt.state.lower()}} icon_down no-margin"> <img class="imgsize3" alt="icon state" src="{{helper.get_icon_state(elt)}}" />{{elt.state}}: {{elt.get_full_name()}}</h1> 

		%if elt.action_url != '':
			<div class="span4">
				<span class="pull-right leftmargin" id="host_tags">
					%tags = elt.get_host_tags()
					%for t in tags:
					<script>add_tag_image('/static/images/sets/{{t.lower()}}/tag.png','{{t}}');</script>
					%end
				</span>
			</div>
			<div class="span1">
				<div class="btn-group">
					%action_urls = elt.action_url.split('|')
					%if len(action_urls) == 1:
					<button class="btn btn-mini"><i class="icon-cog"></i> Action</button>
					%else:
					<button class="btn btn-mini"><i class="icon-cog"></i> Actions</button>
					%end
					<button class="btn btn-mini dropdown-toggle" data-toggle="dropdown">
				 		<span class="caret"></span>
				 	</button>
					<ul class="dropdown-menu pull-right">
						%action_urls = elt.action_url.split('|')
						%if len(action_urls) > 0:
							%for triplet in action_urls:
								%if len(triplet.split(',')) == 3:
									%( action_url, icon, alt) = triplet.split(',')
									<li><a href="{{action_url}}" target=_blank><img src={{icon}} alt="{{alt}}"></a></li>
								%else:
									%if len(triplet.split(',')) == 1:
										<li><a id="action-link" href="{{triplet}}" target=_blank>{{triplet}}</a></li>
									%end
								%end
							%end
						%end
				    </ul>
			    </div>
			</div>	
		%else:
			<div class="span5">
			  	<span class="pull-right leftmargin" id="host_tags">
					%tags = elt.get_host_tags()
					%for t in tags:
					<script>add_tag_image('/static/images/sets/{{t.lower()}}/tag.png','{{t}}');</script>
					%end
				</span>
			</div>
		%end	
  	</div>

	<div class="row-fluid box">	   
		<table class="span4">
			%#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>{{','.join([h.get_name() for h in elt.parents])}}</td>
{'fraction_non_alphanumeric': 0.19733668868616966, 'fraction_numerical': 0.0037747719408619063, 'mean_word_length': 3.473733583489681, 'pattern_counts': {'":': 0, '<': 151, '<?xml version=': 0, '>': 165, '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': '2885657', 'n_tokens_mistral': 4046, 'n_tokens_neox': 3456, 'n_words': 732}