always make a sidebar for custom reports with bind params; add show_sidebar setting

This commit is contained in:
Oliver Gorwits
2023-03-16 11:32:36 +00:00
parent 4de2a916fc
commit 653ea75935
2 changed files with 29 additions and 3 deletions

View File

@@ -16,7 +16,7 @@
<script type="text/javascript">has_sidebar["[% report.tag | html_entity %]"] = 1;</script>
[% INCLUDE "sidebar/report/${report.tag}.tt" %]
[% CATCH %]
<script type="text/javascript">has_sidebar["[% report.tag | html_entity %]"] = 0;</script>
<script type="text/javascript">has_sidebar["[% report.tag | html_entity %]"] = [% report.rconfig.bind_params.size ? '1' : '0' %];</script>
[% INCLUDE "sidebar/report/generic_report.tt" %]
[% END %]
</form>
@@ -49,5 +49,16 @@
</div>
<script type="text/javascript">
[% IF report.rconfig.bind_params.size AND NOT report.rconfig.show_sidebar %]
$('.nd_sidebar').toggle(0);
$('#nd_sidebar-toggle-img-out').toggle();
$('.content').css('margin-right', '10px');
$('div.content > div.tab-content table.nd_floatinghead').floatThead('destroy');
$('div.content > div.tab-content table.nd_floatinghead').floatThead({
scrollingTop: 40
,useAbsolutePositioning: false
});
sidebar_hidden = 1;
[% END %]
[%+ INCLUDE 'js/report.js' -%]
</script>

View File

@@ -1,4 +1,19 @@
[% IF report.rconfig.bind_params.size %]
<p class="nd_sidebar-title"><em>Report Options</em></p>
[% FOREACH k IN report.rconfig.bind_params %]
<input name="[% k %]" value="[% params.$k | html_entity %]" type="hidden"/>
[% FOREACH p IN report.rconfig.bind_params %]
<div class="clearfix nd_netmap-sidebar">
<em class="muted nd_sidebar-label">[% p.ucfirst | html_entity %]</em><br/>
<input id="nd_port-query" placeholder=""
name="[% p | html_entity %]" value="[% params.$p | html_entity %]" type="text"
rel="tooltip" data-placement="left" data-offset="5" data-title="[% p.ucfirst | html_entity %]"/>
</div>
[% END %]
<button id="[% report.tag | html_entity %]_submit" type="submit" class="btn btn-info">
<i class="icon-search icon-large pull-left nd_navbar-icon"></i> Search</button>
[% ELSE %]
[% FOREACH k IN report.rconfig.bind_params %]
<input name="[% k %]" value="[% params.$k | html_entity %]" type="hidden"/>
[% END %]
[% END %]