mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 17:25:26 +02:00
2012-07-06 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.editor.js, godmode/reporting/visual_console_builder.elements.php, include/functions_visual_map.php, include/ajax/visual_console_builder.ajax.php, include/functions_visual_map_editor.php: uploaded some fixes and changes for the visualmap, for example refactored some part of print the visualmap in operation. * include/functions_html.php: fixed when included from standarlone file from enterprise structure directory. * include/constants.php: added constants for avoid magic numbers into the code of Visualmaps. * include/graphs/functions_gd.php, include/functions.php, include/functions_io.php, include/functions_modules.php, include/functions_ui.php: cleaned source code style. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6747 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
9a71dc64c0
commit
104bc62283
@ -1,3 +1,23 @@
|
|||||||
|
2012-07-06 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* godmode/reporting/visual_console_builder.editor.js,
|
||||||
|
godmode/reporting/visual_console_builder.elements.php,
|
||||||
|
include/functions_visual_map.php,
|
||||||
|
include/ajax/visual_console_builder.ajax.php,
|
||||||
|
include/functions_visual_map_editor.php: uploaded some fixes and
|
||||||
|
changes for the visualmap, for example refactored some part of
|
||||||
|
print the visualmap in operation.
|
||||||
|
|
||||||
|
* include/functions_html.php: fixed when included from standarlone
|
||||||
|
file from enterprise structure directory.
|
||||||
|
|
||||||
|
* include/constants.php: added constants for avoid magic numbers
|
||||||
|
into the code of Visualmaps.
|
||||||
|
|
||||||
|
* include/graphs/functions_gd.php, include/functions.php,
|
||||||
|
include/functions_io.php, include/functions_modules.php,
|
||||||
|
include/functions_ui.php: cleaned source code style.
|
||||||
|
|
||||||
2012-07-06 Sergio Martin <sergio.martin@artica.es>
|
2012-07-06 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* pandoradb.sql
|
* pandoradb.sql
|
||||||
|
@ -49,7 +49,6 @@ function visual_map_main() {
|
|||||||
draw_lines(lines, 'background', true);
|
draw_lines(lines, 'background', true);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function eventsTextAgent() {
|
function eventsTextAgent() {
|
||||||
@ -681,6 +680,10 @@ function hiddenFields(item) {
|
|||||||
|
|
||||||
$("#module_graph_size_row").css('display', 'none');
|
$("#module_graph_size_row").css('display', 'none');
|
||||||
$("#module_graph_size_row." + item).css('display', '');
|
$("#module_graph_size_row." + item).css('display', '');
|
||||||
|
|
||||||
|
if (typeof(enterprise_hiddenFields) == 'function') {
|
||||||
|
enterprise_hiddenFields(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanFields() {
|
function cleanFields() {
|
||||||
|
@ -45,9 +45,6 @@ foreach ($all_images as $image_file) {
|
|||||||
$images_list[$image_file] = $image_file;
|
$images_list[$image_file] = $image_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
$layoutDataTypes = visual_map_get_layout_data_types();
|
|
||||||
|
|
||||||
|
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
$table->head = array ();
|
$table->head = array ();
|
||||||
$table->head['icon'] = '';
|
$table->head['icon'] = '';
|
||||||
|
@ -499,6 +499,9 @@ switch ($action) {
|
|||||||
|
|
||||||
echo json_encode($size);
|
echo json_encode($size);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
enterprise_hook("enterprise_visualmap_ajax");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* visual map element status check */
|
/* visual map element status check */
|
||||||
|
@ -131,4 +131,19 @@ define('PROCESS_VALUE_NONE', 0);
|
|||||||
define('PROCESS_VALUE_MIN', 1);
|
define('PROCESS_VALUE_MIN', 1);
|
||||||
define('PROCESS_VALUE_MAX', 2);
|
define('PROCESS_VALUE_MAX', 2);
|
||||||
define('PROCESS_VALUE_AVG', 3);
|
define('PROCESS_VALUE_AVG', 3);
|
||||||
|
//Status
|
||||||
|
define('VISUAL_MAP_STATUS_CRITICAL_BAD', 1);
|
||||||
|
define('VISUAL_MAP_STATUS_CRITICAL_ALERT', 4);
|
||||||
|
define('VISUAL_MAP_STATUS_NORMAL', 0);
|
||||||
|
define('VISUAL_MAP_STATUS_WARNING', 2);
|
||||||
|
define('VISUAL_MAP_STATUS_UNKNOW', 3);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Service constants */
|
||||||
|
//Status
|
||||||
|
define('SERVICE_STATUS_UNKNOW', -1);
|
||||||
|
define('SERVICE_STATUS_NORMAL', 0);
|
||||||
|
define('SERVICE_STATUS_CRITICAL', 1);
|
||||||
|
define('SERVICE_STATUS_WARNING', 2);
|
||||||
?>
|
?>
|
@ -136,6 +136,7 @@ function safe_url_extraclean ($string, $default_string = '') {
|
|||||||
*/
|
*/
|
||||||
function no_permission () {
|
function no_permission () {
|
||||||
require ("config.php");
|
require ("config.php");
|
||||||
|
|
||||||
echo "<h3 class='error'>".__('You don\'t have access')."</h3>";
|
echo "<h3 class='error'>".__('You don\'t have access')."</h3>";
|
||||||
echo html_print_image('images/noaccess.png', true, array("alt" => 'No access', "width" => '120')) . "<br /><br />";
|
echo html_print_image('images/noaccess.png', true, array("alt" => 'No access', "width" => '120')) . "<br /><br />";
|
||||||
echo "<table width=550>";
|
echo "<table width=550>";
|
||||||
@ -144,6 +145,7 @@ function no_permission () {
|
|||||||
echo "</table>";
|
echo "</table>";
|
||||||
echo "<tr><td><td><td><td>";
|
echo "<tr><td><td><td><td>";
|
||||||
include "general/footer.php";
|
include "general/footer.php";
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,6 +157,7 @@ function no_permission () {
|
|||||||
*/
|
*/
|
||||||
function unmanaged_error ($error = "") {
|
function unmanaged_error ($error = "") {
|
||||||
require_once ("config.php");
|
require_once ("config.php");
|
||||||
|
|
||||||
echo "<h3 class='error'>".__('Unmanaged error')."</h3>";
|
echo "<h3 class='error'>".__('Unmanaged error')."</h3>";
|
||||||
echo html_print_image('images/error.png', true, array("alt" => 'error')) . "<br /><br />";
|
echo html_print_image('images/error.png', true, array("alt" => 'error')) . "<br /><br />";
|
||||||
echo "<table width=550>";
|
echo "<table width=550>";
|
||||||
@ -165,6 +168,7 @@ function unmanaged_error ($error = "") {
|
|||||||
echo "</table>";
|
echo "</table>";
|
||||||
echo "<tr><td><td><td><td>";
|
echo "<tr><td><td><td><td>";
|
||||||
include "general/footer.php";
|
include "general/footer.php";
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -656,29 +660,31 @@ function get_parameter_post ($name, $default = "") {
|
|||||||
*/
|
*/
|
||||||
function get_alert_priority ($priority = 0) {
|
function get_alert_priority ($priority = 0) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
switch ($priority) {
|
switch ($priority) {
|
||||||
case 0:
|
case 0:
|
||||||
return __('Maintenance');
|
return __('Maintenance');
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
return __('Informational');
|
return __('Informational');
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
return __('Normal');
|
return __('Normal');
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
return __('Warning');
|
return __('Warning');
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
return __('Critical');
|
return __('Critical');
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
return __('Minor');
|
return __('Minor');
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
return __('Major');
|
return __('Major');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -697,7 +703,8 @@ function get_alert_days ($row) {
|
|||||||
|
|
||||||
if ($check == 7) {
|
if ($check == 7) {
|
||||||
return __('All');
|
return __('All');
|
||||||
} elseif ($check == 0) {
|
}
|
||||||
|
elseif ($check == 0) {
|
||||||
return __('None');
|
return __('None');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -731,14 +738,16 @@ function get_alert_days ($row) {
|
|||||||
* @return string A string with the concatenated values
|
* @return string A string with the concatenated values
|
||||||
*/
|
*/
|
||||||
function get_alert_times ($row2) {
|
function get_alert_times ($row2) {
|
||||||
if ($row2["time_from"]){
|
if ($row2["time_from"]) {
|
||||||
$time_from_table = $row2["time_from"];
|
$time_from_table = $row2["time_from"];
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$time_from_table = __('N/A');
|
$time_from_table = __('N/A');
|
||||||
}
|
}
|
||||||
if ($row2["time_to"]){
|
if ($row2["time_to"]) {
|
||||||
$time_to_table = $row2["time_to"];
|
$time_to_table = $row2["time_to"];
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$time_to_table = __('N/A');
|
$time_to_table = __('N/A');
|
||||||
}
|
}
|
||||||
if ($time_to_table == $time_from_table)
|
if ($time_to_table == $time_from_table)
|
||||||
@ -960,12 +969,12 @@ function enterprise_include ($filename) {
|
|||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
// Load enterprise extensions
|
// Load enterprise extensions
|
||||||
$filepath = realpath ($config["homedir"].'/'.ENTERPRISE_DIR.'/'.$filename);
|
$filepath = realpath ($config["homedir"] . '/' . ENTERPRISE_DIR . '/' . $filename);
|
||||||
|
|
||||||
if ($filepath === false)
|
if ($filepath === false)
|
||||||
return ENTERPRISE_NOT_HOOK;
|
return ENTERPRISE_NOT_HOOK;
|
||||||
|
|
||||||
if (strncmp ($config["homedir"], $filepath, strlen ($config["homedir"])) != 0){
|
if (strncmp ($config["homedir"], $filepath, strlen ($config["homedir"])) != 0) {
|
||||||
return ENTERPRISE_NOT_HOOK;
|
return ENTERPRISE_NOT_HOOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1188,8 +1197,8 @@ function array_key_to_offset($array, $key) {
|
|||||||
* @return array SNMP result.
|
* @return array SNMP result.
|
||||||
*/
|
*/
|
||||||
function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '', $snmp3_auth_user = '',
|
function get_snmpwalk($ip_target, $snmp_version, $snmp_community = '', $snmp3_auth_user = '',
|
||||||
$snmp3_security_level = '', $snmp3_auth_method = '', $snmp3_auth_pass = '',
|
$snmp3_security_level = '', $snmp3_auth_method = '', $snmp3_auth_pass = '',
|
||||||
$snmp3_privacy_method = '', $snmp3_privacy_pass = '', $quick_print = 0, $base_oid = "", $snmp_port = '') {
|
$snmp3_privacy_method = '', $snmp3_privacy_pass = '', $quick_print = 0, $base_oid = "", $snmp_port = '') {
|
||||||
|
|
||||||
snmp_set_quick_print ($quick_print);
|
snmp_set_quick_print ($quick_print);
|
||||||
|
|
||||||
|
@ -28,6 +28,11 @@ if (!isset($config)) {
|
|||||||
require_once(str_repeat("../", $i) . "config.php");
|
require_once(str_repeat("../", $i) . "config.php");
|
||||||
break; // Skip config.php loading after load the first one
|
break; // Skip config.php loading after load the first one
|
||||||
}
|
}
|
||||||
|
else if(file_exists(str_repeat("../", $i) . 'include/config.php')) {
|
||||||
|
//For path from the enterprise structure dirs.
|
||||||
|
require_once(str_repeat("../", $i) . "include/config.php");
|
||||||
|
break; // Skip config.php loading after load the first one
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,7 +153,8 @@ function io_ascii_to_html($num) {
|
|||||||
|
|
||||||
if ($num <= 15) {
|
if ($num <= 15) {
|
||||||
return "�".dechex($num).";";
|
return "�".dechex($num).";";
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
return "&#x".dechex($num).";";
|
return "&#x".dechex($num).";";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
* @subpackage UI
|
* @subpackage UI
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once($config['homedir'].'/include/functions_agents.php');
|
require_once($config['homedir'] . '/include/functions_agents.php');
|
||||||
require_once($config['homedir'] . '/include/functions_modules.php');
|
require_once($config['homedir'] . '/include/functions_modules.php');
|
||||||
require_once($config['homedir'] . '/include/functions.php');
|
require_once($config['homedir'] . '/include/functions.php');
|
||||||
require_once($config['homedir'] . '/include/functions_groups.php');
|
require_once($config['homedir'] . '/include/functions_groups.php');
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -43,7 +43,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
|
|||||||
|
|
||||||
|
|
||||||
echo '<div id="properties_panel" style="display: none; position: absolute; border: 2px solid #114105; padding: 5px; background: white; z-index: 90;">';
|
echo '<div id="properties_panel" style="display: none; position: absolute; border: 2px solid #114105; padding: 5px; background: white; z-index: 90;">';
|
||||||
//----------------------------Hiden Form----------------------------------------
|
//----------------------------Hiden Form----------------------------
|
||||||
?>
|
?>
|
||||||
<table class="databox" border="0" cellpadding="4" cellspacing="4" width="300">
|
<table class="databox" border="0" cellpadding="4" cellspacing="4" width="300">
|
||||||
<caption>
|
<caption>
|
||||||
|
@ -12,13 +12,14 @@
|
|||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU Lesser General Public License for more details.
|
// GNU Lesser General Public License for more details.
|
||||||
|
|
||||||
// If is called from index
|
if (file_exists('include/functions.php')) {
|
||||||
if(file_exists('include/functions.php')) {
|
// If is called from index
|
||||||
include_once('include/functions.php');
|
include_once('include/functions.php');
|
||||||
include_once('include/functions_html.php');
|
include_once('include/functions_html.php');
|
||||||
include_once('include/graphs/functions_utils.php');
|
include_once('include/graphs/functions_utils.php');
|
||||||
} // If is called through url
|
}
|
||||||
else if(file_exists('../functions.php')) {
|
else if (file_exists('../functions.php')) {
|
||||||
|
// If is called through url
|
||||||
include_once('../functions.php');
|
include_once('../functions.php');
|
||||||
include_once('../functions_html.php');
|
include_once('../functions_html.php');
|
||||||
include_once('functions_utils.php');
|
include_once('functions_utils.php');
|
||||||
@ -45,7 +46,7 @@ if($id_graph && in_array($graph_type, $types)) {
|
|||||||
$graph['fontsize'] = 6;
|
$graph['fontsize'] = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch($graph_type) {
|
switch ($graph_type) {
|
||||||
case 'histogram':
|
case 'histogram':
|
||||||
gd_histogram ($graph['width'],
|
gd_histogram ($graph['width'],
|
||||||
$graph['height'],
|
$graph['height'],
|
||||||
@ -86,7 +87,7 @@ function gd_histogram ($width, $height, $mode, $data, $max_value, $font, $title,
|
|||||||
// $title is for future use
|
// $title is for future use
|
||||||
$nvalues = count($data);
|
$nvalues = count($data);
|
||||||
|
|
||||||
Header("Content-type: image/png");
|
Header("Content-type: image/png");
|
||||||
$image = imagecreate($width,$height);
|
$image = imagecreate($width,$height);
|
||||||
$white = ImageColorAllocate($image,255,255,255);
|
$white = ImageColorAllocate($image,255,255,255);
|
||||||
imagecolortransparent ($image, $white);
|
imagecolortransparent ($image, $white);
|
||||||
@ -105,7 +106,8 @@ function gd_histogram ($width, $height, $mode, $data, $max_value, $font, $title,
|
|||||||
|
|
||||||
if ($mode != 2) {
|
if ($mode != 2) {
|
||||||
$size_per = ($max_value / ($width-40));
|
$size_per = ($max_value / ($width-40));
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$size_per = ($max_value / ($width));
|
$size_per = ($max_value / ($width));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user