Added some changes to networkmap

This commit is contained in:
Arturo Gonzalez 2017-03-27 17:55:17 +02:00
parent 27e8ddcdaf
commit a0d9ddd8e6
2 changed files with 27 additions and 17 deletions

View File

@ -519,13 +519,23 @@ function networkmap_links_to_js_links($relations, $nodes_graph) {
$item['arrow_end'] = 'module';
$item['status_end'] = modules_get_agentmodule_status((int)$id_target_module, false, false, null);
$item['id_module_end'] = (int)$id_target_module;
$item['text_end'] = io_safe_output(modules_get_agentmodule_name((int)$id_target_module));
$text_end = io_safe_output(modules_get_agentmodule_name((int)$id_target_module));
if (preg_match ("/(.+)_ifOperStatus$/" , (string)$text_end, $matches)) {
if ($matches[1]) {
$item['text_end'] = $matches[1];
}
}
}
if ($relation['child_type'] == 1) {
$item['arrow_start'] = 'module';
$item['status_start'] = modules_get_agentmodule_status((int)$id_source_module, false, false, null);
$item['id_module_start'] = (int)$id_source_module;
$item['text_start'] = io_safe_output(modules_get_agentmodule_name((int)$id_source_module));
$text_start = io_safe_output(modules_get_agentmodule_name((int)$id_source_module));
if (preg_match ("/(.+)_ifOperStatus$/" , (string)$text_start, $matches)) {
if ($matches[1]) {
$item['text_start'] = $matches[1];
}
}
}
$agent = 0;

View File

@ -733,10 +733,10 @@ function edit_node(data, dblClick) {
$("select[name='interface_source']", template_relation_row)
.attr('name', "interface_source_" + i)
.attr('id', "interface_source_" + i + networkmap_id);
.attr('id', "interface_source_" + i);
$("select[name='interface_target']", template_relation_row)
.attr('name', "interface_target_" + i)
.attr('id', "interface_target_" + i + networkmap_id);
.attr('id', "interface_target_" + i);
$(".edit_icon_progress", template_relation_row)
.attr('class', "edit_icon_progress_" + i);
$(".edit_icon", template_relation_row)
@ -2617,19 +2617,19 @@ function init_graph(parameter_object) {
.data(module_color_status)
.enter()
.append("marker")
.attr("id", function(d) { return "interface_end_" + d.status_code; })
.attr("refX", (node_radius / 2) + (interface_radius / 2))
.attr("refY", interface_radius)
.attr("markerWidth", (node_radius / 2) + interface_radius)
.attr("markerHeight", (node_radius / 2) + interface_radius)
.attr("orient", "auto")
.append("circle")
.attr("cx", interface_radius)
.attr("cy", interface_radius)
.attr("r", interface_radius)
.attr("style", function(d) {
return "fill: " + d.color + ";";
});
.attr("id", function(d) { return "interface_end_" + d.status_code; })
.attr("refX", (node_radius / 2) + (interface_radius / 2))
.attr("refY", interface_radius)
.attr("markerWidth", (node_radius / 2) + interface_radius)
.attr("markerHeight", (node_radius / 2) + interface_radius)
.attr("orient", "auto")
.append("circle")
.attr("cx", interface_radius)
.attr("cy", interface_radius)
.attr("r", interface_radius)
.attr("style", function(d) {
return "fill: " + d.color + ";";
});
defs.append("marker")
.attr("id", "interface_start")