{% extends "fmd_base.html" %}
{% block content %}

    <div class="card mb-3">
        <div class="card-header"><h4>Configuration settings</h4></div>
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-striped table-bordered table-hover">
                    <tr>
                        <td style="width: 50%"><b>Dashboard link</b></td>
                        <td><a href="{{ url_for('dashboard.index') }}">/{{ details.link }}</a></td>
                    </tr>
                    <tr>
                        <td><b>Measurements database</b></td>
                        <td>{{ config.database_name }}</td>
                    </tr>
                    <tr>
                        <td><b>Location of tests of monitored app</b></td>
                        <td>{{ config.test_dir if config.test_dir != None else "Unspecified" }}</td>
                    </tr>
                    <tr>
                        <td><b>Username</b></td>
                        <td>{{ config.username }}</td>
                    </tr>
                    <tr>
                        <td><b>Password</b></td>
                        <td>{{ '*' * config.password|length }}</td>
                    </tr>
                    <tr>
                        <td><b>Guest username</b></td>
                        <td>{{ config.guest_username }}</td>
                    </tr>
                    <tr>
                        <td><b>Guest password</b></td>
                        <td>{{ config.guest_password }}</td>
                    </tr>
                    <tr>
                        <td><b>Collecting outlier data?</b></td>
                        <td>{% if config.outliers_enabled %}
                            Yes, with outlier_detection_constant = {{ config.outlier_detection_constant }}
                        {% else %}No
                        {% endif %}</td>
                    </tr>
                    <tr>
                        <td><b>Security token</b></td>
                        <td>{{ '*' * config.security_token|length }}</td>
                    </tr>
                    <tr>
                        <td><b>Custom endpoint colors</b></td>
                        <td>{% for key, value in config.colors.items() %}
                            {{ key }}: {{ value }}<br/>
                        {% endfor %}</td>
                    </tr>
                    <tr>
                        <td><b>User specified timezone</b></td>
                        <td>{{ config.timezone }}</td>
                    </tr>
                </table>
            </div>
        </div>
    </div>

    <div class="card mb-3">
        <div class="card-header"><h4>Deployment details</h4></div>
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-striped table-bordered table-hover">
                    <tr>
                        <td style="width: 50%"><b>Currently deployed version</b></td>
                        <td>{{ details['config-version'] }}</td>
                    </tr>
                    <tr>
                        <td><b>First request in the currently deployed version</b></td>
                        <td>{{ details['first-request-version'] }}</td>
                    </tr>
                    <tr>
                        <td><b>Monitoring Dashboard version</b></td>
                        <td>{{ details['dashboard-version'] }}</td>
                    </tr>
                    <tr>
                        <td><b>First request since using the Monitoring Dashboard</b></td>
                        <td>{{ details['first-request'] }}</td>
                    </tr>
                    <tr>
                        <td><b>Total amount of monitored requests</b></td>
                        <td>{{ "{:,d}".format(details['total-requests']) }}</td>
                    </tr>
                </table>
            </div>
        </div>
    </div>

{% endblock %}
