Commit 4e5c8f3a authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

WebUI component:

- minor formatting in service page
- minor formatting in slice service page
parent 2d1eb2fc
Loading
Loading
Loading
Loading
+30 −43
Original line number Diff line number Diff line
@@ -26,18 +26,20 @@
            Back to service list
        </button>
    </div>
    <!--
    <div class="col-sm-3">
        <a id="update" class="btn btn-secondary" href="#">
            <i class="bi bi-pencil-square"></i>
            Update
        </a>
    </div>
    <div class="col-sm-3">
    <div class="col-sm-3">-->
        <!-- <button type="button" class="btn btn-danger"><i class="bi bi-x-square"></i>Delete service</button> -->
        <button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#deleteModal">
        <!--<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#deleteModal">
            <i class="bi bi-x-square"></i>Delete service
        </button>
    </div>
    -->
</div>

<div class="row mb-3">
@@ -91,66 +93,51 @@
        {% for constraint in service.service_constraints %}
        {% if constraint.WhichOneof('constraint')=='custom' %}
        <tr>
            <td>
                Custom
            </td>
            <td>
                {{ constraint.custom.constraint_type }}
            </td>
            <td>
                <ul>
                    {{ constraint.custom.constraint_value }}
                </ul>
            </td>
            <td>Custom</td>
            <td>{{ constraint.custom.constraint_type }}</td>
            <td>{{ constraint.custom.constraint_value }}</td>
        </tr>
        {% endif %}
        {% if constraint.WhichOneof('constraint')=='endpoint_location' %}
        {% elif constraint.WhichOneof('constraint')=='endpoint_location' %}
        <tr>
            <td>
                Endpoint Location
            </td>
            <td>Endpoint Location</td>
            <td>
                {{ constraint.endpoint_location.endpoint_id.device_id.device_uuid.uuid }} / {{
                constraint.endpoint_location.endpoint_id.endpoint_uuid.uuid }}
            </td>
            <td>
                <ul>
                    {{ constraint.endpoint_location.location }}
                </ul>
                {% if constraint.endpoint_location.location.WhichOneof('location')=='region' %}
                    Region: {{ constraint.endpoint_location.location.region }}
                {% elif constraint.endpoint_location.location.WhichOneof('location')=='gps_position' %}
                    Position (lat/long):
                    {{ constraint.endpoint_location.location.gps_position.latitude }} /
                    {{ constraint.endpoint_location.location.gps_position.longitude }}
                {% endif %}
            </td>
        </tr>
        {% endif %}
        {% if constraint.WhichOneof('constraint')=='endpoint_priority' %}
        {% elif constraint.WhichOneof('constraint')=='endpoint_priority' %}
        <tr>
            <td>
                Endpoint Priority
            </td>
            <td>Endpoint Priority</td>
            <td>
                {{ constraint.endpoint_priority.endpoint_id.device_id.device_uuid.uuid }} / {{
                constraint.endpoint_priority.endpoint_id.endpoint_uuid.uuid }}
            </td>
            <td>
                <ul>
                    {{ constraint.endpoint_priority.priority }}
                </ul>
            </td>
            <td>{{ constraint.endpoint_priority.priority }}</td>
        </tr>
        {% endif %}
        {% if constraint.WhichOneof('constraint')=='sla_availability' %}
        {% elif constraint.WhichOneof('constraint')=='sla_availability' %}
        <tr>
            <td>SLA Availability</td>
            <td>-</td>
            <td>
                SLA Availability
            </td>
            <td>
                /
            </td>
            <td>
                <ul>
                    <li> num_disjoint_paths: {{ constraint.sla_availability.num_disjoint_paths }} </li>
                    <li> all_active: {{ constraint.sla_availability.all_active }} </li>
                </ul>
                {{ constraint.sla_availability.num_disjoint_paths }} disjoint paths;
                {% if constraint.sla_availability.all_active %}all{% else %}single{% endif %}active
            </td>
        </tr>
        {% else %}
        <tr>
            <td>-</td>
            <td>-</td>
            <td>{{ constraint }}</td>
        </tr>
        {% endif %}
        {% endfor %}
    </tbody>
