{% extends 'generic/object.html' %}
{% load helpers %}
{% load plugins %}
{% load settings %}
{% load render_table from django_tables2 %}
{% load perms %}

{% block controls %}
{{ block.super }}
{% endblock controls %}

{% block breadcrumbs %}
{{ block.super }}
{% endblock %}

{% block tabs %}
{{ block.super }}
{% endblock %}

{% block content %}
<div class="row">
    <div class="col">
        <div class="card">
            <h5 class="card-header">App Environment</h5>
            <div class="card-body">
                <table class="table table-hover attr-table">
                    <tr>
                        <th scope="row">App env</th>
                        <td>{{ object.app_env }}</td>
                    </tr>
                    <tr>
                        <th scope="row">MTLS</th>
                        <td>{{ object.mtls }}</td>
                    </tr>
                    <tr>
                        <th scope="row">Repo</th>
                        <td><a href="{{ object.repo }}">{{ object.repo }}</a></td>
                    </tr>
                    <tr>
                        <th scope="row">Branch</th>
                        <td>{{ object.branch }}</td>
                    </tr>
                    <tr>
                        <th scope="row">Path</th>
                        <td>{{ object.path }}</td>
                    </tr>
                    <tr>
                        <th scope="row">Egress IP</th>
                        <td>{{ object.egress_ip }}</td>
                    </tr>
                    <tr>
                        <th scope="row">Deployment Kind</th>
                        <td>{{ object.deployment_kind }}</td>
                    </tr>
                    <tr>
                        <th scope="row">Monitoring</th>
                        <td>{{ object.monitoring }}</td>
                    </tr>
                    <tr>
                        <th scope="row">Postgres Monitoring</th>
                        <td>{{ object.postgres_monitoring }}</td>
                    </tr>
                    <tr>
                        <th scope="row">OCP Project</th>
                        <td>{{ object.ocp_project|linkify|placeholder }}</td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <div class="col">
        <div class="card">
            <h5 class="card-header">Resource Quota</h5>
            <div class="card-body">
                <table class="table table-hover attr-table">
                    <tr class="table-active">
                        <th scope="row" colspan="2">Limits</th>
                    </tr>
                    <tr>
                        <th scope="row">CPU</th>
                        <td>{{ object.limits_cpu|placeholder }}</td>
                    </tr>
                    <tr>
                        <th scope="row">Limits</th>
                        <td>{{ object.limits_memory.value|placeholder }}</td>
                    </tr>
                    <tr class="table-active">
                        <th scope="row" colspan="2">Requests</th>
                    </tr>
                    <tr>
                        <th scope="row">Requests</th>
                        <td>{{ object.requests_cpu|placeholder }}</td>
                    </tr>
                    <tr>
                        <th scope="row">Requests</th>
                        <td>{{ object.requests_memory|placeholder }}</td>
                    </tr>
                    <tr>
                        <td colspan="2"><a href="{{ object.repo }}">Resource Quota OCP</a></td>
                    </tr>
                </table>
            </div>
        </div>
        <div class="card">
            <h5 class="card-header">Price Table</h5>
            <div class="card-body">
                <table class="table table-hover attr-table">
                    <tr class="table-active">
                        <th scope="row">Element</th>
                        <th scope="row">Amount</th>
                        <th scope="row">Total</th>
                    </tr>
                    <tr>
                        <td>CPU</td>
                        <td>{{ object.limits_cpu|placeholder }}</td>
                        <td>{% get_cpu_cost object.limits_cpu %} Franken</td>
                    </tr>
                    <tr>
                        <th scope="row">Memory</th>
                        <td>{{ object.limits_memory|placeholder }}</td>
                        <td> Franken</td>
                    </tr>
                    <tr>
                        <th scope="row">Storage</th>
                        <td>-</td>
                        <td>-</td>
                    </tr>
                    <tr class="table-info">
                        <td>Total (CHF)</td>
                        <td></td>
                        <td>5000</td>
                    </tr>
                </table>
            </div>
        </div>
        {% include 'inc/panels/custom_fields.html' %}
    </div>
</div>

{% endblock %}
