Refactor JSON to be in the html/head tag instead
of at the footer
This commit is contained in:
@@ -4,6 +4,13 @@
|
|||||||
{% if config.DAILY_REPORTS_CHART_ENABLED %}
|
{% if config.DAILY_REPORTS_CHART_ENABLED %}
|
||||||
<link href="{{ url_for('static', filename='css/c3.min.css') }}" rel="stylesheet">
|
<link href="{{ url_for('static', filename='css/c3.min.css') }}" rel="stylesheet">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if config.DAILY_REPORTS_CHART_ENABLED %}
|
||||||
|
{% block script %}
|
||||||
|
<script src="{{url_for('static', filename='js/d3.min.js')}}"></script>
|
||||||
|
<script src="{{url_for('static', filename='js/c3.min.js')}}"></script>
|
||||||
|
<script src="{{url_for('static', filename='js/dailychart.js')}}"></script>
|
||||||
|
{% endblock script %}
|
||||||
|
{% endif %}
|
||||||
{% endblock head %}
|
{% endblock head %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if config.REFRESH_RATE > 0 %}
|
{% if config.REFRESH_RATE > 0 %}
|
||||||
@@ -124,10 +131,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
{% if config.DAILY_REPORTS_CHART_ENABLED %}
|
|
||||||
{% block script %}
|
|
||||||
<script src="{{url_for('static', filename='js/d3.min.js')}}"></script>
|
|
||||||
<script src="{{url_for('static', filename='js/c3.min.js')}}"></script>
|
|
||||||
<script src="{{url_for('static', filename='js/dailychart.js')}}"></script>
|
|
||||||
{% endblock script %}
|
|
||||||
{% endif %}
|
|
||||||
|
|||||||
@@ -19,6 +19,36 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<link href="{{ url_for('static', filename='Semantic-UI-2.1.8/semantic.min.css') }}" rel="stylesheet" />
|
<link href="{{ url_for('static', filename='Semantic-UI-2.1.8/semantic.min.css') }}" rel="stylesheet" />
|
||||||
<link href="{{ url_for('static', filename='css/puppetboard.css') }}" rel="stylesheet" />
|
<link href="{{ url_for('static', filename='css/puppetboard.css') }}" rel="stylesheet" />
|
||||||
|
|
||||||
|
{% if config.OFFLINE_MODE %}
|
||||||
|
<script src="{{ url_for('static', filename='jquery-2.1.1/jquery.min.js') }}"></script>
|
||||||
|
<script src="{{ url_for('static', filename='jquery-datatables-1.10.13/jquery.dataTables.min.js') }}"></script>
|
||||||
|
<script src="{{ url_for('static', filename='jquery-datatables-1.10.13/dataTables.semanticui.min.js') }}"></script>
|
||||||
|
{% if config.LOCALISE_TIMESTAMP %}
|
||||||
|
<script src="{{ url_for('static', filename='moment.js-2.7.0/moment.min.js') }}"></script>
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
||||||
|
<script src="//cdnjs.cloudflare.com/ajax/libs/datatables/1.10.13/js/jquery.dataTables.min.js"></script>
|
||||||
|
<script src="//cdnjs.cloudflare.com/ajax/libs/datatables/1.10.13/js/dataTables.semanticui.min.js"></script>
|
||||||
|
{% if config.LOCALISE_TIMESTAMP %}
|
||||||
|
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.7.0/moment.min.js"></script>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% if config.LOCALISE_TIMESTAMP %}
|
||||||
|
<script src="{{ url_for('static', filename='js/timestamps.js')}}"></script>
|
||||||
|
{% endif %}
|
||||||
|
<script src="{{ url_for('static', filename='Semantic-UI-2.1.8/semantic.min.js') }}"></script>
|
||||||
|
<script src="{{ url_for('static', filename='js/lists.js') }}"></script>
|
||||||
|
<script src="{{ url_for('static', filename='js/scroll.top.js') }}"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
$(".ui.dropdown").dropdown();
|
||||||
|
{% block onload_script %} {% endblock onload_script %}
|
||||||
|
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
{% block script %} {% endblock script %}
|
||||||
{% block head %} {% endblock head %}
|
{% block head %} {% endblock head %}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -70,32 +100,5 @@
|
|||||||
Copyright © 2013-{{ now('%Y') }} <a href="https://github.com/voxpupuli" target="_blank">Puppet Community</a>. <span style="float:right">Live from PuppetDB.</span>
|
Copyright © 2013-{{ now('%Y') }} <a href="https://github.com/voxpupuli" target="_blank">Puppet Community</a>. <span style="float:right">Live from PuppetDB.</span>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
{% if config.OFFLINE_MODE %}
|
|
||||||
<script src="{{ url_for('static', filename='jquery-2.1.1/jquery.min.js') }}"></script>
|
|
||||||
<script src="{{ url_for('static', filename='jquery-datatables-1.10.13/jquery.dataTables.min.js') }}"></script>
|
|
||||||
<script src="{{ url_for('static', filename='jquery-datatables-1.10.13/dataTables.semanticui.min.js') }}"></script>
|
|
||||||
{% if config.LOCALISE_TIMESTAMP %}
|
|
||||||
<script src="{{ url_for('static', filename='moment.js-2.7.0/moment.min.js') }}"></script>
|
|
||||||
{% endif %}
|
|
||||||
{% else %}
|
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/datatables/1.10.13/js/jquery.dataTables.min.js"></script>
|
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/datatables/1.10.13/js/dataTables.semanticui.min.js"></script>
|
|
||||||
{% if config.LOCALISE_TIMESTAMP %}
|
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.7.0/moment.min.js"></script>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% if config.LOCALISE_TIMESTAMP %}
|
|
||||||
<script src="{{ url_for('static', filename='js/timestamps.js')}}"></script>
|
|
||||||
{% endif %}
|
|
||||||
<script src="{{ url_for('static', filename='Semantic-UI-2.1.8/semantic.min.js') }}"></script>
|
|
||||||
<script src="{{ url_for('static', filename='js/lists.js') }}"></script>
|
|
||||||
<script src="{{ url_for('static', filename='js/scroll.top.js') }}"></script>
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(".ui.dropdown").dropdown();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{% block script %} {% endblock script %}
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -4,6 +4,15 @@
|
|||||||
{% if config.DAILY_REPORTS_CHART_ENABLED %}
|
{% if config.DAILY_REPORTS_CHART_ENABLED %}
|
||||||
<link href="{{ url_for('static', filename='css/c3.min.css') }}" rel="stylesheet" />
|
<link href="{{ url_for('static', filename='css/c3.min.css') }}" rel="stylesheet" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% block script %}
|
||||||
|
<script type="text/javascript">
|
||||||
|
{{ macros.datatable_init(table_html_id="reports_table", ajax_url=url_for('reports_ajax', env=current_env, node_name=node.name), default_length=config.LITTLE_TABLE_COUNT, length_selector=config.TABLE_COUNT_SELECTOR, columns=columns) }}
|
||||||
|
</script>
|
||||||
|
{% if config.DAILY_REPORTS_CHART_ENABLED %}
|
||||||
|
<script src="{{url_for('static', filename='js/d3.min.js')}}"></script>
|
||||||
|
<script src="{{url_for('static', filename='js/c3.min.js')}}"></script>
|
||||||
|
<script src="{{url_for('static', filename='js/dailychart.js')}}"></script>
|
||||||
|
{% endif %}
|
||||||
{% endblock head %}
|
{% endblock head %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class='ui two column grid'>
|
<div class='ui two column grid'>
|
||||||
@@ -58,13 +67,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
{% block script %}
|
|
||||||
<script type="text/javascript">
|
|
||||||
{{ macros.datatable_init(table_html_id="reports_table", ajax_url=url_for('reports_ajax', env=current_env, node_name=node.name), default_length=config.LITTLE_TABLE_COUNT, length_selector=config.TABLE_COUNT_SELECTOR, columns=columns) }}
|
|
||||||
</script>
|
|
||||||
{% if config.DAILY_REPORTS_CHART_ENABLED %}
|
|
||||||
<script src="{{url_for('static', filename='js/d3.min.js')}}"></script>
|
|
||||||
<script src="{{url_for('static', filename='js/c3.min.js')}}"></script>
|
|
||||||
<script src="{{url_for('static', filename='js/dailychart.js')}}"></script>
|
|
||||||
{% endif %}
|
|
||||||
{% endblock script %}
|
{% endblock script %}
|
||||||
|
|||||||
@@ -28,12 +28,11 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
{% block script %}
|
{% block onload_script %}
|
||||||
{% macro extra_options(caller) %}
|
{% macro extra_options(caller) %}
|
||||||
// No initial loading
|
// No initial loading
|
||||||
"deferLoading": true,
|
"deferLoading": true,
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
<script type="text/javascript">
|
|
||||||
{{ macros.datatable_init(table_html_id="reports_table", ajax_url=url_for('reports_ajax', env=current_env, node_name=node_name), default_length=config.NORMAL_TABLE_COUNT, length_selector=config.TABLE_COUNT_SELECTOR, extra_options=extra_options, columns=columns) }}
|
{{ macros.datatable_init(table_html_id="reports_table", ajax_url=url_for('reports_ajax', env=current_env, node_name=node_name), default_length=config.NORMAL_TABLE_COUNT, length_selector=config.TABLE_COUNT_SELECTOR, extra_options=extra_options, columns=columns) }}
|
||||||
|
|
||||||
// Event listener for status filters
|
// Event listener for status filters
|
||||||
@@ -56,5 +55,4 @@
|
|||||||
$('#failed, #changed, #unchanged, #noop').change(status_filter_change);
|
$('#failed, #changed, #unchanged, #noop').change(status_filter_change);
|
||||||
// Call at init - fix page reload behavior
|
// Call at init - fix page reload behavior
|
||||||
status_filter_change();
|
status_filter_change();
|
||||||
</script>
|
{% endblock onload_script %}
|
||||||
{% endblock script %}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user