X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=static%2Fsrc%2Finstancehandler%2Finstance_topology_view.js;h=716a61923384701761c2af8e4779ce06a34834b2;hb=cbf1fc522af13679164e3d86eefcba1984e6e479;hp=1193b18f750eec6b6b710ec0a1d444ec53e2ec3c;hpb=e6eb7437628e932ef823800b5a8380790a6b22d7;p=osm%2FLW-UI.git
diff --git a/static/src/instancehandler/instance_topology_view.js b/static/src/instancehandler/instance_topology_view.js
index 1193b18..716a619 100644
--- a/static/src/instancehandler/instance_topology_view.js
+++ b/static/src/instancehandler/instance_topology_view.js
@@ -1,8 +1,46 @@
+/*
+ Copyright 2018 EveryUP srl
+
+ 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 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.
+*/
+
//GraphEditor instance
var graph_editor = new TCD3.ModelGraphEditor();
+var layer_map = {
+ 'nsr': {
+ 'id': 'NS instance id',
+ 'nsdId': 'NSD id',
+ 'name-ref': 'NSD name',
+ 'operational-status': 'Operational status',
+ 'config-status': 'Config status',
+ 'detailed-status': 'Detailed status',
+ 'create-time': 'Creation date',
+ // 'instantiate_params' :'Instantiation parameters'
+ },
+ 'vnfr': {
+ 'id': 'VNF instance id',
+ 'vnfd-id': 'NSD id',
+ 'vnfd-ref': 'NSD name',
+ 'member-vnf-index': 'Constituent VNF in the NS',
+ 'ip-address': 'Mgmt IP address',
+ 'vim-account-id': 'VIM id',
+ 'create-time': 'Creation date'
+ }
+};
+
var type_view = {
- "nsr": ["vnfr", "ns_vl"],
+ "nsr": ["vnfr", "ns_vl", "ns_cp"],
"vnfr": ["vdur", "cp", "vnf_vl"]
};
@@ -41,7 +79,6 @@ $(document).ready(function () {
});
-
function handleForce(el) {
graph_editor.handleForce((el.getAttribute('aria-pressed') === "true"));
}
@@ -119,6 +156,7 @@ function refreshElementInfo(event, element) {
}
}
+
function layerDetails(filters) {
var side = $('#side');
var graph_parameters = graph_editor.getGraphParams();
@@ -126,12 +164,37 @@ function layerDetails(filters) {
if(graph_parameters['view'] && filters.link.view.length >0 && filters.link.view[0]){
if(filters.link.view[0] === 'nsr') {
layer_template = getMainSection('NS View');
- layer_template += getChildrenTable(graph_parameters['view']['nsr']);
+ layer_template+= '
';
+ for (var key in layer_map['nsr']) {
+ if ( graph_parameters['view']['nsr'][key] ) {
+ var field_value = graph_parameters['view']['nsr'][key];
+ if(key === 'create-time'){
+ field_value = moment.unix(field_value).toISOString();
+ } else if (key === 'instantiate_params'){
+ field_value = JSON.stringify(field_value);
+ }
+ layer_template += '' + layer_map['nsr'][key] + ' | ' + field_value + ' |
';
+ }
+ }
+ layer_template += '
';
+ //layer_template += getChildrenTable(graph_parameters['view']['nsr']);
}
else if(filters.link.view[0] === 'vnfr') {
layer_template = getMainSection('VNF View');
var vnfr_id = filters.link.group[0];
- layer_template += getChildrenTable(graph_parameters['view']['vnfr'][vnfr_id]);
+
+ layer_template+= '';
+ var vnfr_data = graph_parameters['view']['vnfr'][vnfr_id];
+ for (var key in layer_map['vnfr']) {
+ if ( vnfr_data[key] ) {
+ var field_value = vnfr_data[key];
+ if(key === 'create-time'){
+ field_value = moment.unix(field_value).toISOString();
+ }
+ layer_template += '' + layer_map['vnfr'][key] + ' | ' + field_value + ' |
';
+ }
+ }
+ layer_template += '
';
}
}
@@ -159,10 +222,10 @@ function updateLegend(view) {
}
var map = {
- 'ip-address': 'IP', 'vnfd-id': 'Vnfd Id', 'vnfd-ref': 'Vnfd Ref', 'vim-account-id': 'Vim Id',
+ 'ip-address': 'IP', 'vnfd-id': 'Vnfd Id', 'vnfd-ref': 'Vnfd Ref', 'vim-account-id': 'VIM Id',
'member-vnf-index-ref': 'Member index', 'created-time': 'Created', 'id': 'Id', 'mgmt-network': 'Mgmt network',
'name': 'Name', 'type': 'Type', 'vim-network-name': 'Vim network name', 'connection-point-id': 'Cp Id',
- 'vdu-id-ref': 'Vdu Id', 'nsr-id-ref': 'Nsr Id'
+ 'vdu-id-ref': 'Vdu Id', 'nsr-id-ref': 'Nsr Id', 'vim-id': 'VIM id'
};
function vnfrDetails(vnfr) {