<commit_before>{% extends "layout.html" %}

{% block content %}
    <script>
        var stats = {
            loadavg1: {
                route: '{{ path('tesla_system_info_loadavg', {interval: 1}) }}'
            },
            loadavg2: {
                route: '{{ path('tesla_system_info_loadavg', {interval: 5}) }}'
            },
            loadavg3: {
                route: '{{ path('tesla_system_info_loadavg', {interval: 15}) }}'
            },
            cpuuser_user: {
                route: '{{ path('tesla_system_info_cpuusage', {type: "user"}) }}'
            },
            cpuuser_nice: {
                route: '{{ path('tesla_system_info_cpuusage', {type: "nice"}) }}'
            },
            cpuuser_sys: {
                route: '{{ path('tesla_system_info_cpuusage', {type: "sys"}) }}'
            },
            cpuuser_idle: {
                route: '{{ path('tesla_system_info_cpuusage', {type: "idle"}) }}'
            },
            netport_est_all: {
                route: '{{ path('tesla_system_info_netportconnections', {port: 'all', state: 'established'}) }}'
            },
            netport_all_all: {
                route: '{{ path('tesla_system_info_netportconnections', {port: 'all', state: 'all'}) }}'
            },
            netport_est_80: {
                route: '{{ path('tesla_system_info_netportconnections', {port: '80', state: 'established'}) }}'
            },
            netport_all_80: {
                route: '{{ path('tesla_system_info_netportconnections', {port: '80', state: 'all'}) }}'
            },
            netport_est_2000: {
                route: '{{ path('tesla_system_info_netportconnections', {port: '2000', state: 'established'}) }}'
            },
            netport_all_2000: {
                route: '{{ path('tesla_system_info_netportconnections', {port: '2000', state: 'all'}) }}'
            },
            netport_est_9000: {
                route: '{{ path('tesla_system_info_netportconnections', {port: '9000', state: 'established'}) }}'
            },
            netport_all_9000: {
                route: '{{ path('tesla_system_info_netportconnections', {port: '9000', state: 'all'}) }}'
            }
        };

        $(document).ready(function () {
            loadStats();
            window.setInterval(function () {
                loadStats();
            }, 10000);
        });

        function loadStats() {
            var $container = $('#stats');
            for (var monitor in stats) {
                var settings = stats[monitor];
                if (!$('#stats #' + monitor).length) {
                    // create a new indicator
                    $container.append('<div id="' + monitor + '"><div class="row"><div class="col-sm-3"><strong class="title"></strong></div><div class="col-sm-1"><span class="value_text"></span></div><div class="col-sm-8"><div class="progress progress-striped active"><div class="progress-bar " role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width:0%"> </div></div></div></div></div>');
                }

                $.ajax({
                    dataType: "json",
                    url: settings.route,
                    data: null,
                    $indicator: $('#stats #' + monitor),
                    success: function (data) {
                        this.$indicator.find('.title').text(data.title);
                        this.$indicator.find('.value_text').text(data.value);
                        var level = ((data.value - data.min) / (data.max - data.min)) * 100;
                        this.$indicator.find('.progress-bar').css('width', level + '%');
                        var cls = 'progress-bar-success';
                        if (data.warning == true) {
                            cls = 'progress-bar-warning';
                        }
                        if (data.critical == true) {
                            cls = 'progress-bar-danger';
                        }
                        this.$indicator.find('.progress-bar').removeClass('progress-bar-success').removeClass('progress-bar-warning').removeClass('progress-bar-danger').addClass(cls);
                    }
                });

            }
        }
    </script>


    <h1>Live Dashboard</h1>
    <br/>

    <div id="stats">


    </div>

{% endblock %}
<commit_msg>added extra net monitoring ports<commit_after>{% extends "layout.html" %}

