<commit_before>{% extends 'base.html' %}


{% block content %}

<h1>Apache Logs</h1>

<div class="col-sm-12">
    <div class="help-button">
        <button class="js-fr-offcanvas-open" aria-controls="help_box">
            <i class="fa fa-question-circle" aria-hidden="true"></i>
            Help
        </button>
    </div>
</div>

<div class="clear-float"></div>
<h2>Anomaly Detection Configuration</h2>

<div class="clear-float"></div>
<h3>Categorize data</h3>

<div class="col-sm-12">
    <div class="action-buttons-right">
        <form class="pure-form" method="post" action="{% url 'apache:configure_anomaly_detection_correct_sessions_marks_automatically_mark_anomalies' %}">
            {% csrf_token %}
            
            <input type="hidden" name="agent_name" value="{{ agent_name }}">
            <input type="hidden" name="virtualhost_name" value="{{ virtualhost_name }}">
    
            <button type="submit" class="pure-button pure-button-primary">
                <i class="fa fa-magic" aria-hidden="true"></i>
                Automatically mark sessions as anomalies
            </button>
        </form>
    </div>
    
    <form class="pure-form" method="post" action="{% url 'apache:configure_anomaly_detection_save_settings' %}">
        {% csrf_token %}
        
        <input type="hidden" name="agent_name" value="{{ agent_name }}">
        <input type="hidden" name="virtualhost_name" value="{{ virtualhost_name }}">

        <div class="scrollable">
            <table class="table custab">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>IP</th>
                        <th>Session start</th>
                        <th>Session length (s)</th>
                        <th>Bandwidth usage (bytes)</th>
                        <th>Requests count</th>
                        <th>Error requests (%)</th>
                        <th>User-Agent</th>
                        <th>Is anomaly</th>
                    </tr>
                </thead>
    
                <tbody>
                {% for s in sessions %}
                    <tr id="table_row_{{ s.id }}"
                        {% if s.classification == CLASSIFICATION_ANOMALY %}
                            class="analysis_results_row_anomaly"
                        {% elif s.classification == CLASSIFICATION_NORMAL %}
                            class="analysis_results_row_normal"
                        {% elif s.classification == CLASSIFICATION_UNKNOWN %}
                            class="analysis_results_row_unknown"
                        {% endif %}
                    >
                        <td>{{ s.id }}</td>
                        <td>{{ s.client_ip }}</td>
                        <td>{{ s.session_start }}</td>
                        <td>{{ s.session_length }}</td>
                        <td>{{ s.bandwidth_usage }}</td>
                        <td>{{ s.requests_count }}</td>
                        <td>{{ s.error_percentage | floatformat }}</td>
                        <td>{{ s.useragent }}</td>
                        <td>
                            <input type="hidden" name="rows_ids" value="{{ s.id }}">
                            <input id="table_check_button_{{ s.id }}" type="checkbox" name="checks" value="{{ s.id }}"
                             {% if s.classification == CLASSIFICATION_ANOMALY %}
                                checked="checked" 
                             {% endif %}
                                onclick="change_table_row_color({{ s.id }})"
                             >
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
            </div>

        <p class="action-buttons-left">
            <button type="submit" class="pure-button button-success">
                <i class="fa fa-check" aria-hidden="true"></i>
                Done
            </button>
        </p>
    </form>
</div>

<section class="fr-offcanvas fr-offcanvas--right js-fr-offcanvas slas-offcanvas" id="help_box">
    <p>
        Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim <a href="#">ipsam voluptatem</a> quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor.
    </p>
    <p>
        Sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem <a href="#">ullam corporis suscipit</a> laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
    </p>
    <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa, sunt modi! Nobis ab quia soluta, perspiciatis <a href="#">laudantium eveniet</a> quaerat sed, quod hic debitis earum repellendus optio, inventore ex facere possimus.
    </p>
    <button class="fr-offcanvas-close js-fr-offcanvas-close">
        <i class="fa fa-times" aria-hidden="true"></i>
        Close
    </button>
</section>

{% endblock %}
<commit_msg>Update Apache config page template<commit_after>{% extends 'base.html' %}


{% block content %}

<h1>Apache Logs</h1>

