<!--
    Copyright 2022-2024 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
   
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
   
         http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
   -->

{% extends 'base.html' %}

{% block content %}
<div class="row mb-3">
    <div class="col-sm-3">
        <button type="button" class="btn btn-success" onclick="window.location.href='{{ url_for('base_optical.home') }}'">
            <i class="bi bi-box-arrow-in-left"></i>
            Back to link list
        </button>
    </div>
   
</div>
{% for link in optical_links %}
<h1>Link : {{ link.name }} </h1>


<br>
<div class="row mb-3">
    <div class="col-sm-4">
        <b>UUID: </b>{{ link.link_id.link_uuid.uuid }}<br>
    
    </div>
    <div class="col-sm-8">
        <table class="table table-striped table-hover">
            <thead>
                <tr>
                    <th scope="col">Endpoint UUID</th>
                  
                    <th scope="col">Device UUID </th>
                  
                </tr>
            </thead>
            <tbody>
                {% for endpoint in link.link_endpoint_ids %}
                <tr>
                    <td>
                        {{ endpoint.endpoint_uuid.uuid }}
                    </td>
                   
                    <td>
                        {{endpoint.device_id.device_uuid.uuid}}
                        
                    </td>
         
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</div>



<b>Optical Link Detail:</b>
<table class="table table-striped table-hover">
    <thead>
        <tr>
            <th scope="col">Key</th>
            <th scope="col">Value</th>
        </tr>
    </thead>
    <tbody>
        {% for field_descriptor, field_value in link.optical_details.items() %}
          
            <tr>
               
                <td>
                    {{ field_descriptor }}
                </td>
                <td>
                    {{ field_value }}
                </td>
            </tr>
            
        {% endfor %}
       
        {%if l_slots %}
        <tr>
            <td>
                l_slots
            </td>
            <td>
                {{ l_slots }}
            </td>
        </tr>
        {%endif%}
        {%if s_slots %}
        <tr>
            <td>
                s_slots
            </td>
            <td>
                {{ s_slots }}
            </td>
        </tr>
        {%endif%}
    </tbody>
</table>

{% endfor %}
<!-- Modal -->


{% endblock %}
