<commit_before>{% extends 'layout.twig' %}
{% set title = ('Users'|trans ~ ': ' ~ 'STB statuses report '|trans ~ app.now_time) | trans %}

{% block content %}
    <style type="text/css">
        @media print{
            #datatable-1{
                max-width: 180mm;
            }
            #datatable-1 th, #datatable-1 td{
                max-width: 60mm;
            }
        }
    </style>
    <div id="iptv_list">
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                <div class="box">
                    <div class="box-content">
                        <div class="box-content no-padding">
                            <div class="row">
                                <div class="" id="table_container">
                                    <div class="dataTables_processing"></div>
                            <table class="table  table-hover table-datatable compact" id="datatable-1">
                                <thead>
                                    <tr>
                                        <th data-filter="rank">#</th>
                                        <th data-filter="mac">MAC</th>
                                        <th data-filter="status">{{ 'Status'|trans }}</th>
                                        <th data-filter="last_change_status">{{ 'Time'|trans }}</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {% if attribute(app, 'consoleReport') is defined %}
                                        <!-- Start: list_row -->
                                        {% for item in app.consoleReport %}
                                            <tr data-userid="{{ item.id }}">
                                                <td>{{ item.rank }}</td>
                                                <td><a href="{{ app.request.baseUrl }}/{{ app.controller_alias }}/edit-users?id={{ item.id }}" >{{ item.mac }}</a></td>
                                                <td data-filter="status">{% if item.status %}<span class="">{{ 'on'|trans }}</span>{% else %}<span class="">{{ 'off'|trans }}</span>{% endif %}</td>
                                                <td>{{ item.last_change_status|date('M d, Y H:i') }}</td>
                                            </tr>
                                        {% endfor %}
                                    {% endif %}
                                    <!-- End: list_row -->
                                </tbody>
                            </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript" defer>

        function TestTable1() {
            $('#datatable-1').on('xhr.dt', function (e, settings, json) {
                if (typeof (json.data) == 'object' && json.data.length >0) {
                    var date;
                    for (var i in json.data) {
                        var status = json.data[i].status;
                        var mac = json.data[i].mac;
                        var id = json.data[i].id;
                        json.data[i].mac = '<a href="{{ app.request.baseUrl }}/{{ app.controller_alias }}/edit-users?id='+ id +'" >'+ mac +'</a>';
                        json.data[i].status = (status != 0 ? "<span class=''>{{ 'on'|trans }}</span>" : "<span class=''>{{ 'off'|trans }}</span>");
                        date = json.data[i]['last_change_status'];
                        if (date > 0) {
                            date = new Date(date * 1000);
                            json.data[i]['last_change_status'] = date.toLocaleFormat("%b %d, %Y %H:%M");
                        }
                    }
                }
            }).dataTable({
                "processing": true,
                "serverSide": true,
                "dom": 'T<"clear">lfrtip',<commit_msg>Fix stb status (issue #5576)<commit_after>{% extends 'layout.twig' %}
{% set title = ('Users'|trans ~ ': ' ~ 'STB statuses report '|trans ~ app.now_time) | trans %}

{% block content %}
    <style type="text/css">
        @media print{
            #datatable-1{
                max-width: 180mm;
            }
            #datatable-1 th, #datatable-1 td{
                max-width: 60mm;
            }
        }
    </style>
    <div id="iptv_list">
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                <div class="box">
                    <div class="box-content">
                        <div class="box-content no-padding">
                            <div class="row">
                                <div class="" id="table_container">
                                    <div class="dataTables_processing"></div>
                            <table class="table  table-hover table-datatable compact" id="datatable-1">
                                <thead>
                                    <tr>
                                        <th data-filter="rank">#</th>
                                        <th data-filter="mac">MAC</th>
                                        <th data-filter="status">{{ 'Status'|trans }}</th>
                                        <th data-filter="last_change_status">{{ 'Time'|trans }}</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {% if attribute(app, 'consoleReport') is defined %}
                                        <!-- Start: list_row -->
                                        {% for item in app.consoleReport %}
                                            <tr data-userid="{{ item.id }}">
                                                <td>{{ item.rank }}</td>
                                                <td><a href="{{ app.request.baseUrl }}/{{ app.controller_alias }}/edit-users?id={{ item.id }}" >{{ item.mac }}</a></td>
                                                <td data-filter="status">{% if item.status %}<span class="">{{ 'on'|trans }}</span>{% else %}<span class="">{{ 'off'|trans }}</span>{% endif %}</td>
                                                <td>{{ item.last_change_status|date('M d, Y H:i') }}</td>
                                            </tr>
                                        {% endfor %}
                                    {% endif %}
                                    <!-- End: list_row -->
                                </tbody>
                            </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript" defer>

        function TestTable1() {
            $('#datatable-1').on('xhr.dt', function (e, settings, json) {
                if (typeof (json.data) == 'object' && json.data.length >0) {
                    var date;
                    for (var i in json.data) {
                        var status = json.data[i].status;
                        var mac = json.data[i].mac;
                        var id = json.data[i].id;
                        json.data[i].mac = '<a href="{{ app.request.baseUrl }}/{{ app.controller_alias }}/edit-users?id='+ id +'" >'+ mac +'</a>';
                        json.data[i].status = (status != 0 ? "<span class=''>{{ 'off'|trans }}</span>" : "<span class=''>{{ 'on'|trans }}</span>");
                        date = json.data[i]['last_change_status'];
                        if (date > 0) {
                            date = new Date(date * 1000);
                            json.data[i]['last_change_status'] = date.toLocaleFormat("%b %d, %Y %H:%M");
                        }
                    }
                }
            }).dataTable({
                "processing": true,
                "serverSide": true,
                "dom": 'T<"clear">lfrtip',
{'fraction_non_alphanumeric': 0.15125535823637476, 'fraction_numerical': 0.006858542559706062, 'mean_word_length': 0.8977457587729492, 'pattern_counts': {'":': 6, '<': 127, '<?xml version=': 0, '>': 131, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 68, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3829848', 'n_tokens_mistral': 2084, 'n_tokens_neox': 1928, 'n_words': 419}