Fixed group and set_center
This commit is contained in:
parent
9a77256198
commit
f10a661cd6
|
@ -87,15 +87,16 @@ function inner_minimap_box(param_x, param_y) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function set_center(id) {
|
||||
pos_x = (width_svg / 2) - translation[0];
|
||||
pos_y = (height_svg / 2) - translation[1];
|
||||
function set_center(id, event) {
|
||||
pos_x = (width_svg / 2) - (translation[0] / scale);
|
||||
pos_y = (height_svg / 2) - (translation[1] / scale);
|
||||
|
||||
var params = [];
|
||||
params.push("set_center=1");
|
||||
params.push("id=" + id);
|
||||
params.push("x=" + pos_x);
|
||||
params.push("y=" + pos_y);
|
||||
params.push("scale=" + scale);
|
||||
params.push("page=operation/agentes/pandora_networkmap.view");
|
||||
jQuery.ajax({
|
||||
data: params.join("&"),
|
||||
|
@ -2720,7 +2721,7 @@ function init_graph(parameter_object) {
|
|||
}
|
||||
window.scale_minimap = 4.2;
|
||||
window.translation = [0, 0];
|
||||
window.scale = 0.5;
|
||||
window.scale = (typeof (z_dash) != "undefined") ? z_dash : 0.5;
|
||||
window.node_radius = 40;
|
||||
if (typeof (parameter_object.node_radius) != "undefined") {
|
||||
window.node_radius = parameter_object.node_radius;
|
||||
|
|
|
@ -221,11 +221,10 @@ else {
|
|||
$table->data[0][0] = __('Name');
|
||||
$table->data[0][1] = html_print_input_text ('name', $name, '', 30,
|
||||
100,true);
|
||||
$table->data[1][0] = __('Group');
|
||||
|
||||
|
||||
$table->data[1][0] = __('Group');
|
||||
$table->data[1][1] = html_print_select_groups($config['id_user'], "AR",
|
||||
true, 'id_group', $idGroup, '', '', '', true);
|
||||
true, 'id_group', $id_group, '', '', '', true);
|
||||
|
||||
$table->data[2][0] = __('Node radius');
|
||||
$table->data[2][1] = html_print_input_text ('node_radius', $node_radius, '', 2,
|
||||
|
|
|
@ -511,9 +511,16 @@ if (is_ajax ()) {
|
|||
$id = (int)get_parameter('id', 0);
|
||||
$x = (int)get_parameter('x', 0);
|
||||
$y = (int)get_parameter('y', 0);
|
||||
$scale = (float)get_parameter('scale', 0);
|
||||
|
||||
$networkmap = db_get_row('tmap', 'id', $id);
|
||||
|
||||
$array_filter = json_decode($networkmap['filter']);
|
||||
if (isset($array_filter->z_dash)) {
|
||||
$array_filter->z_dash = number_format($scale,2);
|
||||
}
|
||||
$filter = json_encode($array_filter);
|
||||
|
||||
// ACL for the network map
|
||||
// $networkmap_read = check_acl ($config['id_user'], $networkmap['id_group'], "MR");
|
||||
$networkmap_write = check_acl ($config['id_user'], $networkmap['id_group'], "MW");
|
||||
|
@ -529,7 +536,7 @@ if (is_ajax ()) {
|
|||
$networkmap['center_x'] = $x;
|
||||
$networkmap['center_y'] = $y;
|
||||
db_process_sql_update('tmap',
|
||||
array('center_x' => $networkmap['center_x'], 'center_y' => $networkmap['center_y']),
|
||||
array('center_x' => $networkmap['center_x'], 'center_y' => $networkmap['center_y'], 'filter' => $filter),
|
||||
array('id' => $id));
|
||||
|
||||
$return = array();
|
||||
|
|
Loading…
Reference in New Issue