-
Notifications
You must be signed in to change notification settings - Fork 477
Expand file tree
/
Copy pathhtml_fancy.tpl
More file actions
69 lines (59 loc) · 1.88 KB
/
Copy pathhtml_fancy.tpl
File metadata and controls
69 lines (59 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
## -*- coding: utf-8 -*-
<%! from ansiblecmdb.util import to_bool %>
<%namespace name="defs" file="/html_fancy_defs.html" import="*" />
<%
# Default parameter values
local_js = to_bool(context.get('local_js', '0'))
collapsed = to_bool(context.get('collapsed', '0'))
host_details = to_bool(context.get('host_details', '1'))
skip_empty = to_bool(context.get('skip_empty', '0'))
# Get column definitions from html_fancy_defs.html
cols = var_cols(columns, exclude_columns)
# Extend default columns with custom columns
cols.extend(cust_cols)
# Set the Javascript resource URL (local disk or CDN)
if local_js is False:
res_url = "https://cdn.datatables.net/1.10.2/"
else:
res_url = "file://" + data_dir + "/static/"
# Set the link type for the host overview table's 'host' column (the link that
# takes you to the host details).
link_type = "anchor"
if host_details is False:
link_type = "none"
%>
<% html_header("Ansible Overview", local_js, res_url) %>
<% html_header_bar("Host Overview") %>
<% html_col_toggles(cols) %>
<% html_host_overview(cols, hosts, skip_empty=skip_empty, link_type=link_type) %>
% if host_details is True:
<% html_host_details(hosts, collapsed=collapsed, skip_empty=skip_empty) %>
% endif
<% html_footer_bar(version) %>
<script>
$(document).ready( function () {
<% js_init_host_overview(cols) %>
<% js_ev_collapse() %>
// Show host name in header bar when scrolling
$( window ).scroll(function() {
var scrollTop = $(window).scrollTop();
var curElem = false;
$( "#hosts h3" ).each(function( index ) {
var el = $(this);
if ((el.offset().top - 128) <= scrollTop) {
curElem = el;
} else {
return false;
}
});
if (curElem) {
$("header h1").text(curElem.text());
$('#top').show();
} else {
$("header h1").text("Host Overview");
$('#top').hide();
};
});
});
</script>
<% html_footer() %>