diff --git a/src/webui/service/main/routes.py b/src/webui/service/main/routes.py index 1ca5329e396fc1744a2ae26207d37d84b1bca27d..979d0664bc42221e3559eef498bd53562fe073e7 100644 --- a/src/webui/service/main/routes.py +++ b/src/webui/service/main/routes.py @@ -14,7 +14,8 @@ import json, logging, re from flask import jsonify, redirect, render_template, Blueprint, flash, session, url_for, request -from common.proto.context_pb2 import Connection, Context, Device, Empty, Link, Service, Slice, Topology, ContextIdList, TopologyId, TopologyIdList +from common.proto.context_pb2 import ( + Connection, Context, Device, Empty, Link, Service, Slice, Topology, ContextIdList, TopologyId, TopologyIdList) from common.tools.grpc.Tools import grpc_message_to_json_string from common.tools.object_factory.Context import json_context_id from common.tools.object_factory.Topology import json_topology_id diff --git a/src/webui/service/templates/service/detail.html b/src/webui/service/templates/service/detail.html index 975369ca21d294900c83537916bf527dce4810e9..e1f963e425e23216281068b82da23c809a677296 100644 --- a/src/webui/service/templates/service/detail.html +++ b/src/webui/service/templates/service/detail.html @@ -43,6 +43,7 @@ <div class="row mb-3"> <div class="col-sm-4"> + <b>Context: </b> {{ service.service_id.context_id.context_uuid.uuid }}<br><br> <b>UUID: </b> {{ service.service_id.service_uuid.uuid }}<br><br> <b>Type: </b> {{ ste.Name(service.service_type).replace('SERVICETYPE_', '') }}<br><br> <b>Status: </b> {{ sse.Name(service.service_status.service_status).replace('SERVICESTATUS_', '') }}<br><br> @@ -209,13 +210,17 @@ <ul> {% for sub_service_id in connection.sub_service_ids %} <li> + {% if sub_service_id.context_id.context_uuid.uuid == session['context_uuid'] %} <a href="{{ url_for('service.detail', service_uuid=sub_service_id.service_uuid.uuid) }}"> - {{ sub_service_id.service_uuid.uuid }} + {{ sub_service_id.context_id.context_uuid.uuid }} / {{ sub_service_id.service_uuid.uuid }} <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"> <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/> <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/> </svg> </a> + {% else %} + {{ sub_service_id.context_id.context_uuid.uuid }} / {{ sub_service_id.service_uuid.uuid }} + {% endif %} </li> {% endfor %} </ul> diff --git a/src/webui/service/templates/slice/detail.html b/src/webui/service/templates/slice/detail.html index 07734f32304b60365f76413d4689a37b66cc60a3..889e10ce53b4a019b55f714c2442f32f0c2b8e93 100644 --- a/src/webui/service/templates/slice/detail.html +++ b/src/webui/service/templates/slice/detail.html @@ -44,7 +44,9 @@ <div class="row mb-3"> <div class="col-sm-4"> + <b>Context: </b> {{ slice.slice_id.context_id.context_uuid.uuid }}<br><br> <b>UUID: </b> {{ slice.slice_id.slice_uuid.uuid }}<br><br> + <b>Owner: </b> {{ slice.slice_owner.owner_uuid.uuid }}<br><br> <b>Status: </b> {{ sse.Name(slice.slice_status.slice_status).replace('SLICESTATUS_', '') }}<br><br> </div> <div class="col-sm-8"> @@ -180,13 +182,17 @@ {% for service_id in slice.slice_service_ids %} <tr> <td> + {% if service_id.context_id.context_uuid.uuid == session['context_uuid'] %} <a href="{{ url_for('service.detail', service_uuid=service_id.service_uuid.uuid) }}"> - {{ service_id.service_uuid.uuid }} + {{ service_id.context_id.context_uuid.uuid }} / {{ service_id.service_uuid.uuid }} <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"> <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/> <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/> </svg> </a> + {% else %} + {{ service_id.context_id.context_uuid.uuid }} / {{ service_id.service_uuid.uuid }} + {% endif %} </td> </tr> {% endfor %} @@ -204,13 +210,17 @@ {% for subslice_id in slice.slice_subslice_ids %} <tr> <td> + {% if subslice_id.context_id.context_uuid.uuid == session['context_uuid'] %} <a href="{{ url_for('slice.detail', slice_uuid=subslice_id.slice_uuid.uuid) }}"> - {{ subslice_id.slice_uuid.uuid }} + {{ subslice_id.context_id.context_uuid.uuid }} / {{ subslice_id.slice_uuid.uuid }} <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"> <path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/> <path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/> </svg> </a> + {% else %} + {{ subslice_id.context_id.context_uuid.uuid }} / {{ subslice_id.slice_uuid.uuid }} + {% endif %} </td> </tr> {% endfor %}