mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
#8898 networkmap
This commit is contained in:
parent
182bb2d2c4
commit
16554cfc7a
5
pandora_console/extras/mr/57.sql
Normal file
5
pandora_console/extras/mr/57.sql
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
START TRANSACTION;
|
||||||
|
|
||||||
|
ALTER TABLE `tmap` ADD COLUMN `refresh_time` INT UNSIGNED NOT NULL DEFAULT 0;
|
||||||
|
|
||||||
|
COMMIT;
|
@ -2102,13 +2102,12 @@ class NetworkMap
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->relations) {
|
|
||||||
// Search for relations.
|
// Search for relations.
|
||||||
foreach ($this->nodes as $k => $item) {
|
foreach ($this->nodes as $k => $item) {
|
||||||
$target = $this->calculateRelations($k);
|
$target = $this->calculateRelations($k);
|
||||||
|
|
||||||
// Adopt all orphan nodes but pandora one.
|
// Adopt all orphan nodes but pandora one.
|
||||||
if (empty($target)) {
|
if (empty($target) === true) {
|
||||||
if (isset($this->noPandoraNode) === false
|
if (isset($this->noPandoraNode) === false
|
||||||
|| $this->noPandoraNode == false
|
|| $this->noPandoraNode == false
|
||||||
) {
|
) {
|
||||||
@ -2130,9 +2129,6 @@ class NetworkMap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$edges = $this->relations;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_array($edges)) {
|
if (is_array($edges)) {
|
||||||
foreach ($edges as $rel) {
|
foreach ($edges as $rel) {
|
||||||
@ -2628,6 +2624,79 @@ class NetworkMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Regenerates a nodes - relationships array using graphviz dot
|
||||||
|
* schema and stores nodes&relations into $this->graph.
|
||||||
|
*
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
|
public function recalculateCoords()
|
||||||
|
{
|
||||||
|
global $config;
|
||||||
|
|
||||||
|
include_once 'include/functions_os.php';
|
||||||
|
|
||||||
|
$map_filter = $this->mapOptions['map_filter'];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Let graphviz place the nodes.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ($map_filter['empty_map']) {
|
||||||
|
$this->generateEmptyDotGraph();
|
||||||
|
} else if (!isset($this->dotGraph)) {
|
||||||
|
$this->generateDotGraph();
|
||||||
|
}
|
||||||
|
|
||||||
|
$graph = $this->calculateCoords();
|
||||||
|
|
||||||
|
if (is_array($graph) === true) {
|
||||||
|
$nodes = $graph['nodes'];
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
$nodes_aux = [];
|
||||||
|
|
||||||
|
// Prepare graph nodes.
|
||||||
|
foreach ($nodes as $id => $coords) {
|
||||||
|
$node_tmp['id'] = $id;
|
||||||
|
|
||||||
|
$source = $this->getNodeData($id);
|
||||||
|
|
||||||
|
$node_tmp['type'] = $source['node_type'];
|
||||||
|
$node_tmp['x'] = $coords['x'];
|
||||||
|
$node_tmp['y'] = $coords['y'];
|
||||||
|
|
||||||
|
switch ($node_tmp['type']) {
|
||||||
|
case NODE_AGENT:
|
||||||
|
$node_tmp['source_data'] = $source['id_agente'];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NODE_MODULE:
|
||||||
|
$node_tmp['source_data'] = $source['id_agente_modulo'];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NODE_PANDORA:
|
||||||
|
$node_tmp['source_data'] = 0;
|
||||||
|
$node_center['x'] = ($coords['x'] - MAP_X_CORRECTION);
|
||||||
|
$node_center['y'] = ($coords['y'] - MAP_Y_CORRECTION);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NODE_GENERIC:
|
||||||
|
default:
|
||||||
|
$node_tmp['source_data'] = $source['id_source'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$nodes_aux[$index] = $node_tmp;
|
||||||
|
$index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $nodes_aux;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transform node information into JS data.
|
* Transform node information into JS data.
|
||||||
*
|
*
|
||||||
@ -3317,6 +3386,10 @@ class NetworkMap
|
|||||||
*/
|
*/
|
||||||
public function loadController(?bool $return=true)
|
public function loadController(?bool $return=true)
|
||||||
{
|
{
|
||||||
|
if (isset($this->mapOptions['refresh_time']) === false) {
|
||||||
|
$this->mapOptions['refresh_time'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$output = '';
|
$output = '';
|
||||||
|
|
||||||
if ($this->useTooltipster
|
if ($this->useTooltipster
|
||||||
@ -3365,6 +3438,26 @@ class NetworkMap
|
|||||||
init_minimap();
|
init_minimap();
|
||||||
function_open_minimap();
|
function_open_minimap();
|
||||||
|
|
||||||
|
if ('.$this->mapOptions['refresh_time'].' > 0) {
|
||||||
|
var startCountDown = function (duration, cb) {
|
||||||
|
$("div.vc-countdown").countdown("destroy");
|
||||||
|
if (!duration) return;
|
||||||
|
var t = new Date();
|
||||||
|
t.setTime(t.getTime() + duration * 1000);
|
||||||
|
$("div.vc-countdown").countdown({
|
||||||
|
until: t,
|
||||||
|
format: "MS",
|
||||||
|
layout: "(%M%nn%M:%S%nn%S '.__('Until refresh').') ",
|
||||||
|
alwaysExpire: true,
|
||||||
|
onExpiry: function () {
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
startCountDown('.($this->mapOptions['refresh_time']).', false);
|
||||||
|
}
|
||||||
|
|
||||||
$(document.body).on("mouseleave",
|
$(document.body).on("mouseleave",
|
||||||
".context-menu-list",
|
".context-menu-list",
|
||||||
function(e) {
|
function(e) {
|
||||||
|
@ -2702,7 +2702,7 @@ function networkmap_clean_duplicate_links($id)
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$sql_duplicate_links = 'SELECT id, id_parent, id_child
|
$sql_duplicate_links = 'SELECT *
|
||||||
FROM trel_item t1
|
FROM trel_item t1
|
||||||
WHERE t1.deleted = 0 AND t1.id_child IN (
|
WHERE t1.deleted = 0 AND t1.id_child IN (
|
||||||
SELECT t2.id_child
|
SELECT t2.id_child
|
||||||
@ -2712,7 +2712,7 @@ function networkmap_clean_duplicate_links($id)
|
|||||||
AND t1.id_parent = t2.id_parent
|
AND t1.id_parent = t2.id_parent
|
||||||
AND t2.id_map = '.$id.')
|
AND t2.id_map = '.$id.')
|
||||||
AND t1.id_map = '.$id.'
|
AND t1.id_map = '.$id.'
|
||||||
ORDER BY id_parent, id_child';
|
ORDER BY id_parent, id_child, id_parent_source_data desc, id_child_source_data desc';
|
||||||
|
|
||||||
$rows = db_get_all_rows_sql($sql_duplicate_links);
|
$rows = db_get_all_rows_sql($sql_duplicate_links);
|
||||||
if (empty($rows) === true) {
|
if (empty($rows) === true) {
|
||||||
@ -2721,9 +2721,23 @@ function networkmap_clean_duplicate_links($id)
|
|||||||
|
|
||||||
$pre_parent = -1;
|
$pre_parent = -1;
|
||||||
$pre_child = -1;
|
$pre_child = -1;
|
||||||
|
$pre_parent_source = -1;
|
||||||
|
$pre_child_source = -1;
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
if (($pre_parent === (int) $row['id_parent'])
|
if (($pre_parent === (int) $row['id_parent'])
|
||||||
&& ($pre_child === (int) $row['id_child'])
|
&& ($pre_child === (int) $row['id_child'])
|
||||||
|
) {
|
||||||
|
// Agent <-> Agent.
|
||||||
|
if ((int) $row['parent_type'] === 0 && (int) $row['child_type'] === 0) {
|
||||||
|
// Delete the duplicate row.
|
||||||
|
db_process_sql_delete(
|
||||||
|
'trel_item',
|
||||||
|
['id' => $row['id']]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// Agent <-> Module or Module <-> Agent or Module <-> Module.
|
||||||
|
if ($pre_parent_source === (int) $row['id_parent_source_data']
|
||||||
|
&& $pre_child_source === (int) $row['id_child_source_data']
|
||||||
) {
|
) {
|
||||||
// Delete the duplicate row.
|
// Delete the duplicate row.
|
||||||
db_process_sql_delete(
|
db_process_sql_delete(
|
||||||
@ -2731,18 +2745,25 @@ function networkmap_clean_duplicate_links($id)
|
|||||||
['id' => $row['id']]
|
['id' => $row['id']]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$pre_parent = $row['id_parent'];
|
$pre_parent_source = (int) $row['id_parent_source_data'];
|
||||||
$pre_child = $row['id_child'];
|
$pre_child_source = (int) $row['id_child_source_data'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$pre_parent = (int) $row['id_parent'];
|
||||||
|
$pre_child = (int) $row['id_child'];
|
||||||
|
if ((int) $row['parent_type'] === 1 || (int) $row['child_type'] === 1) {
|
||||||
|
$pre_parent_source = (int) $row['id_parent_source_data'];
|
||||||
|
$pre_child_source = (int) $row['id_child_source_data'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
db_process_sql($sql_duplicate_links);
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
db_clean_cache();
|
db_clean_cache();
|
||||||
|
|
||||||
$sql_duplicate_links_parent_as_children = '
|
$sql_duplicate_links_parent_as_children = '
|
||||||
SELECT id, id_parent, id_child
|
SELECT *
|
||||||
FROM trel_item t1
|
FROM trel_item t1
|
||||||
WHERE t1.deleted = 0 AND t1.id_child IN (
|
WHERE t1.deleted = 0 AND t1.id_child IN (
|
||||||
SELECT t2.id_parent
|
SELECT t2.id_parent
|
||||||
@ -2765,6 +2786,22 @@ function networkmap_clean_duplicate_links($id)
|
|||||||
if (($row['id'] != $row2['id'])
|
if (($row['id'] != $row2['id'])
|
||||||
&& ($row['id_child'] == $row2['id_parent'])
|
&& ($row['id_child'] == $row2['id_parent'])
|
||||||
&& ($row['id_parent'] == $row2['id_child'])
|
&& ($row['id_parent'] == $row2['id_child'])
|
||||||
|
&& ($row['parent_type'] == $row2['child_type'])
|
||||||
|
&& ($row['child_type'] == $row2['parent_type'])
|
||||||
|
) {
|
||||||
|
// Agent <-> Agent.
|
||||||
|
if ((int) $row2['parent_type'] === 0 && (int) $row2['child_type'] === 0) {
|
||||||
|
db_process_sql_delete(
|
||||||
|
'trel_item',
|
||||||
|
['id' => $row2['id']]
|
||||||
|
);
|
||||||
|
|
||||||
|
$found = true;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
// Agent <-> Module or Module <-> Agent or Module <-> Module.
|
||||||
|
if ((int) $row['id_child_source_data'] === (int) $row2['id_parent_source_data']
|
||||||
|
&& (int) $row['id_parent_source_data'] === (int) $row2['id_child_source_data']
|
||||||
) {
|
) {
|
||||||
db_process_sql_delete(
|
db_process_sql_delete(
|
||||||
'trel_item',
|
'trel_item',
|
||||||
@ -2775,6 +2812,27 @@ function networkmap_clean_duplicate_links($id)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Si no son del mismo tipo pero hay un parent_type = 0 y child_type = 0 borrar.
|
||||||
|
if ((int) $row['parent_type'] === 0 && (int) $row['child_type'] === 0) {
|
||||||
|
db_process_sql_delete(
|
||||||
|
'trel_item',
|
||||||
|
['id' => $row['id']]
|
||||||
|
);
|
||||||
|
|
||||||
|
$found = true;
|
||||||
|
break;
|
||||||
|
} else if ((int) $row2['parent_type'] === 0 && (int) $row2['child_type'] === 0) {
|
||||||
|
db_process_sql_delete(
|
||||||
|
'trel_item',
|
||||||
|
['id' => $row2['id']]
|
||||||
|
);
|
||||||
|
|
||||||
|
$found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($found === true) {
|
if ($found === true) {
|
||||||
break;
|
break;
|
||||||
@ -3024,19 +3082,28 @@ function erase_node($id)
|
|||||||
$return = db_process_sql_update(
|
$return = db_process_sql_update(
|
||||||
'titem',
|
'titem',
|
||||||
['deleted' => 1],
|
['deleted' => 1],
|
||||||
['id' => $node['id']]
|
[
|
||||||
|
'id' => (int) $node['id'],
|
||||||
|
'id_map' => (int) $node['id_map'],
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
db_process_sql_update(
|
db_process_sql_update(
|
||||||
'trel_item',
|
'trel_item',
|
||||||
['deleted' => 1],
|
['deleted' => 1],
|
||||||
['id_parent' => (int) $node['id']]
|
[
|
||||||
|
'id_parent' => (int) $node['id'],
|
||||||
|
'id_map' => (int) $node['id_map'],
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
db_process_sql_update(
|
db_process_sql_update(
|
||||||
'trel_item',
|
'trel_item',
|
||||||
['deleted' => 1],
|
['deleted' => 1],
|
||||||
['id_child' => (int) $node['id']]
|
[
|
||||||
|
'id_child' => (int) $node['id'],
|
||||||
|
'id_map' => (int) $node['id_map'],
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$node_modules = db_get_all_rows_filter(
|
$node_modules = db_get_all_rows_filter(
|
||||||
@ -3054,39 +3121,52 @@ function erase_node($id)
|
|||||||
db_process_sql_update(
|
db_process_sql_update(
|
||||||
'titem',
|
'titem',
|
||||||
['deleted' => 1],
|
['deleted' => 1],
|
||||||
['id' => $node_module['id']]
|
[
|
||||||
|
'id' => (int) $node_module['id'],
|
||||||
|
'id_map' => (int) $node_module['id_map'],
|
||||||
|
]
|
||||||
);
|
);
|
||||||
db_process_sql_update(
|
db_process_sql_update(
|
||||||
'trel_item',
|
'trel_item',
|
||||||
['deleted' => 1],
|
['deleted' => 1],
|
||||||
['id_parent_source_data' => (int) $node_module['source_data']]
|
[
|
||||||
|
'id_parent_source_data' => (int) $node_module['source_data'],
|
||||||
|
'id_map' => (int) $node_module['id_map'],
|
||||||
|
]
|
||||||
);
|
);
|
||||||
db_process_sql_update(
|
db_process_sql_update(
|
||||||
'trel_item',
|
'trel_item',
|
||||||
['deleted' => 1],
|
['deleted' => 1],
|
||||||
['id_child_source_data' => (int) $node_module['source_data']]
|
[
|
||||||
|
'id_child_source_data' => (int) $node_module['source_data'],
|
||||||
|
'id_map' => (int) $node_module['id_map'],
|
||||||
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$return = db_process_sql_delete(
|
$return = db_process_sql_delete(
|
||||||
'titem',
|
'titem',
|
||||||
['id' => $node['id']]
|
[
|
||||||
|
'id' => (int) $node['id'],
|
||||||
|
'id_map' => (int) $node['id_map'],
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
db_process_sql_delete(
|
db_process_sql_delete(
|
||||||
'trel_item',
|
'trel_item',
|
||||||
['id_parent' => 0]
|
[
|
||||||
|
'parent_type' => 2,
|
||||||
|
'id_map' => (int) $node['id_map'],
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
db_process_sql_delete(
|
db_process_sql_delete(
|
||||||
'trel_item',
|
'trel_item',
|
||||||
['id_parent' => (int) $node['id']]
|
[
|
||||||
);
|
'child_type' => 2,
|
||||||
|
'id_map' => (int) $node['id_map'],
|
||||||
db_process_sql_delete(
|
]
|
||||||
'trel_item',
|
|
||||||
['id_child' => (int) $node['id']]
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4070,6 +4150,7 @@ function add_agent_node_in_option($id_networkmap, $id_agent, $x, $y)
|
|||||||
function networkmap_get_new_nodes_and_links($networkmap, $x, $y)
|
function networkmap_get_new_nodes_and_links($networkmap, $x, $y)
|
||||||
{
|
{
|
||||||
$id_networkmap = $networkmap['id'];
|
$id_networkmap = $networkmap['id'];
|
||||||
|
$id_recon = $networkmap['source_data'];
|
||||||
|
|
||||||
$map_filter = $networkmap['filter'];
|
$map_filter = $networkmap['filter'];
|
||||||
if (is_array($map_filter) === false) {
|
if (is_array($map_filter) === false) {
|
||||||
@ -4077,11 +4158,11 @@ function networkmap_get_new_nodes_and_links($networkmap, $x, $y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((int) $networkmap['source'] === SOURCE_TASK) {
|
if ((int) $networkmap['source'] === SOURCE_TASK) {
|
||||||
$agents = get_discovery_agents($id_networkmap, true);
|
$agents = get_discovery_agents($id_recon, true);
|
||||||
} else if ((int) $networkmap['source'] === SOURCE_NETWORK) {
|
} else if ((int) $networkmap['source'] === SOURCE_NETWORK) {
|
||||||
// Network map, based on direct network.
|
// Network map, based on direct network.
|
||||||
$agents = networkmap_get_nodes_from_ip_mask(
|
$agents = networkmap_get_nodes_from_ip_mask(
|
||||||
$networkmap['source_data'],
|
$id_recon,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@ -2099,8 +2099,6 @@ function show_menu(item, data) {
|
|||||||
disabled: false,
|
disabled: false,
|
||||||
callback: function(key, options) {
|
callback: function(key, options) {
|
||||||
refresh();
|
refresh();
|
||||||
// refresh_holding_area();
|
|
||||||
// update_networkmap();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
items_list["restart_map"] = {
|
items_list["restart_map"] = {
|
||||||
@ -2497,12 +2495,37 @@ function refresh() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let location = "";
|
||||||
|
if ($("#main").height()) {
|
||||||
|
location = `index.php?sec=network&sec2=operation/agentes/pandora_networkmap&tab=view&id_networkmap=${networkmap_id}`;
|
||||||
|
} else {
|
||||||
|
location = `index.php?sec=network&sec2=operation/agentes/pandora_networkmap&tab=view&pure=1&id_networkmap=${networkmap_id}`;
|
||||||
|
}
|
||||||
|
|
||||||
if (array_nodes.length === 0 && array_links.length === 0) {
|
if (array_nodes.length === 0 && array_links.length === 0) {
|
||||||
update_networkmap();
|
update_networkmap();
|
||||||
$("#spinner_networkmap").css("display", "none");
|
$("#spinner_networkmap").css("display", "none");
|
||||||
|
// window.location = location;
|
||||||
} else {
|
} else {
|
||||||
console.log("hay algun nodo o link nuevo, toca repintar mapa");
|
if (array_nodes.length > 0) {
|
||||||
// crear una funcion donde se llame a graphviz y se reciban las nuevas posiciones, pero sin borrar links.
|
$.ajax({
|
||||||
|
data: {
|
||||||
|
page: "operation/agentes/pandora_networkmap.view",
|
||||||
|
refresh_map: 1,
|
||||||
|
id: networkmap_id
|
||||||
|
},
|
||||||
|
dataType: "json",
|
||||||
|
type: "POST",
|
||||||
|
url: window.base_url_homedir + "/ajax.php",
|
||||||
|
success: function(data) {
|
||||||
|
$("#spinner_networkmap").css("display", "none");
|
||||||
|
window.location = location;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (array_links.length > 0) {
|
||||||
|
$("#spinner_networkmap").css("display", "none");
|
||||||
|
window.location = location;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -646,7 +646,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#refresh_units").trigger("change");
|
$("#refresh_time_units").trigger("change");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,6 +78,42 @@ if (is_ajax() === true) {
|
|||||||
$reset_map = (bool) get_parameter('reset_map', false);
|
$reset_map = (bool) get_parameter('reset_map', false);
|
||||||
$refresh_map = (bool) get_parameter('refresh_map', false);
|
$refresh_map = (bool) get_parameter('refresh_map', false);
|
||||||
|
|
||||||
|
if ($refresh_map) {
|
||||||
|
$id_map = get_parameter('id');
|
||||||
|
|
||||||
|
include_once $config['homedir'].'/include/class/NetworkMap.class.php';
|
||||||
|
|
||||||
|
$map_manager = new NetworkMap(
|
||||||
|
['id_map' => $id_map]
|
||||||
|
);
|
||||||
|
|
||||||
|
$filter = json_decode($map_manager->map['filter'], true);
|
||||||
|
$z_dash = $filter['z_dash'];
|
||||||
|
|
||||||
|
$nodes = $map_manager->recalculateCoords();
|
||||||
|
|
||||||
|
foreach ($nodes as $key => $value) {
|
||||||
|
if ($value['type'] == 0 || $value['type'] == 2) {
|
||||||
|
$node['x'] = ($value['x'] + ($map_manager->map['center_x'] / 2) / $z_dash);
|
||||||
|
$node['y'] = ($value['y'] + ($map_manager->map['center_y'] / 2) / $z_dash);
|
||||||
|
$node['refresh'] = 0;
|
||||||
|
|
||||||
|
db_process_sql_update(
|
||||||
|
'titem',
|
||||||
|
$node,
|
||||||
|
[
|
||||||
|
'source_data' => $value['source_data'],
|
||||||
|
'id_map' => $id_map,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $id_map;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ($get_reset_map_form) {
|
if ($get_reset_map_form) {
|
||||||
$map_id = get_parameter('map_id');
|
$map_id = get_parameter('map_id');
|
||||||
|
|
||||||
@ -2271,6 +2307,10 @@ if ($networkmap === false) {
|
|||||||
]
|
]
|
||||||
).'</a>',
|
).'</a>',
|
||||||
];
|
];
|
||||||
|
$buttons['test'] = [
|
||||||
|
'active' => false,
|
||||||
|
'text' => '<div style="width:100%;height:54px;display:flex;align-items:center"><div class="vc-countdown"></div></div>',
|
||||||
|
];
|
||||||
} else {
|
} else {
|
||||||
if (!$dash_mode) {
|
if (!$dash_mode) {
|
||||||
$buttons['screen'] = [
|
$buttons['screen'] = [
|
||||||
@ -2306,6 +2346,10 @@ if ($networkmap === false) {
|
|||||||
]
|
]
|
||||||
).'</a>',
|
).'</a>',
|
||||||
];
|
];
|
||||||
|
$buttons['test'] = [
|
||||||
|
'active' => false,
|
||||||
|
'text' => '<div style="width:100%;height:54px;display:flex;align-items:center"><div class="vc-countdown"></div></div>',
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2325,8 +2369,15 @@ if ($networkmap === false) {
|
|||||||
|
|
||||||
include_once $config['homedir'].'/include/class/NetworkMap.class.php';
|
include_once $config['homedir'].'/include/class/NetworkMap.class.php';
|
||||||
|
|
||||||
|
$filter = json_decode($networkmap['filter'], true);
|
||||||
|
$zoom = $filter['z_dash'];
|
||||||
|
|
||||||
$map_manager = new NetworkMap(
|
$map_manager = new NetworkMap(
|
||||||
[ 'id_map' => $networkmap['id']]
|
[
|
||||||
|
'id_map' => $networkmap['id'],
|
||||||
|
'center_x' => $networkmap['center_x'],
|
||||||
|
'center_y' => $networkmap['center_y'],
|
||||||
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$map_manager->printMap();
|
$map_manager->printMap();
|
||||||
|
@ -2317,7 +2317,7 @@ CREATE TABLE IF NOT EXISTS `tmap` (
|
|||||||
`generated` INT UNSIGNED NOT NULL DEFAULT 0,
|
`generated` INT UNSIGNED NOT NULL DEFAULT 0,
|
||||||
`filter` TEXT,
|
`filter` TEXT,
|
||||||
`id_group_map` INT UNSIGNED NOT NULL DEFAULT 0,
|
`id_group_map` INT UNSIGNED NOT NULL DEFAULT 0,
|
||||||
`refresh_time` INT UNSIGNED NOT NULL DEFAULT 300,
|
`refresh_time` INT UNSIGNED NOT NULL DEFAULT 0,
|
||||||
PRIMARY KEY(`id`)
|
PRIMARY KEY(`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user