[Rebranding] Central node in network maps

This commit is contained in:
fermin831 2018-05-14 12:58:22 +02:00
parent 29f56df1fd
commit 80aeded931
3 changed files with 22 additions and 11 deletions

View File

@ -104,7 +104,7 @@ function networkmap_process_networkmap($id = 0) {
// Open Graph // Open Graph
$graph = networkmap_open_graph ($layout, $nooverlap, $pure, $zoom, $graph = networkmap_open_graph ($layout, $nooverlap, $pure, $zoom,
$ranksep, $font_size, null); $ranksep, $font_size, null);
$graph .= networkmap_create_pandora_node (__('Pandora FMS'), $font_size, $simple); $graph .= networkmap_create_pandora_node (get_product_name(), $font_size, $simple);
$graph .= networkmap_close_graph (); $graph .= networkmap_close_graph ();
switch (PHP_OS) { switch (PHP_OS) {
@ -211,7 +211,7 @@ function networkmap_process_networkmap($id = 0) {
} }
else { else {
// Generate dot file // Generate dot file
$graph = networkmap_generate_dot (__('Pandora FMS'), $graph = networkmap_generate_dot (get_product_name(),
$id_group, $id_group,
$simple, $simple,
$font_size, $font_size,
@ -1090,8 +1090,9 @@ function networkmap_loadfile($id = 0, $file = '',
$data['id_agent'] = 0; $data['id_agent'] = 0;
$data['id_module'] = 0; $data['id_module'] = 0;
$data['type'] = ''; $data['type'] = '';
if (preg_match('/Pandora FMS/', $line) != 0) { $product_name = get_product_name();
$data['text'] = 'Pandora FMS'; if (preg_match("/$product_name/", $line) != 0) {
$data['text'] = $product_name;
$data['id_agent'] = 0; $data['id_agent'] = 0;
} }
else { else {
@ -1621,7 +1622,9 @@ if (empty($list_networkmaps))
$list_networkmaps = array(); $list_networkmaps = array();
?> ?>
<div id="open_version_dialog" style="display: none;">In the Open version of PandoraFMS can not be edited nodes or map</div> <div id="open_version_dialog" style="display: none;">
<?php echo __("In the Open version of %s can not be edited nodes or map", get_product_name()); ?>
</div>
<div id="dialog_node_edit" style="display: none;" title="<?php echo __('Edit node');?>"> <div id="dialog_node_edit" style="display: none;" title="<?php echo __('Edit node');?>">
<div style="text-align: left; width: 100%;"> <div style="text-align: left; width: 100%;">

View File

@ -3640,9 +3640,6 @@ function draw_elements_graph() {
}) })
.on("contextmenu", function (d) { show_menu("node", d); }); .on("contextmenu", function (d) { show_menu("node", d); });
node_temp.append("title")
.text(function (d) { return d.text; });
var font_size = (node_radius / 1.5); var font_size = (node_radius / 1.5);
node_temp.append("text") node_temp.append("text")
@ -3657,16 +3654,24 @@ function draw_elements_graph() {
}) })
.append("tspan") .append("tspan")
.attr("style", "font-size: " + font_size + "px !important; font-family:Verdana; text-align:center; text-anchor:middle; fill:#000000") .attr("style", "font-size: " + font_size + "px !important; font-family:Verdana; text-align:center; text-anchor:middle; fill:#000000")
.text(function (d) { .text(function (d) { return get_node_name_ov(d) })
return d.text;
})
.classed('dragable_node', true) //own dragable .classed('dragable_node', true) //own dragable
.on("click", selected_node) .on("click", selected_node)
.on("contextmenu", function (d) { show_menu("node", d); }); .on("contextmenu", function (d) { show_menu("node", d); });
node_temp.append("title")
.text(function (d) { return get_node_name_ov(d) });
node.exit().remove(); node.exit().remove();
} }
function get_node_name_ov (data) {
// Node central name should be the product name
return (data.type == 0 && data.id_agent == 0)
? $("#hidden-product_name").val()
: data.text;
}
function choose_group_for_show_agents() { function choose_group_for_show_agents() {
if (enterprise_installed) { if (enterprise_installed) {
group = $("#group_for_show_agents option:selected").val(); group = $("#group_for_show_agents option:selected").val();

View File

@ -700,6 +700,9 @@ else {
$id = (int) get_parameter('id_networkmap', 0); $id = (int) get_parameter('id_networkmap', 0);
} }
// Print the product name to handle it in js
html_print_input_hidden ('product_name', get_product_name());
$dash_mode = 0; $dash_mode = 0;
$map_dash_details = array(); $map_dash_details = array();
$networkmap = db_get_row('tmap', 'id', $id); $networkmap = db_get_row('tmap', 'id', $id);