{% block content %}
    <script>
        var stats = {
            loadavg1: {
                route: '{{ path('tesla_system_info_loadavg', {interval: 1}) }}'
            },
            loadavg2: {
                route: '{{ path('tesla_system_info_loadavg', {interval: 5}) }}'
            },
            loadavg3: {
                route: '{{ path('tesla_system_info_loadavg', {interval: 15}) }}'
            },
            cpuuser_user: {
                route: '{{ path('tesla_system_info_cpuusage', {type: "user"}) }}'
            },
            cpuuser_nice: {
                route: '{{ path('tesla_system_info_cpuusage', {type: "nice"}) }}'
            },
            cpuuser_sys: {
                route: '{{ path('tesla_system_info_cpuusage', {type: "sys"}) }}'
            },
            cpuuser_idle: {
                route: '{{ path('tesla_system_info_cpuusage', {type: "idle"}) }}'
            },
            netport_est_all: {
                route: '{{ path('tesla_system_info_netportconnections', {port: 'all', state: 'established'}) }}'
            },
            netport_all_all: {
                route: '{{ path('tesla_system_info_netportconnections', {port: 'all', state: 'all'}) }}'
            },
            netport_est_80: {
                route: '{{ path('tesla_system_info_netportconnections', {port: '80', state: 'established'}) }}'
            },
            netport_all_80: {
                route: '{{ path('tesla_system_info_netportconnections', {port: '80', state: 'all'}) }}'
            },
            netport_est_2000: {
                route: '{{ path('tesla_system_info_netportconnections', {port: '2000', state: 'established'}) }}'
            },
            netport_all_2000: {
                route: '{{ path('tesla_system_info_netportconnections', {port: '2000', state: 'all'}) }}'
            },
            netport_est_9000: {
                route: '{{ path('tesla_system_info_netportconnections', {port: '9000', state: 'established'}) }}'
            },
            netport_all_9000: {
                route: '{{ path('tesla_system_info_netportconnections', {port: '9000', state: 'all'}) }}'
            },
            netport_est_8090: {
                route: '{{ path('tesla_system_info_netportconnections', {port: '8090', state: 'established'}) }}'
            },
            netport_all_8090: {
                route: '{{ path('tesla_system_info_netportconnections', {port: '8090', state: 'all'}) }}'
            }
        };

        $(document).ready(function () {
            loadStats();
            window.setInterval(function () {
                loadStats();
            }, 10000);
        });

        function loadStats() {
            var $container = $('#stats');
            for (var monitor in stats) {
                var settings = stats[monitor];
                if (!$('#stats #' + monitor).length) {
                    // create a new indicator
                    $container.append('<div id="' + monitor + '"><div class="row"><div class="col-sm-3"><strong class="title"></strong></div><div class="col-sm-1"><span class="value_text"></span></div><div class="col-sm-8"><div class="progress progress-striped active"><div class="progress-bar " role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width:0%"> </div></div></div></div></div>');
                }

                $.ajax({
                    dataType: "json",
                    url: settings.route,
                    data: null,
                    $indicator: $('#stats #' + monitor),
                    success: function (data) {
                        this.$indicator.find('.title').text(data.title);
                        this.$indicator.find('.value_text').text(data.value);
                        var level = ((data.value - data.min) / (data.max - data.min)) * 100;
                        this.$indicator.find('.progress-bar').css('width', level + '%');
                        var cls = 'progress-bar-success';
                        if (data.warning == true) {
                            cls = 'progress-bar-warning';
                        }
                        if (data.critical == true) {
                            cls = 'progress-bar-danger';
                        }
                        this.$indicator.find('.progress-bar').removeClass('progress-bar-success').removeClass('progress-bar-warning').removeClass('progress-bar-danger').addClass(cls);
                    }
                });

            }
        }
    </script>


    <h1>Live Dashboard</h1>
    <br/>

    <div id="stats">


    </div>

{% endblock %}

{'fraction_non_alphanumeric': 0.16388735505245722, 'fraction_numerical': 0.016565433462175594, 'mean_word_length': 1.6075439101641233, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 53, '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': '7372300', 'n_tokens_mistral': 2717, 'n_tokens_neox': 2482, 'n_words': 398}