+144 −144
Original line number Diff line number Diff line
@@ -26,7 +26,22 @@
            Back to slice list
        </button>
    </div>
    <!--
    <div class="col-sm-3">
        <a id="update" class="btn btn-secondary" href="#">
            <i class="bi bi-pencil-square"></i>
            Update
        </a>
    </div>
    <div class="col-sm-3">-->
        <!-- <button type="button" class="btn btn-danger"><i class="bi bi-x-square"></i>Delete slice</button> -->
        <!--<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#deleteModal">
            <i class="bi bi-x-square"></i>Delete slice
        </button>
    </div>
    -->
</div>

<div class="row mb-3">
    <div class="col-sm-4">
        <b>UUID: </b> {{ slice.slice_id.slice_uuid.uuid }}<br><br>
@@ -77,66 +92,51 @@
        {% for constraint in slice.slice_constraints %}
        {% if constraint.WhichOneof('constraint')=='custom' %}
        <tr>
            <td>
                Custom
            </td>
            <td>
                {{ constraint.custom.constraint_type }}
            </td>
            <td>
                <ul>
                    {{ constraint.custom.constraint_value }}
                </ul>
            </td>
            <td>Custom</td>
            <td>{{ constraint.custom.constraint_type }}</td>
            <td>{{ constraint.custom.constraint_value }}</td>
        </tr>
        {% endif %}
        {% if constraint.WhichOneof('constraint')=='endpoint_location' %}
        {% elif constraint.WhichOneof('constraint')=='endpoint_location' %}
        <tr>
            <td>
                Endpoint Location
            </td>
            <td>Endpoint Location</td>
            <td>
                {{ constraint.endpoint_location.endpoint_id.device_id.device_uuid.uuid }} / {{
                constraint.endpoint_location.endpoint_id.endpoint_uuid.uuid }}
            </td>
            <td>
                <ul>
                    {{ constraint.endpoint_location.location }}
                </ul>
                {% if constraint.endpoint_location.location.WhichOneof('location')=='region' %}
                    Region: {{ constraint.endpoint_location.location.region }}
                {% elif constraint.endpoint_location.location.WhichOneof('location')=='gps_position' %}
                    Position (lat/long):
                    {{ constraint.endpoint_location.location.gps_position.latitude }} /
                    {{ constraint.endpoint_location.location.gps_position.longitude }}
                {% endif %}
            </td>
        </tr>
        {% endif %}
        {% if constraint.WhichOneof('constraint')=='endpoint_priority' %}
        {% elif constraint.WhichOneof('constraint')=='endpoint_priority' %}
        <tr>
            <td>
                Endpoint Priority
            </td>
            <td>Endpoint Priority</td>
            <td>
                {{ constraint.endpoint_priority.endpoint_id.device_id.device_uuid.uuid }} / {{
                constraint.endpoint_priority.endpoint_id.endpoint_uuid.uuid }}
            </td>
            <td>
                <ul>
                    {{ constraint.endpoint_priority.priority }}
                </ul>
            </td>
            <td>{{ constraint.endpoint_priority.priority }}</td>
        </tr>
        {% endif %}
        {% if constraint.WhichOneof('constraint')=='sla_availability' %}
        {% elif constraint.WhichOneof('constraint')=='sla_availability' %}
        <tr>
            <td>SLA Availability</td>
            <td>-</td>
            <td>
                SLA Availability
            </td>
            <td>
                /
            </td>
            <td>
                <ul>
                    <li> num_disjoint_paths: {{ constraint.sla_availability.num_disjoint_paths }} </li>
                    <li> all_active: {{ constraint.sla_availability.all_active }} </li>
                </ul>
                {{ constraint.sla_availability.num_disjoint_paths }} disjoint paths;
                {% if constraint.sla_availability.all_active %}all{% else %}single{% endif %}active
            </td>
        </tr>
        {% else %}
        <tr>
            <td>-</td>
            <td>-</td>
            <td>{{ constraint }}</td>
        </tr>
        {% endif %}
        {% endfor %}
    </tbody>