<commit_before>{% extends "backend/common/layout.html" %}
{% block rule_active %}active{% endblock %}
{% block nav_first %}Dashboards{% endblock %}
{% block nav_second %}{{ data.title }}{% endblock %}
{% block body %}
    <hr class="aky">
    <form role="form">
        <input type="hidden" name="type" value="{{ data.type }}">
        <input type="hidden" name="id" value="{{ data.id }}">
        <div class="aon hb">
            <label for="title">Name</label>
            <input type="text" class="form-control" name="name" value="{{ data.rule.description }}" placeholder="Rule name">
        </div>
        <div class="gd">
            <label for="author">Author</label>
            <input type="text" class="form-control" name="author" value="{{ data.rule.author }}" placeholder="Rule author"/>
        </div>
        <div class="aon gp">
            <label for="vul_type">Vulnerability type</label>
            <select id="vul_type" class="form-control">
                {% for vul in data.all_vuls %}
                    <option value="{{ vul.id }}" {% if vul.id == data.rule.vul_id %}selected{% endif %}>
                        {{ vul.name }}
                    </option>
                {% endfor %}
            </select>
        </div>
        <div class="aon gp">
            <label for="language">Language</label>
            <select id="language" class="form-control">
                {% for lang in data.all_lang %}
                    <option value="{{ lang.id }}" {% if lang.id == data.rule.language %}selected{% endif %}>
                        {{ lang.language }} ({{ lang.extensions }})
                    </option>
                {% endfor %}
            </select>
        </div>
        <div class="aon gh">
            <label for="status">Status</label>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="status" value="1" {% if data.rule.status == 1 %}checked{% endif %}>
                    <span class="aoc"></span>
                    On
                </label>
            </div>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="status" value="0" {% if data.rule.status == 0 %}checked{% endif %}>
                    <span class="aoc"></span>
                    Off
                </label>
            </div>
        </div>
        <div class="aon gh">
            <label>Repair block</label>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="repair-block" value="0" {% if data.rule.block_repair == 0 %}checked{% endif %}>
                    <span class="aoc"></span>
                    Function up
                </label>
            </div>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="repair-block" value="2" {% if data.rule.block_repair == 2 %}checked{% endif %}>
                    <span class="aoc"></span>
                    Current line
                </label>
            </div>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="repair-block" value="1" {% if data.rule.block_repair == 1 %}checked{% endif %}>
                    <span class="aoc"></span>
                    Function down
                </label>
            </div>
        </div>
        <div class="aon gh">
            <label>Level</label>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="level" value="1" {% if data.rule.level == 1 %}checked{% endif %}>
                    <span class="aoc"></span>
                    Low
                </label>
            </div>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="level" value="2" {% if data.rule.level == 2 %}checked{% endif %}>
                    <span class="aoc"></span>
                    Medium
                </label>
            </div>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="level" value="3" {% if data.rule.level == 3 %}checked{% endif %}>
                    <span class="aoc"></span>
                    High
                </label>
            </div>
        </div>
        <div class="aon gp">
            <label for="regex-location">Regex location</label>
            <textarea class="form-control" id="regex-location">{{ data.rule.regex_location }}</textarea>
        </div>
        <div class="aon gp">
            <label for="regex-repair">Regex repair</label>
            <textarea class="form-control" id="regex-repair">{{ data.rule.regex_repair }}</textarea>
        </div>
        <div class="aon hn">
            <label for="repair">Repair</label>
            <textarea class="form-control" rows="4" id="repair">{{ data.rule.repair }}</textarea>
        </div>
        <div class="aon hn">
            <label for="repair">Verify <a href="http://cobra-docs.readthedocs.io/en/latest/rule/" target="_blank">
                <span class="bv abu" data-toggle="tooltip" data-placement="right" data-container="body" data-original-title="Click view rule verify detail"></span></a></label>
            <textarea class="form-control" rows="6" id="verify">{{ data.rule.verify }}</textarea>
        </div>
        <hr class="aky">
        <div class="aon hj akg">
            <div class="akh aki">
                <button type="button" name="submit" class="ce apk fh">Edit</button>
            </div>
            <div class="akh">
                <button class="ce fh apr delete-rule" type="button">
                    <span class="bv xm"></span> Delete
                </button>
            </div>
        </div>
    </form>
{% endblock %}
{% block scripts %}
    <script>
        var app = {
            id: $('input[name=id]').val(),<commit_msg>improves<commit_after>{% extends "backend/common/layout.html" %}
{% block rule_active %}active{% endblock %}
{% block nav_first %}Dashboards{% endblock %}
{% block nav_second %}{{ data.title }}{% endblock %}
{% block body %}
    <hr class="aky">
    <form role="form">
        <input type="hidden" name="type" value="{{ data.type }}">
        <input type="hidden" name="id" value="{{ data.id }}">
        <div class="aon hb">
            <label for="title">Name</label>
            <input type="text" class="form-control" name="name" value="{{ data.rule.description }}" placeholder="Rule name">
        </div>
        <div class="gd">
            <label for="author">Author</label>
            <input type="text" class="form-control" name="author" value="{{ data.rule.author }}" placeholder="Rule author"/>
        </div>
        <div class="aon gp">
            <label for="vul_type">Vulnerability type</label>
            <select id="vul_type" class="form-control">
                {% for vul in data.all_vuls %}
                    <option value="{{ vul.id }}" {% if vul.id == data.rule.vul_id %}selected{% endif %}>
                        {{ vul.name }}
                    </option>
                {% endfor %}
            </select>
        </div>
        <div class="aon gp">
            <label for="language">Language</label>
            <select id="language" class="form-control">
                {% for lang in data.all_lang %}
                    <option value="{{ lang.id }}" {% if lang.id == data.rule.language %}selected{% endif %}>
                        {{ lang.language }} ({{ lang.extensions }})
                    </option>
                {% endfor %}
            </select>
        </div>
        <div class="aon gh">
            <label for="status">Status</label>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="status" value="1" {% if data.rule.status == 1 %}checked{% endif %}>
                    <span class="aoc"></span>
                    On
                </label>
            </div>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="status" value="0" {% if data.rule.status == 0 %}checked{% endif %}>
                    <span class="aoc"></span>
                    Off
                </label>
            </div>
        </div>
        <div class="aon gh">
            <label>Repair block</label>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="repair-block" value="0" {% if data.rule.block_repair == 0 %}checked{% endif %}>
                    <span class="aoc"></span>
                    Function up
                </label>
            </div>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="repair-block" value="2" {% if data.rule.block_repair == 2 %}checked{% endif %}>
                    <span class="aoc"></span>
                    Current line
                </label>
            </div>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="repair-block" value="1" {% if data.rule.block_repair == 1 %}checked{% endif %}>
                    <span class="aoc"></span>
                    Function down
                </label>
            </div>
        </div>
        <div class="aon gh">
            <label>Level</label>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="level" value="1" {% if data.rule.level == 1 %}checked{% endif %}>
                    <span class="aoc"></span>
                    Low
                </label>
            </div>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="level" value="2" {% if data.rule.level == 2 %}checked{% endif %}>
                    <span class="aoc"></span>
                    Medium
                </label>
            </div>
            <div class="em aob aog">
                <label>
                    <input type="radio" name="level" value="3" {% if data.rule.level == 3 %}checked{% endif %}>
                    <span class="aoc"></span>
                    High
                </label>
            </div>
        </div>
        <div class="aon gp">
            <label for="regex-location">Regex location</label>
            <textarea class="form-control" id="regex-location">{{ data.rule.regex_location }}</textarea>
        </div>
        <div class="aon gp">
            <label for="regex-repair">Regex repair</label>
            <textarea class="form-control" id="regex-repair">{{ data.rule.regex_repair }}</textarea>
        </div>
        <div class="aon hn">
            <label for="repair">Verify <a href="http://cobra-docs.readthedocs.io/en/latest/rule/" target="_blank">
                <span class="bv abu" data-toggle="tooltip" data-placement="right" data-container="body" data-original-title="Click view rule verify detail"></span></a></label>
            <textarea class="form-control" rows="6" id="verify">{{ data.rule.verify }}</textarea>
        </div>
        <div class="aon hn">
            <label for="repair">Repair</label>
            <textarea class="form-control" rows="4" id="repair">{{ data.rule.repair }}</textarea>
        </div>
        <hr class="aky">
        <div class="aon hj akg">
            <div class="akh aki">
                <button type="button" name="submit" class="ce apk fh">Edit</button>
            </div>
            <div class="akh">
                <button class="ce fh apr delete-rule" type="button">
                    <span class="bv xm"></span> Delete
                </button>
            </div>
        </div>
    </form>
{% endblock %}
{% block scripts %}
    <script>
        var app = {
            id: $('input[name=id]').val(),
{'fraction_non_alphanumeric': 0.16775285653829877, 'fraction_numerical': 0.003046974185357596, 'mean_word_length': 1.5156482861400895, 'pattern_counts': {'":': 0, '<': 285, '<?xml version=': 0, '>': 285, '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': '5199126', 'n_tokens_mistral': 3509, 'n_tokens_neox': 3216, 'n_words': 767}