Skip to content
Snippets Groups Projects
Commit 6655cdbe authored by Mohammad Ismaeel's avatar Mohammad Ismaeel
Browse files

Integral optical link with optical controller

parent ca8d23f9
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!284Resolve: "(CNIT) Multi-Granular Optical Nodes and Optical Transpoders management"
......@@ -8,7 +8,7 @@ from device.client.DeviceClient import DeviceClient
from service.client.ServiceClient import ServiceClient
from slice.client.SliceClient import SliceClient
from .forms import UpdateDeviceForm ,AddTrancseiver ,UpdateInterfaceForm
from common.tools.context_queries.OpticalConfig import opticalconfig_get_uuid
from common.tools.context_queries.OpticalConfig import opticalconfig_get_uuid , device_get_uuid
opticalconfig = Blueprint('opticalconfig', __name__,url_prefix="/opticalconfig")
......@@ -68,12 +68,14 @@ def show_details(config_uuid):
LOGGER.info("response %s",response)
opticalConfig = OpticalConfig()
opticalConfig.CopyFrom(response)
config =json.loads(opticalConfig.config)
LOGGER.info("config details %s",config)
interfaces=config["interfaces"]
new_config={}
device_name=""
if ("device_name" in config):
device_name= config["device_name"]
for channel in config['channels'] :
new_config["name"]=channel['name']
......@@ -85,7 +87,7 @@ def show_details(config_uuid):
device_details.append(new_config)
LOGGER.info("config details %s",device_details)
return render_template('opticalconfig/details.html', device=device_details,config_id=config_uuid,interfaces=interfaces)
return render_template('opticalconfig/details.html', device=device_details,config_id=config_uuid,device_name=device_name)
@opticalconfig.route('<path:opticalconfig_uuid>/delete', methods=['GET'])
def delete_opitcalconfig (opticalconfig_uuid) :
......@@ -119,6 +121,7 @@ def update_externally () :
LOGGER.info(f"device from post {device}")
if (device_name):
opticalconfig_uuid = opticalconfig_get_uuid(device_name=device_name)
opticalconfigId=OpticalConfigId()
opticalconfigId.opticalconfig_uuid=opticalconfig_uuid
......
......@@ -33,29 +33,26 @@
</div>
<div class="col-sm-12">
<div class="col-sm-12">
<div class="col-sm-3">
<!-- <button type="button" class="btn btn-danger"><i class="bi bi-x-square"></i>Delete device</button> -->
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#deleteModal">
<i class="bi bi-x-square"></i>
Delete Optical Config
</button>
</div>
<div class="row">
<div class="col-sm-3">
<button type="button" class="btn btn-success" onclick="window.location.href='{{ url_for('opticalconfig.home') }}'">
<i class="bi bi-box-arrow-in-left"></i>
Back to device list
</button>
</div>
<div class="col-sm-3">
<!-- <button type="button" class="btn btn-danger"><i class="bi bi-x-square"></i>Delete device</button> -->
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#deleteModal">
<i class="bi bi-x-square"></i>
Delete Optical Config
</button>
</div>
</div>
</div>
<div class="col-sm-12">
<span>Interface:</span>
<span>
<ul>
<li><span>Name:</span><span class="font-weight-bold" style="font-weight: 700;">{{ interfaces.interface.name
}}</span> </li>
<li><span>Ip:</span> <span class="font-weight-bold" style="font-weight: 700;">{{ interfaces.interface.ip }}</span>
<li><span>Ip:</span> <span class="font-weight-bold" style="font-weight: 700;">{{ interfaces.interface["prefix-legnth"] }}</span>
</li>
<li><span>Enabled:</span> <span class="font-weight-bold" style="font-weight: 700;"> {{ interfaces.interface.enabled
}}</span></li>
</ul>
</span>
<span>Device Name:</span>
<span>{{device_name}}</span>
</div>
</div>
......
......@@ -26,6 +26,7 @@
<thead>
<tr>
<th scope="col">UUID</th>
<th scope="col">Device Name</th>
<th scope="col">Channels Number</th>
</tr>
......@@ -35,6 +36,7 @@
{% for device in config %}
<tr>
<td>{{device.opticalconfig_id.opticalconfig_uuid}}</td>
<td>{{device.device_name}}</td>
<td>{{ device.channels_number }}</td>
<td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment