<commit_before>{# Page: NavSecondary > Dashboard > Configuration > System Log #}

{% extends '@bolt/_base/_page-nav.twig' %}

{% block page_nav 'Settings/Configuration' %}

{% block page_title __('logs.system-log') %}

{% block page_main %}

    {% from '@bolt/_macro/_pager.twig' import pager %}
    {% from '@bolt/_buic/_moment.twig' import buic_moment %}
    {% import '@bolt/_macro/_macro.twig' as macro %}

    <div class="row">
        <div class="col-xs-12">

            <form class="form-inline">
                <div class="form-group">
                    <select class="form-control" name="level" id="level">
                        <option value="">-- Level --</option>
                        <option value="100">{{ 100|loglevel }}</option>
                        <option value="200">{{ 200|loglevel }}</option>
                        <option value="250">{{ 250|loglevel }}</option>
                        <option value="300">{{ 300|loglevel }}</option>
                        <option value="400">{{ 400|loglevel }}</option>
                        <option value="500">{{ 500|loglevel }}</option>
                        <option value="550">{{ 550|loglevel }}</option>
                        <option value="600">{{ 600|loglevel }}</option>
                    </select>
                </div>

                <div class="form-group">
                    <select class="form-control" name="context" id="context">
                        <option value="">-- Context --</option>
                        <option value="authentication">authentication</option>
                        <option value="config">config</option>
                        <option value="content">content</option>
                        <option value="cron">cron</option>
                        <option value="deprecated">deprecated</option>
                        <option value="exception">exception</option>
                        <option value="news">news</option>
                        <option value="nut">nut</option>
                        <option value="security">security</option>
                        <option value="storage">storage</option>
                        <option value="template">template</option>
                        <option value="translation">translation</option>
                        <option value="twig">twig</option>
                        <option value="upload">upload</option>
                    </select>
                </div>

                <button type="submit" class="btn btn-secondary"> <!-- href="{{ path('systemlog', {'action': 'trim'}) }}"> -->
                    <i class="fa fa-filter"></i> {{ __('general.phrase.filter') }}
                </button>

                <div class="btn-group pull-right" style="padding-bottom: 12px">
                    <a class="btn btn-default" href="{{ path('systemlog', {'action': 'trim'}) }}">
                        <i class="fa fa-trash-o"></i> {{ __('general.phrase.log-system-trim') }}
                    </a>
                    <a class="btn btn-default confirm" href="{{ path('systemlog', {'action': 'clear'}) }}" data-confirm="Are you sure you want to clear the system logs?">
                        <i class="fa fa-trash"></i> {{ __('general.phrase.clear-system-log') }}
                    </a>
                </div>
            </form>

            <table class="table table-striped dashboardlisting">
                <thead>
                    <tr>
                        <th>№</th>
                        <th>Type</th>
                        <th>Context</th>
                        <th>Route</th>
                        <th>URI</th>
                        <th>Details</th>
                        <th>User</th>
                        <th>IP</th>
                        <th>Date</th>
                    </tr>
                </thead>
                <tbody>
                {% for entry in context.entries %}
                    <tr>
                        <td>
                            {{ entry.id }}
                        </td>
                        <td>
                            {{ entry.level|loglevel }}
                        </td>
                        <td>
                            {{ entry.context }}
                        </td>
                        <td>
                            {{ entry.route }}
                        </td>
                        <td>
                            {{ entry.requesturi }}
                        </td>
                        <td>
                            {% spaceless %}
                            <b>{{ entry.message|raw }}</b>
                            {% if entry.source %}
                            <span class="info-pop pull-right" style="background-color: inherit !important;"
                                  data-content="{{ _self.trace_info_html(entry.source) }}"
                                  data-html="true" >
                                  <i class="fa fa-bug"></i>
                            </span>
                            {% endif %}
                            {% endspaceless %}
                        </td>
                        <td>
                            <em>{{ macro.userlink(entry.ownerid) }}</em>
                        </td>
                        <td>
                            {{ entry.ip }}
                        </td>
                        <td>
                            {{ buic_moment(entry.date) }}
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>

            {{ pager() }}

        </div>
    </div>

{% endblock page_main %}

{% macro trace_info_html(source) %}
    {% if source %}
        {% for key,value in source %}
            {{ key }}: {{ value }}<br>
        {% endfor %}
    {% endif %}
{% endmacro %}<commit_msg>Nicer listing overview for System Log.<commit_after>{# Page: NavSecondary > Dashboard > Configuration > System Log #}

{% extends '@bolt/_base/_page-nav.twig' %}

{% block page_nav 'Settings/Configuration' %}

{% block page_title __('logs.system-log') %}

{% block page_main %}

    {% from '@bolt/_macro/_pager.twig' import pager %}
    {% from '@bolt/_buic/_moment.twig' import buic_moment %}
    {% import '@bolt/_macro/_macro.twig' as macro %}

    <div class="row">
        <div class="col-xs-12">

            <form class="form-inline">
                <div class="form-group">
                    <select class="form-control" name="level" id="level">
                        <option value="">-- Level --</option>
                        <option value="100">{{ 100|loglevel }}</option>
                        <option value="200">{{ 200|loglevel }}</option>
                        <option value="250">{{ 250|loglevel }}</option>
                        <option value="300">{{ 300|loglevel }}</option>
                        <option value="400">{{ 400|loglevel }}</option>
                        <option value="500">{{ 500|loglevel }}</option>
                        <option value="550">{{ 550|loglevel }}</option>
                        <option value="600">{{ 600|loglevel }}</option>
                    </select>
                </div>

                <div class="form-group">
                    <select class="form-control" name="context" id="context">
                        <option value="">-- Context --</option>
                        <option value="authentication">authentication</option>
                        <option value="config">config</option>
                        <option value="content">content</option>
                        <option value="cron">cron</option>
                        <option value="deprecated">deprecated</option>
                        <option value="exception">exception</option>
                        <option value="news">news</option>
                        <option value="nut">nut</option>
                        <option value="security">security</option>
                        <option value="storage">storage</option>
                        <option value="template">template</option>
                        <option value="translation">translation</option>
                        <option value="twig">twig</option>
                        <option value="upload">upload</option>
                    </select>
                </div>

                <button type="submit" class="btn btn-secondary"> <!-- href="{{ path('systemlog', {'action': 'trim'}) }}"> -->
                    <i class="fa fa-filter"></i> {{ __('general.phrase.filter') }}
                </button>

                <div class="btn-group pull-right" style="padding-bottom: 12px">
                    <a class="btn btn-default" href="{{ path('systemlog', {'action': 'trim'}) }}">
                        <i class="fa fa-trash-o"></i> {{ __('general.phrase.log-system-trim') }}
                    </a>
                    <a class="btn btn-default confirm" href="{{ path('systemlog', {'action': 'clear'}) }}" data-confirm="Are you sure you want to clear the system logs?">
                        <i class="fa fa-trash"></i> {{ __('general.phrase.clear-system-log') }}
                    </a>
                </div>
            </form>

            <table class="table table-striped dashboardlisting">
                <thead>
                    <tr>
                        <th>№</th>
                        <th>Type</th>
                        <th>Context</th>
                        <th>Route</th>
                        <th>URI / Details</th>
                        <th>User / IP / Date</th>
                    </tr>
                </thead>
                <tbody>
                {% for entry in context.entries %}
                    <tr>
                        <td>
                            {{ entry.id }}
                        </td>
                        <td>
                            {{ entry.level|loglevel }}
                        </td>
                        <td>
                            {{ entry.context }}
                        </td>
                        <td>
                            {{ entry.route }}
                        </td>
                        <td>

                            {{ entry.message|raw }} <a onclick="$(this).hide(); $('#trace-source-{{ entry.id }}').removeClass('hide');" class="btn btn-default btn-xs"><i class="fa fa-bug"></i> Source</a> <br>

                            <span id="trace-source-{{ entry.id }}" class="hide">
                            {% if entry.requesturi %}
                               <span class="dim"><strong>URI:</strong> <code>{{ entry.requesturi }}</code></span><br>
                            {% endif %}
                            {% if entry.source %}
                               <span class="dim"><strong>Source:</strong> <code>{{ entry.source.file }} :: {{ entry.source.line }} </code></span>
                            {% endif %}
                            </span>
                        </td>
                        <td class="username">
                            {{ macro.userlink(entry.ownerid) }} / {{ entry.ip }} <br>
                            {{ buic_moment(entry.date) }}
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>

            {{ pager() }}

        </div>
    </div>

{% endblock page_main %}
{'fraction_non_alphanumeric': 0.15234340779675865, 'fraction_numerical': 0.009110819097678493, 'mean_word_length': 1.0832116788321169, 'pattern_counts': {'":': 0, '<': 267, '<?xml version=': 0, '>': 275, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3815309', 'n_tokens_mistral': 3006, 'n_tokens_neox': 2645, 'n_words': 536}