projects
/
osm
/
LW-UI.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix 895
[osm/LW-UI.git]
/
static
/
src
/
descriptorhandler
/
composer.js
diff --git
a/static/src/descriptorhandler/composer.js
b/static/src/descriptorhandler/composer.js
index
18072a8
..
aef680f
100644
(file)
--- a/
static/src/descriptorhandler/composer.js
+++ b/
static/src/descriptorhandler/composer.js
@@
-18,7
+18,7
@@
var graph_editor = new TCD3.ModelGraphEditor();
var type_view = {
var graph_editor = new TCD3.ModelGraphEditor();
var type_view = {
- "nsd": ["vnf", "ns_vl"],
+ "nsd": ["vnf", "ns_vl"
, "ns_cp"
],
"vnfd": ["vdu", "cp", "vnf_vl", "int_cp"]
};
"vnfd": ["vdu", "cp", "vnf_vl", "int_cp"]
};
@@
-141,8
+141,14
@@
function initDropOnGraph() {
graph_editor.addNode(node_information, function () {
console.log("OK")
graph_editor.addNode(node_information, function () {
console.log("OK")
- }, function (error) {
- showAlert(error)
+ }, function (result) {
+ var data = result.responseJSON;
+ var title = "Error " + (data && data.code ? data.code : 'unknown');
+ var message = data && data.detail ? data.detail : 'No detail available.';
+ bootbox.alert({
+ title: title,
+ message: message
+ });
})
};
})
};
@@
-195,6
+201,9
@@
function refreshElementInfo(event, element) {
case 'int_cp':
intcpDetails(element.info.osm);
break;
case 'int_cp':
intcpDetails(element.info.osm);
break;
+ case 'ns_cp':
+ nscpDetails(element.info.osm);
+ break;
case 'cp':
cpDetails(element.info.osm);
break;
case 'cp':
cpDetails(element.info.osm);
break;
@@
-257,7
+266,7
@@
function updatePalette(view) {
var nodes_properties = osm_gui_properties['nodes'];
for (var n in nodes) {
var node = nodes[n];
var nodes_properties = osm_gui_properties['nodes'];
for (var n in nodes) {
var node = nodes[n];
- if (nodes_properties[node]) {
+ if (nodes_properties[node]
&& (nodes_properties[node].draggable != false)
) {
palette_template += '<div id="drag_' + n + '" class="node ui-draggable"' +
'type-name="' + node + '" draggable="true" ondragstart="nodeDragStart(event)">' +
'<div class="icon" style="background-color:' + nodes_properties[node].color + '"></div>' +
palette_template += '<div id="drag_' + n + '" class="node ui-draggable"' +
'type-name="' + node + '" draggable="true" ondragstart="nodeDragStart(event)">' +
'<div class="icon" style="background-color:' + nodes_properties[node].color + '"></div>' +
@@
-287,7
+296,13
@@
function updatePalette(view) {
palette.append(palette_template)
},
error: function (result) {
palette.append(palette_template)
},
error: function (result) {
- showAlert(result);
+ var data = result.responseJSON;
+ var title = "Error " + (data && data.code ? data.code : 'unknown');
+ var message = data && data.detail ? data.detail : 'No detail available.';
+ bootbox.alert({
+ title: title,
+ message: message
+ });
}
});
}
}
});
}
@@
-331,6
+346,15
@@
function cpDetails(cp) {
side.append(cp_template);
}
side.append(cp_template);
}
+function nscpDetails(cp) {
+ var side = $('#side_form');
+ var cp_template = getMainSection('Connection Point');
+
+ cp_template += getChildrenTable(cp, true);
+ side.empty();
+ side.append(cp_template);
+}
+
function vlDetails(vl) {
var side = $('#side_form');
var vl_template = getMainSectionWithSubmitButton('Virtual Link');
function vlDetails(vl) {
var side = $('#side_form');
var vl_template = getMainSectionWithSubmitButton('Virtual Link');