{% extends 'base.html' %}

{% block content %}
    <h1>Device {{ device.device_id.device_uuid.uuid }}</h1>

    <div class="row mb-3">
        <b>UUID:</b>
        <div class="col-sm-10">
            {{ device.device_id.device_uuid.uuid }}
        </div>
    </div>
    <div class="row mb-3">
        <b>Type:</b>
        <div class="col-sm-10">
            {{ device.device_type }}
        </div>
    </div>
    <div class="row mb-3">
        <b>Configurations:</b>
        <div class="col-sm-10">
            <ul>
            {% for config in device.device_config.config_rules %}
                <li>{{ config.resource_key }}: {{ config.resource_value }}</li>
            {% endfor %}
            </ul>
        </div>
    </div>
    <div class="row mb-3">
        <b>Endpoints:</b>
        <div class="col-sm-10">
            <ul>
            {% for endpoint in device.device_endpoints %}
                <li>{{ endpoint.endpoint_id.endpoint_uuid.uuid }}: {{ endpoint.endpoint_type }}</li>
            {% endfor %}
            </ul>
        </div>
    </div>

    <div class="row mb-3"><button type="button" class="btn btn-success" onclick="window.location.href = '/device/'"><i class="bi bi-box-arrow-in-left"></i>Back to device list</button></div>

{% endblock %}