<div class="col-sm-12">
    <div class="help-button">
        <button class="js-fr-offcanvas-open" aria-controls="help_box">
            <i class="fa fa-question-circle" aria-hidden="true"></i>
            Help
        </button>
    </div>
</div>

<div class="clear-float"></div>
<h2>Anomaly Detection Configuration</h2>

<div class="clear-float"></div>
<h3>Categorize data</h3>

<div class="col-sm-12">
    <div class="action-buttons-right">
        <form class="pure-form" method="post" action="{% url 'apache:configure_anomaly_detection_correct_sessions_marks_automatically_mark_anomalies' %}">
            {% csrf_token %}

            <input type="hidden" name="agent_name" value="{{ agent_name }}">
            <input type="hidden" name="virtualhost_name" value="{{ virtualhost_name }}">

            <button type="submit" class="pure-button pure-button-primary">
                <i class="fa fa-magic" aria-hidden="true"></i>
                Automatically mark sessions as anomalies
            </button>
        </form>
    </div>
</div>
    
<div class="col-sm-12">
    <form class="pure-form" method="post" action="{% url 'apache:configure_anomaly_detection_save_settings' %}">
        {% csrf_token %}

        <input type="hidden" name="agent_name" value="{{ agent_name }}">
        <input type="hidden" name="virtualhost_name" value="{{ virtualhost_name }}">

        <div class="scrollable">
            <table class="table custab">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>IP</th>
                        <th>Session start</th>
                        <th>Session length (s)</th>
                        <th>Bandwidth usage (bytes)</th>
                        <th>Requests count</th>
                        <th>Error requests (%)</th>
                        <th>User-Agent</th>
                        <th>Is anomaly</th>
                    </tr>
                </thead>

                <tbody>
                {% for s in sessions %}
                    <tr id="table_row_{{ s.id }}"
                        {% if s.classification == CLASSIFICATION_ANOMALY %}
                            class="analysis_results_row_anomaly"
                        {% elif s.classification == CLASSIFICATION_NORMAL %}
                            class="analysis_results_row_normal"
                        {% elif s.classification == CLASSIFICATION_UNKNOWN %}
                            class="analysis_results_row_unknown"
                        {% endif %}
                    >
                        <td>{{ s.id }}</td>
                        <td>{{ s.client_ip }}</td>
                        <td>{{ s.session_start }}</td>
                        <td>{{ s.session_length }}</td>
                        <td>{{ s.bandwidth_usage }}</td>
                        <td>{{ s.requests_count }}</td>
                        <td>{{ s.error_percentage | floatformat }}</td>
                        <td>{{ s.useragent }}</td>
                        <td>
                            <input type="hidden" name="rows_ids" value="{{ s.id }}">
                            <input id="table_check_button_{{ s.id }}" type="checkbox" name="checks" value="{{ s.id }}"
                             {% if s.classification == CLASSIFICATION_ANOMALY %}
                                checked="checked"
                             {% endif %}
                                onclick="change_table_row_color({{ s.id }})"
                             >
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
            </div>

        <p class="action-buttons-left">
            <button type="submit" class="pure-button button-success">
                <i class="fa fa-check" aria-hidden="true"></i>
                Done
            </button>
        </p>
    </form>
</div>

<section class="fr-offcanvas fr-offcanvas--right js-fr-offcanvas slas-offcanvas" id="help_box">
    <p>
        Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim <a href="#">ipsam voluptatem</a> quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor.
    </p>
    <p>
        Sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem <a href="#">ullam corporis suscipit</a> laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
    </p>
    <p>
        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa, sunt modi! Nobis ab quia soluta, perspiciatis <a href="#">laudantium eveniet</a> quaerat sed, quod hic debitis earum repellendus optio, inventore ex facere possimus.
    </p>
    <button class="fr-offcanvas-close js-fr-offcanvas-close">
        <i class="fa fa-times" aria-hidden="true"></i>
        Close
    </button>
</section>

{% endblock %}

{'fraction_non_alphanumeric': 0.12701301064507325, 'fraction_numerical': 0.0020016377035756527, 'mean_word_length': 1.7356893977103036, 'pattern_counts': {'":': 0, '<': 221, '<?xml version=': 0, '>': 221, 'https://': 0, 'lorem ipsum': 2, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7396504', 'n_tokens_mistral': 3372, 'n_tokens_neox': 3099, 'n_words': 775}