Merge branch 'develop' into '486-Mejoras-visuales-de-las-ventanas-modales-de-las-MRs-open'

# Conflicts:
#   pandora_console/include/javascript/update_manager.js
This commit is contained in:
Enrique Camargo 2017-04-19 11:39:57 +02:00
commit 6259a62095
79 changed files with 1072 additions and 723 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG-170323 Version: 7.0NG-170419
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG-170323" pandora_version="7.0NG-170419"
echo "Test if you has the tools for to make the packages." echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -41,7 +41,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG'; use constant AGENT_VERSION => '7.0NG';
use constant AGENT_BUILD => '170323'; use constant AGENT_BUILD => '170419';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG %define version 7.0NG
%define release 170323 %define release 170419
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG %define version 7.0NG
%define release 170323 %define release 170419
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG" PI_VERSION="7.0NG"
PI_BUILD="170323" PI_BUILD="170419"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -40,14 +40,15 @@ If (NOT flag) Then
set ifaces_cfg = objWMIService.ExecQuery("Select ipaddress from Win32_NetworkAdapterConfiguration Where Caption='" & iface.caption & "'") set ifaces_cfg = objWMIService.ExecQuery("Select ipaddress from Win32_NetworkAdapterConfiguration Where Caption='" & iface.caption & "'")
Wscript.StdOut.Write "<data><![CDATA[" & iface.ProductName & ";" & iface.MACAddress & ";" Wscript.StdOut.Write "<data><![CDATA[" & iface.ProductName & ";" & iface.MACAddress & ";"
for each iface_cfg in ifaces_cfg for each iface_cfg in ifaces_cfg
if ( iface_cfg.IPAddress(0) <> "" ) then On Error Resume Next
if (iface_cfg.IPAddress(0) <> "" ) then
Wscript.StdOut.Write trim(iface_cfg.IPAddress(0)) Wscript.StdOut.Write trim(iface_cfg.IPAddress(0))
end if end if
next next
wscript.stdOut.WriteLine "]]></data>" Wscript.StdOut.WriteLine "]]></data>"
Next Next
Wscript.StdOut.WriteLine "</datalist>" Wscript.StdOut.WriteLine "</datalist>"
Wscript.StdOut.WriteLine "</inventory_module>" Wscript.StdOut.WriteLine "</inventory_module>"
Wscript.StdOut.WriteLine "</inventory>" Wscript.StdOut.WriteLine "</inventory>"
End If End If

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{170323} {170419}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -38,6 +38,7 @@
#include "pandora_module_plugin.h" #include "pandora_module_plugin.h"
#include "pandora_module_ping.h" #include "pandora_module_ping.h"
#include "pandora_module_snmpget.h" #include "pandora_module_snmpget.h"
#include "../windows/pandora_wmi.h"
#include "../pandora_strutils.h" #include "../pandora_strutils.h"
#include <list> #include <list>
@ -1137,6 +1138,13 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
} else if (module_freedisk_percent != "") { } else if (module_freedisk_percent != "") {
module = new Pandora_Module_Freedisk_Percent (module_name, module = new Pandora_Module_Freedisk_Percent (module_name,
module_freedisk_percent); module_freedisk_percent);
// Added a description with the memory free
char buffer[100];
unsigned long memory = Pandora_Wmi::getDiskFreeSpace(module_freedisk_percent);
if (sprintf(buffer, "Free memory %s %dMB",
module_freedisk_percent.c_str(), memory) > 0) {
module->setDescription(buffer);
}
} else if (module_freememory != "") { } else if (module_freememory != "") {
module = new Pandora_Module_Freememory (module_name); module = new Pandora_Module_Freememory (module_name);
} else if (module_freememory_percent != "") { } else if (module_freememory_percent != "") {

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG(Build 170323)") #define PANDORA_VERSION ("7.0NG(Build 170419)")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -300,7 +300,7 @@ Pandora_Windows_Service::pandora_init () {
} }
// Get the agent alias. // Get the agent alias.
conf->getValue ("agent_alias"); agent_alias = conf->getValue ("agent_alias");
if (agent_alias == "") { if (agent_alias == "") {
agent_alias = Pandora_Windows_Info::getSystemName (); agent_alias = Pandora_Windows_Info::getSystemName ();
this->conf->setValue("agent_alias", agent_alias); this->conf->setValue("agent_alias", agent_alias);
@ -441,7 +441,7 @@ Pandora_Windows_Service::getXmlHeader () {
agent_name = conf->getValue ("agent_name"); agent_name = conf->getValue ("agent_name");
// Get agent alias // Get agent alias
conf->getValue ("agent_alias"); agent_alias = conf->getValue ("agent_alias");
// Get parent agent name // Get parent agent name
parent_agent_name = conf->getValue ("parent_agent_name"); parent_agent_name = conf->getValue ("parent_agent_name");
@ -1519,7 +1519,7 @@ Pandora_Windows_Service::checkConfig (string file) {
} }
/* Get agent name */ /* Get agent name */
tmp = conf->getValue ("agent_name"); agent_name = conf->getValue ("agent_name");
/* Error getting agent name */ /* Error getting agent name */

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG(Build 170323))" VALUE "ProductVersion", "(7.0NG(Build 170419))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG-170323 Version: 7.0NG-170419
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG-170323" pandora_version="7.0NG-170419"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -1,11 +0,0 @@
START TRANSACTION;
CREATE TABLE IF NOT EXISTS `ttable_test` (
`id` int(10) unsigned NOT NULL auto_increment,
`field1` varchar(60) NOT NULL default '',
`field2` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `tusuario` ADD COLUMN `test` tinyint(1) NOT NULL DEFAULT 0;
COMMIT;

View File

@ -1,11 +0,0 @@
START TRANSACTION;
CREATE TABLE IF NOT EXISTS `ttable_test2` (
`id` int(10) unsigned NOT NULL auto_increment,
`field1` varchar(60) NOT NULL default '',
`field2` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `tusuario` ADD COLUMN `test_nuevo2` tinyint(1) NOT NULL DEFAULT 0;
COMMIT;

View File

@ -1,11 +0,0 @@
START TRANSACTION;
CREATE TABLE IF NOT EXISTS `ttable_test3` (
`id` int(10) unsigned NOT NULL auto_increment,
`field1` varchar(60) NOT NULL default '',
`field2` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `tusuario` ADD COLUMN `test3` tinyint(1) NOT NULL DEFAULT 0;
COMMIT;

View File

@ -1,11 +0,0 @@
START TRANSACTION;
CREATE TABLE IF NOT EXISTS `ttable_test4` (
`id` int(10) unsigned NOT NULL auto_increment,
`field1` varchar(60) NOT NULL default '',
`field2` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `tusuario` ADD COLUMN `test4` asdfasdfa;
COMMIT;

View File

@ -1291,6 +1291,22 @@ UPDATE twidget_dashboard SET id_widget = (SELECT id FROM twidget WHERE unique_na
DELETE FROM twidget WHERE unique_name = 'graph_availability'; DELETE FROM twidget WHERE unique_name = 'graph_availability';
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tbackup` -- Table `tbackup` (Extension table. Modify only if exists)
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
ALTER TABLE tbackup ADD COLUMN `filepath` varchar(512) NOT NULL DEFAULT ""; DROP PROCEDURE IF EXISTS addcol;
delimiter //
CREATE PROCEDURE addcol()
BEGIN
SET @vv1 = (SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = DATABASE() AND table_name = 'tbackup');
IF @vv1>0 THEN
ALTER TABLE tbackup ADD COLUMN `filepath` varchar(512) NOT NULL DEFAULT "";
END IF;
END;
//
CALL addcol();
DROP PROCEDURE addcol;
-- ---------------------------------------------------------------------
-- Table `tconfig`
-- ---------------------------------------------------------------------
UPDATE `tconfig` SET `value` = 'login_logo_v7.png' where `token`='custom_logo_login';

View File

@ -0,0 +1,7 @@
<?php
$stacked = db_get_sql('select stacked from tgraph where id_graph = '.$_GET['data']);
$num_items = db_get_sql('select count(*) from tgraph_source where id_graph = '.$_GET['data']);
echo "$stacked,$num_items";
?>

View File

@ -293,8 +293,8 @@ if ($search != "") {
$search_sql .= ")"; $search_sql .= ")";
}else{ }else{
$search_sql = " AND ( nombre " . $order_collation . " $search_sql = " AND ( nombre " . $order_collation . "
LIKE '%$search%' OR alias " . $order_collation . " LIKE LOWER('%$search%') OR alias " . $order_collation . "
LIKE '%$search%') "; LIKE LOWER('%$search%')) ";
} }
} }

View File

@ -694,7 +694,7 @@ foreach ($modules as $module) {
} }
} }
$data[1] = '<a href="?sec=gpolicies&sec2=enterprise/godmode/policies/policies&id=' . $policyInfo['id_policy'] . '">' . $data[1] = '<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&id=' . $policyInfo['id_policy'] . '">' .
html_print_image($img,true, array('title' => $title)) . html_print_image($img,true, array('title' => $title)) .
'</a>'; '</a>';
} }

View File

@ -1173,7 +1173,7 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
secondText: '<?php echo __('Second');?>', secondText: '<?php echo __('Second');?>',
currentText: '<?php echo __('Now');?>', currentText: '<?php echo __('Now');?>',
closeText: '<?php echo __('Close');?>'}); closeText: '<?php echo __('Close');?>'});
$("#text-once_date_from, #text-once_date_to").datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>"}); $("#text-once_date_from, #text-once_date_to").datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>", showButtonPanel: true});
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]); $.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);

View File

@ -688,7 +688,7 @@ foreach ($simple_alerts as $alert) {
else { else {
$img = 'images/policies.png'; $img = 'images/policies.png';
$data[3] .= '&nbsp;&nbsp;<a href="?sec=gpolicies&sec2=enterprise/godmode/policies/policies&pure='.$pure.'&id=' . $policyInfo['id'] . '">' . $data[3] .= '&nbsp;&nbsp;<a href="?sec=gmodules&sec2=enterprise/godmode/policies/policies&pure='.$pure.'&id=' . $policyInfo['id'] . '">' .
html_print_image($img, true, array('title' => $policyInfo['name'])) . html_print_image($img, true, array('title' => $policyInfo['name'])) .
'</a>'; '</a>';
} }

View File

@ -115,7 +115,7 @@ if (enterprise_installed() && $alert['id_policy_alerts'] != 0) {
else { else {
$img = 'images/policies.png'; $img = 'images/policies.png';
$policy = '<a href="?sec=gpolicies&amp;sec2=enterprise/godmode/policies/policies&amp;id=' . $policyInfo['id'] . '">' . $policy = '<a href="?sec=gmodules&amp;sec2=enterprise/godmode/policies/policies&amp;id=' . $policyInfo['id'] . '">' .
html_print_image($img, true, array('title' => $policyInfo['name'])) . html_print_image($img, true, array('title' => $policyInfo['name'])) .
'</a>'; '</a>';
} }

View File

@ -49,7 +49,7 @@ You can of course remove the warnings, that's why we include the source and do n
ui_print_page_header (__('Module management') . ' &raquo; ' . ui_print_page_header (__('Module management') . ' &raquo; ' .
__('Network component management'), "", false, __('Network component management'), "", false,
"network_component", true,"sell",true,"modulemodal"); "network_component", true,"",true,"modulemodal");
$sec = 'gmodules'; $sec = 'gmodules';
} }

View File

@ -73,9 +73,11 @@ elseif (isset ($_GET["add_module"])) {
if (isset ($_GET["create"]) || isset ($_GET["update"])) { if (isset ($_GET["create"]) || isset ($_GET["update"])) {
//Submitted form //Submitted form
$name = get_parameter_post ("name"); $name = io_safe_output(get_parameter_post ("name"));
$description = get_parameter_post ("description"); $description = get_parameter_post ("description");
if ($name != "") {
if (!empty($name) && !ctype_space($name)) {
$name = io_safe_input($name);
if ($id_np > 0) { if ($id_np > 0) {
//Profile exists //Profile exists
$values = array( $values = array(

View File

@ -65,6 +65,17 @@ $change_weight = (bool) get_parameter('change_weight', false);
$change_label = (bool) get_parameter('change_label', false); $change_label = (bool) get_parameter('change_label', false);
$id_graph = (int) get_parameter('id', 0); $id_graph = (int) get_parameter('id', 0);
if($id_graph !== 0){
$sql = "SELECT * FROM tgraph
WHERE (private = 0 OR (private = 1 AND id_user = '".$config["id_user"]."'))
AND id_graph = ".$id_graph;
$control = db_process_sql($sql);
if(!$control){
header('Location: index.php?sec=reporting&sec2=godmode/reporting/graphs');
}
}
if ($add_graph) { if ($add_graph) {
$name = get_parameter_post ("name"); $name = get_parameter_post ("name");
$description = get_parameter_post ("description"); $description = get_parameter_post ("description");

View File

@ -298,6 +298,26 @@ function update_button_palette_callback() {
break; break;
case 'module_graph': case 'module_graph':
if($('#dir_items').html() == 'horizontal'){
if(parseInt($('#text-left').val()) + (parseInt($('input[name=height_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('width'))
|| parseInt($('#text-left').val()) + (parseInt($('input[name=width_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('width'))){
alert($('#count_items').html()+' joined graph items are wider than background');
return false;
}
}
if($('#dir_items').html() == 'vertical'){
if(parseInt($('#text-top').val()) + (parseInt($('input[name=height_module_graph]').val() * $('#count_items').html())) > parseInt($('#background').css('height'))){
alert($('#count_items').html()+' joined graph items are higher than background');
return false;
}
}
if($('input[name=width_module_graph]').val() == ''){ if($('input[name=width_module_graph]').val() == ''){
alert('Undefined width'); alert('Undefined width');
return false; return false;
@ -1151,6 +1171,8 @@ function loadFieldsFromDB(item) {
}); });
$('#count_items').html(1);
if (data.type == 6 || data.type == 7 || data.type == 8 || data.type == 1) { if (data.type == 6 || data.type == 7 || data.type == 8 || data.type == 1) {
$("#period_row." + item).css('display', ''); $("#period_row." + item).css('display', '');
@ -1169,6 +1191,20 @@ function loadFieldsFromDB(item) {
} }
else { else {
jQuery.get ("ajax.php",
{"page": "general/cg_items","data": data.id_custom_graph},
function (data, status) {
if(data.split(",")[0] == 4){
$('#count_items').html(data.split(",")[1]);
$('#dir_items').html('vertical');
}
else if (data.split(",")[0] == 5) {
$('#count_items').html(data.split(",")[1]);
$('#dir_items').html('horizontal');
}
});
$("input[name='radio_choice'][value='custom_graph']") $("input[name='radio_choice'][value='custom_graph']")
.prop('checked', true); .prop('checked', true);
@ -3125,9 +3161,8 @@ function move_elements_resize(original_width, original_height, width, height) {
} }
function unselectAll() { function unselectAll() {
$("#background").css('border', '1px lightgray solid'); $("#background").css('border', '1px lightgray solid');
$(".item").each(function(){
$(".item").each(function(){
$(this).css('border', ''); $(this).css('border', '');
if($(this).attr('withborder') == 'true'){ if($(this).attr('withborder') == 'true'){
$(this).css('top', '+=1'); $(this).css('top', '+=1');
@ -3136,7 +3171,7 @@ function unselectAll() {
} }
}); });
selectedItem = null;
} }
function click_button_toolbox(id) { function click_button_toolbox(id) {

View File

@ -55,12 +55,12 @@ if (isset($_GET["server"])) {
} }
elseif (isset($_GET["server_remote"])) { elseif (isset($_GET["server_remote"])) {
// Headers // Headers
$id_server= get_parameter_get ("server_remote"); $id_server= get_parameter_get ("server_remote");
$ext = get_parameter ("ext", '');
ui_print_page_header (__('Remote Configuration'), "images/gm_servers.png", false, "servers", true); ui_print_page_header (__('Remote Configuration'), "images/gm_servers.png", false, "servers", true);
enterprise_include("godmode/servers/server_disk_conf_editor.php"); enterprise_include("godmode/servers/server_disk_conf_editor.php");
} }
else { else {
// Header // Header
ui_print_page_header (__('Pandora servers'), "images/gm_servers.png", false, "servers", true); ui_print_page_header (__('Pandora servers'), "images/gm_servers.png", false, "servers", true);
@ -119,7 +119,8 @@ else {
$correct = false; $correct = false;
$id_server = get_parameter ("id_server"); $id_server = get_parameter ("id_server");
$server_md5 = md5(io_safe_output(servers_get_name ($id_server,'none')), FALSE); $ext = get_parameter ("ext", '');
$server_md5 = md5(io_safe_output(servers_get_name ($id_server,'none') . $ext), FALSE);
if (file_exists ($config["remote_config"] . "/md5/" . $server_md5 . ".srv.md5")) { if (file_exists ($config["remote_config"] . "/md5/" . $server_md5 . ".srv.md5")) {
// Server remote configuration editor // Server remote configuration editor

View File

@ -124,9 +124,14 @@ foreach ($servers as $server) {
} }
$data[7] = ui_print_timestamp ($server['keepalive'], true); $data[7] = ui_print_timestamp ($server['keepalive'], true);
$ext = '_server';
if ($server['type'] != 'data')
$ext = '';
$safe_server_name = servers_get_name($server["id_server"]); $safe_server_name = servers_get_name($server["id_server"]);
if (!isset($names_servers[$safe_server_name])){ if (($server['type'] == 'data' || $server['type'] == 'enterprise satellite')) {
if (servers_check_remote_config ($safe_server_name) && enterprise_installed()) { if (servers_check_remote_config ($safe_server_name . $ext) && enterprise_installed()) {
$names_servers[$safe_server_name] = true; $names_servers[$safe_server_name] = true;
} else { } else {
$names_servers[$safe_server_name] = false; $names_servers[$safe_server_name] = false;
@ -154,8 +159,8 @@ foreach ($servers as $server) {
array('title' => __('Edit'))); array('title' => __('Edit')));
$data[8] .= '</a>'; $data[8] .= '</a>';
if ($names_servers[$safe_server_name] === true) { if (($names_servers[$safe_server_name] === true) && ($server['type'] == 'data' || $server['type'] == 'enterprise satellite')) {
$data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server["id_server"].'">'; $data[8] .= '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server["id_server"].'&ext='.$ext.'">';
$data[8] .= html_print_image ('images/remote_configuration.png', true, $data[8] .= html_print_image ('images/remote_configuration.png', true,
array('title' => __('Remote configuration'))); array('title' => __('Remote configuration')));
$data[8] .= '</a>'; $data[8] .= '</a>';

View File

@ -296,6 +296,8 @@ if ($get_double_auth_generation_page) {
ob_clean(); ob_clean();
?> ?>
<script type="text/javascript" src="../../include/javascript/qrcode.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var secret = "<?php echo $secret; ?>"; var secret = "<?php echo $secret; ?>";
var userID = "<?php echo $config['id_user']; ?>"; var userID = "<?php echo $config['id_user']; ?>";

View File

@ -851,7 +851,7 @@ if ($list_modules) {
} }
} }
$data[1] = '<a href="?sec=gpolicies&amp;sec2=enterprise/godmode/policies/policies&amp;id=' . $id_policy . '">' . $data[1] = '<a href="?sec=gmodules&amp;sec2=enterprise/godmode/policies/policies&amp;id=' . $id_policy . '">' .
html_print_image($img,true, array('title' => $title)) . html_print_image($img,true, array('title' => $title)) .
'</a>'; '</a>';
} }

View File

@ -27,7 +27,7 @@ if (is_ajax ()) {
$ent = get_parameter('ent'); $ent = get_parameter('ent');
$offline = get_parameter('offline'); $offline = get_parameter('offline');
if (!$ent) { if (!$ent) {
$dir = $config['attachment_store'] . "/last_package/downloads/pandora_console/extras/mr"; $dir = $config['attachment_store'] . "/downloads/pandora_console/extras/mr";
} }
else { else {
if ($offline) { if ($offline) {
@ -38,7 +38,6 @@ if (is_ajax ()) {
} }
} }
$file = "$dir/$number.sql"; $file = "$dir/$number.sql";
$dangerous_query = false; $dangerous_query = false;
$mr_file = fopen($file, "r"); $mr_file = fopen($file, "r");
while (!feof($mr_file)) { while (!feof($mr_file)) {
@ -141,17 +140,19 @@ if (is_ajax ()) {
} }
if ($remove_rr) { if ($remove_rr) {
$number = get_parameter('number'); $numbers = get_parameter('number',0);
for ($i = 1; $i <= $number; $i++) { foreach ($numbers as $number) {
$file = $config["homedir"] . "/extras/mr/$i.sql"; for ($i = 1; $i <= $number; $i++) {
if (file_exists($file)) { $file = $config["homedir"] . "/extras/mr/$i.sql";
unlink($file); if (file_exists($file)) {
} unlink($file);
} }
}
return; }
}
return;
}
if ($remove_rr_extras) { if ($remove_rr_extras) {
$dir = $config["homedir"] . "/extras/mr/"; $dir = $config["homedir"] . "/extras/mr/";

View File

@ -22,7 +22,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC170323'; $build_version = 'PC170419';
$pandora_version = 'v7.0NG'; $pandora_version = 'v7.0NG';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -2687,7 +2687,7 @@ function get_number_of_mr($package, $ent, $offline) {
global $config; global $config;
if (!$ent) { if (!$ent) {
$dir = $config['attachment_store'] . "/last_package/downloads/pandora_console/extras/mr"; $dir = $config['attachment_store'] . "/downloads/pandora_console/extras/mr";
} }
else { else {
if ($offline) { if ($offline) {

View File

@ -1739,6 +1739,10 @@ function agents_get_status($id_agent = 0, $noACLs = false) {
} }
} }
if (!isset($modules) || empty($modules) || count($modules) == 0) {
return AGENT_MODULE_STATUS_NOT_INIT;
}
$modules_status = array(); $modules_status = array();
$modules_async = 0; $modules_async = 0;
foreach ($modules as $module) { foreach ($modules as $module) {
@ -2473,27 +2477,27 @@ function agents_get_network_interfaces ($agents = false, $agents_filter = false)
else{ else{
$interface_traffic_modules = agents_get_modules($agent_id, $columns, "nombre LIKE 'if%Octets_$interface_name'"); $interface_traffic_modules = agents_get_modules($agent_id, $columns, "nombre LIKE 'if%Octets_$interface_name'");
} }
if (!empty($interface_traffic_modules) && count($interface_traffic_modules) >= 2) { if (!empty($interface_traffic_modules) && count($interface_traffic_modules) >= 2) {
$interface_traffic_modules_aux = array('in' => '', 'out' => ''); $interface_traffic_modules_aux = array('in' => '', 'out' => '');
foreach ($interface_traffic_modules as $interface_traffic_module) { foreach ($interface_traffic_modules as $interface_traffic_module) {
$interface_name_escaped = str_replace("/", "\/", $interface_name); $interface_name_escaped = str_replace("/", "\/", $interface_name);
if($type_interface){ if ($type_interface) {
if (preg_match ("/^" . $interface_name_escaped . "_if(.+)Octets$/i", $interface_traffic_module['nombre'], $matches)) { if (preg_match ("/^" . $interface_name_escaped . "_if(.+)Octets$/i", $interface_traffic_module['nombre'], $matches)) {
if (strtolower($matches[1]) == 'in') { if (strtolower($matches[1]) == 'in' || strtolower($matches[1]) == 'hcin') {
$interface_traffic_modules_aux['in'] = $interface_traffic_module['id_agente_modulo']; $interface_traffic_modules_aux['in'] = $interface_traffic_module['id_agente_modulo'];
} }
elseif (strtolower($matches[1]) == 'out') { elseif (strtolower($matches[1]) == 'out' || strtolower($matches[1]) == 'hcout') {
$interface_traffic_modules_aux['out'] = $interface_traffic_module['id_agente_modulo']; $interface_traffic_modules_aux['out'] = $interface_traffic_module['id_agente_modulo'];
} }
} }
} }
else{ else{
if (preg_match ("/^if(.+)Octets_$interface_name_escaped$/i", $interface_traffic_module['nombre'], $matches)) { if (preg_match ("/^if(.+)Octets_$interface_name_escaped$/i", $interface_traffic_module['nombre'], $matches)) {
if (strtolower($matches[1]) == 'in') { if (strtolower($matches[1]) == 'in' || strtolower($matches[1]) == 'hcin') {
$interface_traffic_modules_aux['in'] = $interface_traffic_module['id_agente_modulo']; $interface_traffic_modules_aux['in'] = $interface_traffic_module['id_agente_modulo'];
} }
elseif (strtolower($matches[1]) == 'out') { elseif (strtolower($matches[1]) == 'out' || strtolower($matches[1]) == 'hcout') {
$interface_traffic_modules_aux['out'] = $interface_traffic_module['id_agente_modulo']; $interface_traffic_modules_aux['out'] = $interface_traffic_module['id_agente_modulo'];
} }
} }

View File

@ -145,10 +145,22 @@ function alerts_get_event_status_group($idGroup, $type = "alert_fired", $query =
else { else {
$temp = array(); $temp = array();
foreach ($type as $item) { foreach ($type as $item) {
$temp[] = '"' . $item . '"'; array_push ( $temp , $item );
} }
$typeWhere = ' AND event_type IN (' . implode(',', $temp) . ')'; $typeWhere = ' AND event_type IN (';
foreach ($temp as $ele) {
$typeWhere .= "'".$ele."'";
if($ele != end($temp)){
$typeWhere .= ",";
}
}
$typeWhere .= ')';
} }
if ($agents == null) { if ($agents == null) {
@ -160,14 +172,11 @@ function alerts_get_event_status_group($idGroup, $type = "alert_fired", $query =
else { else {
$idAgents = array_values($agents); $idAgents = array_values($agents);
if($type=='alert_fired'){
$idAgents = array_keys($agents);
}
} }
$result = db_get_all_rows_sql('SELECT id_evento $result = db_get_all_rows_sql('SELECT id_evento
FROM tevento FROM tevento
WHERE estado = 0 AND id_agente IN (' . implode(',', $idAgents) . ') ' . $typeWhere . $query . ' WHERE estado = 0 AND id_agente IN (0,' . implode(',', $idAgents) . ') ' . $typeWhere . $query . '
ORDER BY id_evento DESC LIMIT 1'); ORDER BY id_evento DESC LIMIT 1');
if ($result === false) { if ($result === false) {

View File

@ -1724,7 +1724,7 @@ function db_check_minor_relase_available_to_um ($package, $ent, $offline) {
global $config; global $config;
if (!$ent) { if (!$ent) {
$dir = $config['attachment_store'] . "/last_package/downloads/pandora_console/extras/mr"; $dir = $config['attachment_store'] . "/downloads/pandora_console/extras/mr";
} }
else { else {
if ($offline) { if ($offline) {
@ -1736,7 +1736,6 @@ function db_check_minor_relase_available_to_um ($package, $ent, $offline) {
} }
$have_minor_release = false; $have_minor_release = false;
if (file_exists($dir) && is_dir($dir)) { if (file_exists($dir) && is_dir($dir)) {
if (is_readable($dir)) { if (is_readable($dir)) {
$files = scandir($dir); // Get all the files from the directory ordered by asc $files = scandir($dir); // Get all the files from the directory ordered by asc

View File

@ -4242,7 +4242,7 @@ function graph_netflow_aggregate_area ($data, $period, $width, $height, $unit =
$sources, array (), ui_get_full_url("images/image_problem.opaque.png", false, false, false), $sources, array (), ui_get_full_url("images/image_problem.opaque.png", false, false, false),
"", $unit, $homeurl, "", $unit, $homeurl,
$config['homedir'] . "/images/logo_vertical_water.png", $config['homedir'] . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size'], $unit, 2); $config['fontpath'], $config['font_size'], $unit, $ttl);
} }

View File

@ -519,13 +519,23 @@ function networkmap_links_to_js_links($relations, $nodes_graph) {
$item['arrow_end'] = 'module'; $item['arrow_end'] = 'module';
$item['status_end'] = modules_get_agentmodule_status((int)$id_target_module, false, false, null); $item['status_end'] = modules_get_agentmodule_status((int)$id_target_module, false, false, null);
$item['id_module_end'] = (int)$id_target_module; $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) { if ($relation['child_type'] == 1) {
$item['arrow_start'] = 'module'; $item['arrow_start'] = 'module';
$item['status_start'] = modules_get_agentmodule_status((int)$id_source_module, false, false, null); $item['status_start'] = modules_get_agentmodule_status((int)$id_source_module, false, false, null);
$item['id_module_start'] = (int)$id_source_module; $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; $agent = 0;
@ -1038,7 +1048,7 @@ function clean_duplicate_links ($relations) {
if (enterprise_installed()) { if (enterprise_installed()) {
delete_link($segregation_links['mm'][$index_to_del]); delete_link($segregation_links['mm'][$index_to_del]);
} }
unset($segregation_links['mm'][$index_to_del]); //unset($segregation_links['mm'][$index_to_del]);
} }
$index_to_del++; $index_to_del++;
} }
@ -1142,8 +1152,8 @@ function clean_duplicate_links ($relations) {
} }
$final_links3['aa'] = $final_links2['aa']; $final_links3['aa'] = $final_links2['aa'];
$final_links3['mm'] = $final_links2['mm']; $final_links3['mm'] = $segregation_links['mm'];
$final_links3['am'] = $final_links2['am']; $final_links3['am'] = $segregation_links['am'];
$final_links3['ff'] = $final_links2['ff']; $final_links3['ff'] = $final_links2['ff'];
$cleaned_links = array(); $cleaned_links = array();
@ -1270,6 +1280,9 @@ function show_networkmap($id = 0, $user_readonly = false, $nodes_and_relations =
<img id="image_hide_show_labels" src="images/icono_borrar.png" /> <img id="image_hide_show_labels" src="images/icono_borrar.png" />
</a> </a>
</div>'; </div>';
echo '<div id="holding_spinner_' . $networkmap['id'] . '" style="display: none; position: absolute; right: 50px; top: 20px;">
<img id="image_hide_show_labels" src="images/spinner.gif" />
</div>';
echo '</div>'; echo '</div>';
@ -1322,7 +1335,6 @@ function show_networkmap($id = 0, $user_readonly = false, $nodes_and_relations =
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
$(document).ready(function() { $(document).ready(function() {
init_graph({ init_graph({
refesh_period: networkmap_refresh_time,
graph: networkmap, graph: networkmap,
networkmap_center: networkmap_center, networkmap_center: networkmap_center,
networkmap_dimensions: networkmap_dimensions, networkmap_dimensions: networkmap_dimensions,
@ -1335,8 +1347,6 @@ function show_networkmap($id = 0, $user_readonly = false, $nodes_and_relations =
init_minimap(); init_minimap();
function_open_minimap(); function_open_minimap();
window.interval_obj = setInterval(update_networkmap, networkmap_refresh_time);
$(document.body).on("mouseleave", $(document.body).on("mouseleave",
".context-menu-list", ".context-menu-list",
function(e) { function(e) {
@ -1415,6 +1425,13 @@ if (empty($list_networkmaps))
html_print_image('images/dot_green.png', true) . '</span>' . html_print_image('images/dot_green.png', true) . '</span>' .
'<span id="shape_icon_fail" style="display: none;">' . '<span id="shape_icon_fail" style="display: none;">' .
html_print_image('images/dot_red.png', true) . '</span>'; html_print_image('images/dot_red.png', true) . '</span>';
$table->data["node_name"][0] = __('Name');
$table->data["node_name"][1] = html_print_input_text('edit_name_node',
'', __('name node'), '20', '50', true);
$table->data["node_name"][2] =
html_print_button(__('Update node'), '', false,
'', 'class="sub"', true);
$table->data["fictional_node_name"][0] = __('Name'); $table->data["fictional_node_name"][0] = __('Name');
$table->data["fictional_node_name"][1] = html_print_input_text('edit_name_fictional_node', $table->data["fictional_node_name"][1] = html_print_input_text('edit_name_fictional_node',
'', __('name fictional node'), '20', '50', true); '', __('name fictional node'), '20', '50', true);

View File

@ -311,7 +311,8 @@ function reporting_make_reporting_data($report = null, $id_report,
$type, $type,
$force_width_chart, $force_width_chart,
$force_height_chart, $force_height_chart,
'netflow_area'); 'netflow_area',
$pdf);
break; break;
case 'netflow_pie': case 'netflow_pie':
$report['contents'][] = reporting_netflow( $report['contents'][] = reporting_netflow(
@ -320,7 +321,8 @@ function reporting_make_reporting_data($report = null, $id_report,
$type, $type,
$force_width_chart, $force_width_chart,
$force_height_chart, $force_height_chart,
'netflow_pie'); 'netflow_pie',
$pdf);
break; break;
case 'netflow_data': case 'netflow_data':
$report['contents'][] = reporting_netflow( $report['contents'][] = reporting_netflow(
@ -329,7 +331,8 @@ function reporting_make_reporting_data($report = null, $id_report,
$type, $type,
$force_width_chart, $force_width_chart,
$force_height_chart, $force_height_chart,
'netflow_data'); 'netflow_data',
$pdf);
break; break;
case 'netflow_statistics': case 'netflow_statistics':
$report['contents'][] = reporting_netflow( $report['contents'][] = reporting_netflow(
@ -338,7 +341,8 @@ function reporting_make_reporting_data($report = null, $id_report,
$type, $type,
$force_width_chart, $force_width_chart,
$force_height_chart, $force_height_chart,
'netflow_statistics'); 'netflow_statistics',
$pdf);
break; break;
case 'netflow_summary': case 'netflow_summary':
$report['contents'][] = reporting_netflow( $report['contents'][] = reporting_netflow(
@ -347,7 +351,8 @@ function reporting_make_reporting_data($report = null, $id_report,
$type, $type,
$force_width_chart, $force_width_chart,
$force_height_chart, $force_height_chart,
'netflow_summary'); 'netflow_summary',
$pdf);
break; break;
case 'monitor_report': case 'monitor_report':
$report['contents'][] = reporting_monitor_report( $report['contents'][] = reporting_monitor_report(
@ -3241,7 +3246,7 @@ function reporting_monitor_report($report, $content) {
} }
function reporting_netflow($report, $content, $type, function reporting_netflow($report, $content, $type,
$force_width_chart, $force_height_chart, $type_netflow = null) { $force_width_chart, $force_height_chart, $type_netflow = null, $pdf = false) {
global $config; global $config;
@ -3315,7 +3320,7 @@ function reporting_netflow($report, $content, $type,
$filter, $filter,
$content['top_n_value'], $content['top_n_value'],
$content ['server_name'], $content ['server_name'],
'HTML'); $pdf ? 'PDF' : 'HTML');
break; break;
case 'data': case 'data':
break; break;

View File

@ -1361,7 +1361,7 @@ function reporting_html_agent_module($table, $item) {
break; break;
} }
$file_name = ui_print_truncate_text($row['agent_alias'], 'agent_small', $file_name = ui_print_truncate_text($row['agent_name'], 'agent_small',
false, true, false, '...'); false, true, false, '...');
$table_data .= "<td style='background-color: " . $rowcolor . ";'>" . $table_data .= "<td style='background-color: " . $rowcolor . ";'>" .
$file_name . "</td>"; $file_name . "</td>";
@ -1379,7 +1379,8 @@ function reporting_html_agent_module($table, $item) {
__("%s in %s : NORMAL", __("%s in %s : NORMAL",
$module_name, $module_name,
$row['agent_name']), $row['agent_name']),
true, array('width' => '20px', 'height' => '20px')); true, array('width' => '20px', 'height' => '20px'),
'images/status_sets/default/');
break; break;
case AGENT_STATUS_CRITICAL: case AGENT_STATUS_CRITICAL:
$table_data .= ui_print_status_image( $table_data .= ui_print_status_image(
@ -1387,7 +1388,8 @@ function reporting_html_agent_module($table, $item) {
__("%s in %s : CRITICAL", __("%s in %s : CRITICAL",
$module_name, $module_name,
$row['agent_name']), $row['agent_name']),
true, array('width' => '20px', 'height' => '20px')); true, array('width' => '20px', 'height' => '20px'),
'images/status_sets/default/');
break; break;
case AGENT_STATUS_WARNING: case AGENT_STATUS_WARNING:
$table_data .= ui_print_status_image( $table_data .= ui_print_status_image(
@ -1395,7 +1397,8 @@ function reporting_html_agent_module($table, $item) {
__("%s in %s : WARNING", __("%s in %s : WARNING",
$module_name, $module_name,
$row['agent_name']), $row['agent_name']),
true, array('width' => '20px', 'height' => '20px')); true, array('width' => '20px', 'height' => '20px'),
'images/status_sets/default/');
break; break;
case AGENT_STATUS_UNKNOWN: case AGENT_STATUS_UNKNOWN:
$table_data .= ui_print_status_image( $table_data .= ui_print_status_image(
@ -1403,7 +1406,8 @@ function reporting_html_agent_module($table, $item) {
__("%s in %s : UNKNOWN", __("%s in %s : UNKNOWN",
$module_name, $module_name,
$row['agent_name']), $row['agent_name']),
true, array('width' => '20px', 'height' => '20px')); true, array('width' => '20px', 'height' => '20px'),
'images/status_sets/default/');
break; break;
case AGENT_MODULE_STATUS_NORMAL_ALERT: case AGENT_MODULE_STATUS_NORMAL_ALERT:
case AGENT_MODULE_STATUS_WARNING_ALERT: case AGENT_MODULE_STATUS_WARNING_ALERT:
@ -1413,7 +1417,8 @@ function reporting_html_agent_module($table, $item) {
__("%s in %s : ALERTS FIRED", __("%s in %s : ALERTS FIRED",
$module_name, $module_name,
$row['agent_name']), $row['agent_name']),
true, array('width' => '20px', 'height' => '20px')); true, array('width' => '20px', 'height' => '20px'),
'images/status_sets/default/');
break; break;
case 4: case 4:
$table_data .= ui_print_status_image( $table_data .= ui_print_status_image(
@ -1421,7 +1426,8 @@ function reporting_html_agent_module($table, $item) {
__("%s in %s : Not initialize", __("%s in %s : Not initialize",
$module_name, $module_name,
$row['agent_name']), $row['agent_name']),
true, array('width' => '20px', 'height' => '20px')); true, array('width' => '20px', 'height' => '20px'),
'images/status_sets/default/');
break; break;
} }
$table_data .= "</td>"; $table_data .= "</td>";

View File

@ -124,7 +124,7 @@ function ui_print_truncate_text($text, $numChars = GENERIC_SIZE_TEXT, $showTextI
} }
} }
if ($showTextInAToopTip) { if ($showTextInAToopTip) {
$truncateText = $truncateText . ui_print_help_tip($text, true); $truncateText = $truncateText . ui_print_help_tip(htmlspecialchars($text), true);
} }
else { else {
if ($style !== false) { if ($style !== false) {
@ -813,7 +813,7 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f
else { else {
$img = 'images/policies.png'; $img = 'images/policies.png';
$data[$index['policy']] = '<a href="?sec=gpolicies&amp;sec2=enterprise/godmode/policies/policies&amp;id=' . $policyInfo['id'] . '">' . $data[$index['policy']] = '<a href="?sec=gmodules&amp;sec2=enterprise/godmode/policies/policies&amp;id=' . $policyInfo['id'] . '">' .
html_print_image($img,true, array('title' => $policyInfo['name'])) . html_print_image($img,true, array('title' => $policyInfo['name'])) .
'</a>'; '</a>';
} }

View File

@ -363,10 +363,10 @@ function update_manager_check_online_free_packages ($is_ajax=true) {
var applying_mr = "<?php echo __('Applying DB MR'); ?>\n"; var applying_mr = "<?php echo __('Applying DB MR'); ?>\n";
</script> </script>
<?php <?php
$baseurl = ui_get_full_url(false, false, false, false);
echo "<p><b>There is a new version:</b> " . $result[0]['version'] . "</p>"; echo "<p><b>There is a new version:</b> " . $result[0]['version'] . "</p>";
echo "<a href='javascript: update_last_package(\"" . base64_encode($result[0]["file_name"]) . echo "<a href='javascript: update_last_package(\"" . base64_encode($result[0]["file_name"]) .
"\", \"" . $result[0]['version'] ."\");'>" . "\", \"" . $result[0]['version'] ."\", \"" . $baseurl ."\");'>" .
__("Update to the last version") . "</a>"; __("Update to the last version") . "</a>";
} }
else { else {

View File

@ -2434,12 +2434,9 @@ function visual_map_print_visual_map ($id_layout, $show_links = true,
$proportion_height = 0; $proportion_height = 0;
$proportion_width = 0; $proportion_width = 0;
if (!is_null($height) && !is_null($width)) { if (!is_null($height) && !is_null($width)) {
$resizedMap = true; $resizedMap = true;
if ($keep_aspect_ratio) { if ($keep_aspect_ratio) {
$ratio = min($width / $layout['width'], $height / $layout['height']); $ratio = min($width / $layout['width'], $height / $layout['height']);
$mapWidth = $ratio * $layout['width']; $mapWidth = $ratio * $layout['width'];
@ -2453,49 +2450,48 @@ function visual_map_print_visual_map ($id_layout, $show_links = true,
$dif_height = $layout["height"] - $mapHeight; $dif_height = $layout["height"] - $mapHeight;
$dif_width = $layout["width"] - $mapWidth; $dif_width = $layout["width"] - $mapWidth;
$proportion_height = $mapHeight / $layout["height"]; $proportion_height = $mapHeight / $layout["height"];
$proportion_width = $mapWidth / $layout["width"]; $proportion_width = $mapWidth / $layout["width"];
if ($layout["background"] != 'None.png' ) {
if (is_metaconsole()) { if (is_metaconsole()) {
$backgroundImage = $backgroundImage =
'/include/Image/image_functions.php?getFile=1&thumb=1&thumb_size=' . $mapWidth . 'x' . $mapHeight . '&file=' . '/include/Image/image_functions.php?getFile=1&thumb=1&thumb_size=' . $mapWidth . 'x' . $mapHeight . '&file=' .
$config['homeurl'] . 'images/console/background/' . $config['homeurl'] . 'images/console/background/' .
$layout["background"]; $layout["background"];
} }
else { else {
$backgroundImage = $backgroundImage =
'/include/Image/image_functions.php?getFile=1&thumb=1&thumb_size=' . $mapWidth . 'x' . $mapHeight . '&file=' . '/include/Image/image_functions.php?getFile=1&thumb=1&thumb_size=' . $mapWidth . 'x' . $mapHeight . '&file=' .
$config['homedir'] . '/images/console/background/' . $config['homedir'] . '/images/console/background/' .
($layout["background"]); ($layout["background"]);
}
} }
} }
else { else {
$mapWidth = $layout["width"]; $mapWidth = $layout["width"];
$mapHeight = $layout["height"]; $mapHeight = $layout["height"];
$backgroundImage = $metaconsole_hack . 'images/console/background/' . $backgroundImage = '';
$layout["background"]; if ($layout["background"] != 'None.png' )
$backgroundImage = $metaconsole_hack . 'images/console/background/' .
$layout["background"];
} }
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {
echo "<div style='width: 100%; overflow:auto; margin: 0 auto; padding:5px;'>"; echo "<div style='width: 100%; overflow:auto; margin: 0 auto; padding:5px;'>";
} }
echo '<div style="'; echo '<div id="background_'.$id_layout.'"
if(get_parameter('pure')==1){
echo 'width:100%;height:100%;position:absolute;';
}
echo 'background-color:'.$layout["background_color"].';"><div id="background_'.$id_layout.'"
style="margin:0px auto;text-align: style="margin:0px auto;text-align:
z-index: 0; z-index: 0;
position:relative; position:relative;
width:' . $mapWidth . 'px; width:' . $mapWidth . 'px;
height:' . $mapHeight . 'px;">'; height:' . $mapHeight . 'px;
echo "<img src='" . background-color:'.$layout["background_color"].';">';
ui_get_full_url($backgroundImage) . "' width='100%' height='100%' />";
if ($layout["background"] != 'None.png' )
echo "<img src='" .
ui_get_full_url($backgroundImage) . "' width='100%' height='100%' />";
$layout_datas = db_get_all_rows_field_filter('tlayout_data', $layout_datas = db_get_all_rows_field_filter('tlayout_data',

View File

@ -446,7 +446,10 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
html_print_input_text('width_module_graph', 300, '', 3, 5, true) . html_print_input_text('width_module_graph', 300, '', 3, 5, true) .
' X ' . ' X ' .
html_print_input_text('height_module_graph', 180, '', 3, 5, true) . html_print_input_text('height_module_graph', 180, '', 3, 5, true) .
'</td>'; ' X ' .
'<span id="count_items">1</span> '.
'<span id="dir_items"></span> item/s
</td>';
//Insert and modify before the buttons to create or update. //Insert and modify before the buttons to create or update.
@ -587,6 +590,49 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$(".border_color").attachColorPicker(); $(".border_color").attachColorPicker();
$(".fill_color").attachColorPicker(); $(".fill_color").attachColorPicker();
$(".line_color").attachColorPicker(); $(".line_color").attachColorPicker();
$("input[name=radio_choice]").change(function(){
$('#count_items').html(1);
});
$("#custom_graph").click(function(){
$('#count_items').html(1);
jQuery.get ("ajax.php",
{"page": "general/cg_items","data": $(this).val()},
function (data, status) {
if(data.split(",")[0] == 8){
size = 400+(data.split(",")[1] * 50);
if(data.split(",")[1]>3){
size = 400+(3 * 50);
}
$('#text-width_module_graph').val(size);
$('#text-height_module_graph').val(180);
}
else if (data.split(",")[0] == 4) {
size = data.split(",")[1];
if(data.split(",")[1] > 1){
$('#count_items').html(data.split(",")[1]);
$('#dir_items').html('vertical');
}
$('#text-width_module_graph').val(300);
$('#text-height_module_graph').val(50);
}
else if (data.split(",")[0] == 5) {
size = data.split(",")[1];
if(data.split(",")[1] > 1){
$('#count_items').html(data.split(",")[1]);
$('#dir_items').html('horizontal');
}
$('#text-width_module_graph').val(100);
$('#text-height_module_graph').val(100);
}
});
});
}); });
</script> </script>
<?php <?php

View File

@ -143,8 +143,12 @@ function progressbar($progress, $width, $height, $title, $font,
$graph['mode'] = $mode; $graph['mode'] = $mode;
$id_graph = serialize_in_temp($graph, null, $ttl); $id_graph = serialize_in_temp($graph, null, $ttl);
if (is_metaconsole()) {
return "<img src='include/graphs/functions_gd.php?static_graph=1&graph_type=progressbar&ttl=".$ttl."&id_graph=".$id_graph."'>"; return "<img src='../../include/graphs/functions_gd.php?static_graph=1&graph_type=progressbar&ttl=".$ttl."&id_graph=".$id_graph."'>";
}
else {
return "<img src='include/graphs/functions_gd.php?static_graph=1&graph_type=progressbar&ttl=".$ttl."&id_graph=".$id_graph."'>";
}
} }

View File

@ -142,23 +142,31 @@ function pandoraFlotPieCustom(graph_id, values, labels, width,
} }
var label_conf; var label_conf;
label_conf = {
show: true,
radius: 0.75,
formatter: function(label, series) {
return '<div style="font-size:' + font_size + 'pt;' +
'text-align:center;padding:2px;color:white;">' +
series.percent.toFixed(2) + '%</div>';
},
background: {
opacity: 0.5,
color: ''
}
};
var show_legend = true; var show_legend = true;
if((width <= 450)) {
show_legend = false;
label_conf = {
show: false
};
}
else {
label_conf = {
show: true,
radius: 0.75,
formatter: function(label, series) {
return '<div style="font-size:' + font_size + 'pt;' +
'text-align:center;padding:2px;color:white;">' +
series.percent.toFixed(2) + '%</div>';
},
background: {
opacity: 0.5,
color: ''
}
};
}
var conf_pie = { var conf_pie = {
series: { series: {
pie: { pie: {
@ -176,6 +184,9 @@ function pandoraFlotPieCustom(graph_id, values, labels, width,
clickable: true clickable: true
} }
}; };
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
conf_pie.series.pie.label = {show: false};
}
var plot = $.plot($('#'+graph_id), data, conf_pie); var plot = $.plot($('#'+graph_id), data, conf_pie);
if (no_data == data.length) { if (no_data == data.length) {
@ -205,17 +216,17 @@ function pandoraFlotPieCustom(graph_id, values, labels, width,
var pielegends = $('#'+graph_id+' .pieLabelBackground'); var pielegends = $('#'+graph_id+' .pieLabelBackground');
pielegends.each(function () { pielegends.each(function () {
$(this).css('transform', "rotate(-35deg)"); $(this).css('transform', "rotate(-35deg)").css('color', 'black');
}); });
var labelpielegends = $('#'+graph_id+' .pieLabel'); var labelpielegends = $('#'+graph_id+' .pieLabel');
labelpielegends.each(function () { labelpielegends.each(function () {
$(this).css('transform', "rotate(-35deg)"); $(this).css('transform', "rotate(-35deg)").css('color', 'black');
}); });
// Events // Events
$('#' + graph_id).bind('plothover', pieHover); $('#' + graph_id).bind('plothover', pieHover);
$('#' + graph_id).bind('plotclick', Clickpie); $('#' + graph_id).bind('plotclick', Clickpie);
$('#' + graph_id).bind('mouseout',resetInteractivity); $('#' + graph_id).bind('mouseout', resetInteractivity);
$('#' + graph_id).css('margin-left', 'auto'); $('#' + graph_id).css('margin-left', 'auto');
$('#' + graph_id).css('margin-right', 'auto'); $('#' + graph_id).css('margin-right', 'auto');
@ -309,15 +320,19 @@ function pandoraFlotHBars(graph_id, values, labels, water_mark,
borderWidth: 1, borderWidth: 1,
backgroundColor: { colors: ["#FFF", "#FFF"] } backgroundColor: { colors: ["#FFF", "#FFF"] }
}, },
xaxis: {
axisLabelUseCanvas: true,
axisLabelFontSizePixels: font_size,
axisLabelFontFamily: font+'Font',
tickFormatter: xFormatter,
},
yaxis: { yaxis: {
axisLabelUseCanvas: true, axisLabelUseCanvas: true,
axisLabelFontSizePixels: 12, axisLabelFontSizePixels: font_size,
axisLabelFontFamily: font+'Font', axisLabelFontFamily: font+'Font',
axisLabelPadding: 3, ticks: yFormatter,
ticks: yFormatter, color: '',
tickSize: 1, },
color: '',
},
legend: { legend: {
show: false show: false
} }
@ -339,141 +354,38 @@ function pandoraFlotHBars(graph_id, values, labels, water_mark,
$('#' + graph_id).HUseTooltip(); $('#' + graph_id).HUseTooltip();
$('#' + graph_id).css("margin-left","auto"); $('#' + graph_id).css("margin-left","auto");
$('#' + graph_id).css("margin-right","auto"); $('#' + graph_id).css("margin-right","auto");
$('#' + graph_id).find('div.legend-tooltip').tooltip({ track: true }); //~ $('#' + graph_id).find('div.legend-tooltip').tooltip({ track: true });
// Adjust the top of yaxis tick to set it in the middle of the bars
//yAxisHeight = $('#' + graph_id + ' .yAxis .tickLabel')
//.css('height').split('px')[0];
//~ i = 0;
//~ $('#' + graph_id + ' .yAxis .tickLabel').each(function() {
//~ $(this).css('display','none');
//~ $(this).addClass("legend_"+i);
//~ i++;
//~ });
$('#' + graph_id + ' .xAxis .tickLabel').each(function() {
/*
tickTop = $(this).css('top').split('px')[0];
tickNewTop = parseInt(parseInt(tickTop) - (yAxisHeight / 2) - 3);
$(this).css('top', tickNewTop + 'px');
valuesNewTop = parseInt(parseInt(tickTop) - (yAxisHeight));
$('#value_' + i + '_' + graph_id)
.css('top',parseInt(plot.offset().top) + parseInt(valuesNewTop));
pixelPerValue = parseInt(plot.width()) / maxvalue;
inCanvasValuePos = parseInt(pixelPerValue *
($('#value_' + i + '_' + graph_id).html()));
label_width = ($('#value_' + i + '_' + graph_id)
.css('width').split('px')[0] - 3);
label_left_offset = plot.offset().left + inCanvasValuePos + 5; //Label located on right side of bar + 5 pixels
//If label fit into the bar just recalculate left position to fit on right side of bar
if (inCanvasValuePos > label_width) {
label_left_offset = plot.offset().left + inCanvasValuePos
- $('#value_' + i + '_' + graph_id).css('width').split('px')[0] - 3;
}
$('#value_' + i + '_' + graph_id)
.css('left', label_left_offset);
i++;
*/
label = parseFloat($(this).text());
text = label.toLocaleString();
if ( label >= 1000000)
text = text.substring(0,4) + "M";
else if (label >= 100000)
text = text.substring(0,3) + "K";
else if (label >= 1000)
text = text.substring(0,2) + "K";
$(this).text(text);
});
/*
// When resize the window, adjust the values
$('#' + graph_id).parent().resize(function () {
i = 0;
pixelPerValue = parseInt(plot.width()) / maxvalue;
$('#' + graph_id + ' .yAxis .tickLabel').each(function() {
inCanvasValuePos = parseInt(pixelPerValue *
($('#value_' + i + '_' + graph_id).html()));
label_width = ($('#value_' + i + '_' + graph_id)
.css('width').split('px')[0] - 3);
label_left_offset = plot.offset().left + inCanvasValuePos + 5; //Label located on right side of bar + 5 pixels
//If label fit into the bar just recalculate left position to fit on right side of bar
if (inCanvasValuePos > label_width) {
label_left_offset = plot.offset().left + inCanvasValuePos
- $('#value_' + i + '_' + graph_id)
.css('width').split('px')[0] - 3;
}
$('#value_' + i + '_' + graph_id)
.css('left', label_left_offset);
i++;
});
});
// Format functions
function xFormatter(v, axis) {
if (labels[v] != undefined) {
return labels[v];
}
else {
return '';
}
}
function yFormatter(v, axis) {
return v;
}
// Events
$('#' + graph_id).bind('plothover', function (event, pos, item) {
$('.values_' + graph_id).css('font-weight', '');
if (item != null) {
index = item.dataIndex;
$('#value_' + index + '_' + graph_id)
.css('font-weight', 'bold');
}
});
if (water_mark) {
set_watermark(graph_id, plot,
$('#watermark_image_' + graph_id).attr('src'));
}
if (maxvalue == 0) {
// Fixed the position for the graphs with all values in
// bars is 0.
$(".values_" + graph_id).css("left", (plot.offset().left + 5) + "px");
}
* */
function yFormatter(v, axis) { function yFormatter(v, axis) {
format = new Array(); format = new Array();
for (i = 0; i < labels_total.length; i++) { for (i = 0; i < labels_total.length; i++) {
var label = labels_total[i][1]; var label = labels_total[i][1];
var shortLabel = reduceText(label, 30); var shortLabel = reduceText(label, 25);
var title = ''; var title = '';
if (label !== shortLabel) { if (label !== shortLabel) {
title = label; title = label;
label = shortLabel; label = shortLabel;
} }
format.push([i,'<div style=font-size:'+font_size+'pt title="'+title+'" class="'+font+'">' format.push([i,'<div style="font-size:'+font_size+'pt !important; word-break:keep-all; max-width: 150px;" title="'+title+'" class="'+font+'">'
+ label + label
+ '</div>']); + '</div>']);
} }
return format; return format;
} }
function xFormatter(v, axis) {
label = parseFloat(v);
text = label.toLocaleString();
if ( label >= 1000000)
text = text.substring(0,4) + "M";
else if (label >= 100000)
text = text.substring(0,3) + "K";
else if (label >= 1000)
text = text.substring(0,2) + "K";
return '<div style="font-size:'+font_size+'pt !important;">'+text+'</div>';
}
if (water_mark) { if (water_mark) {
set_watermark(graph_id, plot, $('#watermark_image_'+graph_id).attr('src')); set_watermark(graph_id, plot, $('#watermark_image_'+graph_id).attr('src'));
} }
@ -600,20 +512,30 @@ function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors,
}, },
xaxis: { xaxis: {
axisLabelUseCanvas: true, axisLabelUseCanvas: true,
axisLabelFontSizePixels: 7, axisLabelFontSizePixels: font_size,
axisLabelFontFamily: font+'Font', axisLabelFontFamily: font+'Font',
axisLabelPadding: 0, axisLabelPadding: 0,
ticks: xFormatter, ticks: xFormatter,
labelWidth: 130, labelWidth: 130,
labelHeight: 50,
}, },
yaxis: { yaxis: {
axisLabelUseCanvas: true, axisLabelUseCanvas: true,
axisLabelFontSizePixels: 7, axisLabelFontSizePixels: font_size,
axisLabelFontFamily: font+'Font', axisLabelFontFamily: font+'Font',
axisLabelPadding: 100, axisLabelPadding: 100,
autoscaleMargin: 0.02, autoscaleMargin: 0.02,
tickFormatter: function (v, axis) { tickFormatter: function (v, axis) {
return v ; label = parseFloat(v);
text = label.toLocaleString();
if ( label >= 1000000)
text = text.substring(0,4) + "M";
else if (label >= 100000)
text = text.substring(0,3) + "K";
else if (label >= 1000)
text = text.substring(0,2) + "K";
return '<div style="font-size:'+font_size+'pt !important;">'+text+'</div>';
} }
}, },
legend: { legend: {
@ -630,82 +552,43 @@ function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors,
} }
}; };
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))
options.xaxis.labelWidth = 100;
var plot = $.plot($('#'+graph_id),datas, options ); var plot = $.plot($('#'+graph_id),datas, options );
$('#' + graph_id).VUseTooltip(); $('#' + graph_id).VUseTooltip();
$('#' + graph_id).css("margin-left","auto"); $('#' + graph_id).css("margin-left","auto");
$('#' + graph_id).css("margin-right","auto"); $('#' + graph_id).css("margin-right","auto");
$('#' + graph_id).find('div.legend-tooltip').tooltip({ track: true }); //~ $('#' + graph_id).find('div.legend-tooltip').tooltip({ track: true });
// Adjust the top of yaxis tick to set it in the middle of the bars
//yAxisHeight = $('#'+graph_id+' .yAxis .tickLabel').css('height').split('px')[0];
//plot.getPlaceholder().onload = function(){pruebas};
//~ i = 0;
//~ $('#'+graph_id+' .xAxis .tickLabel').each(function() {
//~ $(this).css('display','none');
//~ $(this).addClass("legend_"+i);
//~ i++;
//~ tickNewTop = parseInt(parseInt(tickTop) - (yAxisHeight/2)-3);
//~ $(this).css('top', tickNewTop+'px');
//~
//~ valuesNewTop = parseInt(parseInt(tickTop) - (yAxisHeight));
//~
//~ $('#value_'+i+'_'+graph_id).css('top',parseInt(plot.offset().top) + parseInt(valuesNewTop));
//~
//~ pixelPerValue = parseInt(plot.width()) / maxvalue;
//~
//~ inCanvasValuePos = parseInt(pixelPerValue * ($('#value_'+i+'_'+graph_id).html()));
//~
//~ $('#value_'+i+'_'+graph_id).css('left',plot.offset().left + inCanvasValuePos - $('#value_'+i+'_'+graph_id).css('width').split('px')[0] - 3);
//~ });
// When resize the window, adjust the values
//~ $('#'+graph_id).parent().resize(function () {
//~ i = 0;
//~ pixelPerValue = parseInt(plot.width()) / maxvalue;
//~
//~ $('#'+graph_id+' .yAxis .tickLabel').each(function() {
//~ inCanvasValuePos = parseInt(pixelPerValue * ($('#value_'+i+'_'+graph_id).html()));
//~
//~ $('#value_'+i+'_'+graph_id).css('left',plot.offset().left + inCanvasValuePos - $('#value_'+i+'_'+graph_id).css('width').split('px')[0] - 3);
//~ i++;
//~ });
//~ });
$('#'+graph_id+' .yAxis .tickLabel').each(function() {
label = parseFloat($(this).text());
text = label.toLocaleString();
if ( label >= 1000000)
text = text.substring(0,4) + "M";
else if (label >= 100000)
text = text.substring(0,3) + "K";
else if (label >= 1000)
text = text.substring(0,2) + "K";
$(this).text(text);
});
$('#'+graph_id+' .xAxis .tickLabel') $('#'+graph_id+' .xAxis .tickLabel')
.css('transform', 'rotate(-45deg)') .css('transform', 'rotate(-45deg)')
.css('max-width','100px')
.find('div') .find('div')
.css('position', 'relative') .css('position', 'relative')
.css('top', '+10px') .css('top', '+10px')
.css('left', '-20px'); .css('left', '-30px');
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))
$('#'+graph_id+' .xAxis .tickLabel')
.find('div')
.css('top', '+0px')
.css('left', '-20px');
// Format functions // Format functions
function xFormatter(v, axis) { function xFormatter(v, axis) {
var format = new Array(); var format = new Array();
for (i = 0; i < labels_total.length; i++) { for (i = 0; i < labels_total.length; i++) {
var label = labels_total[i][1]; var label = labels_total[i][1];
var shortLabel = reduceText(label, 35); var shortLabel = reduceText(label, 28);
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent))
shortLabel = reduceText(label, 18);
var title = ''; var title = '';
if (label !== shortLabel) { if (label !== shortLabel) {
title = label; title = label;
label = shortLabel; label = shortLabel;
} }
format.push([i, format.push([i,
'<div class="'+font+'" title="'+title+'" style="word-break: break-word; max-width: 110px;font-size:'+font_size+'pt">' '<div class="'+font+'" title="'+title+'" style="word-break: normal; max-width: 100px;font-size:'+font_size+'pt !important;">'
+ label + label
+ '</div>']); + '</div>']);
} }
@ -713,22 +596,13 @@ function pandoraFlotVBars(graph_id, values, labels, labels_long, legend, colors,
} }
function yFormatter(v, axis) { function yFormatter(v, axis) {
return v; return '<div class="'+font+'" style="font-size:'+font_size+'pt !important;">'+v+'</div>';
} }
function lFormatter(v, axis) { function lFormatter(v, axis) {
return '<div style=color:>'+v+'</div>'; return '<div style="font-size:'+font_size+'pt !important;">'+v+'</div>';
} }
// Events
//~ $('#'+graph_id).bind('plothover', function (event, pos, item) {
//~ $('.values_'+graph_id).css('font-weight', '');
//~ if(item != null) {
//~ index = item.dataIndex;
//~ $('#value_'+index+'_'+graph_id).css('font-weight', 'bold');
//~ }
//~ });
if (water_mark) { if (water_mark) {
set_watermark(graph_id, plot, $('#watermark_image_'+graph_id).attr('src')); set_watermark(graph_id, plot, $('#watermark_image_'+graph_id).attr('src'));
} }
@ -857,7 +731,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
force_integer, separator, separator2, force_integer, separator, separator2,
yellow_up, red_up, yellow_inverse, red_inverse, yellow_up, red_up, yellow_inverse, red_inverse,
series_suffix_str, dashboard, vconsole, xaxisname,background_color,legend_color) { series_suffix_str, dashboard, vconsole, xaxisname,background_color,legend_color) {
var threshold = true; var threshold = true;
var thresholded = false; var thresholded = false;
font = font.split("/").pop().split(".").shift(); font = font.split("/").pop().split(".").shift();
@ -1581,7 +1455,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
// Re-calculate the graph height with the legend height // Re-calculate the graph height with the legend height
if (dashboard || vconsole) { if (dashboard || vconsole) {
var hDiff = $('#'+graph_id).height() - $('#legend_'+graph_id).height(); var hDiff = $('#'+graph_id).height() - $('#legend_'+graph_id).height();
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ){ if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ){
} }
else { else {
$('#'+graph_id).css('height', hDiff); $('#'+graph_id).css('height', hDiff);
@ -1649,8 +1523,21 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
if (thresholded) { if (thresholded) {
var zoom_data_threshold = new Array (); var zoom_data_threshold = new Array ();
var y_recal = axis_thresholded(threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max,
red_threshold, extremes, red_up);
plot = $.plot($('#' + graph_id), data_base,
$.extend(true, {}, options, {
yaxis: {
max: y_recal.max,
min: y_recal.min
},
xaxis: {
min: plot.getAxes().xaxis.min,
max: plot.getAxes().xaxis.max
}
}));
zoom_data_threshold = add_threshold (data_base, threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max, zoom_data_threshold = add_threshold (data_base, threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max,
yellow_threshold, red_threshold, extremes, red_up); red_threshold, extremes, red_up);
plot.setData(zoom_data_threshold); plot.setData(zoom_data_threshold);
plot.draw(); plot.draw();
} }
@ -1874,18 +1761,18 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
if (labels[v] == undefined) { if (labels[v] == undefined) {
return ''; return '';
} }
return '<div class='+font+' style=font-size:'+font_size+'pt>'+labels[v]+'</div>'; return '<div class='+font+' style="font-size:'+font_size+'pt !important;">'+labels[v]+'</div>';
} }
function yFormatter(v, axis) { function yFormatter(v, axis) {
axis.datamin = 0; axis.datamin = 0;
var formatted = number_format(v,force_integer,unit); var formatted = number_format(v,force_integer,unit);
return '<div class='+font+' style=font-size:'+font_size+'pt>'+formatted+'</div>'; return '<div class='+font+' style="font-size:'+font_size+'pt !important;">'+formatted+'</div>';
} }
function lFormatter(v, item) { function lFormatter(v, item) {
return '<div style=font-size:'+font_size+'pt>'+v+'</div>'; return '<div style="font-size:'+font_size+'pt !important;">'+v+'</div>';
// Prepared to turn series with a checkbox // Prepared to turn series with a checkbox
//return '<div style=color:;font-size:'+font_size+'pt><input type="checkbox" id="' + graph_id + '_' + item.id +'" checked="checked" class="check_serie_'+graph_id+'">'+v+'</div>'; //return '<div style=color:;font-size:'+font_size+'pt><input type="checkbox" id="' + graph_id + '_' + item.id +'" checked="checked" class="check_serie_'+graph_id+'">'+v+'</div>';
} }
@ -1931,28 +1818,32 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
plot = $.plot($('#' + graph_id), data_base, plot = $.plot($('#' + graph_id), data_base,
$.extend(true, {}, options, { $.extend(true, {}, options, {
yaxis: {max: max_draw}, yaxis: {max: max_draw},
xaxis: {
min: plot.getAxes().xaxis.min,
max: plot.getAxes().xaxis.max
}
})); }));
thresholded = false; thresholded = false;
} }
else { else {
var max_draw = plot.getAxes().yaxis.datamax; var max_draw = plot.getAxes().yaxis.datamax;
if (max_draw < red_threshold || max_draw < yellow_threshold) { // Recalculate the y axis
var y_recal = axis_thresholded(threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max,
var maxim_data = (red_threshold < yellow_threshold) ? yellow_threshold : red_threshold red_threshold, extremes, red_up);
plot = $.plot($('#' + graph_id), data_base,
plot = $.plot($('#' + graph_id), data_base, $.extend(true, {}, options, {
$.extend(true, {}, options, { yaxis: {
yaxis: {max: maxim_data + (maxim_data*0.5)}, max: y_recal.max,
})); min: y_recal.min
} else { },
plot = $.plot($('#' + graph_id), data_base, xaxis: {
$.extend(true, {}, options, { min: plot.getAxes().xaxis.min,
yaxis: {max: plot.getAxes().yaxis.max}, max: plot.getAxes().xaxis.max
})); }
} }));
datas = add_threshold (data_base, threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max, datas = add_threshold (data_base, threshold_data, plot.getAxes().yaxis.min, plot.getAxes().yaxis.max,
yellow_threshold, red_threshold, extremes, red_up); red_threshold, extremes, red_up);
thresholded = true; thresholded = true;
} }
@ -1994,7 +1885,7 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend,
$('#legend_'+graph_id).css('margin-bottom', '10px'); $('#legend_'+graph_id).css('margin-bottom', '10px');
parent_height = parseInt( parent_height = parseInt(
$('#menu_'+graph_id).parent().css('height').split('px')[0]); $('#menu_'+graph_id).parent().css('height').split('px')[0]);
adjust_menu(graph_id, plot, parent_height); adjust_menu(graph_id, plot, parent_height, width);
} }
if (!dashboard) { if (!dashboard) {
@ -2054,6 +1945,7 @@ function set_watermark(graph_id, plot, watermark_src) {
if ($('#'+graph_id+' .yAxis .tickLabel').eq(0).css('height') != undefined) { if ($('#'+graph_id+' .yAxis .tickLabel').eq(0).css('height') != undefined) {
down_ticks_height = $('#'+graph_id+' .yAxis .tickLabel').eq(0).css('height').split('px')[0]; down_ticks_height = $('#'+graph_id+' .yAxis .tickLabel').eq(0).css('height').split('px')[0];
} }
var left_pos = parseInt(context.canvas.width - 3) - $('#watermark_image_'+graph_id)[0].width; var left_pos = parseInt(context.canvas.width - 3) - $('#watermark_image_'+graph_id)[0].width;
var top_pos = 6; var top_pos = 6;
//var top_pos = parseInt(context.canvas.height - down_ticks_height - 10) - $('#watermark_image_'+graph_id)[0].height; //var top_pos = parseInt(context.canvas.height - down_ticks_height - 10) - $('#watermark_image_'+graph_id)[0].height;
@ -2143,7 +2035,65 @@ function number_format(number, force_integer, unit) {
return number + ' ' + shorts[pos] + unit; return number + ' ' + shorts[pos] + unit;
} }
function add_threshold (data_base, threshold_data, y_min, y_max, yellow_threshold, // Recalculate the threshold data depends on warning and critical
function axis_thresholded (threshold_data, y_min, y_max, red_threshold, extremes, red_up) {
var y = {
min: 0,
max: 0
};
// Default values
var yaxis_resize = {
up: null,
normal_up: 0,
normal_down: 0,
down: null
};
// Resize the y axis to display all intervals
$.each(threshold_data, function() {
if (/_up/.test(this.id)){
yaxis_resize['up'] = this.data[0][1];
}
if (/_down/.test(this.id)){
if (/critical/.test(this.id)) {
yaxis_resize['down'] = red_threshold;
} else {
yaxis_resize['down'] = extremes[this.id];
}
}
if (/_normal/.test(this.id)){
var end;
if (/critical/.test(this.id)) {
end = red_up;
} else {
end = extremes[this.id + '_2'];
}
if (yaxis_resize['normal_up'] < end) yaxis_resize['normal_up'] = end;
if (yaxis_resize['normal_down'] > this.data[0][1]) yaxis_resize['normal_down'] = this.data[0][1];
}
});
// If you need to display a up or a down bar, display 10% of data height
var margin_up_or_down = (y_max - y_min)*0.10;
// Calculate the new axis
y['max'] = yaxis_resize['normal_up'] > y_max ? yaxis_resize['normal_up'] : y_max;
y['min'] = yaxis_resize['normal_down'] > y_min ? yaxis_resize['normal_down'] : y_min;
if (yaxis_resize['up'] !== null) {
y['max'] = (yaxis_resize['up'] + margin_up_or_down) < y_max
? y_max
: yaxis_resize['up'] + margin_up_or_down;
}
if (yaxis_resize['down'] !== null) {
y['min'] = (yaxis_resize['down'] - margin_up_or_down) < y_min
? yaxis_resize['up'] + margin_up_or_down
: y_min;
}
return y;
}
function add_threshold (data_base, threshold_data, y_min, y_max,
red_threshold, extremes, red_up) { red_threshold, extremes, red_up) {
var datas = new Array (); var datas = new Array ();
@ -2195,5 +2145,6 @@ function add_threshold (data_base, threshold_data, y_min, y_max, yellow_threshol
function reduceText (text, maxLength) { function reduceText (text, maxLength) {
if (text.length <= maxLength) return text if (text.length <= maxLength) return text
var firstSlideEnd = parseInt((maxLength - 3) / 2); var firstSlideEnd = parseInt((maxLength - 3) / 2);
return text.substr(0, firstSlideEnd) + '...' + text.substr(-firstSlideEnd - 3); var str_cut = text.substr(0, firstSlideEnd);
return str_cut + '...' + text.substr(-firstSlideEnd - 3);
} }

View File

@ -205,7 +205,7 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
// Parent layer // Parent layer
$return = "<div class='parent_graph' style='width: " . $width . "px; " . $background_style . "'>"; $return = "<div class='parent_graph' style='width: " . $width . "px; " . $background_style . "'>";
// Set some containers to legend, graph, timestamp tooltip, etc. // Set some containers to legend, graph, timestamp tooltip, etc.
$return .= "<p id='legend_$graph_id' class='legend_graph' style='font-size:".$font_size."pt'></p>"; $return .= "<p id='legend_$graph_id' class='legend_graph' style='font-size:$font_size"."pt !important;'></p>";
if (!empty($threshold_data)) { if (!empty($threshold_data)) {
$yellow_up = $threshold_data['yellow_up']; $yellow_up = $threshold_data['yellow_up'];
@ -265,7 +265,9 @@ function flot_area_graph($chart_data, $width, $height, $color, $legend,
} }
$return .= html_print_input_hidden('line_width_graph', $config['custom_graph_width'], true); $return .= html_print_input_hidden('line_width_graph', $config['custom_graph_width'], true);
$return .= "<div id='timestamp_$graph_id' class='timestamp_graph' style='font-size:".$font_size."pt;display:none; position:absolute; background:#fff; border: solid 1px #aaa; padding: 2px; z-index:1000;'></div>"; $return .= "<div id='timestamp_$graph_id' class='timestamp_graph' style='font-size:".$font_size."pt;display:none; position:absolute; background:#fff; border: solid 1px #aaa; padding: 2px; z-index:1000;'></div>";
$return .= "<div id='$graph_id' class='graph $adapt_key' style='width: ".$width."px; height: ".$height."px;'></div>"; $return .= "<div id='$graph_id' class='";
if($type=='area_simple'){$return .= "noresizevc ";}
$return .= "graph $adapt_key' style='width: ".$width."px; height: ".$height."px;'></div>";
if ($menu) { if ($menu) {
$height = 100; $height = 100;
} }
@ -598,7 +600,7 @@ function flot_custom_pie_chart ($flash_charts, $graph_values,
$graph_id = uniqid('graph_'); $graph_id = uniqid('graph_');
$return = "<div id='$graph_id' class='graph' style='width: ".$width."px; height: ".$height."px;'></div>"; $return = "<div id='$graph_id' class='graph noresizevc' style='width: ".$width."px; height: ".$height."px;'></div>";
if ($water_mark != '') { if ($water_mark != '') {
$return .= "<div id='watermark_$graph_id' style='display:none; position:absolute;'><img id='watermark_image_$graph_id' src='".$water_mark["url"]."'></div>"; $return .= "<div id='watermark_$graph_id' style='display:none; position:absolute;'><img id='watermark_image_$graph_id' src='".$water_mark["url"]."'></div>";

View File

@ -172,7 +172,6 @@ function delete_link(source_id, source_module_id, target_id, target_module_id, i
init_drag_and_drop(); init_drag_and_drop();
set_positions_graph(); set_positions_graph();
} }
$("#dialog_node_edit").dialog("close"); $("#dialog_node_edit").dialog("close");
} }
}); });
@ -219,6 +218,43 @@ function update_fictional_node(id_db_node) {
} }
} }
function update_node_name (id_db_node) {
if (enterprise_installed) {
var name = $("input[name='edit_name_node']").val();
var params = [];
params.push("update_node_name=1");
params.push("networkmap_id=" + networkmap_id);
params.push("node_id=" + id_db_node);
params.push("name=" + name);
params.push("page=enterprise/operation/agentes/pandora_networkmap.view");
jQuery.ajax ({
data: params.join ("&"),
dataType: 'json',
type: 'POST',
url: action="ajax.php",
success: function (data) {
if (data['correct']) {
$("#dialog_node_edit").dialog("close");
jQuery.each(graph.nodes, function(i, element) {
if (element.id_db == id_db_node) {
graph.nodes[i].text = name;
$("#id_node_" + i + networkmap_id + " title").html(name);
$("#id_node_" + i + networkmap_id + " tspan").html(name);
}
});
draw_elements_graph();
set_positions_graph();
}
}
});
}
}
function change_shape(id_db_node) { function change_shape(id_db_node) {
if (enterprise_installed) { if (enterprise_installed) {
var shape = $("select[name='shape']").val(); var shape = $("select[name='shape']").val();
@ -532,6 +568,9 @@ function update_link(row_index, id_link) {
temp_link["status_start"] = "0"; temp_link["status_start"] = "0";
temp_link["status_end"] = "0"; temp_link["status_end"] = "0";
temp_link["text_start"] = data["text_start"];
temp_link["text_end"] = data["text_end"];
$.each(graph.nodes, function(k, node) { $.each(graph.nodes, function(k, node) {
if (node['id_agent'] == data['id_db_target']) { if (node['id_agent'] == data['id_db_target']) {
temp_link["target"] = graph.nodes[k]; temp_link["target"] = graph.nodes[k];
@ -579,7 +618,7 @@ function add_new_link (new_link) {
graph.links.push(new_link); graph.links.push(new_link);
} }
function edit_node(data, dblClick) { function edit_node(data_node, dblClick) {
if (enterprise_installed) { if (enterprise_installed) {
var flag_edit_node = true; var flag_edit_node = true;
var edit_node = null var edit_node = null
@ -594,7 +633,7 @@ function edit_node(data, dblClick) {
edit_node = selection[0].pop(); edit_node = selection[0].pop();
} }
else if (dblClick){ else if (dblClick){
edit_node = d3.select("#id_node_" + data['id'] + networkmap_id); edit_node = d3.select("#id_node_" + data_node['id'] + networkmap_id);
edit_node = edit_node[0][0]; edit_node = edit_node[0][0];
} }
else { else {
@ -615,18 +654,22 @@ function edit_node(data, dblClick) {
selected_links = get_relations(node_selected); selected_links = get_relations(node_selected);
$("select[name='shape'] option[value='" + data.shape + "']") $("select[name='shape'] option[value='" + node_selected.shape + "']")
.prop("selected", true); .prop("selected", true);
$("select[name='shape']").attr("onchange", $("select[name='shape']").attr("onchange",
"javascript: change_shape(" + data.id_db + ");"); "javascript: change_shape(" + node_selected.id_db + ");");
$("#node_options-fictional_node_update_button-1 input") $("#node_options-fictional_node_update_button-1 input")
.attr("onclick", "update_fictional_node(" + data.id_db + ");"); .attr("onclick", "update_fictional_node(" + node_selected.id_db + ");");
$("#node_options-node_name-2 input")
.attr("onclick", "update_node_name(" + node_selected.id_db + ");");
$("#node_details-0-1").html('<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' + data["id_agent"] + '">' + data["text"] + '</a>'); $("#node_details-0-1").html('<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' + node_selected["id_agent"] + '">' + node_selected["text"] + '</a>');
var params = []; var params = [];
params.push("get_agent_info=1"); params.push("get_agent_info=1");
params.push("id_agent=" + data["id_agent"]); params.push("id_agent=" + node_selected["id_agent"]);
params.push("page=enterprise/operation/agentes/pandora_networkmap.view"); params.push("page=enterprise/operation/agentes/pandora_networkmap.view");
jQuery.ajax ({ jQuery.ajax ({
data: params.join ("&"), data: params.join ("&"),
dataType: 'json', dataType: 'json',
@ -640,75 +683,47 @@ function edit_node(data, dblClick) {
$("#node_details-1-1").html(adressess); $("#node_details-1-1").html(adressess);
$("#node_details-2-1").html(data["os"]); $("#node_details-2-1").html(data["os"]);
$("#node_details-3-1").html(data["group"]); $("#node_details-3-1").html(data["group"]);
}
}); $('[aria-describedby=dialog_node_edit]').css({'top':'200px'});
$('#foot').css({'top':parseInt($("[aria-describedby=dialog_node_edit]").css('height')+$("[aria-describedby=dialog_node_edit]").css('top')),'position':'relative'});
$("#interface_information").find("tr:gt(0)").remove();
get_interface_data_to_table(node_selected, selected_links);
var params = [];
params.push("get_interface_info=1");
params.push("id_agent=" + data["id_agent"]);
params.push("page=enterprise/operation/agentes/pandora_networkmap.view");
jQuery.ajax ({
data: params.join ("&"),
dataType: 'json',
type: 'POST',
url: action="ajax.php",
success: function (data) {
if (data.length == 0) {
$("#interface_information").find('tbody')
.append($('<tr>').html("<p style=\"text-align: center;\">It has no interface to display</p>"));
}
else {
jQuery.each(data, function(j, interface) {
$("#interface_information").find('tbody')
.append($('<tr>')
.append($('<td>')
.html(interface['name'])
)
.append($('<td>')
.html(interface['status'])
)
.append($('<td>')
.html(interface['graph'])
)
.append($('<td>')
.html(interface['ip'])
)
.append($('<td>')
.html(interface['mac'])
)
);
});
}
} }
}); });
$("#dialog_node_edit" ) $("#dialog_node_edit" )
.dialog( "option", "title", .dialog( "option", "title",
dialog_node_edit_title.replace("%s", data.text)); dialog_node_edit_title.replace("%s", node_selected.text));
$("#dialog_node_edit").dialog("open"); $("#dialog_node_edit").dialog("open");
if (data.id_agent == -2) { if (node_selected.id_agent == undefined || node_selected.id_agent == -2) {
//Fictional node //Fictional node
$("#node_options-fictional_node_name") $("#node_options-fictional_node_name")
.css("display", ""); .css("display", "");
$("input[name='edit_name_fictional_node']") $("input[name='edit_name_fictional_node']")
.val(data.text); .val(node_selected.text);
$("#node_options-fictional_node_networkmap_link") $("#node_options-fictional_node_networkmap_link")
.css("display", ""); .css("display", "");
$("#edit_networkmap_to_link") $("#edit_networkmap_to_link")
.val(data.networkmap_id); .val(node_selected.networkmap_id);
$("#node_options-fictional_node_update_button") $("#node_options-fictional_node_update_button")
.css("display", ""); .css("display", "");
$("#node_options-node_name")
.css("display", "none");
$("#node_options-node_update_button")
.css("display", "none");
} }
else { else {
$("input[name='edit_name_node']")
.val(node_selected.text);
$("#node_options-fictional_node_name") $("#node_options-fictional_node_name")
.css("display", "none"); .css("display", "none");
$("#node_options-fictional_node_networkmap_link") $("#node_options-fictional_node_networkmap_link")
.css("display", "none"); .css("display", "none");
$("#node_options-fictional_node_update_button") $("#node_options-fictional_node_update_button")
.css("display", "none"); .css("display", "none");
$("#node_options-node_name")
.css("display", "");
} }
//Clean //Clean
@ -716,124 +731,160 @@ function edit_node(data, dblClick) {
//Show the no relations //Show the no relations
$("#relations_table-loading").css('display', 'none'); $("#relations_table-loading").css('display', 'none');
$("#relations_table-no_relations").css('display', ''); $("#relations_table-no_relations").css('display', '');
jQuery.each(selected_links, function(i, link_each) {
$("#relations_table-no_relations").css('display', 'none');
$("#relations_table-loading").css('display', '');
var template_relation_row = $("#relations_table-template_row")
.clone();
$(template_relation_row).css('display', '');
$(template_relation_row).attr('class', 'relation_link_row');
$("select[name='interface_source']", template_relation_row)
.attr('name', "interface_source_" + i)
.attr('id', "interface_source_" + i + networkmap_id);
$("select[name='interface_target']", template_relation_row)
.attr('name', "interface_target_" + i)
.attr('id', "interface_target_" + i + networkmap_id);
$(".edit_icon_progress", template_relation_row)
.attr('class', "edit_icon_progress_" + i);
$(".edit_icon", template_relation_row)
.attr('class', "edit_icon_" + i);
$(".edit_icon_correct", template_relation_row)
.attr('class', "edit_icon_correct_" + i);
$(".edit_icon_fail", template_relation_row)
.attr('class', "edit_icon_fail_" + i);
$(".edit_icon_link", template_relation_row)
.attr('class', "edit_icon_link_" + i)
.click(function() {
update_link(i, link_each.id_db);
}
);
var params = [];
params.push("get_intefaces=1");
params.push("id_agent=" + link_each.source.id_agent);
params.push("page=enterprise/operation/agentes/pandora_networkmap.view");
jQuery.ajax ({
data: params.join ("&"),
dataType: 'json',
type: 'POST',
url: action="ajax.php",
success: function (data) {
if (data['correct']) {
$("select[name='interface_source_" + i + "']", template_relation_row).empty();
$("select[name='interface_source_" + i + "']", template_relation_row).append('<option value="' + link_each.source.id_agent + '">None</option>');
jQuery.each(data['interfaces'], function(j, interface) {
$("select[name='interface_source_" + i + "']", template_relation_row)
.append($("<option>")
.attr("value", interface['id_agente_modulo'])
.html(interface['nombre']));
if (interface.id_agente_modulo == link_each.id_module_start) {
$("select[name='interface_source_" + i + "'] option[value='" + interface['id_agente_modulo'] + "']", template_relation_row)
.prop("selected", true);
}
});
}
}
});
var params = [];
params.push("get_intefaces=1");
params.push("id_agent=" + link_each.target.id_agent);
params.push("page=enterprise/operation/agentes/pandora_networkmap.view");
jQuery.ajax ({
data: params.join ("&"),
dataType: 'json',
type: 'POST',
url: action="ajax.php",
success: function (data) {
if (data['correct']) {
$("select[name='interface_target_" + i + "']", template_relation_row).empty();
$("select[name='interface_target_" + i + "']", template_relation_row).append('<option value="' + link_each.target.id_agent + '">None</option>');
jQuery.each(data['interfaces'], function(j, interface) {
$("select[name='interface_target_" + i + "']", template_relation_row)
.append($("<option>")
.attr("value", interface['id_agente_modulo'])
.html(interface['nombre']));
if (interface.id_agente_modulo == link_each.id_module_end) {
$("select[name='interface_target_" + i + "'] option[value='" + interface['id_agente_modulo'] + "']", template_relation_row)
.prop("selected", true);
}
});
}
}
});
$("#relations_table-template_row-node_source", template_relation_row)
.html(link_each.source.text);
$("#relations_table-template_row-node_target", template_relation_row)
.html(link_each.target.text);
$("#relations_table-template_row-edit", template_relation_row)
.attr("align", "center");
$("#relations_table-template_row-edit .delete_icon", template_relation_row)
.attr("href", "javascript: " +
"delete_link(" +
link_each.source.id_db + "," +
link_each.id_module_start + "," +
link_each.target.id_db + "," +
link_each.id_module_end + "," +
link_each.id_db + ");");
$("#relations_table tbody").append(template_relation_row);
template_relation_row = null;
});
$("#relations_table-loading").css('display', 'none');
} }
} }
} }
function get_interface_data_to_table (node_selected, selected_links) {
$("#interface_information").find("tr:gt(0)").remove();
var params = [];
params.push("get_interface_info=1");
params.push("id_agent=" + node_selected["id_agent"]);
params.push("page=enterprise/operation/agentes/pandora_networkmap.view");
jQuery.ajax ({
data: params.join ("&"),
dataType: 'json',
type: 'POST',
url: action="ajax.php",
success: function (data) {
if (data.length == 0) {
$("#interface_information").find('tbody')
.append($('<tr>').html("<p style=\"text-align: center;\">It has no interface to display</p>"));
}
else {
jQuery.each(data, function(j, interface) {
$("#interface_information").find('tbody')
.append($('<tr>')
.append($('<td>')
.html(interface['name'])
)
.append($('<td>')
.html(interface['status'])
)
.append($('<td>')
.html(interface['graph'])
)
.append($('<td>')
.html(interface['ip'])
)
.append($('<td>')
.html(interface['mac'])
)
);
});
}
load_interfaces(selected_links);
}
});
}
function load_interfaces (selected_links) {
//Clean
$("#relations_table .relation_link_row").remove();
//Show the no relations
$("#relations_table-loading").css('display', 'none');
$("#relations_table-no_relations").css('display', '');
jQuery.each(selected_links, function(i, link_each) {
$("#relations_table-no_relations").css('display', 'none');
$("#relations_table-loading").css('display', '');
var template_relation_row = $("#relations_table-template_row")
.clone();
$(template_relation_row).css('display', '');
$(template_relation_row).attr('class', 'relation_link_row');
$("select[name='interface_source']", template_relation_row)
.attr('name', "interface_source_" + i)
.attr('id', "interface_source_" + i);
$("select[name='interface_target']", template_relation_row)
.attr('name', "interface_target_" + i)
.attr('id', "interface_target_" + i);
$(".edit_icon_progress", template_relation_row)
.attr('class', "edit_icon_progress_" + i);
$(".edit_icon", template_relation_row)
.attr('class', "edit_icon_" + i);
$(".edit_icon_correct", template_relation_row)
.attr('class', "edit_icon_correct_" + i);
$(".edit_icon_fail", template_relation_row)
.attr('class', "edit_icon_fail_" + i);
$(".edit_icon_link", template_relation_row)
.attr('class', "edit_icon_link_" + i)
.click(function() {
update_link(i, link_each.id_db);
}
);
var params3 = [];
params3.push("get_intefaces=1");
params3.push("id_agent_target=" + link_each.target.id_agent);
params3.push("id_agent_source=" + link_each.source.id_agent);
params3.push("page=enterprise/operation/agentes/pandora_networkmap.view");
jQuery.ajax ({
data: params3.join ("&"),
dataType: 'json',
type: 'POST',
async: true,
cache: false,
url: action="ajax.php",
success: function (data) {
if (data['correct']) {
$("select[name='interface_target_" + i + "']", template_relation_row).empty();
$("select[name='interface_target_" + i + "']", template_relation_row).append('<option value="' + link_each.target.id_agent + '">None</option>');
$("select[name='interface_source_" + i + "']", template_relation_row).empty();
$("select[name='interface_source_" + i + "']", template_relation_row).append('<option value="' + link_each.source.id_agent + '">None</option>');
jQuery.each(data['target_interfaces'], function(j, interface) {
$("select[name='interface_target_" + i + "']", template_relation_row)
.append($("<option>")
.attr("value", interface['id_agente_modulo'])
.html(interface['nombre']));
if (interface.id_agente_modulo == link_each.id_module_end) {
$("select[name='interface_target_" + i + "'] option[value='" + interface['id_agente_modulo'] + "']", template_relation_row)
.prop("selected", true);
}
});
jQuery.each(data['source_interfaces'], function(j, interface) {
$("select[name='interface_source_" + i + "']", template_relation_row)
.append($("<option>")
.attr("value", interface['id_agente_modulo'])
.html(interface['nombre']));
if (interface.id_agente_modulo == link_each.id_module_start) {
$("select[name='interface_source_" + i + "'] option[value='" + interface['id_agente_modulo'] + "']", template_relation_row)
.prop("selected", true);
}
});
$("#relations_table-loading").css('display', 'none');
}
}
});
$("#relations_table-template_row-node_source", template_relation_row)
.html(link_each.source.text);
$("#relations_table-template_row-node_target", template_relation_row)
.html(link_each.target.text);
$("#relations_table-template_row-edit", template_relation_row)
.attr("align", "center");
$("#relations_table-template_row-edit .delete_icon", template_relation_row)
.attr("href", "javascript: " +
"delete_link(" +
link_each.source.id_db + "," +
link_each.id_module_start + "," +
link_each.target.id_db + "," +
link_each.id_module_end + "," +
link_each.id_db + ");");
$("#relations_table tbody").append(template_relation_row);
template_relation_row = null;
});
}
function add_node() { function add_node() {
$("#agent_name").val(""); $("#agent_name").val("");
@ -925,16 +976,34 @@ function add_agent_node(agents) {
temp_node['state'] = data['state']; temp_node['state'] = data['state'];
graph.nodes.push(temp_node); graph.nodes.push(temp_node);
/* FLECHAS EMPEZADO PARA MEJORAR
jQuery.each(data['rel'], function(i, relation) { /*jQuery.each(data['rel'], function(i, relation) {
var temp_link = {}; var temp_link = {};
if (i == 0) {
var found = 0;
temp_link['source'] = graph.nodes[temp_node['id']];
jQuery.each(graph.nodes, function(j, element) {
if (element.id_agent == relation['id_agent_end']) {
found = j;
}
});
temp_link['target'] = graph.nodes[found];
}
else {
var found = 0;
temp_link['target'] = graph.nodes[temp_node['id']];
jQuery.each(graph.nodes, function(j, element) {
if (element.id_agent == relation['id_agent_start']) {
found = j;
}
});
temp_link['source'] = graph.nodes[found];
}
temp_link['id_db'] = String(relation['id_db']); temp_link['id_db'] = String(relation['id_db']);
temp_link['id_agent_end'] = String(relation['id_agent_end']); temp_link['id_agent_end'] = String(relation['id_agent_end']);
temp_link['id_agent_start'] = String(relation['id_agent_start']); temp_link['id_agent_start'] = String(relation['id_agent_start']);
temp_link['id_module_end'] = relation['id_module_end']; temp_link['id_module_end'] = relation['id_module_end'];
temp_link['id_module_start'] = relation['id_module_start']; temp_link['id_module_start'] = relation['id_module_start'];
temp_link['source'] = relation['source'];
temp_link['target'] = relation['target'];
temp_link['source_in_db'] = String(relation['source_in_db']); temp_link['source_in_db'] = String(relation['source_in_db']);
temp_link['target_in_db'] = String(relation['target_in_db']); temp_link['target_in_db'] = String(relation['target_in_db']);
temp_link['arrow_end'] = relation['arrow_end']; temp_link['arrow_end'] = relation['arrow_end'];
@ -945,8 +1014,7 @@ function add_agent_node(agents) {
temp_link['text_start'] = relation['text_start']; temp_link['text_start'] = relation['text_start'];
graph.links.push(temp_link); graph.links.push(temp_link);
}); });*/
*/
draw_elements_graph(); draw_elements_graph();
init_drag_and_drop(); init_drag_and_drop();
@ -1145,18 +1213,79 @@ function zoom(manual) {
function set_positions_graph() { function set_positions_graph() {
link.selectAll("path.link") link.selectAll("path.link")
.attr("d", function(d) { .attr("d", function(d) {
if (d.arrow_end == "module" || d.arrow_start == "module") {
return "M " + d.source.x + " " + d.source.y + return arcPath(true, d);
" L " + d.target.x + " " + d.target.y; }
}); else {
return "M " + d.source.x + " " + d.source.y + " L " + d.target.x + " " + d.target.y;
}
})
.style("fill", "none");
link.selectAll("path.link_reverse") link.selectAll("path.link_reverse")
.attr("d", function(d) { .attr("d", function(d) {
if (d.arrow_end == "module" || d.arrow_start == "module") {
return "M " + d.target.x + " " + d.target.y + return arcPath(false, d);
" L " + d.source.x + " " + d.source.y; }
}); else {
return "M " + d.target.x + " " + d.target.y + " L " + d.source.x + " " + d.source.y;
}
})
.style("fill", "none");
function arcPath(leftHand, d) {
var x1 = leftHand ? d.source.x : d.target.x,
y1 = leftHand ? d.source.y : d.target.y,
x2 = leftHand ? d.target.x : d.source.x,
y2 = leftHand ? d.target.y : d.source.y,
dx = x2 - x1,
dy = y2 - y1,
dr = Math.sqrt(dx * dx + dy * dy),
drx = dr,
dry = dr,
sweep = leftHand ? 0 : 1;
siblingCount = countSiblingLinks(d.source, d.target)
xRotation = 1,
largeArc = 0;
if (siblingCount > 1) {
var siblings = getSiblingLinks(d.source, d.target);
var arcScale = d3.scale.ordinal()
.domain(siblings)
.rangePoints([1, siblingCount]);
drx = drx/(1 + (1/siblingCount) * (arcScale(d.text_start + d.id_db + networkmap_id) - 1));
dry = dry/(1 + (1/siblingCount) * (arcScale(d.text_start + d.id_db + networkmap_id) - 1));
return "M" + x1 + "," + y1 + "A" + drx + ", " + dry + " " + xRotation + ", " + largeArc + ", " + sweep + " " + x2 + "," + y2;
}
else {
if (leftHand) {
return "M " + d.source.x + " " + d.source.y + " L " + d.target.x + " " + d.target.y;
}
else {
return "M " + d.target.x + " " + d.target.y + " L " + d.source.x + " " + d.source.y;
}
}
}
function countSiblingLinks (source, target) {
var count = 0;
for(var i = 0; i < graph.links.length; ++i){
if( (graph.links[i].source.id == source.id && graph.links[i].target.id == target.id) || (graph.links[i].source.id == target.id && graph.links[i].target.id == source.id) )
count++;
}
return count;
}
function getSiblingLinks (source, target) {
var siblings = [];
for(var i = 0; i < graph.links.length; ++i){
if( (graph.links[i].source.id == source.id && graph.links[i].target.id == target.id) || (graph.links[i].source.id == target.id && graph.links[i].target.id == source.id) )
siblings.push(graph.links[i].text_start + graph.links[i].id_db + networkmap_id);
}
return siblings;
}
node.selectAll(".node_shape_circle") node.selectAll(".node_shape_circle")
.attr("cx", function(d) { .attr("cx", function(d) {
return d.x; return d.x;
@ -1863,8 +1992,8 @@ function add_interface_link_js () {
temp_link['status_end'] = "0"; temp_link['status_end'] = "0";
//temp_link['text_start'] = link['text_start']; temp_link['text_start'] = data['text_start'];
//temp_link['text_end'] = link['text_end']; temp_link['text_end'] = data['text_end'];
jQuery.each(graph.nodes, function(j, node) { jQuery.each(graph.nodes, function(j, node) {
if (node['id_agent'] == data['id_db_target']) { if (node['id_agent'] == data['id_db_target']) {
@ -1892,6 +2021,7 @@ function refresh_holding_area() {
var pos_x = parseInt(holding_pos_x) + parseInt(node_radius); var pos_x = parseInt(holding_pos_x) + parseInt(node_radius);
var pos_y = parseInt(holding_pos_y) + parseInt(node_radius); var pos_y = parseInt(holding_pos_y) + parseInt(node_radius);
if (enterprise_installed) { if (enterprise_installed) {
$('#holding_spinner_' + networkmap_id).css("display", "");
var params = []; var params = [];
params.push("refresh_holding_area=1"); params.push("refresh_holding_area=1");
params.push("id=" + networkmap_id); params.push("id=" + networkmap_id);
@ -1904,16 +2034,13 @@ function refresh_holding_area() {
type: 'POST', type: 'POST',
url: action="ajax.php", url: action="ajax.php",
success: function (data) { success: function (data) {
if (data['correct']) { if (data['correct']) {
window.holding_area = data['holding_area']; window.holding_area = data['holding_area'];
var length_nodes = graph.nodes.length;
jQuery.each(holding_area.nodes, function(i, node) { jQuery.each(holding_area.nodes, function(i, node) {
var temp_node = {}; var temp_node = {};
temp_node['id'] = length_nodes + node['id']; temp_node['id'] = graph.nodes.length;
holding_area.nodes[i]['id'] = temp_node['id']; holding_area.nodes[i]['id'] = temp_node['id'];
temp_node['id_db'] = node['id_db']; temp_node['id_db'] = node['id_db'];
@ -1970,10 +2097,32 @@ function refresh_holding_area() {
graph.links.push(temp_link); graph.links.push(temp_link);
}); });
$("#layer_graph_links_" + networkmap_id).remove();
$("#layer_graph_nodes_" + networkmap_id).remove();
window.layer_graph_links = window.layer_graph
.append("g")
.attr("id", "layer_graph_links_" + networkmap_id);
window.layer_graph_nodes = window.layer_graph
.append("g")
.attr("id", "layer_graph_nodes_" + networkmap_id);
force.nodes(graph.nodes)
.links(graph.links)
.start();
window.node = layer_graph_nodes.selectAll(".node");
window.link = layer_graph_links.selectAll(".link");
draw_elements_graph(); draw_elements_graph();
init_drag_and_drop(); init_drag_and_drop();
set_positions_graph(); set_positions_graph();
$('#holding_spinner_' + networkmap_id).css("display", "none");
} }
},
error: function(){
$('#holding_spinner_' + networkmap_id).css("display", "none");
} }
}); });
} }
@ -2210,6 +2359,7 @@ function init_drag_and_drop() {
graph.nodes[d.id].py = d.py + delta[1]; graph.nodes[d.id].py = d.py + delta[1];
}); });
draw_elements_graph();
set_positions_graph(); set_positions_graph();
d3.event.sourceEvent.stopPropagation(); d3.event.sourceEvent.stopPropagation();
@ -2324,7 +2474,7 @@ function init_graph(parameter_object) {
if (typeof(parameter_object.node_radius) != "undefined") { if (typeof(parameter_object.node_radius) != "undefined") {
window.node_radius = parameter_object.node_radius; window.node_radius = parameter_object.node_radius;
} }
window.interface_radius = 5; window.interface_radius = 3;
window.disabled_drag_zoom = false; window.disabled_drag_zoom = false;
window.key_multiple_selection = 17; //CTRL key window.key_multiple_selection = 17; //CTRL key
window.flag_multiple_selection = false; window.flag_multiple_selection = false;
@ -2543,7 +2693,7 @@ function init_graph(parameter_object) {
.attr("markerHeight", (node_radius / 2) + interface_radius) .attr("markerHeight", (node_radius / 2) + interface_radius)
.attr("orient", "auto") .attr("orient", "auto")
.append("circle") .append("circle")
.attr("cx", (node_radius / 2) - (interface_radius / 2)) .attr("cx", (node_radius / 2.3) - (interface_radius / 2.3))
.attr("cy", interface_radius) .attr("cy", interface_radius)
.attr("r", interface_radius) .attr("r", interface_radius)
.attr("style", function(d) { .attr("style", function(d) {
@ -2554,19 +2704,19 @@ function init_graph(parameter_object) {
.data(module_color_status) .data(module_color_status)
.enter() .enter()
.append("marker") .append("marker")
.attr("id", function(d) { return "interface_end_" + d.status_code; }) .attr("id", function(d) { return "interface_end_" + d.status_code; })
.attr("refX", (node_radius / 2) + (interface_radius / 2)) .attr("refX", (node_radius / 2.3) + (interface_radius / 2.3))
.attr("refY", interface_radius) .attr("refY", interface_radius)
.attr("markerWidth", (node_radius / 2) + interface_radius) .attr("markerWidth", (node_radius / 2) + interface_radius)
.attr("markerHeight", (node_radius / 2) + interface_radius) .attr("markerHeight", (node_radius / 2) + interface_radius)
.attr("orient", "auto") .attr("orient", "auto")
.append("circle") .append("circle")
.attr("cx", interface_radius) .attr("cx", interface_radius)
.attr("cy", interface_radius) .attr("cy", interface_radius)
.attr("r", interface_radius) .attr("r", interface_radius)
.attr("style", function(d) { .attr("style", function(d) {
return "fill: " + d.color + ";"; return "fill: " + d.color + ";";
}); });
defs.append("marker") defs.append("marker")
.attr("id", "interface_start") .attr("id", "interface_start")
@ -2786,7 +2936,7 @@ function myMouseoutRhombusFunction(node_id) {
function draw_elements_graph() { function draw_elements_graph() {
link = link.data(force.links(), function(d) { link = link.data(force.links(), function(d) {
return d.source.id + networkmap_id + "-" + d.target.id + networkmap_id; return d.source.id + networkmap_id + "-" + d.target.id + networkmap_id + Math.random();
}); });
link_temp = link.enter() link_temp = link.enter()
@ -2814,7 +2964,7 @@ function draw_elements_graph() {
link_temp.append("path") link_temp.append("path")
.attr("id", function(d) { .attr("id", function(d) {
return "link_id_" + d.id_db + networkmap_id; return "link_id_text_" + d.id_db + networkmap_id;
}) })
.attr("class", function(d) { .attr("class", function(d) {
var holding_area_text = ""; var holding_area_text = "";
@ -2865,10 +3015,10 @@ function draw_elements_graph() {
}); });
//Add the reverse line for the end marker, it is invisible //Add the reverse line for the end marker, it is invisible
link_temp.append("path") link_temp.append("path")
.attr("id", function(d) { .attr("id", function(d) {
return "link_reverse_id_" + d.id_db; return "link_reverse_id_" + d.id_db + networkmap_id;
}) })
.attr("stroke-width", 0) .attr("stroke-width", 0)
.attr("d", null) .attr("d", null)
.attr("class", function(d) { .attr("class", function(d) {
@ -2879,8 +3029,27 @@ function draw_elements_graph() {
.attr("xml:space", "preserve") .attr("xml:space", "preserve")
.append("textPath") .append("textPath")
.attr("xlink:href", function(d) { .attr("xlink:href", function(d) {
return "#link_id_" + d.id_db; if (d.source.x < d.target.x) {
return "#link_id_text_" + d.id_db + networkmap_id;
}
else {
return "#link_reverse_id_" + d.id_db + networkmap_id;
}
}) })
.attr("startOffset", function(d) {
if (d.source.x < d.target.x) {
return "";
}
else {
return "85%";
}})
.attr("text-anchor", function(d) {
if (d.source.x < d.target.x) {
return "";
}
else {
return "end";
}})
.append("tspan") .append("tspan")
.attr("style", "font-size: 12px; " + .attr("style", "font-size: 12px; " +
"font-style:normal; " + "font-style:normal; " +
@ -2891,7 +3060,7 @@ function draw_elements_graph() {
"fill:#000000; " + "fill:#000000; " +
"fill-opacity:1; " + "fill-opacity:1; " +
"stroke:none; " + "stroke:none; " +
"text-align:end; ") "text-align:start; ")
.text(function(d) { .text(function(d) {
var text_link = ""; var text_link = "";
if (d.text_start) { if (d.text_start) {
@ -2905,8 +3074,27 @@ function draw_elements_graph() {
.attr("xml:space", "preserve") .attr("xml:space", "preserve")
.append("textPath") .append("textPath")
.attr("xlink:href", function(d) { .attr("xlink:href", function(d) {
return "#link_reverse_id_" + d.id_db; if (d.source.x < d.target.x) {
return "#link_id_text_" + d.id_db + networkmap_id;
}
else {
return "#link_reverse_id_" + d.id_db + networkmap_id;
}
}) })
.attr("startOffset", function(d) {
if (d.source.x < d.target.x) {
return "85%";
}
else {
return "";
}})
.attr("text-anchor", function(d) {
if (d.source.x < d.target.x) {
return "end";
}
else {
return "";
}})
.append("tspan") .append("tspan")
.attr("style", "font-size: 12px; " + .attr("style", "font-size: 12px; " +
"font-style:normal; " + "font-style:normal; " +
@ -2926,7 +3114,7 @@ function draw_elements_graph() {
return (Array(25).join(" ")) + text_link; return (Array(25).join(" ")) + text_link;
}); });
node = node.data(force.nodes(), function(d) { return d.id;}); node = node.data(force.nodes(), function(d) { return d.id;});
node_temp = node.enter() node_temp = node.enter()

View File

@ -5727,7 +5727,7 @@ $.widget( "ui.dialog", {
if ( !$( event.target ).closest(".ui-dialog").length ) { if ( !$( event.target ).closest(".ui-dialog").length ) {
event.preventDefault(); event.preventDefault();
$(".ui-dialog:visible:last .ui-dialog-content") $(".ui-dialog:visible:last .ui-dialog-content")
.data("ui-dialog")._focusTabbable(); .data("ui-dialog");
} }
} }
}); });

View File

@ -234,7 +234,7 @@ function install_package (package, homeurl) {
buttons: { buttons: {
"Apply MR": function () { "Apply MR": function () {
var err = []; var err = [];
err = apply_minor_release(data['mr'], package, 1, 1); err = apply_minor_release(data['mr'], package, 1, 1, home_url);
if (!err['error']) { if (!err['error']) {
if (err['message'] == 'bad_mr_filename') { if (err['message'] == 'bad_mr_filename') {
@ -271,7 +271,7 @@ function install_package (package, homeurl) {
}); });
var dialog_accept_package_mr_fail_text = "<div>"; var dialog_accept_package_mr_fail_text = "<div>";
dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>"; dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_info_mr.png'></div>";
dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>"; dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>";
dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_not_accepted_code_yes + "</p></div>"; dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_not_accepted_code_yes + "</p></div>";
dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "</div>"; dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "</div>";
@ -314,7 +314,7 @@ function install_package (package, homeurl) {
}); });
var dialog_success_pkg_text = "<div>"; var dialog_success_pkg_text = "<div>";
dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_exito_mr.png'></div>"; dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_exito_mr.png'></div>";
dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>"; dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>";
dialog_success_pkg_text = dialog_success_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_success + "</p></div>"; dialog_success_pkg_text = dialog_success_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_success + "</p></div>";
dialog_success_pkg_text = dialog_success_pkg_text + "</div>"; dialog_success_pkg_text = dialog_success_pkg_text + "</div>";
@ -345,7 +345,7 @@ function install_package (package, homeurl) {
}); });
var dialog_error_pkg_text = "<div>"; var dialog_error_pkg_text = "<div>";
dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>"; dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_error_mr.png'></div>";
dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>"; dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>";
dialog_error_pkg_text = dialog_error_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_error + "</p></div>"; dialog_error_pkg_text = dialog_error_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_error + "</p></div>";
dialog_error_pkg_text = dialog_error_pkg_text + "</div>"; dialog_error_pkg_text = dialog_error_pkg_text + "</div>";
@ -388,7 +388,7 @@ function install_package (package, homeurl) {
}); });
var dialog_cancel_pkg_text = "<div>"; var dialog_cancel_pkg_text = "<div>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_info_mr.png'></div>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_cancel + "</p></div>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_cancel + "</p></div>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "</div>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "</div>";
@ -405,7 +405,7 @@ function install_package (package, homeurl) {
}); });
var dialog_bad_message_text = "<div>"; var dialog_bad_message_text = "<div>";
dialog_bad_message_text = dialog_bad_message_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>"; dialog_bad_message_text = dialog_bad_message_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_error_mr.png'></div>";
dialog_bad_message_text = dialog_bad_message_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>"; dialog_bad_message_text = dialog_bad_message_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>";
dialog_bad_message_text = dialog_bad_message_text + "<p style='font-family:Verdana; font-size:12pt;'>" + bad_mr_file + "</p></div>"; dialog_bad_message_text = dialog_bad_message_text + "<p style='font-family:Verdana; font-size:12pt;'>" + bad_mr_file + "</p></div>";
dialog_bad_message_text = dialog_bad_message_text + "</div>"; dialog_bad_message_text = dialog_bad_message_text + "</div>";
@ -433,7 +433,7 @@ function install_package (package, homeurl) {
}); });
var dialog_success_mr_text = "<div>"; var dialog_success_mr_text = "<div>";
dialog_success_mr_text = dialog_success_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_exito_mr.png'></div>"; dialog_success_mr_text = dialog_success_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_exito_mr.png'></div>";
dialog_success_mr_text = dialog_success_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>"; dialog_success_mr_text = dialog_success_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>";
dialog_success_mr_text = dialog_success_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_success + "</p></div>"; dialog_success_mr_text = dialog_success_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_success + "</p></div>";
dialog_success_mr_text = dialog_success_mr_text + "</div>"; dialog_success_mr_text = dialog_success_mr_text + "</div>";
@ -476,7 +476,7 @@ function install_package (package, homeurl) {
}); });
var dialog_success_pkg_text = "<div>"; var dialog_success_pkg_text = "<div>";
dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_exito_mr.png'></div>"; dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_exito_mr.png'></div>";
dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>"; dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>";
dialog_success_pkg_text = dialog_success_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_success + "</p></div>"; dialog_success_pkg_text = dialog_success_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_success + "</p></div>";
dialog_success_pkg_text = dialog_success_pkg_text + "</div>"; dialog_success_pkg_text = dialog_success_pkg_text + "</div>";
@ -507,7 +507,7 @@ function install_package (package, homeurl) {
}); });
var dialog_error_pkg_text = "<div>"; var dialog_error_pkg_text = "<div>";
dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>"; dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_error_mr.png'></div>";
dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>"; dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>";
dialog_error_pkg_text = dialog_error_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_error + "</p></div>"; dialog_error_pkg_text = dialog_error_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_error + "</p></div>";
dialog_error_pkg_text = dialog_error_pkg_text + "</div>"; dialog_error_pkg_text = dialog_error_pkg_text + "</div>";
@ -529,7 +529,7 @@ function install_package (package, homeurl) {
// Check the status of the update // Check the status of the update
check_install_package(package, homeurl); check_install_package(package, homeurl);
remove_rr_file(data['mr']); remove_rr_file(data['mr'], home_url);
} }
} }
else { else {
@ -552,7 +552,7 @@ function install_package (package, homeurl) {
}); });
var dialog_error_mr_text = "<div>"; var dialog_error_mr_text = "<div>";
dialog_error_mr_text = dialog_error_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>"; dialog_error_mr_text = dialog_error_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_error_mr.png'></div>";
dialog_error_mr_text = dialog_error_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>"; dialog_error_mr_text = dialog_error_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>";
dialog_error_mr_text = dialog_error_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_error + "</p></div>"; dialog_error_mr_text = dialog_error_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_error + "</p></div>";
dialog_error_mr_text = dialog_error_mr_text + "</div>"; dialog_error_mr_text = dialog_error_mr_text + "</div>";
@ -586,7 +586,7 @@ function install_package (package, homeurl) {
}); });
var dialog_cancel_mr_text = "<div>"; var dialog_cancel_mr_text = "<div>";
dialog_cancel_mr_text = dialog_cancel_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>"; dialog_cancel_mr_text = dialog_cancel_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_info_mr.png'></div>";
dialog_cancel_mr_text = dialog_cancel_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>"; dialog_cancel_mr_text = dialog_cancel_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>";
dialog_cancel_mr_text = dialog_cancel_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_cancel + "</p></div>"; dialog_cancel_mr_text = dialog_cancel_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_cancel + "</p></div>";
dialog_cancel_mr_text = dialog_cancel_mr_text + "</div>"; dialog_cancel_mr_text = dialog_cancel_mr_text + "</div>";
@ -606,8 +606,8 @@ function install_package (package, homeurl) {
$('button:contains(Cancel)').attr("id","cancel_rr_button"); $('button:contains(Cancel)').attr("id","cancel_rr_button");
var dialog_have_mr_text = "<div>"; var dialog_have_mr_text = "<div>";
dialog_have_mr_text = dialog_have_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_warning_mr.png'></div>"; dialog_have_mr_text = dialog_have_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_warning_mr.png'></div>";
dialog_have_mr_text = dialog_have_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>This package includes db changes</strong></h3>"; dialog_have_mr_text = dialog_have_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>There are a DB changes</strong></h3>";
dialog_have_mr_text = dialog_have_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + text1_mr_file + "</p>"; dialog_have_mr_text = dialog_have_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + text1_mr_file + "</p>";
dialog_have_mr_text = dialog_have_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + text2_mr_file + "<a style='font-family:Verdana bold; font-size:12pt; color:#82B92E'href=\"index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list\">" + text3_mr_file + "</a>" + text4_mr_file + "</p></div>"; dialog_have_mr_text = dialog_have_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + text2_mr_file + "<a style='font-family:Verdana bold; font-size:12pt; color:#82B92E'href=\"index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list\">" + text3_mr_file + "</a>" + text4_mr_file + "</p></div>";
dialog_have_mr_text = dialog_have_mr_text + "</div>"; dialog_have_mr_text = dialog_have_mr_text + "</div>";
@ -653,7 +653,7 @@ function install_package (package, homeurl) {
}); });
var dialog_success_pkg_text = "<div>"; var dialog_success_pkg_text = "<div>";
dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_exito_mr.png'></div>"; dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_exito_mr.png'></div>";
dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>"; dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>";
dialog_success_pkg_text = dialog_success_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_success + "</p></div>"; dialog_success_pkg_text = dialog_success_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_success + "</p></div>";
dialog_success_pkg_text = dialog_success_pkg_text + "</div>"; dialog_success_pkg_text = dialog_success_pkg_text + "</div>";
@ -684,7 +684,7 @@ function install_package (package, homeurl) {
}); });
var dialog_error_pkg_text = "<div>"; var dialog_error_pkg_text = "<div>";
dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>"; dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_error_mr.png'></div>";
dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>"; dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>";
dialog_error_pkg_text = dialog_error_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_error + "</p></div>"; dialog_error_pkg_text = dialog_error_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_error + "</p></div>";
dialog_error_pkg_text = dialog_error_pkg_text + "</div>"; dialog_error_pkg_text = dialog_error_pkg_text + "</div>";
@ -706,7 +706,7 @@ function install_package (package, homeurl) {
// Check the status of the update // Check the status of the update
check_install_package(package, homeurl); check_install_package(package, homeurl);
remove_rr_file_to_extras(); remove_rr_file_to_extras(home_url);
} }
} }
}); });
@ -732,7 +732,7 @@ function install_package (package, homeurl) {
}); });
var dialog_cancel_pkg_text = "<div>"; var dialog_cancel_pkg_text = "<div>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_info_mr.png'></div>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_cancel + "</p></div>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_cancel + "</p></div>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "</div>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "</div>";
@ -785,7 +785,7 @@ function install_package (package, homeurl) {
}); });
var dialog_text = "<div>"; var dialog_text = "<div>";
dialog_text = dialog_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>"; dialog_text = dialog_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_info_mr.png'></div>";
dialog_text = dialog_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>" + text1_package_file + "</strong></h3>"; dialog_text = dialog_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>" + text1_package_file + "</strong></h3>";
dialog_text = dialog_text + "<p style='font-family:Verdana; font-size:12pt;'>" + text2_package_file + "</p></div>"; dialog_text = dialog_text + "<p style='font-family:Verdana; font-size:12pt;'>" + text2_package_file + "</p></div>";
dialog_text = dialog_text + "</div>"; dialog_text = dialog_text + "</div>";
@ -872,7 +872,6 @@ function update_last_package(package, version, homeurl) {
parameters, parameters,
function (data) { function (data) {
if (data['in_progress']) { if (data['in_progress']) {
$("#box_online .loading").hide();
$("#box_online .download_package").hide(); $("#box_online .download_package").hide();
$("#box_online .content").html(data['message']); $("#box_online .content").html(data['message']);
@ -888,12 +887,11 @@ function update_last_package(package, version, homeurl) {
parameters2, parameters2,
function (data) { function (data) {
if (data['correct']) { if (data['correct']) {
$("#box_online .loading").hide();
$("#box_online .download_package").hide(); $("#box_online .download_package").hide();
$("#box_online .content").html(data['message']); $("#box_online .content").html(data['message']);
install_free_package_prev_step(package, version, homeurl); install_free_package_prev_step(package, version, home_url);
} }
else { else {
$("#box_online .content").html(data['message']); $("#box_online .content").html(data['message']);
@ -981,9 +979,7 @@ function install_free_package_prev_step(package, version, homeurl) {
home_url + "ajax.php", home_url + "ajax.php",
parameters, parameters,
function (data) { function (data) {
$("#box_online .loading").hide();
$("#box_online .downloading_package").hide(); $("#box_online .downloading_package").hide();
if (data['have_minor']) { if (data['have_minor']) {
$("<div id='mr_dialog2' class='dialog ui-dialog-content' title='" + mr_available + "'></div>").dialog ({ $("<div id='mr_dialog2' class='dialog ui-dialog-content' title='" + mr_available + "'></div>").dialog ({
resizable: true, resizable: true,
@ -998,8 +994,7 @@ function install_free_package_prev_step(package, version, homeurl) {
buttons: { buttons: {
"Apply MR": function () { "Apply MR": function () {
var err = []; var err = [];
err = apply_minor_release(data['mr'], package, 0, 0); err = apply_minor_release(data['mr'], package, 0, 0, home_url);
if (!err['error']) { if (!err['error']) {
if (err['message'] == 'bad_mr_filename') { if (err['message'] == 'bad_mr_filename') {
$("#mr_dialog2").dialog("close"); $("#mr_dialog2").dialog("close");
@ -1035,7 +1030,7 @@ function install_free_package_prev_step(package, version, homeurl) {
}); });
var dialog_accept_package_mr_fail_text = "<div>"; var dialog_accept_package_mr_fail_text = "<div>";
dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>"; dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_info_mr.png'></div>";
dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>"; dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>";
dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_not_accepted_code_yes + "</p></div>"; dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_not_accepted_code_yes + "</p></div>";
dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "</div>"; dialog_accept_package_mr_fail_text = dialog_accept_package_mr_fail_text + "</div>";
@ -1054,7 +1049,6 @@ function install_free_package_prev_step(package, version, homeurl) {
parameters2, parameters2,
function (data) { function (data) {
if (data['in_progress']) { if (data['in_progress']) {
$("#box_online .loading").hide();
$("#box_online .download_package").hide(); $("#box_online .download_package").hide();
$("#box_online .content").html(data['message']); $("#box_online .content").html(data['message']);
@ -1070,6 +1064,8 @@ function install_free_package_prev_step(package, version, homeurl) {
}, },
"json" "json"
); );
remove_rr_file_to_extras(home_url);
}, },
"Cancel": function () { "Cancel": function () {
$(this).dialog("close"); $(this).dialog("close");
@ -1094,7 +1090,7 @@ function install_free_package_prev_step(package, version, homeurl) {
}); });
var dialog_cancel_pkg_text = "<div>"; var dialog_cancel_pkg_text = "<div>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_info_mr.png'></div>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_cancel + "</p></div>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_cancel + "</p></div>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "</div>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "</div>";
@ -1108,7 +1104,7 @@ function install_free_package_prev_step(package, version, homeurl) {
}); });
var dialog_bad_message_text = "<div>"; var dialog_bad_message_text = "<div>";
dialog_bad_message_text = dialog_bad_message_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>"; dialog_bad_message_text = dialog_bad_message_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_error_mr.png'></div>";
dialog_bad_message_text = dialog_bad_message_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>"; dialog_bad_message_text = dialog_bad_message_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>";
dialog_bad_message_text = dialog_bad_message_text + "<p style='font-family:Verdana; font-size:12pt;'>" + bad_mr_file + "</p></div>"; dialog_bad_message_text = dialog_bad_message_text + "<p style='font-family:Verdana; font-size:12pt;'>" + bad_mr_file + "</p></div>";
dialog_bad_message_text = dialog_bad_message_text + "</div>"; dialog_bad_message_text = dialog_bad_message_text + "</div>";
@ -1136,7 +1132,7 @@ function install_free_package_prev_step(package, version, homeurl) {
}); });
var dialog_success_mr_text = "<div>"; var dialog_success_mr_text = "<div>";
dialog_success_mr_text = dialog_success_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_exito_mr.png'></div>"; dialog_success_mr_text = dialog_success_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_exito_mr.png'></div>";
dialog_success_mr_text = dialog_success_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>"; dialog_success_mr_text = dialog_success_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>";
dialog_success_mr_text = dialog_success_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_success + "</p></div>"; dialog_success_mr_text = dialog_success_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_success + "</p></div>";
dialog_success_mr_text = dialog_success_mr_text + "</div>"; dialog_success_mr_text = dialog_success_mr_text + "</div>";
@ -1155,7 +1151,6 @@ function install_free_package_prev_step(package, version, homeurl) {
parameters2, parameters2,
function (data) { function (data) {
if (data['in_progress']) { if (data['in_progress']) {
$("#box_online .loading").hide();
$("#box_online .download_package").hide(); $("#box_online .download_package").hide();
$("#box_online .content").html(data['message']); $("#box_online .content").html(data['message']);
@ -1172,7 +1167,7 @@ function install_free_package_prev_step(package, version, homeurl) {
"json" "json"
); );
remove_rr_file(data['mr']); remove_rr_file_to_extras(home_url);
} }
} }
else { else {
@ -1195,7 +1190,7 @@ function install_free_package_prev_step(package, version, homeurl) {
}); });
var dialog_error_mr_text = "<div>"; var dialog_error_mr_text = "<div>";
dialog_error_mr_text = dialog_error_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>"; dialog_error_mr_text = dialog_error_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_error_mr.png'></div>";
dialog_error_mr_text = dialog_error_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>"; dialog_error_mr_text = dialog_error_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>";
dialog_error_mr_text = dialog_error_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_error + "</p></div>"; dialog_error_mr_text = dialog_error_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_error + "</p></div>";
dialog_error_mr_text = dialog_error_mr_text + "</div>"; dialog_error_mr_text = dialog_error_mr_text + "</div>";
@ -1227,7 +1222,7 @@ function install_free_package_prev_step(package, version, homeurl) {
}); });
var dialog_cancel_mr_text = "<div>"; var dialog_cancel_mr_text = "<div>";
dialog_cancel_mr_text = dialog_cancel_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>"; dialog_cancel_mr_text = dialog_cancel_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_info_mr.png'></div>";
dialog_cancel_mr_text = dialog_cancel_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>"; dialog_cancel_mr_text = dialog_cancel_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>";
dialog_cancel_mr_text = dialog_cancel_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_cancel + "</p></div>"; dialog_cancel_mr_text = dialog_cancel_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + mr_cancel + "</p></div>";
dialog_cancel_mr_text = dialog_cancel_mr_text + "</div>"; dialog_cancel_mr_text = dialog_cancel_mr_text + "</div>";
@ -1246,13 +1241,13 @@ function install_free_package_prev_step(package, version, homeurl) {
$('button:contains(Cancel)').attr("id","cancel_rr_button"); $('button:contains(Cancel)').attr("id","cancel_rr_button");
var dialog_have_mr_text = "<div>"; var dialog_have_mr_text = "<div>";
dialog_have_mr_text = dialog_have_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_warning_mr.png'></div>"; dialog_have_mr_text = dialog_have_mr_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_warning_mr.png'></div>";
dialog_have_mr_text = dialog_have_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>This package includes db changes</strong></h3>"; dialog_have_mr_text = dialog_have_mr_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>There are a DB changes</strong></h3>";
dialog_have_mr_text = dialog_have_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + text1_mr_file + "</p>"; dialog_have_mr_text = dialog_have_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + text1_mr_file + "</p>";
dialog_have_mr_text = dialog_have_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + text2_mr_file + "<a style='font-family:Verdana bold; font-size:12pt; color:#82B92E'href=\"index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list\">" + text3_mr_file + "</a>" + text4_mr_file + "</p></div>"; dialog_have_mr_text = dialog_have_mr_text + "<p style='font-family:Verdana; font-size:12pt;'>" + text2_mr_file + "<a style='font-family:Verdana bold; font-size:12pt; color:#82B92E'href=\"index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list\">" + text3_mr_file + "</a>" + text4_mr_file + "</p></div>";
dialog_have_mr_text = dialog_have_mr_text + "</div>"; dialog_have_mr_text = dialog_have_mr_text + "</div>";
$('#mr_dialog2').html(dialog_have_mr_mr_text); $('#mr_dialog2').html(dialog_have_mr_text);
$('#mr_dialog2').dialog('open'); $('#mr_dialog2').dialog('open');
} }
else { else {
@ -1267,7 +1262,6 @@ function install_free_package_prev_step(package, version, homeurl) {
parameters2, parameters2,
function (data) { function (data) {
if (data['in_progress']) { if (data['in_progress']) {
$("#box_online .loading").hide();
$("#box_online .download_package").hide(); $("#box_online .download_package").hide();
$("#box_online .content").html(data['message']); $("#box_online .content").html(data['message']);
@ -1284,9 +1278,10 @@ function install_free_package_prev_step(package, version, homeurl) {
"json" "json"
); );
remove_rr_file_to_extras(); remove_rr_file_to_extras(home_url);
} }
} },
"json"
); );
}, },
"Cancel": function () { "Cancel": function () {
@ -1310,7 +1305,7 @@ function install_free_package_prev_step(package, version, homeurl) {
}); });
var dialog_cancel_pkg_text = "<div>"; var dialog_cancel_pkg_text = "<div>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_info_mr.png'></div>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>INFO</strong></h3>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_cancel + "</p></div>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + package_cancel + "</p></div>";
dialog_cancel_pkg_text = dialog_cancel_pkg_text + "</div>"; dialog_cancel_pkg_text = dialog_cancel_pkg_text + "</div>";
@ -1326,7 +1321,7 @@ function install_free_package_prev_step(package, version, homeurl) {
}); });
var dialog_text = "<div>"; var dialog_text = "<div>";
dialog_text = dialog_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_info_mr.png'></div>"; dialog_text = dialog_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_info_mr.png'></div>";
dialog_text = dialog_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>" + text1_package_file + "</strong></h3>"; dialog_text = dialog_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>" + text1_package_file + "</strong></h3>";
dialog_text = dialog_text + "<p style='font-family:Verdana; font-size:12pt;'>" + text2_package_file + "</p></div>"; dialog_text = dialog_text + "<p style='font-family:Verdana; font-size:12pt;'>" + text2_package_file + "</p></div>";
dialog_text = dialog_text + "</div>"; dialog_text = dialog_text + "</div>";
@ -1369,7 +1364,7 @@ function install_free_package(package, version, homeurl) {
}); });
var dialog_error_pkg_text = "<div>"; var dialog_error_pkg_text = "<div>";
dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>"; dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_error_mr.png'></div>";
dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>"; dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>";
dialog_error_pkg_text = dialog_error_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + data['message'] + "</p></div>"; dialog_error_pkg_text = dialog_error_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + data['message'] + "</p></div>";
dialog_error_pkg_text = dialog_error_pkg_text + "</div>"; dialog_error_pkg_text = dialog_error_pkg_text + "</div>";
@ -1405,7 +1400,7 @@ function install_free_package(package, version, homeurl) {
}); });
var dialog_success_pkg_text = "<div>"; var dialog_success_pkg_text = "<div>";
dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_exito_mr.png'></div>"; dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_exito_mr.png'></div>";
dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>"; dialog_success_pkg_text = dialog_success_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>SUCCESS</strong></h3>";
dialog_success_pkg_text = dialog_success_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + data['message'] + "</p></div>"; dialog_success_pkg_text = dialog_success_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + data['message'] + "</p></div>";
dialog_success_pkg_text = dialog_success_pkg_text + "</div>"; dialog_success_pkg_text = dialog_success_pkg_text + "</div>";
@ -1439,7 +1434,7 @@ function install_free_package(package, version, homeurl) {
}); });
var dialog_error_pkg_text = "<div>"; var dialog_error_pkg_text = "<div>";
dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>"; dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_error_mr.png'></div>";
dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>"; dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>";
dialog_error_pkg_text = dialog_error_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + data['message'] + "</p></div>"; dialog_error_pkg_text = dialog_error_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + data['message'] + "</p></div>";
dialog_error_pkg_text = dialog_error_pkg_text + "</div>"; dialog_error_pkg_text = dialog_error_pkg_text + "</div>";
@ -1474,7 +1469,7 @@ function install_free_package(package, version, homeurl) {
}); });
var dialog_error_pkg_text = "<div>"; var dialog_error_pkg_text = "<div>";
dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='images/icono_error_mr.png'></div>"; dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:25%; float:left'><img style='padding-left:20px; padding-top:20px;' src='" + home_url + "images/icono_error_mr.png'></div>";
dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>"; dialog_error_pkg_text = dialog_error_pkg_text + "<div style='width:75%; float:left;'><h3><strong style='font-family:Verdana; font-size:13pt;'>ERROR</strong></h3>";
dialog_error_pkg_text = dialog_error_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + data['message'] + "</p></div>"; dialog_error_pkg_text = dialog_error_pkg_text + "<p style='font-family:Verdana; font-size:12pt;'>" + data['message'] + "</p></div>";
dialog_error_pkg_text = dialog_error_pkg_text + "</div>"; dialog_error_pkg_text = dialog_error_pkg_text + "</div>";
@ -1486,7 +1481,8 @@ function install_free_package(package, version, homeurl) {
}); });
} }
function apply_minor_release (n_mr, pkg, ent, off) { function apply_minor_release (n_mr, pkg, ent, off, homeurl) {
var home_url = (typeof homeurl !== 'undefined') ? homeurl + '/' : '';
var error = []; var error = [];
error['error'] = false; error['error'] = false;
$('#mr_dialog2').empty(); $('#mr_dialog2').empty();
@ -1504,7 +1500,7 @@ function apply_minor_release (n_mr, pkg, ent, off) {
async: false, async: false,
dataType: "html", dataType: "html",
type: "POST", type: "POST",
url: "ajax.php", url: home_url + "ajax.php",
success: function (data) { success: function (data) {
$('#mr_dialog2').append("</div style='max-height:50px'>"); $('#mr_dialog2').append("</div style='max-height:50px'>");
if (data == 'bad_mr_filename') { if (data == 'bad_mr_filename') {
@ -1535,7 +1531,8 @@ function apply_minor_release (n_mr, pkg, ent, off) {
return error; return error;
} }
function remove_rr_file (number) { function remove_rr_file (number, homeurl) {
var home_url = (typeof homeurl !== 'undefined') ? homeurl + '/' : '';
var params = {}; var params = {};
params["remove_rr"] = 1; params["remove_rr"] = 1;
params["number"] = number; params["number"] = number;
@ -1545,13 +1542,14 @@ function remove_rr_file (number) {
data: params, data: params,
dataType: "html", dataType: "html",
type: "POST", type: "POST",
url: "ajax.php", url: home_url + "ajax.php",
success: function (data) { success: function (data) {
} }
}); });
} }
function remove_rr_file_to_extras () { function remove_rr_file_to_extras (homeurl) {
var home_url = (typeof homeurl !== 'undefined') ? homeurl + '/' : '';
var params = {}; var params = {};
params["remove_rr_extras"] = 1; params["remove_rr_extras"] = 1;
params["page"] = "include/ajax/rolling_release.ajax"; params["page"] = "include/ajax/rolling_release.ajax";
@ -1560,7 +1558,7 @@ function remove_rr_file_to_extras () {
data: params, data: params,
dataType: "html", dataType: "html",
type: "POST", type: "POST",
url: "ajax.php", url: home_url + "ajax.php",
success: function (data) { success: function (data) {
} }
}); });

View File

@ -451,13 +451,13 @@ button.ui-button::-moz-focus-inner {
float: right; float: right;
} }
.ui-dialog .ui-dialog-buttonpane button { .ui-dialog .ui-dialog-buttonpane button {
margin: .5em 1em .5em 0; margin: .5em 1em .5em 0 !important;
cursor: pointer; cursor: pointer !important;
background: white; background: white !important;
background-color: white; background-color: white !important;
border: 1px solid #82b92e; border: 1px solid #82b92e !important;
height:30px; height:30px !important;
width:90px; width:90px !important;
} }
.ui-dialog .ui-resizable-se { .ui-dialog .ui-resizable-se {
width: 12px; width: 12px;

View File

@ -71,7 +71,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0NG'; $version = '7.0NG';
$build = '170323'; $build = '170419';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -450,6 +450,7 @@ if (!empty($network_interfaces)) {
$table_interface->head_colspan[0] = 8; $table_interface->head_colspan[0] = 8;
$table_interface->data = array(); $table_interface->data = array();
$event_text_cont = 0; $event_text_cont = 0;
foreach ($network_interfaces as $interface_name => $interface) { foreach ($network_interfaces as $interface_name => $interface) {
if (!empty($interface['traffic'])) { if (!empty($interface['traffic'])) {
$permission = false; $permission = false;

View File

@ -82,11 +82,12 @@ $interface_traffic_modules = array(
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Pandora FMS Graph (<?php echo agents_get_alias($agent_id) . ' - ' . $interface_name; ?>)</title> <title>Pandora FMS Graph (<?php echo agents_get_alias($agent_id) . ' - ' . $interface_name; ?>)</title>
<link rel="stylesheet" href="../../include/styles/pandora_minimal.css" type="text/css" /> <link rel="stylesheet" href="../../include/styles/pandora_minimal.css" type="text/css" />
<script type='text/javaScript' src='../../include/javascript/calendar.js'></script> <link rel="stylesheet" href="../../include/styles/jquery-ui-1.10.0.custom.css" type="text/css" />
<script type='text/javascript' src='../../include/javascript/pandora.js'></script> <script type='text/javascript' src='../../include/javascript/pandora.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery-1.9.0.js'></script> <script type='text/javascript' src='../../include/javascript/jquery-1.9.0.js'></script>
<script type='text/javascript' src='../../include/javascript/jquery.pandora.js'></script> <script type='text/javascript' src='../../include/javascript/jquery.pandora.js'></script>
<script type='text/javascript'> <script type='text/javascript' src='../../include/javascript/jquery.jquery-ui-1.10.0.custom.js'></script>
<script type='text/javascript'>
<!-- <!--
window.onload = function() { window.onload = function() {
// Hack to repeat the init process to period select // Hack to repeat the init process to period select
@ -103,7 +104,7 @@ $interface_traffic_modules = array(
$("#hidden-show_other").val(0); $("#hidden-show_other").val(0);
} }
} }
//--> -->
</script> </script>
</head> </head>
<body bgcolor="#ffffff" style='background:#ffffff;'> <body bgcolor="#ffffff" style='background:#ffffff;'>
@ -142,6 +143,7 @@ $interface_traffic_modules = array(
$width = (int) get_parameter("width", 555); $width = (int) get_parameter("width", 555);
$height = (int) get_parameter("height", 245); $height = (int) get_parameter("height", 245);
$start_date = (string) get_parameter("start_date", date("Y-m-d")); $start_date = (string) get_parameter("start_date", date("Y-m-d"));
$start_time = get_parameter ("start_time", date("H:i:s"));
$zoom = (int) get_parameter ("zoom", 1); $zoom = (int) get_parameter ("zoom", 1);
$baseline = get_parameter ("baseline", 0); $baseline = get_parameter ("baseline", 0);
$show_percentil = get_parameter ("show_percentil", 0); $show_percentil = get_parameter ("show_percentil", 0);
@ -153,12 +155,19 @@ $interface_traffic_modules = array(
echo "<script type='text/javascript'>window.resizeTo($width + 120, $height + 320);</script>"; echo "<script type='text/javascript'>window.resizeTo($width + 120, $height + 320);</script>";
} }
$current = date("Y-m-d"); /*$current = date("Y-m-d");
if ($start_date != $current) if ($start_date != $current)
$date = strtotime($start_date); $date = strtotime($start_date);
else else
$date = $utime; $date = $utime;
*/
$date = strtotime("$start_date $start_time");
$now = time();
if ($date > $now){
$date = $now;
}
$urlImage = ui_get_full_url(false); $urlImage = ui_get_full_url(false);
@ -229,6 +238,12 @@ $interface_traffic_modules = array(
$table->data[] = $data; $table->data[] = $data;
$table->rowclass[] = ''; $table->rowclass[] = '';
$data = array();
$data[0] = __('Begin time');
$data[1] = html_print_input_text ("start_time", $start_time,'', 10, 10, true);
$table->data[] = $data;
$table->rowclass[] = '';
$data = array(); $data = array();
$data[0] = __('Time range'); $data[0] = __('Time range');
$data[1] = html_print_extended_select_for_time('period', $period, '', '', 0, 7, true); $data[1] = html_print_extended_select_for_time('period', $period, '', '', 0, 7, true);
@ -295,6 +310,13 @@ $interface_traffic_modules = array(
</body> </body>
</html> </html>
<?php
// Echo the script tags of the datepicker and the timepicker
// Modify the user language cause the ui.datepicker language files use - instead _
$custom_user_language = str_replace('_', '-', $user_language);
ui_require_jquery_file("ui.datepicker-" . $custom_user_language, "include/javascript/i18n/", true);
ui_include_time_picker(true);
?>
<script> <script>
<?php <?php
@ -321,5 +343,24 @@ $interface_traffic_modules = array(
} }
?> ?>
// Add datepicker and timepicker
$("#text-start_date").datepicker({
dateFormat: "<?php echo DATE_FORMAT_JS; ?>"
});
$("#text-start_time").timepicker({
showSecond: true,
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
timeOnlyTitle: '<?php echo __('Choose time');?>',
timeText: '<?php echo __('Time');?>',
hourText: '<?php echo __('Hour');?>',
minuteText: '<?php echo __('Minute');?>',
secondText: '<?php echo __('Second');?>',
currentText: '<?php echo __('Now');?>',
closeText: '<?php echo __('Close');?>'
});
$.datepicker.setDefaults($.datepicker.regional["<?php echo $custom_user_language; ?>"]);
forced_title_callback(); forced_title_callback();
</script> </script>

View File

@ -759,3 +759,27 @@ else {
show_networkmap($id, $user_readonly, $nodes_and_relations, $dash_mode, $map_dash_details); show_networkmap($id, $user_readonly, $nodes_and_relations, $dash_mode, $map_dash_details);
} }
?> ?>
<script>
$(document).ready(function() {
$("*").on("click", function(){
if($("[aria-describedby=dialog_node_edit]").css('display') == 'block'){
$('#foot').css({'top':parseInt($("[aria-describedby=dialog_node_edit]").css('height')+$("[aria-describedby=dialog_node_edit]").css('top')),'position':'relative'});
}
else{
$('#foot').css({'position':'','top':'0'});
}
});
$("[aria-describedby=dialog_node_edit]").on('dialogclose', function(event) {
$('#foot').css({'position':'','top':'0'});
});
});
</script>

View File

@ -1050,7 +1050,7 @@ if (!empty($result)) {
} }
} }
$data[0] = '<a href="?sec=gpolicies&amp;sec2=enterprise/godmode/policies/policies&amp;id=' . $policyInfo['id_policy'] . '">' . $data[0] = '<a href="?sec=gmodules&amp;sec2=enterprise/godmode/policies/policies&amp;id=' . $policyInfo['id_policy'] . '">' .
html_print_image($img,true, array('title' => $title)) . html_print_image($img,true, array('title' => $title)) .
'</a>'; '</a>';
} }

View File

@ -139,7 +139,7 @@ if (is_ajax ()) {
$alert = get_parameter('alert_fired'); $alert = get_parameter('alert_fired');
if ($alert == 'true') { if ($alert == 'true') {
$resultAlert = alerts_get_event_status_group($idGroup, $resultAlert = alerts_get_event_status_group($idGroup,
'alert_fired', $query, $agents); array('alert_fired','alert_ceased'), $query, $agents);
} }
$critical = get_parameter('critical'); $critical = get_parameter('critical');
if ($critical == 'true') { if ($critical == 'true') {

View File

@ -57,6 +57,7 @@ if (is_ajax()) {
$event_filter = events_get_event_filter($id_filter); $event_filter = events_get_event_filter($id_filter);
$event_filter['search'] = io_safe_output($event_filter['search']);
$event_filter['id_name'] = io_safe_output($event_filter['id_name']); $event_filter['id_name'] = io_safe_output($event_filter['id_name']);
$event_filter['tag_with'] = base64_encode(io_safe_output($event_filter['tag_with'])); $event_filter['tag_with'] = base64_encode(io_safe_output($event_filter['tag_with']));
$event_filter['tag_without'] = base64_encode(io_safe_output($event_filter['tag_without'])); $event_filter['tag_without'] = base64_encode(io_safe_output($event_filter['tag_without']));

View File

@ -25,6 +25,16 @@ $delete_graph = (bool) get_parameter ('delete_graph');
$view_graph = (bool) get_parameter ('view_graph'); $view_graph = (bool) get_parameter ('view_graph');
$id_graph = (int) get_parameter ('id'); $id_graph = (int) get_parameter ('id');
if($id_graph !== 0){
$sql = "SELECT * FROM tgraph
WHERE (private = 0 OR (private = 1 AND id_user = '".$config["id_user"]."'))
AND id_graph = ".$id_graph;
$control = db_process_sql($sql);
if(!$control){
header('Location: index.php?sec=reporting&sec2=godmode/reporting/graphs');
}
}
// Delete module SQL code // Delete module SQL code
if ($delete_graph) { if ($delete_graph) {
if (check_acl ($config['id_user'], 0, "AW")) { if (check_acl ($config['id_user'], 0, "AW")) {

View File

@ -302,9 +302,8 @@ $ignored_params['refr'] = '';
} }
}); });
$(".graph").each(function(){ $(".graph:not([class~='noresizevc'])").each(function(){
height = parseInt($(this).css("height")) - 30; height = parseInt($(this).css("height")) - 30;
$(this).css('height', height); $(this).css('height', height);
}); });

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG %define version 7.0NG
%define release 170323 %define release 170419
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG %define version 7.0NG
%define release 170323 %define release 170419
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -1086,7 +1086,7 @@ INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `o
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (54,'InetdDaemon','module_begin&#x0d;&#x0a;module_name&#x20;InetdDaemon&#x0d;&#x0a;module_type&#x20;generic_proc&#x0d;&#x0a;module_exec&#x20;ps&#x20;-Af&#x20;|&#x20;grep&#x20;inetd&#x20;|&#x20;grep&#x20;-v&#x20;&quot;grep&quot;&#x20;|&#x20;wc&#x20;-l&#x20;|&#x20;&#x20;awk&#x20;&#039;{&#x20;print&#x20;$1&#x20;}&#039;&#x0d;&#x0a;module_end&#x0d;&#x0a;','Check&#x20;inetddaemon&#x20;running&#x20;in&#x20;system',3,'',46,2,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0); INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (54,'InetdDaemon','module_begin&#x0d;&#x0a;module_name&#x20;InetdDaemon&#x0d;&#x0a;module_type&#x20;generic_proc&#x0d;&#x0a;module_exec&#x20;ps&#x20;-Af&#x20;|&#x20;grep&#x20;inetd&#x20;|&#x20;grep&#x20;-v&#x20;&quot;grep&quot;&#x20;|&#x20;wc&#x20;-l&#x20;|&#x20;&#x20;awk&#x20;&#039;{&#x20;print&#x20;$1&#x20;}&#039;&#x0d;&#x0a;module_end&#x0d;&#x0a;','Check&#x20;inetddaemon&#x20;running&#x20;in&#x20;system',3,'',46,2,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (55,'disk_root_free','module_begin&#x0d;&#x0a;module_name&#x20;disk_root_free&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_exec&#x20;df&#x20;-k&#x20;/&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{&#x20;print&#x20;100-$4&#x20;}&#039;&#x0d;&#x0a;module_max&#x20;100&#x0d;&#x0a;module_min&#x20;0&#x0d;&#x0a;module_description&#x20;Free&#x20;disk&#x20;Percentage&#x20;of&#x20;root&#x20;partition&#x0d;&#x0a;module_end','Free&#x20;disk&#x20;Percentage&#x20;of&#x20;root&#x20;partition',3,'',46,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0); INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (55,'disk_root_free','module_begin&#x0d;&#x0a;module_name&#x20;disk_root_free&#x0d;&#x0a;module_type&#x20;generic_data&#x0d;&#x0a;module_exec&#x20;df&#x20;-k&#x20;/&#x20;|&#x20;tail&#x20;-1&#x20;|&#x20;awk&#x20;&#039;{&#x20;print&#x20;100-$4&#x20;}&#039;&#x0d;&#x0a;module_max&#x20;100&#x0d;&#x0a;module_min&#x20;0&#x0d;&#x0a;module_description&#x20;Free&#x20;disk&#x20;Percentage&#x20;of&#x20;root&#x20;partition&#x0d;&#x0a;module_end','Free&#x20;disk&#x20;Percentage&#x20;of&#x20;root&#x20;partition',3,'',46,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (56,'OpenedFiles&#x20;','module_begin&#x20;&#x0d;&#x0a;module_name&#x20;OpenedFiles&#x20;&#x0d;&#x0a;module_type&#x20;generic_data&#x20;&#x0d;&#x0a;module_exec&#x20;lsof&#x20;|&#x20;wc&#x20;-l&#x20;&#x0d;&#x0a;module_description&#x20;Total&#x20;files&#x20;opened&#x20;in&#x20;system&#x20;&#x0d;&#x0a;module_end&#x20;','Total&#x20;files&#x20;opened&#x20;in&#x20;system&#x20;',1,'',43,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0); INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (56,'OpenedFiles&#x20;','module_begin&#x20;&#x0d;&#x0a;module_name&#x20;OpenedFiles&#x20;&#x0d;&#x0a;module_type&#x20;generic_data&#x20;&#x0d;&#x0a;module_exec&#x20;lsof&#x20;|&#x20;wc&#x20;-l&#x20;&#x0d;&#x0a;module_description&#x20;Total&#x20;files&#x20;opened&#x20;in&#x20;system&#x20;&#x0d;&#x0a;module_end&#x20;','Total&#x20;files&#x20;opened&#x20;in&#x20;system&#x20;',1,'',43,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (57,'Zombie&#x20;processes','module_begin&#x20;&#x0d;&#x0a;module_name&#x20;Zombie&#x20;processes&#x20;&#x0d;&#x0a;module_type&#x20;generic_data&#x20;&#x0d;&#x0a;module_exec&#x20;ps&#x20;&shy;eos&#x20;|&#x20;grep&#x20;Z&#x20;|&#x20;wc&#x20;&shy;l&#x20;|&#x20;tr&#x20;&shy;d&#x20;&ldquo;&#92;n&rdquo;&#x20;&#x0d;&#x0a;module_description&#x20;Number&#x20;of&#x20;zombie&#x20;processes&#x20;&#x0d;&#x0a;module_end&#x20;','Number&#x20;of&#x20;zombie&#x20;processes&#x20;',1,'',43,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0); INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (57,'Zombie&#x20;processes','module_begin&#x20;&#x0d;&#x0a;module_name&#x20;Zombie&#x20;processes&#x0d;&#x0a;module_type&#x20;generic_data&#x20;&#x0d;&#x0a;module_exec&#x20;ps&#x20;&#x2D;eos&#x20;|&#x20;grep&#x20;&#x27;Z&#x27;&#x20;|&#x20;wc&#x20;&#x2D;l&#x20;|&#x20;tr&#x20;&#x2D;d&#x20;&#x22;&#92;n&#x22;&#x20;&#x0d;&#x0a;module_description&#x20;Number&#x20;of&#x20;zombie&#x20;processes&#x20;&#x0d;&#x0a;module_end&#x20;','Number&#x20;of&#x20;zombie&#x20;processes&#x20;',1,'',43,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (58,'Disk_IO_Wait','module_begin&#x20;&#x0d;&#x0a;module_name&#x20;Disk_IO_Wait&#x20;&#x0d;&#x0a;module_type&#x20;generic_data&#x20;&#x0d;&#x0a;module_exec&#x20;top&#x20;-n&#x20;3&#x20;-c&#x20;|&#x20;grep&#x20;&quot;Cpu&quot;&#x20;|&#x20;awk&#x20;&#039;{&#x20;print&#x20;$6&#x20;}&#039;&#x20;|&#x20;grep&#x20;-o&#x20;&quot;[0-9]*&quot;&#x20;|&#x20;tail&#x20;-1&#x20;&#x0d;&#x0a;module_description&#x20;Simple&#x20;approach&#x20;to&#x20;IO/Wait&#x20;monitoring.&#x20;&#x0d;&#x0a;module_end&#x20;','Simple&#x20;approach&#x20;to&#x20;IO/Wait&#x20;monitoring.&#x20;',1,'',43,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0); INSERT INTO `tlocal_component` (`id`, `name`, `data`, `description`, `id_os`, `os_version`, `id_network_component_group`, `type`, `max`, `min`, `module_interval`, `id_module_group`, `history_data`, `min_warning`, `max_warning`, `str_warning`, `min_critical`, `max_critical`, `str_critical`, `min_ff_event`, `post_process`, `unit`, `wizard_level`, `macros`, `critical_instructions`, `warning_instructions`, `unknown_instructions`, `critical_inverse`, `warning_inverse`, `id_category`, `tags`, `disabled_types_event`, `min_ff_event_normal`, `min_ff_event_warning`, `min_ff_event_critical`, `each_ff`, `ff_timeout`, `dynamic_interval`, `dynamic_max`, `dynamic_min`, `prediction_sample_window`, `prediction_samples`, `prediction_threshold`) VALUES (58,'Disk_IO_Wait','module_begin&#x20;&#x0d;&#x0a;module_name&#x20;Disk_IO_Wait&#x20;&#x0d;&#x0a;module_type&#x20;generic_data&#x20;&#x0d;&#x0a;module_exec&#x20;top&#x20;-n&#x20;3&#x20;-c&#x20;|&#x20;grep&#x20;&quot;Cpu&quot;&#x20;|&#x20;awk&#x20;&#039;{&#x20;print&#x20;$6&#x20;}&#039;&#x20;|&#x20;grep&#x20;-o&#x20;&quot;[0-9]*&quot;&#x20;|&#x20;tail&#x20;-1&#x20;&#x0d;&#x0a;module_description&#x20;Simple&#x20;approach&#x20;to&#x20;IO/Wait&#x20;monitoring.&#x20;&#x0d;&#x0a;module_end&#x20;','Simple&#x20;approach&#x20;to&#x20;IO/Wait&#x20;monitoring.&#x20;',1,'',43,1,0,0,0,0,1,0.00,0.00,NULL,0.00,0.00,NULL,0,0.000000000000000,NULL,'basic',NULL,'','','',0,0,0,'','',0,0,0,0,0,0,0,0,0,0,0);
-- GIS Data -- GIS Data
@ -1128,8 +1128,6 @@ INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (4, 'Group&#x20;vi
INSERT INTO `trecon_script` VALUES (2,'IPMI&#x20;Recon','Specific&#x20;Pandora&#x20;FMS&#x20;Intel&#x20;DCM&#x20;Discovery&#x20;&#40;c&#41;&#x20;Artica&#x20;ST&#x20;2011&#x20;&lt;info@artica.es&gt;&#x0d;&#x0a;&#x0d;&#x0a;Usage:&#x20;./ipmi-recon.pl&#x20;&lt;task_id&gt;&#x20;&lt;group_id&gt;&#x20;&lt;create_incident_flag&gt;&#x20;&lt;custom_field1&gt;&#x20;&lt;custom_field2&gt;&#x20;&lt;custom_field3&gt;&#x20;&lt;custom_field4&gt;&#x0d;&#x0a;&#x0d;&#x0a;*&#x20;custom_field1&#x20;=&#x20;Network&#x20;i.e.:&#x20;192.168.100.0/24&#x0d;&#x0a;*&#x20;custom_field2&#x20;=&#x20;Username&#x0d;&#x0a;*&#x20;custom_field3&#x20;=&#x20;Password&#x0d;&#x0a;*&#x20;custom_field4&#x20;=&#x20;Additional&#x20;parameters&#x20;i.e.:&#x20;-D&#x20;LAN_2_0','/usr/share/pandora_server/util/recon_scripts/ipmi-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.:&#x20;192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional&#x20;parameters\",\"help\":\"Optional&#x20;additional&#x20;parameters&#x20;such&#x20;as&#x20;-D&#x20;LAN_2_0&#x20;to&#x20;use&#x20;IPMI&#x20;ver&#x20;2.0&#x20;instead&#x20;of&#x20;1.5.&#x20;&#x20;These&#x20;options&#x20;will&#x20;also&#x20;be&#x20;passed&#x20;to&#x20;the&#x20;IPMI&#x20;plugin&#x20;when&#x20;the&#x20;current&#x20;values&#x20;are&#x20;read.\",\"value\":\"\",\"hide\":\"\"}}'); INSERT INTO `trecon_script` VALUES (2,'IPMI&#x20;Recon','Specific&#x20;Pandora&#x20;FMS&#x20;Intel&#x20;DCM&#x20;Discovery&#x20;&#40;c&#41;&#x20;Artica&#x20;ST&#x20;2011&#x20;&lt;info@artica.es&gt;&#x0d;&#x0a;&#x0d;&#x0a;Usage:&#x20;./ipmi-recon.pl&#x20;&lt;task_id&gt;&#x20;&lt;group_id&gt;&#x20;&lt;create_incident_flag&gt;&#x20;&lt;custom_field1&gt;&#x20;&lt;custom_field2&gt;&#x20;&lt;custom_field3&gt;&#x20;&lt;custom_field4&gt;&#x0d;&#x0a;&#x0d;&#x0a;*&#x20;custom_field1&#x20;=&#x20;Network&#x20;i.e.:&#x20;192.168.100.0/24&#x0d;&#x0a;*&#x20;custom_field2&#x20;=&#x20;Username&#x0d;&#x0a;*&#x20;custom_field3&#x20;=&#x20;Password&#x0d;&#x0a;*&#x20;custom_field4&#x20;=&#x20;Additional&#x20;parameters&#x20;i.e.:&#x20;-D&#x20;LAN_2_0','/usr/share/pandora_server/util/recon_scripts/ipmi-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.:&#x20;192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional&#x20;parameters\",\"help\":\"Optional&#x20;additional&#x20;parameters&#x20;such&#x20;as&#x20;-D&#x20;LAN_2_0&#x20;to&#x20;use&#x20;IPMI&#x20;ver&#x20;2.0&#x20;instead&#x20;of&#x20;1.5.&#x20;&#x20;These&#x20;options&#x20;will&#x20;also&#x20;be&#x20;passed&#x20;to&#x20;the&#x20;IPMI&#x20;plugin&#x20;when&#x20;the&#x20;current&#x20;values&#x20;are&#x20;read.\",\"value\":\"\",\"hide\":\"\"}}');
INSERT INTO `trecon_script` VALUES (4,'SNMP&#x20;L2&#x20;Recon','Pandora&#x20;FMS&#x20;SNMP&#x20;Recon&#x20;Plugin&#x20;for&#x20;level&#x20;2&#x20;network&#x20;topology&#x20;discovery.&#x0d;&#x0a;&#40;c&#41;&#x20;Artica&#x20;ST&#x20;2014&#x20;&lt;info@artica.es&gt;&#x0d;&#x0a;&#x0d;&#x0a;Usage:&#x0d;&#x0a;&#x0d;&#x0a;&#x20;&#x20;&#x20;./snmp-recon.pl&#x20;&lt;task_id&gt;&#x20;&lt;group_id&gt;&#x20;&lt;create_incident&gt;&#x20;&lt;custom_field1&gt;&#x20;&lt;custom_field2&gt;&#x20;[custom_field3]&#x20;[custom_field4]&#x0d;&#x0a;&#x0d;&#x0a;&#x20;*&#x20;custom_field1&#x20;=&#x20;comma&#x20;separated&#x20;list&#x20;of&#x20;networks&#x20;&#40;i.e.:&#x20;192.168.1.0/24,192.168.2.0/24&#41;&#x0d;&#x0a;&#x20;*&#x20;custom_field2&#x20;=&#x20;comma&#x20;separated&#x20;list&#x20;of&#x20;snmp&#x20;communities&#x20;to&#x20;try.&#x0d;&#x0a;&#x20;*&#x20;custom_field3&#x20;=&#x20;a&#x20;router&#x20;in&#x20;the&#x20;network.&#x20;Optional&#x20;but&#x20;recommended.&#x0d;&#x0a;&#x20;*&#x20;custom_field4&#x20;=&#x20;set&#x20;to&#x20;-a&#x20;to&#x20;add&#x20;all&#x20;network&#x20;interfaces&#x20;&#40;by&#x20;default&#x20;only&#x20;interfaces&#x20;that&#x20;are&#x20;up&#x20;are&#x20;added&#41;.&#x0d;&#x0a;&#x0d;&#x0a;&#x20;Additional&#x20;information:&#x0d;&#x0a;When&#x20;the&#x20;script&#x20;is&#x20;called&#x20;from&#x20;a&#x20;recon&#x20;task&#x20;the&#x20;task_id,&#x20;group_id&#x20;and&#x20;create_incident&#x20;parameters&#x20;are&#x20;automatically&#x20;filled&#x20;by&#x20;the&#x20;Pandora&#x20;FMS&#x20;Server.','/usr/share/pandora_server/util/recon_scripts/snmp-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"Comma&#x20;separated&#x20;list&#x20;of&#x20;networks&#x20;&#40;i.e.:&#x20;192.168.1.0/24,192.168.2.0/24&#41;\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Community\",\"help\":\"Comma&#x20;separated&#x20;list&#x20;of&#x20;snmp&#x20;communities&#x20;to&#x20;try.\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Router\",\"help\":\"A&#x20;router&#x20;in&#x20;the&#x20;network.&#x20;Optional&#x20;but&#x20;recommended.\",\"value\":\"\",\"hide\":\"\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Optional&#x20;parameter\",\"help\":\"Set&#x20;to&#x20;-a&#x20;to&#x20;add&#x20;all&#x20;network&#x20;interfaces&#x20;&#40;by&#x20;default&#x20;only&#x20;interfaces&#x20;that&#x20;are&#x20;up&#x20;are&#x20;added&#41;.\",\"value\":\"\",\"hide\":\"\"}}');
INSERT INTO `trecon_script` VALUES (5,'WMI&#x20;Recon&#x20;Script','This&#x20;script&#x20;is&#x20;used&#x20;to&#x20;automatically&#x20;gather&#x20;host&#x20;information&#x20;via&#x20;WMI.&#x0d;&#x0a;Available&#x20;parameters:&#x0d;&#x0a;&#x0d;&#x0a;*&#x20;Network&#x20;=&#x20;network&#x20;to&#x20;scan&#x20;&#40;e.g.&#x20;192.168.100.0/24&#41;.&#x0d;&#x0a;*&#x20;WMI&#x20;auth&#x20;=&#x20;comma&#x20;separated&#x20;list&#x20;of&#x20;WMI&#x20;authentication&#x20;tokens&#x20;in&#x20;the&#x20;format&#x20;username%password&#x20;&#40;e.g.&#x20;Administrador%pass&#41;.&#x0d;&#x0a;&#x0d;&#x0a;See&#x20;the&#x20;documentation&#x20;for&#x20;more&#x20;information.','/usr/share/pandora_server/util/recon_scripts/wmi-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"WMI&#x20;auth\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"}}'); INSERT INTO `trecon_script` VALUES (5,'WMI&#x20;Recon&#x20;Script','This&#x20;script&#x20;is&#x20;used&#x20;to&#x20;automatically&#x20;gather&#x20;host&#x20;information&#x20;via&#x20;WMI.&#x0d;&#x0a;Available&#x20;parameters:&#x0d;&#x0a;&#x0d;&#x0a;*&#x20;Network&#x20;=&#x20;network&#x20;to&#x20;scan&#x20;&#40;e.g.&#x20;192.168.100.0/24&#41;.&#x0d;&#x0a;*&#x20;WMI&#x20;auth&#x20;=&#x20;comma&#x20;separated&#x20;list&#x20;of&#x20;WMI&#x20;authentication&#x20;tokens&#x20;in&#x20;the&#x20;format&#x20;username%password&#x20;&#40;e.g.&#x20;Administrador%pass&#41;.&#x0d;&#x0a;&#x0d;&#x0a;See&#x20;the&#x20;documentation&#x20;for&#x20;more&#x20;information.','/usr/share/pandora_server/util/recon_scripts/wmi-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"WMI&#x20;auth\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"}}');
INSERT INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `execute`, `plugin_type`, `macros`, `parameters`) VALUES (1,'IPMI&#x20;Plugin','Plugin&#x20;to&#x20;get&#x20;IPMI&#x20;monitors&#x20;from&#x20;a&#x20;IPMI&#x20;Device.',0,'/usr/share/pandora_server/util/plugin/ipmi-plugin.pl',0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Target&#x20;IP\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"true\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Sensor\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"Additional&#x20;Options\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"}}','-h&#x20;_field1_&#x20;-u&#x20;_field2_&#x20;-p&#x20;_field3_&#x20;-s&#x20;_field4_&#x20;--&#x20;_field5_'); INSERT INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `execute`, `plugin_type`, `macros`, `parameters`) VALUES (1,'IPMI&#x20;Plugin','Plugin&#x20;to&#x20;get&#x20;IPMI&#x20;monitors&#x20;from&#x20;a&#x20;IPMI&#x20;Device.',0,'/usr/share/pandora_server/util/plugin/ipmi-plugin.pl',0,'{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Target&#x20;IP\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"true\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Sensor\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"5\":{\"macro\":\"_field5_\",\"desc\":\"Additional&#x20;Options\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"}}','-h&#x20;_field1_&#x20;-u&#x20;_field2_&#x20;-p&#x20;_field3_&#x20;-s&#x20;_field4_&#x20;--&#x20;_field5_');
@ -1250,4 +1248,4 @@ INSERT INTO `tpolicy_modules` (`id_policy`, `configuration_data`, `id_tipo_modul
-- --
-- Dumping data for table `tprofile_view` -- Dumping data for table `tprofile_view`
-- --
INSERT INTO `tprofile_view` (`id_profile`, `sec`, `sec2`, `sec3`) VALUES (5, '*', '*','*'); INSERT INTO `tprofile_view` (`id_profile`, `sec`, `sec2`, `sec3`) VALUES (5, '*', '*','*');

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG-170323 Version: 7.0NG-170419
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG-170323" pandora_version="7.0NG-170419"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

@ -102,7 +102,7 @@ sub pandora_startup () {
$Config{"encryption_key"} = enterprise_hook('pandora_get_encryption_key', [\%Config, $Config{"encryption_passphrase"}]); $Config{"encryption_key"} = enterprise_hook('pandora_get_encryption_key', [\%Config, $Config{"encryption_passphrase"}]);
# Update the agent cache. # Update the agent cache.
enterprise_hook('update_agent_cache', [\%Config, $DBH]) if ($Config{'metaconsole_agent_cache'} == 1); enterprise_hook('update_agent_cache', [\%Config, $DBH]) if ($Config{'node_metaconsole'} == 1);
pandora_audit (\%Config, 'Pandora FMS Server Daemon starting', 'SYSTEM', 'System', $DBH); pandora_audit (\%Config, 'Pandora FMS Server Daemon starting', 'SYSTEM', 'System', $DBH);

View File

@ -38,7 +38,7 @@ fi
#Create the pandora user to run the anyterd, mainly #Create the pandora user to run the anyterd, mainly
/usr/sbin/useradd -d /home/pandora -s /bin/false -M -g 0 pandora /usr/sbin/useradd -d /home/pandora -s /bin/false -M -g 0 pandora
cd /tmp/pandorafms/pandora_server && chmod +x pandora_server_installer && sync && ./pandora_server_installer --install cd /tmp/pandorafms/pandora_server && ./pandora_server_installer --install
#Configure the Pandora FMS Server to connect to the database #Configure the Pandora FMS Server to connect to the database
sed -i "s/dbname pandora/dbname $PANDORA_DB_NAME/g" /etc/pandora/pandora_server.conf sed -i "s/dbname pandora/dbname $PANDORA_DB_NAME/g" /etc/pandora/pandora_server.conf

View File

@ -43,7 +43,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG"; my $pandora_version = "7.0NG";
my $pandora_build = "170323"; my $pandora_build = "170419";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash
@ -160,9 +160,6 @@ sub pandora_get_sharedconfig ($$) {
# Pandora FMS Console's attachment directory # Pandora FMS Console's attachment directory
$pa_config->{"attachment_dir"} = pandora_get_tconfig_token ($dbh, 'attachment_store', '/var/www/pandora_console/attachment'); $pa_config->{"attachment_dir"} = pandora_get_tconfig_token ($dbh, 'attachment_store', '/var/www/pandora_console/attachment');
# Metaconsole agent cache.
$pa_config->{"metaconsole_agent_cache"} = pandora_get_tconfig_token ($dbh, 'metaconsole_agent_cache', 0);
#Limit of events replicate in metaconsole #Limit of events replicate in metaconsole
$pa_config->{'replication_limit'} = pandora_get_tconfig_token ($dbh, 'replication_limit', 1000); $pa_config->{'replication_limit'} = pandora_get_tconfig_token ($dbh, 'replication_limit', 1000);
$pa_config->{'include_agents'} = pandora_get_tconfig_token ($dbh, 'include_agents', 0); $pa_config->{'include_agents'} = pandora_get_tconfig_token ($dbh, 'include_agents', 0);
@ -170,6 +167,11 @@ sub pandora_get_sharedconfig ($$) {
#Public url #Public url
$pa_config->{'public_url'} = pandora_get_tconfig_token ($dbh, 'public_url', 'http://localhost/pandora_console'); $pa_config->{'public_url'} = pandora_get_tconfig_token ($dbh, 'public_url', 'http://localhost/pandora_console');
# Node with a metaconsole license.
# NOTE: This must be read when checking license limits!
#$pa_config->{"node_metaconsole"} = pandora_get_tconfig_token ($dbh, 'node_metaconsole', 0);
if ($pa_config->{'include_agents'} eq '') { if ($pa_config->{'include_agents'} eq '') {
$pa_config->{'include_agents'} = 0; $pa_config->{'include_agents'} = 0;
} }
@ -400,6 +402,7 @@ sub pandora_load_config {
$pa_config->{"stats_interval"} = 300; $pa_config->{"stats_interval"} = 300;
$pa_config->{"agentaccess"} = 1; $pa_config->{"agentaccess"} = 1;
$pa_config->{"event_storm_protection"} = 0; $pa_config->{"event_storm_protection"} = 0;
$pa_config->{"node_metaconsole"} = 0; # > 7.0NG
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
#SNMP Forwarding tokens #SNMP Forwarding tokens

View File

@ -4053,10 +4053,10 @@ sub export_module_data ($$$$$$$) {
# Data export is disabled # Data export is disabled
return if ($module->{'id_export'} < 1); return if ($module->{'id_export'} < 1);
logger($pa_config, "Exporting data for module '" . $module->{'nombre'} . "' agent '" . $agent->{'nombre'} . "'.", 10); logger($pa_config, "Exporting data for module '" . $module->{'nombre'} . "' agent '" . $agent->{'alias'} . "'.", 10);
db_do($dbh, 'INSERT INTO tserver_export_data db_do($dbh, 'INSERT INTO tserver_export_data
(id_export_server, agent_name , module_name, module_type, data, timestamp) VALUES (id_export_server, agent_name , module_name, module_type, data, timestamp) VALUES
(?, ?, ?, ?, ?, ?)', $module->{'id_export'}, $agent->{'nombre'}, $module->{'nombre'}, $module_type, $data, $timestamp); (?, ?, ?, ?, ?, ?)', $module->{'id_export'}, $agent->{'alias'}, $module->{'nombre'}, $module_type, $data, $timestamp);
} }
########################################################################## ##########################################################################
@ -4994,7 +4994,7 @@ sub pandora_update_agent_module_count ($$$) {
') WHERE id_agente = ' . $agent_id); ') WHERE id_agente = ' . $agent_id);
# Sync the agent cache every time the module count is updated. # Sync the agent cache every time the module count is updated.
enterprise_hook('update_agent_cache', [$pa_config, $dbh, $agent_id]) if ($pa_config->{'metaconsole_agent_cache'} == 1); enterprise_hook('update_agent_cache', [$pa_config, $dbh, $agent_id]) if ($pa_config->{'node_metaconsole'} == 1);
} }
########################################################################## ##########################################################################
@ -5008,7 +5008,7 @@ sub pandora_update_agent_alert_count ($$$) {
') WHERE id_agente = ' . $agent_id); ') WHERE id_agente = ' . $agent_id);
# Sync the agent cache every time the module count is updated. # Sync the agent cache every time the module count is updated.
enterprise_hook('update_agent_cache', [$pa_config, $dbh, $agent_id]) if ($pa_config->{'metaconsole_agent_cache'} == 1); enterprise_hook('update_agent_cache', [$pa_config, $dbh, $agent_id]) if ($pa_config->{'node_metaconsole'} == 1);
} }
######################################################################## ########################################################################

View File

@ -249,8 +249,8 @@ sub are_connected($$$$$) {
$if_1 = "ping" if $if_1 eq ''; $if_1 = "ping" if $if_1 eq '';
$if_2 = "ping" if $if_2 eq ''; $if_2 = "ping" if $if_2 eq '';
if (defined($self->{'connections'}->{"${dev_1}\t${if_1}\t${dev_2}\t{$if_2}"}) || if (defined($self->{'connections'}->{"${dev_1}\t${if_1}\t${dev_2}\t${if_2}"}) ||
defined($self->{'connections'}->{"${dev_2}\t${if_2}\t${dev_1}\t{$if_1}"})) { defined($self->{'connections'}->{"${dev_2}\t${if_2}\t${dev_1}\t${if_1}"})) {
return 1; return 1;
} }
@ -1154,7 +1154,7 @@ sub scan($) {
# Get a list of found hosts. # Get a list of found hosts.
my @hosts = @{$self->get_hosts()}; my @hosts = @{$self->get_hosts()};
if (scalar(@hosts) > 0) { if (scalar(@hosts) > 0 && $self->{'parent_detection'} == 1) {
# Delete previous connections. # Delete previous connections.
$self->call('delete_connections'); $self->call('delete_connections');

View File

@ -1459,7 +1459,9 @@ sub valid_regex ($) {
sub is_metaconsole ($) { sub is_metaconsole ($) {
my ($pa_config) = @_; my ($pa_config) = @_;
if (defined($pa_config->{"license_type"}) && $pa_config->{"license_type"} == METACONSOLE_LICENSE) { if (defined($pa_config->{"license_type"}) &&
$pa_config->{"license_type"} == METACONSOLE_LICENSE &&
$pa_config->{"node_metaconsole"} == 0) {
return 1; return 1;
} }

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG %define version 7.0NG
%define release 170323 %define release 170419
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG %define version 7.0NG
%define release 170323 %define release 170419
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG" PI_VERSION="7.0NG"
PI_BUILD="170323" PI_BUILD="170419"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

@ -33,7 +33,7 @@ use PandoraFMS::Tools;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG PS170323"; my $version = "7.0NG PS170419";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -35,7 +35,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "7.0NG PS170323"; my $version = "7.0NG PS170419";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);