2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array. * godmode/menu.php, general/header.php, operation/menu.php: Replaced lang_label with lang_string(). * general/logon_ok.php: Reduced one indentation level. * godmode/agentes/agent_manager.php: Replaced lang_label with lang_string(). Use pandora functions. * include/functions_html.php, godmode/agentes/configurar_agente.php: Tab and blankspaces style correction. * godmode/reporting/map_builder.php: Complete rewritten to provide an intuitive way of build the maps. It's cool, useful and very simple. * godmode/reporting/reporting_builder.php: Deleted an output debug. * godmode/setup/setup.php: Rewritten to use pandora functions. Added a colorpicker for color settings. * include/config.php: Reset pandora password. We must solve things with this file... * include/functions.php: Check if input is an array on safe_input(). Use filename as id in array returned by list_files(). * include/functions_db.php: Renamed return_coordinate_* functions. Style correction. * include/javascript/jquery.js: Updated to 1.2.6. * include/javascript/jquery.ui.datepicker.js: Code minimized. * include/javascript/pandora.js: Style correction. * include/javascript/wz_jsgraphics.js: Added a class to the elements of a line, so it can be modified using javascript. * /include/styles/pandora.css: Added style to some tables dropdowns. Added new styles relative to visual map editor. * operation/reporting/reporting_viewer.php: Style correction. Added jQuery UI. * operation/visual_console/index.php: Use Pandora functions. * operation/visual_console/render_view.php: Drawing the map is now on functions_visual_map.php. Added a countdown if a refresh time is set. Use pandora functions. Style correction. * reporting/fgraph.php: Style correction. Use graphic_error() if there's no data on grafico_modulo_sparse(). * images/trash.png: Added to repository. Image used on trash area on visual map editor. * images/console/background/africa.jpg, images/console/background/asia.jpg, images/console/background/europe.jpg, images/console/background/north_america.jpg, images/console/background/oceania.jpg, images/console/background/shouth_america.jpg, images/console/background/world.jpg: Added to repository. Useful and cool map backgrounds. * include/functions_visual_map.php: Added to repository. Implements visual map functions like drawing the map. * include/javascript/jquery.colorpicker.js: Added to repository. Implements a color picker widget. * /include/javascript/jquery.countdown.js: Added to repository. Implements a countdown widget. * include/javascript/jquery.ui.core.js: Added to repository. jQuery UI core. * include/javascript/jquery.ui.draggable.js: Added to repository. jQuery draggable plugin. * include/javascript/jquery.ui.droppable.js: Added to repository. jQuery droppable plugin. * include/javascript/pandora_visual_console.js: Added to repository. Function useful to visual map interface. * include/languages/countdown_*.js: Added to repository. Countdown localization. * include/languages/date_es_la.js, include/languages/date_gl.js, include/languages/time_es_la.js, include/languages/time_gl.js: Added to repository. Missing localizations. * include/styles/color-picker.css: Added to repository. Colorpicker style sheet. * include/styles/countdown.css: Added to repository. Countdown style sheet. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
104cf0aa06
commit
e28ac09264
pandora_console
ChangeLogajax.php
general
godmode
images
console/background
trash.pnginclude
config.phpfunctions.phpfunctions_db.phpfunctions_html.phpfunctions_visual_map.php
javascript
jquery.colorpicker.jsjquery.countdown.jsjquery.jsjquery.ui.core.jsjquery.ui.datepicker.jsjquery.ui.draggable.jsjquery.ui.droppable.jspandora.jspandora_visual_console.jswz_jsgraphics.js
languages
countdown_ca.jscountdown_de.jscountdown_en.jscountdown_es_la.jscountdown_fr.jscountdown_gl.jscountdown_it.jscountdown_pt_br.jsdate_es_la.jsdate_gl.jstime_es_la.jstime_gl.js
styles
operation
reporting
|
@ -1,3 +1,105 @@
|
|||
2008-06-26 Esteban Sanchez <estebans@artica.es>
|
||||
|
||||
* ajax.php: Sed id_user in config array.
|
||||
|
||||
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
|
||||
lang_label with lang_string().
|
||||
|
||||
* general/logon_ok.php: Reduced one indentation level.
|
||||
|
||||
* godmode/agentes/agent_manager.php: Replaced lang_label with
|
||||
lang_string(). Use pandora functions.
|
||||
|
||||
* include/functions_html.php, godmode/agentes/configurar_agente.php:
|
||||
Tab and blankspaces style correction.
|
||||
|
||||
* godmode/reporting/map_builder.php: Complete rewritten to provide an
|
||||
intuitive way of build the maps. It's cool, useful and very simple.
|
||||
|
||||
* godmode/reporting/reporting_builder.php: Deleted an output debug.
|
||||
|
||||
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
|
||||
colorpicker for color settings.
|
||||
|
||||
* include/config.php: Reset pandora password. We must solve things
|
||||
with this file...
|
||||
|
||||
* include/functions.php: Check if input is an array on safe_input().
|
||||
Use filename as id in array returned by list_files().
|
||||
|
||||
* include/functions_db.php: Renamed return_coordinate_* functions.
|
||||
Style correction.
|
||||
|
||||
* include/javascript/jquery.js: Updated to 1.2.6.
|
||||
|
||||
* include/javascript/jquery.ui.datepicker.js: Code minimized.
|
||||
|
||||
* include/javascript/pandora.js: Style correction.
|
||||
|
||||
* include/javascript/wz_jsgraphics.js: Added a class to the elements
|
||||
of a line, so it can be modified using javascript.
|
||||
|
||||
* /include/styles/pandora.css: Added style to some tables dropdowns.
|
||||
Added new styles relative to visual map editor.
|
||||
|
||||
* operation/reporting/reporting_viewer.php: Style correction. Added
|
||||
jQuery UI.
|
||||
|
||||
* operation/visual_console/index.php: Use Pandora functions.
|
||||
|
||||
* operation/visual_console/render_view.php: Drawing the map is now on
|
||||
functions_visual_map.php. Added a countdown if a refresh time is set.
|
||||
Use pandora functions. Style correction.
|
||||
|
||||
* reporting/fgraph.php: Style correction. Use graphic_error() if
|
||||
there's no data on grafico_modulo_sparse().
|
||||
|
||||
* images/trash.png: Added to repository. Image used on trash area on
|
||||
visual map editor.
|
||||
|
||||
* images/console/background/africa.jpg,
|
||||
images/console/background/asia.jpg,
|
||||
images/console/background/europe.jpg,
|
||||
images/console/background/north_america.jpg,
|
||||
images/console/background/oceania.jpg,
|
||||
images/console/background/shouth_america.jpg,
|
||||
images/console/background/world.jpg: Added to repository. Useful and
|
||||
cool map backgrounds.
|
||||
|
||||
* include/functions_visual_map.php: Added to repository. Implements
|
||||
visual map functions like drawing the map.
|
||||
|
||||
* include/javascript/jquery.colorpicker.js: Added to repository.
|
||||
Implements a color picker widget.
|
||||
|
||||
* /include/javascript/jquery.countdown.js: Added to repository.
|
||||
Implements a countdown widget.
|
||||
|
||||
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
|
||||
core.
|
||||
|
||||
* include/javascript/jquery.ui.draggable.js: Added to repository.
|
||||
jQuery draggable plugin.
|
||||
|
||||
* include/javascript/jquery.ui.droppable.js: Added to repository.
|
||||
jQuery droppable plugin.
|
||||
|
||||
* include/javascript/pandora_visual_console.js: Added to repository.
|
||||
Function useful to visual map interface.
|
||||
|
||||
* include/languages/countdown_*.js: Added to repository. Countdown
|
||||
localization.
|
||||
|
||||
* include/languages/date_es_la.js, include/languages/date_gl.js,
|
||||
include/languages/time_es_la.js, include/languages/time_gl.js: Added
|
||||
to repository. Missing localizations.
|
||||
|
||||
* include/styles/color-picker.css: Added to repository. Colorpicker
|
||||
style sheet.
|
||||
|
||||
* include/styles/countdown.css: Added to repository. Countdown style
|
||||
sheet.
|
||||
|
||||
2008-06-24 Sancho Lerena <slerena@gmail.com>
|
||||
|
||||
* include/functions_db.php: Fixed typo.
|
||||
|
|
|
@ -47,6 +47,7 @@ define ('AJAX', true);
|
|||
|
||||
$page = (string) get_parameter ('page');
|
||||
$page .= '.php';
|
||||
$config["id_user"] = $_SESSION["id_usuario"];
|
||||
session_write_close ();
|
||||
if (file_exists ($page)) {
|
||||
$id_user = $_SESSION["id_usuario"];
|
||||
|
|
|
@ -35,12 +35,12 @@ if (isset ($_SESSION["id_usuario"])){
|
|||
echo "<img src='images/user_suit.png' class='bot'> ";
|
||||
else
|
||||
echo "<img src='images/user_green.png' class='bot'> ";
|
||||
echo "<a class='white'>".$lang_label["has_connected"]. '
|
||||
echo "<a class='white'>".lang_string ("has_connected"). '
|
||||
[<b>'. $_SESSION["id_usuario"]. '</b>]</a>';
|
||||
|
||||
// Second column
|
||||
echo "<td>";
|
||||
echo "<a class='white_bold' href='index.php?sec=main'><img src='images/information.png' class='bot'> ". $lang_label["information"]."</a>";
|
||||
echo "<a class='white_bold' href='index.php?sec=main'><img src='images/information.png' class='bot'> ". lang_string ("information")."</a>";
|
||||
|
||||
// Third column
|
||||
echo "<td>";
|
||||
|
@ -53,7 +53,7 @@ if (isset ($_SESSION["id_usuario"])){
|
|||
|
||||
|
||||
echo "<tr><td>";
|
||||
echo "<a class='white_bold' href='index.php?bye=bye'><img src='images/lock.png' class='bot'> ". $lang_label["logout"]."</a>";
|
||||
echo "<a class='white_bold' href='index.php?bye=bye'><img src='images/lock.png' class='bot'> ". lang_string ("logout")."</a>";
|
||||
|
||||
echo "<td>";
|
||||
$server_status = check_server_status ();
|
||||
|
|
|
@ -17,180 +17,186 @@
|
|||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require("include/functions_reporting.php");
|
||||
require("include/functions_reporting.php");
|
||||
|
||||
echo "<div class='jus'>";
|
||||
$nick = $_SESSION['id_usuario'];
|
||||
echo "<h1>" . $lang_label["welcome_title"] . "</h1>";
|
||||
echo "<p>";
|
||||
echo $lang_label["main_text"];
|
||||
echo "</p>";
|
||||
echo "<div class='jus'>";
|
||||
$nick = $_SESSION['id_usuario'];
|
||||
echo "<h1>" . $lang_label["welcome_title"] . "</h1>";
|
||||
echo "<p>";
|
||||
echo $lang_label["main_text"];
|
||||
echo "</p>";
|
||||
|
||||
// Private messages pending to read !
|
||||
// Private messages pending to read !
|
||||
|
||||
$sql='SELECT COUNT(*) FROM tmensajes WHERE id_usuario_destino="'.$nick.'"
|
||||
AND estado="FALSE";';
|
||||
$resultado = mysql_query ($sql);
|
||||
$row = mysql_fetch_array ($resultado);
|
||||
if ($row["COUNT(*)"] != 0){
|
||||
echo "<h2>". $lang_label["new_message_bra"] . '
|
||||
<a href="index.php?sec=messages&sec2=operation/messages/message">'
|
||||
.$row["COUNT(*)"] . ' <img src="images/email.png" border="0">'
|
||||
.$lang_label["new_message_ket"] . '</a></h2>';
|
||||
}
|
||||
$sql='SELECT COUNT(*) FROM tmensajes WHERE id_usuario_destino="'.$nick.'"
|
||||
AND estado="FALSE";';
|
||||
$resultado = mysql_query ($sql);
|
||||
$row = mysql_fetch_array ($resultado);
|
||||
if ($row["COUNT(*)"] != 0){
|
||||
echo "<h2>". $lang_label["new_message_bra"] . '
|
||||
<a href="index.php?sec=messages&sec2=operation/messages/message">'
|
||||
.$row["COUNT(*)"] . ' <img src="images/email.png" border="0">'
|
||||
.$lang_label["new_message_ket"] . '</a></h2>';
|
||||
}
|
||||
|
||||
echo "<table width=95%>";
|
||||
echo "<tr><td valign='top'>";
|
||||
echo "<table width=95%>";
|
||||
echo "<tr><td valign='top'>";
|
||||
|
||||
// Site news !
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo '<h2>' . $lang_label["site_news"] . '</h2>';
|
||||
$sql_news = "SELECT * FROM tnews ORDER by timestamp DESC LIMIT 3";
|
||||
if ($result_news = mysql_query ($sql_news)){
|
||||
echo '<table cellpadding="4" cellspacing="4" width="270" class="databox">';
|
||||
while ($row = mysql_fetch_array ($result_news)) {
|
||||
echo '<tr>';
|
||||
echo "<th><b>".$row["subject"]."</b>";
|
||||
echo "<tr><td>".$lang_label["by"]." <b>".$row["author"]. "</b> ".$lang_label["at"]." <i>".$row["timestamp"]."</i>";
|
||||
echo '<tr><td class=datos>';
|
||||
echo clean_output_breaks($row["text"]);
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
echo "<td align='center'>";
|
||||
// Site stats
|
||||
// Summary
|
||||
// ~~~~~~~~~~~~~~~
|
||||
$data = general_stats($id_user,0);
|
||||
$monitor_checks = $data[0];
|
||||
$monitor_ok = $data[1];
|
||||
$monitor_bad = $data[2];
|
||||
$monitor_unknown = $data[3];
|
||||
$monitor_alert = $data[4];
|
||||
$total_agents = $data[5];
|
||||
$data_checks = $data[6];
|
||||
$data_unknown = $data[7];
|
||||
$data_alert = $data[8];
|
||||
$data_alert_total = $data[9];
|
||||
$monitor_alert_total = $data[10];
|
||||
$data_not_init = $data[11];
|
||||
$monitor_not_init = $data[12];
|
||||
// Calculate global indicators
|
||||
|
||||
$total_checks = $data_checks + $monitor_checks;
|
||||
$notinit_percentage = (($data_not_init + $monitor_not_init) / ($total_checks / 100));
|
||||
$module_sanity = format_numeric (100 - $notinit_percentage);
|
||||
$total_alerts = $data_alert + $monitor_alert;
|
||||
$total_fired_alerts = $monitor_alert_total+$data_alert_total;
|
||||
if ( $total_fired_alerts > 0)
|
||||
$alert_level = format_numeric (100 - ($total_alerts / ($total_fired_alerts / 100)));
|
||||
else
|
||||
$alert_level = 100;
|
||||
|
||||
if ($monitor_checks > 0){
|
||||
$monitor_health = format_numeric ( 100- (($monitor_bad + $monitor_unknown) / ($monitor_checks/100)) , 1);
|
||||
} else
|
||||
$monitor_health = 100;
|
||||
if ($data_checks > 0){
|
||||
$data_health = format_numeric ( (($data_checks -($data_unknown + $data_alert)) / $data_checks ) * 100,1);;
|
||||
} else
|
||||
$data_health = 100;
|
||||
if (($data_checks != 0) OR ($data_checks != 0)){
|
||||
$global_health = format_numeric ((($data_health * $data_checks) + ($monitor_health * $monitor_checks)) / $total_checks);
|
||||
} else
|
||||
$global_health = 100;
|
||||
|
||||
if ($global_health < 0)
|
||||
$global_health;
|
||||
|
||||
echo "<table class='databox' celldpadding=4 cellspacing=4 width=250>";
|
||||
//echo "<h2>".$lang_label["tactical_indicator"]."</h2>";
|
||||
//echo "<img src='reporting/fgraph.php?tipo=odo_tactic&value1=$global_health&value2=$data_health&value3=$monitor_health'>";
|
||||
|
||||
echo "<tr><td colspan='2'>".lang_string("Monitor health")."</th>";
|
||||
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$monitor_health' title='$monitor_health % ".lang_string("of monitors UP")."'>";
|
||||
|
||||
echo "<tr><td colspan='2'>".lang_string("Data health")."</th>";
|
||||
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$data_health' title='$data_health % ".lang_string("of modules with updated data")."'>";
|
||||
|
||||
echo "<tr><td colspan='2'>".lang_string("Global health")."</th>";
|
||||
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$global_health' title='$global_health % ".lang_string("of modules with good data")."'>";
|
||||
|
||||
echo "<tr><td colspan='2'>".lang_string("Module sanity")."</th>";
|
||||
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$module_sanity ' title='$module_sanity % ".lang_string("of well initialized modules")."'>";
|
||||
|
||||
|
||||
echo "<tr><td colspan='2'>".lang_string("Alert level")."</th>";
|
||||
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$alert_level' title='$alert_level % ".lang_string("of non-fired alerts")."'>";
|
||||
echo "</table>";
|
||||
|
||||
$query1 = "SELECT COUNT(id_usuario) FROM tusuario";
|
||||
$result = mysql_query ($query1);
|
||||
$row = mysql_fetch_array ($result);
|
||||
$users_defined = $row[0];
|
||||
|
||||
echo "<table class='databox' celldpadding=4 cellspacing=4 width=250>";
|
||||
echo "<th colspan=2>".$lang_label["Pandora_FMS_summary"]."</th>";
|
||||
echo "<tr><td class='datos2'><b>"."Total agents"."</b></td>";
|
||||
echo "<td class='datos2' style='font: bold 2em Arial, Sans-serif; color: #000;'>".$total_agents."</td>";
|
||||
echo "</tr><tr><td class='datos'><b>"."Total checks"."</b></td>";
|
||||
echo "<td class='datos' style='font: bold 2em Arial, Sans-serif; color: #000;'>".$total_checks."</td>";
|
||||
echo "</tr><tr><td class='datos2'><b>"."Monitor BAD"."</b></td>";
|
||||
echo "<td class='datos2' style='font: bold 2em Arial, Sans-serif; color: #f00;'>";
|
||||
if ($monitor_bad > 0)
|
||||
echo $monitor_bad;
|
||||
else
|
||||
echo "-";
|
||||
echo "</td></tr><tr><td class='datos'><b>"."Alerts defined"."</b></td>";
|
||||
echo "<td class='datos' style='font: bold 2em Arial, Sans-serif; color: #000;'>".$total_alerts."</td>";
|
||||
echo "</tr><tr><td class='datos2'><b>"."Total users"."</b></td>";
|
||||
echo "<td class='datos2' style='font: bold 2em Arial, Sans-serif; color: #000;'>".$users_defined."</td>";
|
||||
echo "</tr></table>";
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo "<div id='activity'>";
|
||||
// Show last activity from this user
|
||||
echo "<h2>" . $lang_label["user_last_activity"] . "</h2>";
|
||||
// Show table header
|
||||
echo '<table cellpadding="4" cellspacing="4" width="700" class="databox"><tr>';
|
||||
echo '<th>' . $lang_label["user"] . '</th>';
|
||||
echo '<th>' . $lang_label["action"] . '</th>';
|
||||
echo '<th width="130px">' . $lang_label["date"] . '</th>';
|
||||
echo '<th>' . $lang_label["src_address"] . '</th>';
|
||||
echo '<th width="200px">' . $lang_label["comments"] . '</th></tr>';
|
||||
|
||||
// Skip offset records
|
||||
$query1="SELECT * FROM tsesion WHERE (TO_DAYS(fecha) > TO_DAYS(NOW()) - 7)
|
||||
AND ID_usuario = '" . $nick . "' ORDER BY fecha DESC limit 15";
|
||||
|
||||
$result = mysql_query ($query1);
|
||||
$contador = 5; // Max items
|
||||
$color = 1;
|
||||
while (($row = mysql_fetch_array ($result)) and ($contador > 0)) {
|
||||
|
||||
if ($color == 1){
|
||||
$tdcolor = "datos";
|
||||
$color = 0;
|
||||
} else {
|
||||
$tdcolor = "datos2";
|
||||
$color = 1;
|
||||
}
|
||||
|
||||
$usuario = $row["ID_usuario"];
|
||||
// Site news !
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo '<h2>' . $lang_label["site_news"] . '</h2>';
|
||||
$sql_news = "SELECT * FROM tnews ORDER by timestamp DESC LIMIT 3";
|
||||
if ($result_news = mysql_query ($sql_news)){
|
||||
echo '<table cellpadding="4" cellspacing="4" width="270" class="databox">';
|
||||
while ($row = mysql_fetch_array ($result_news)) {
|
||||
echo '<tr>';
|
||||
echo '<td class="' . $tdcolor . 'f9"><b>' . $usuario . '</b></td>';
|
||||
echo '<td class="' . $tdcolor . 'f9">' . $row["accion"]. '</td>';
|
||||
echo '<td class="' . $tdcolor . 'f9">' . $row["fecha"]. '</td>';
|
||||
echo '<td class="' . $tdcolor . 'f9">' . $row["IP_origen"]. '</td>';
|
||||
echo '<td class="' . $tdcolor . 'f9">' . $row["descripcion"]. '</td>';
|
||||
echo '</tr>';
|
||||
echo "<th><b>".$row["subject"]."</b>";
|
||||
echo "<tr><td>".$lang_label["by"]." <b>".$row["author"]. "</b> ".$lang_label["at"]." <i>".$row["timestamp"]."</i>";
|
||||
echo '<tr><td class=datos>';
|
||||
echo clean_output_breaks($row["text"]);
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
echo "<td align='center'>";
|
||||
// Site stats
|
||||
// Summary
|
||||
// ~~~~~~~~~~~~~~~
|
||||
$data = general_stats($id_user,0);
|
||||
$monitor_checks = $data[0];
|
||||
$monitor_ok = $data[1];
|
||||
$monitor_bad = $data[2];
|
||||
$monitor_unknown = $data[3];
|
||||
$monitor_alert = $data[4];
|
||||
$total_agents = $data[5];
|
||||
$data_checks = $data[6];
|
||||
$data_unknown = $data[7];
|
||||
$data_alert = $data[8];
|
||||
$data_alert_total = $data[9];
|
||||
$monitor_alert_total = $data[10];
|
||||
$data_not_init = $data[11];
|
||||
$monitor_not_init = $data[12];
|
||||
// Calculate global indicators
|
||||
|
||||
$contador--;
|
||||
$total_checks = $data_checks + $monitor_checks;
|
||||
$notinit_percentage = (($data_not_init + $monitor_not_init) / ($total_checks / 100));
|
||||
$module_sanity = format_numeric (100 - $notinit_percentage);
|
||||
$total_alerts = $data_alert + $monitor_alert;
|
||||
$total_fired_alerts = $monitor_alert_total+$data_alert_total;
|
||||
if ( $total_fired_alerts > 0) {
|
||||
$alert_level = format_numeric (100 - ($total_alerts / ($total_fired_alerts / 100)));
|
||||
} else {
|
||||
$alert_level = 100;
|
||||
}
|
||||
|
||||
if ($monitor_checks > 0){
|
||||
$monitor_health = format_numeric ( 100- (($monitor_bad + $monitor_unknown) / ($monitor_checks/100)) , 1);
|
||||
} else {
|
||||
$monitor_health = 100;
|
||||
}
|
||||
|
||||
if ($data_checks > 0) {
|
||||
$data_health = format_numeric ( (($data_checks -($data_unknown + $data_alert)) / $data_checks ) * 100,1);;
|
||||
} else {
|
||||
$data_health = 100;
|
||||
}
|
||||
|
||||
if ($data_checks != 0 || $data_checks != 0) {
|
||||
$global_health = format_numeric ((($data_health * $data_checks) + ($monitor_health * $monitor_checks)) / $total_checks);
|
||||
} else {
|
||||
$global_health = 100;
|
||||
}
|
||||
|
||||
if ($global_health < 0)
|
||||
$global_health;
|
||||
|
||||
echo "<table class='databox' celldpadding=4 cellspacing=4 width=250>";
|
||||
//echo "<h2>".$lang_label["tactical_indicator"]."</h2>";
|
||||
//echo "<img src='reporting/fgraph.php?tipo=odo_tactic&value1=$global_health&value2=$data_health&value3=$monitor_health'>";
|
||||
|
||||
echo "<tr><td colspan='2'>".lang_string("Monitor health")."</th>";
|
||||
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$monitor_health' title='$monitor_health % ".lang_string("of monitors UP")."'>";
|
||||
|
||||
echo "<tr><td colspan='2'>".lang_string("Data health")."</th>";
|
||||
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$data_health' title='$data_health % ".lang_string("of modules with updated data")."'>";
|
||||
|
||||
echo "<tr><td colspan='2'>".lang_string("Global health")."</th>";
|
||||
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$global_health' title='$global_health % ".lang_string("of modules with good data")."'>";
|
||||
|
||||
echo "<tr><td colspan='2'>".lang_string("Module sanity")."</th>";
|
||||
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$module_sanity ' title='$module_sanity % ".lang_string("of well initialized modules")."'>";
|
||||
|
||||
|
||||
echo "<tr><td colspan='2'>".lang_string("Alert level")."</th>";
|
||||
echo "<tr><td colspan='2'><img src='reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent=$alert_level' title='$alert_level % ".lang_string("of non-fired alerts")."'>";
|
||||
echo "</table>";
|
||||
|
||||
$query1 = "SELECT COUNT(id_usuario) FROM tusuario";
|
||||
$result = mysql_query ($query1);
|
||||
$row = mysql_fetch_array ($result);
|
||||
$users_defined = $row[0];
|
||||
|
||||
echo "<table class='databox' celldpadding=4 cellspacing=4 width=250>";
|
||||
echo "<th colspan=2>".$lang_label["Pandora_FMS_summary"]."</th>";
|
||||
echo "<tr><td class='datos2'><b>"."Total agents"."</b></td>";
|
||||
echo "<td class='datos2' style='font: bold 2em Arial, Sans-serif; color: #000;'>".$total_agents."</td>";
|
||||
echo "</tr><tr><td class='datos'><b>"."Total checks"."</b></td>";
|
||||
echo "<td class='datos' style='font: bold 2em Arial, Sans-serif; color: #000;'>".$total_checks."</td>";
|
||||
echo "</tr><tr><td class='datos2'><b>"."Monitor BAD"."</b></td>";
|
||||
echo "<td class='datos2' style='font: bold 2em Arial, Sans-serif; color: #f00;'>";
|
||||
if ($monitor_bad > 0)
|
||||
echo $monitor_bad;
|
||||
else
|
||||
echo "-";
|
||||
echo "</td></tr><tr><td class='datos'><b>"."Alerts defined"."</b></td>";
|
||||
echo "<td class='datos' style='font: bold 2em Arial, Sans-serif; color: #000;'>".$total_alerts."</td>";
|
||||
echo "</tr><tr><td class='datos2'><b>"."Total users"."</b></td>";
|
||||
echo "<td class='datos2' style='font: bold 2em Arial, Sans-serif; color: #000;'>".$users_defined."</td>";
|
||||
echo "</tr></table>";
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo "<div id='activity'>";
|
||||
// Show last activity from this user
|
||||
echo "<h2>" . $lang_label["user_last_activity"] . "</h2>";
|
||||
// Show table header
|
||||
echo '<table cellpadding="4" cellspacing="4" width="700" class="databox"><tr>';
|
||||
echo '<th>' . $lang_label["user"] . '</th>';
|
||||
echo '<th>' . $lang_label["action"] . '</th>';
|
||||
echo '<th width="130px">' . $lang_label["date"] . '</th>';
|
||||
echo '<th>' . $lang_label["src_address"] . '</th>';
|
||||
echo '<th width="200px">' . $lang_label["comments"] . '</th></tr>';
|
||||
|
||||
// Skip offset records
|
||||
$query1="SELECT * FROM tsesion WHERE (TO_DAYS(fecha) > TO_DAYS(NOW()) - 7)
|
||||
AND ID_usuario = '" . $nick . "' ORDER BY fecha DESC limit 15";
|
||||
|
||||
$result = mysql_query ($query1);
|
||||
$contador = 5; // Max items
|
||||
$color = 1;
|
||||
while ($row = mysql_fetch_array ($result) && $contador > 0) {
|
||||
|
||||
if ($color == 1){
|
||||
$tdcolor = "datos";
|
||||
$color = 0;
|
||||
} else {
|
||||
$tdcolor = "datos2";
|
||||
$color = 1;
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
echo "</div>"; // activity
|
||||
$usuario = $row["ID_usuario"];
|
||||
echo '<tr>';
|
||||
echo '<td class="' . $tdcolor . 'f9"><b>' . $usuario . '</b></td>';
|
||||
echo '<td class="' . $tdcolor . 'f9">' . $row["accion"]. '</td>';
|
||||
echo '<td class="' . $tdcolor . 'f9">' . $row["fecha"]. '</td>';
|
||||
echo '<td class="' . $tdcolor . 'f9">' . $row["IP_origen"]. '</td>';
|
||||
echo '<td class="' . $tdcolor . 'f9">' . $row["descripcion"]. '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
echo '</div>'; // class "jus"
|
||||
$contador--;
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
echo "</div>"; // activity
|
||||
|
||||
echo '</div>'; // class "jus"
|
||||
?>
|
||||
|
|
|
@ -30,12 +30,12 @@ if (give_acl($id_user, 0, "AW")!=1) {
|
|||
exit;
|
||||
}
|
||||
|
||||
echo "<h2>".$lang_label["agent_conf"];
|
||||
echo "<h2>".lang_string ("agent_conf");
|
||||
if (isset($_GET["create_agent"])){
|
||||
$create_agent = 1;
|
||||
echo " > ".$lang_label["create_agent"];
|
||||
echo " > ".lang_string ("create_agent");
|
||||
} else {
|
||||
echo " > ".$lang_label["update_agent"];
|
||||
echo " > ".lang_string ("update_agent");
|
||||
}
|
||||
echo "</h2>";
|
||||
echo "<div style='height: 5px'> </div>";
|
||||
|
@ -58,17 +58,10 @@ if (isset($_GET["disk_conf_delete"])){
|
|||
|
||||
echo '<form name="conf_agent" method="post" action="index.php?sec=gagente&
|
||||
sec2=godmode/agentes/configurar_agente">';
|
||||
if ($create_agent == 1) {
|
||||
echo "<input type='hidden' name='create_agent' value='1'>";
|
||||
} else {
|
||||
echo "<input type='hidden' name='update_agent' value='1'>";
|
||||
echo "<input type='hidden' name='id_agente' value='".$id_agente."'>";
|
||||
}
|
||||
echo '<table width="650" cellpadding="4" cellspacing="4" class="databox_color">';
|
||||
echo '<table width="650" id="table-agent-configuration" cellpadding="4" cellspacing="4" class="databox_color">';
|
||||
echo "<tr>";
|
||||
echo '<td class="datos"><b>'.$lang_label["agent_name"].'</b></td>
|
||||
<td class="datos">
|
||||
<input type="text" name="agente" size=30 value="'.$nombre_agente.'">';
|
||||
echo '<td class="datos"><b>'.lang_string ("agent_name").'</b></td><td class="datos">';
|
||||
print_input_text ('agente', $nombre_agente, '', 30, 100);
|
||||
|
||||
if (isset ($id_agente) && $id_agente != "") {
|
||||
echo "
|
||||
|
@ -84,9 +77,9 @@ if (file_exists ($config["remote_config"] . "/" . $agent_md5 . ".md5")) {
|
|||
}
|
||||
|
||||
echo '<tr><td class="datos2">';
|
||||
echo '<b>'.$lang_label["ip_address"].'</b>';
|
||||
echo '<b>'.lang_string ("ip_address").'</b>';
|
||||
echo '<td class="datos2">';
|
||||
echo '<input type="text" name="direccion" size="16" value="'.$direccion_agente.'">';
|
||||
print_input_text ('direccion', $direccion_agente, '', 16, 100);
|
||||
|
||||
if ($create_agent != 1) {
|
||||
echo " ";
|
||||
|
@ -101,7 +94,7 @@ if ($create_agent != 1) {
|
|||
}
|
||||
echo "</select>";
|
||||
|
||||
echo "<input name='delete_ip' type=checkbox value='1'> ".$lang_label["delete_sel"];
|
||||
echo "<input name='delete_ip' type=checkbox value='1'> ".lang_string ("delete_sel");
|
||||
echo "</td>";
|
||||
}
|
||||
|
||||
|
@ -110,13 +103,10 @@ echo '<td class="datos">';
|
|||
print_select_from_sql ('SELECT id_agente, nombre FROM tagente',
|
||||
'id_parent', $id_parent, '', 'None', '0');
|
||||
|
||||
echo '<tr><td class="datos"><b>'.$lang_label["group"].'</b>';
|
||||
echo '<td class="datos"><select name="grupo" class="w130">';
|
||||
if (isset($grupo)){
|
||||
echo "<option value='".$grupo."'>".dame_grupo($grupo)."</option>";
|
||||
}
|
||||
list_group ($id_user, 0);
|
||||
echo "</select>";
|
||||
echo '<tr><td class="datos"><b>'.lang_string ("group").'</b>';
|
||||
echo '<td class="datos">';
|
||||
print_select_from_sql ('SELECT id_grupo, nombre FROM tgrupo ORDER BY nombre',
|
||||
'grupo', $grupo, '', '', '');
|
||||
|
||||
echo "<tr><td class='datos2'>";
|
||||
echo "<b>".lang_string("interval")."</b></td>";
|
||||
|
@ -125,111 +115,84 @@ echo '<td class="datos2">';
|
|||
echo '<input type="text" name="intervalo" size="15" value="'.$intervalo.'"></td>';
|
||||
echo '<tr><td class="datos"><b>'.lang_string("os").'</b></td>';
|
||||
echo '<td class="datos">';
|
||||
echo '<select name="id_os" class="w130">';
|
||||
|
||||
if (isset($id_os)){
|
||||
echo "<option value='".$id_os."'>".dame_so_name($id_os)."</option>";
|
||||
}
|
||||
$sql1='SELECT id_os, name FROM tconfig_os';
|
||||
$result=mysql_query($sql1);
|
||||
while ($row=mysql_fetch_array($result)){
|
||||
echo "<option value='".$row["id_os"]."'>".$row["name"]."</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<?PHP
|
||||
print_select_from_sql ('SELECT id_os, name FROM tconfig_os ORDER BY name',
|
||||
'id_os', $id_os, '', '', '');
|
||||
|
||||
// Network server
|
||||
echo '<tr><td class="datos2"><b>';
|
||||
echo lang_string("Network server");
|
||||
echo '</b></td><td class="datos2">';
|
||||
echo '<select name="network_server" class="w130">';
|
||||
echo "<option value='".$id_network_server."'>".give_server_name($id_network_server);
|
||||
$sql1 = 'SELECT id_server, name FROM tserver where network_server = 1 ORDER BY name';
|
||||
$result=mysql_query($sql1);
|
||||
while ($row=mysql_fetch_array($result)){
|
||||
echo "<option value='".$row["id_server"]."'>".$row["name"]."</option>";
|
||||
$none = '';
|
||||
$none_value = '';
|
||||
if ($id_network_server == 0) {
|
||||
$none = lang_string ('None');
|
||||
$none_value = 0;
|
||||
}
|
||||
echo '</select>';
|
||||
print_select_from_sql ('SELECT id_server, name FROM tserver WHERE network_server = 1 ORDER BY name',
|
||||
'network_server', $id_network_server, '', $none, $none_value);
|
||||
|
||||
// Plugin Server
|
||||
echo '<tr><td class="datos"><b>';
|
||||
echo lang_string("Plugin server");
|
||||
echo '</b></td><td class="datos">';
|
||||
echo '<select name="plugin_server" class="w130">';
|
||||
echo "<option value='".$id_plugin_server."'>".give_server_name($id_plugin_server);
|
||||
$sql1 = 'SELECT id_server, name FROM tserver where plugin_server = 1 ORDER BY name';
|
||||
$result=mysql_query($sql1);
|
||||
while ($row=mysql_fetch_array($result)){
|
||||
echo "<option value='".$row["id_server"]."'>".$row["name"]."</option>";
|
||||
$none_str = lang_string ('None');
|
||||
$none = '';
|
||||
$none_value = '';
|
||||
if ($id_plugin_server == 0) {
|
||||
$none = $none_str;
|
||||
$none_value = 0;
|
||||
}
|
||||
echo '</select>';
|
||||
print_select_from_sql ('SELECT id_server, name FROM tserver WHERE plugin_server = 1 ORDER BY name',
|
||||
'plugin_server', $id_plugin_server, '', $none, $none_value);
|
||||
|
||||
// WMI Server
|
||||
echo '<tr><td class="datos2"><b>';
|
||||
echo lang_string("WMI server");
|
||||
echo '</b></td><td class="datos2">';
|
||||
echo '<select name="wmi_server" class="w130">';
|
||||
echo "<option value='".$id_wmi_server."'>".give_server_name($id_wmi_server);
|
||||
$sql1 = 'SELECT id_server, name FROM tserver where wmi_server = 1 ORDER BY name';
|
||||
$result=mysql_query($sql1);
|
||||
while ($row=mysql_fetch_array($result)){
|
||||
echo "<option value='".$row["id_server"]."'>".$row["name"]."</option>";
|
||||
$none = '';
|
||||
$none_value = '';
|
||||
if ($id_plugin_server == 0) {
|
||||
$none = $none_str;
|
||||
$none_value = 0;
|
||||
}
|
||||
echo '</select>';
|
||||
print_select_from_sql ('SELECT id_server, name FROM tserver WHERE wmi_server = 1 ORDER BY name',
|
||||
'wmi_server', $id_wmi_server, '', $none, $none_value);
|
||||
|
||||
// Prediction Server
|
||||
echo '<tr><td class="datos"><b>';
|
||||
echo lang_string("Prediction server");
|
||||
echo '</b></td><td class="datos">';
|
||||
echo '<select name="prediction_server" class="w130">';
|
||||
echo "<option value='".$id_prediction_server."'>".give_server_name($id_prediction_server);
|
||||
$sql1 = 'SELECT id_server, name FROM tserver where prediction_server = 1 ORDER BY name';
|
||||
$result=mysql_query($sql1);
|
||||
while ($row=mysql_fetch_array($result)){
|
||||
echo "<option value='".$row["id_server"]."'>".$row["name"]."</option>";
|
||||
$none = '';
|
||||
$none_value = '';
|
||||
if ($id_prediction_server == 0) {
|
||||
$none = $none_str;
|
||||
$none_value = 0;
|
||||
}
|
||||
echo '</select>';
|
||||
print_select_from_sql ('SELECT id_server, name FROM tserver WHERE prediction_server = 1 ORDER BY name',
|
||||
'prediction_server', $id_prediction_server, '', $none, $none_value);
|
||||
|
||||
// Description
|
||||
echo '<tr><td class="datos2"><b>';
|
||||
echo lang_string ("description");
|
||||
echo '</b><td class="datos2">';
|
||||
echo '<input type="text" name="comentarios" size="55" value="'.$comentarios.'"></td>';
|
||||
|
||||
print_input_text ('comentarios', $comentarios, '', 55, 255);
|
||||
|
||||
// Learn mode / Normal mode
|
||||
echo '<tr><td class="datos"><b>';
|
||||
echo lang_string ("module_definition");
|
||||
echo '</b><td class="datos">';
|
||||
if ($modo == "1"){
|
||||
echo $lang_label["learning_mode"].'
|
||||
<input type="radio" class="chk" name="modo" value="1" style="margin-right: 40px;" checked>';
|
||||
echo $lang_label["normal_mode"].'
|
||||
<input type="radio" class="chk" name="modo" value="0">';
|
||||
} else {
|
||||
echo $lang_label["learning_mode"].'
|
||||
<input type="radio" class="chk" name="modo" value="1" style="margin-right: 40px;">';
|
||||
echo $lang_label["normal_mode"].'
|
||||
<input type="radio" name="modo" class="chk" value="0" checked>';
|
||||
}
|
||||
|
||||
echo lang_string ("learning_mode");
|
||||
print_radio_button_extended ("modo", 1, '', $modo, false, '', 'style="margin-right: 40px;"');
|
||||
echo lang_string ("normal_mode");
|
||||
print_radio_button_extended ("modo", 0, '', $modo, false, '', 'style="margin-right: 40px;"');
|
||||
|
||||
// Status (Disabled / Enabled)
|
||||
echo '<tr><td class="datos2"><b>'.lang_string("status").'</b>';
|
||||
echo '<td class="datos2">';
|
||||
if ($disabled == "1"){
|
||||
echo $lang_label["disabled"].'
|
||||
<input type="radio" class="chk" name="disabled" value="1" style="margin-right: 40px;" checked>';
|
||||
echo $lang_label["active"].'
|
||||
<input class="chk" type="radio" name="disabled" value="0">';
|
||||
} else {
|
||||
echo $lang_label["disabled"].'
|
||||
<input type="radio" class="chk" name="disabled" value="1" style="margin-right: 40px;">';
|
||||
echo $lang_label["active"].'
|
||||
<input type="radio" name="disabled" class="chk" value="0" checked>';
|
||||
}
|
||||
echo lang_string ("disabled");
|
||||
print_radio_button_extended ("disabled", 1, '', $disabled, false, '', 'style="margin-right: 40px;"');
|
||||
echo lang_string ("active");
|
||||
print_radio_button_extended ("disabled", 0, '', $disabled, false, '', 'style="margin-right: 40px;"');
|
||||
|
||||
// Remote configuration
|
||||
echo '<tr><td class="datos"><b>'.lang_string("Remote configuration").'</b>';
|
||||
|
@ -244,15 +207,15 @@ if (file_exists($filename)){
|
|||
}
|
||||
|
||||
echo '</table><table width="650"><tr><td align="right">';
|
||||
if ($create_agent == 1){
|
||||
echo "
|
||||
<input name='crtbutton' type='submit' class='sub wand' value='".
|
||||
$lang_label["create"]."'>";
|
||||
if ($create_agent == 1) {
|
||||
print_submit_button (lang_string ('create'), 'crtbutton', false, 'class="sub wand"');
|
||||
print_input_hidden ('create_agent', 1);
|
||||
} else {
|
||||
echo "
|
||||
<input name='uptbutton' type='submit' class='sub upd' value='".
|
||||
$lang_label["update"]."'>";
|
||||
print_submit_button (lang_string ('update'), 'updbutton', false, 'class="sub upd"');
|
||||
print_input_hidden ('update_agent', 1);
|
||||
print_input_hidden ('id_agente', $id_agente);
|
||||
}
|
||||
|
||||
echo "</td></form></table>";
|
||||
|
||||
?>
|
||||
|
|
|
@ -98,6 +98,12 @@ $alert_d6 = "1";
|
|||
$alert_d7 = "1";
|
||||
$alert_recovery = "0";
|
||||
$alert_priority = "0";
|
||||
$id_network_server = 0;
|
||||
$id_plugin_server = 0;
|
||||
$id_prediction_server = 0;
|
||||
$id_wmi_server = 0;
|
||||
$grupo = 0;
|
||||
$id_os = 0;
|
||||
|
||||
// ================================
|
||||
// Create AGENT
|
||||
|
@ -111,7 +117,7 @@ if ( isset ($_POST["create_agent"])) { // Create a new and shining agent
|
|||
$intervalo = entrada_limpia ($_POST["intervalo"]);
|
||||
$comentarios = entrada_limpia ($_POST["comentarios"]);
|
||||
$modo = entrada_limpia ($_POST["modo"]);
|
||||
$id_parent = get_parameter_post ("id_parent", 0);
|
||||
$id_parent = get_parameter_post ("id_parent", 0);
|
||||
$id_network_server = get_parameter_post ("network_server", 0);
|
||||
$id_plugin_server = get_parameter_post ("plugin_server", 0);
|
||||
$id_prediction_server = get_parameter_post ("prediction_server", 0);
|
||||
|
@ -124,9 +130,9 @@ if ( isset ($_POST["create_agent"])) { // Create a new and shining agent
|
|||
$sql1='SELECT nombre FROM tagente WHERE nombre = "'.$nombre_agente.'"';
|
||||
$result=mysql_query($sql1);
|
||||
if ($row=mysql_fetch_array($result)){
|
||||
$agent_creation_error = lang_string("agent_exists");
|
||||
$agent_created_ok = 0;
|
||||
} else {
|
||||
$agent_creation_error = lang_string("agent_exists");
|
||||
$agent_created_ok = 0;
|
||||
} else {
|
||||
$sql_insert ="INSERT INTO tagente (nombre, direccion, id_grupo, intervalo, comentarios,modo, id_os, disabled, id_network_server, id_plugin_server, id_wmi_server, id_prediction_server, id_parent) VALUES ('$nombre_agente', '$direccion_agente', $grupo , $intervalo , '$comentarios',$modo, $id_os, $disabled, $id_network_server, $id_plugin_server, $id_wmi_server, $id_prediction_server, $id_parent)";
|
||||
$result = mysql_query($sql_insert);
|
||||
if ($result) {
|
||||
|
@ -171,30 +177,30 @@ echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=
|
|||
echo "</li>";
|
||||
|
||||
if ($tab == "main")
|
||||
echo "<li class='nomn_high'>";
|
||||
echo "<li class='nomn_high'>";
|
||||
else
|
||||
echo "<li class='nomn'>";
|
||||
echo "<li class='nomn'>";
|
||||
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente=$id_agente'><img src='images/cog.png' width='16' class='top' border='0'> ".$lang_label["setup_agent"]."</a>";
|
||||
echo "</li>";
|
||||
|
||||
if ($tab == "module")
|
||||
echo "<li class='nomn_high'>";
|
||||
echo "<li class='nomn_high'>";
|
||||
else
|
||||
echo "<li class='nomn'>";
|
||||
echo "<li class='nomn'>";
|
||||
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente=$id_agente'><img src='images/lightbulb.png' width='16' class='top' border='0'> ".$lang_label["modules"]."</a>";
|
||||
echo "</li>";
|
||||
|
||||
if ($tab == "alert")
|
||||
echo "<li class='nomn_high'>";
|
||||
echo "<li class='nomn_high'>";
|
||||
else
|
||||
echo "<li class='nomn'>";
|
||||
echo "<li class='nomn'>";
|
||||
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=$id_agente'><img src='images/bell.png' width='16' class='top' border='0'> ". $lang_label["Alerts"]."</a>";
|
||||
echo "</li>";
|
||||
|
||||
if ($tab == "template")
|
||||
echo "<li class='nomn_high'>";
|
||||
echo "<li class='nomn_high'>";
|
||||
else
|
||||
echo "<li class='nomn'>";
|
||||
echo "<li class='nomn'>";
|
||||
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente=$id_agente'><img src='images/network.png' width='16' class='top' border=0> ".$lang_label["ntemplates"]."</a>";
|
||||
echo "</li>";
|
||||
|
||||
|
@ -210,26 +216,26 @@ echo "<div style='height: 25px'> </div>";
|
|||
if (isset($_POST["create_agent"])){
|
||||
if ($agent_created_ok == 0){
|
||||
echo "<h3 class='error'>".$lang_label["create_agent_no"]."</h3>";
|
||||
echo $agent_creation_error;
|
||||
} else {
|
||||
echo $agent_creation_error;
|
||||
} else {
|
||||
echo "<h3 class='suc'>".$lang_label["create_agent_ok"]."</h3>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Fix / Normalize module data
|
||||
// ===========================
|
||||
if (isset($_GET["fix_module"])){
|
||||
$id_module = $_GET["fix_module"];
|
||||
$id_module = $_GET["fix_module"];
|
||||
$id_agent = $_GET["id_agente"];
|
||||
// get info about this module
|
||||
$sql1 = "SELECT AVG(datos) FROM tagente_datos WHERE id_agente_modulo = $id_module AND id_agente = $id_agent";
|
||||
$result=mysql_query($sql1);
|
||||
if ($row=mysql_fetch_array($result)){
|
||||
// get info about this module
|
||||
$sql1 = "SELECT AVG(datos) FROM tagente_datos WHERE id_agente_modulo = $id_module AND id_agente = $id_agent";
|
||||
$result=mysql_query($sql1);
|
||||
if ($row=mysql_fetch_array($result)){
|
||||
$media = $row[0];
|
||||
$media = $media * 1.3;
|
||||
$sql1 = "DELETE FROM tagente_datos WHERE datos > $media AND id_agente_modulo = $id_module AND id_agente = $id_agent";
|
||||
$result=mysql_query($sql1);
|
||||
$result=mysql_query($sql1);
|
||||
echo "<h3 class='suc'>".$lang_label["delete_data_above"]." $media</h3>";
|
||||
}
|
||||
}
|
||||
|
@ -252,23 +258,23 @@ if (isset($_GET["delete_alert"])){ // if modified some parameter
|
|||
// Delete Alert component (from a combined)
|
||||
// ==========================================
|
||||
if (isset($_GET["delete_alert_comp"])){ // if modified some parameter
|
||||
$id_borrar_modulo = $_GET["delete_alert_comp"];
|
||||
// get info about agent
|
||||
$sql1='DELETE FROM tcompound_alert WHERE id_aam = '.$id_borrar_modulo;
|
||||
$result=mysql_query($sql1);
|
||||
if (! $result)
|
||||
echo "<h3 class='error'>".$lang_label["delete_alert_no"]."</h3>";
|
||||
else
|
||||
echo "<h3 class='suc'>".$lang_label["delete_alert_ok"]."</h3>";
|
||||
$id_borrar_modulo = $_GET["delete_alert_comp"];
|
||||
// get info about agent
|
||||
$sql1='DELETE FROM tcompound_alert WHERE id_aam = '.$id_borrar_modulo;
|
||||
$result=mysql_query($sql1);
|
||||
if (! $result)
|
||||
echo "<h3 class='error'>".$lang_label["delete_alert_no"]."</h3>";
|
||||
else
|
||||
echo "<h3 class='suc'>".$lang_label["delete_alert_ok"]."</h3>";
|
||||
}
|
||||
|
||||
// Create alert
|
||||
// =============
|
||||
if (isset($_POST["insert_alert"])){ // if created alert
|
||||
$combined = get_parameter ("combined",0);
|
||||
$combined = get_parameter ("combined",0);
|
||||
$id_agente_modulo = get_parameter ("agente_modulo",0);
|
||||
$maximo = get_parameter ("maximo",0);
|
||||
$minimo = get_parameter ("minimo",0);
|
||||
$maximo = get_parameter ("maximo",0);
|
||||
$minimo = get_parameter ("minimo",0);
|
||||
$descripcion= get_parameter ('descripcion', '');
|
||||
$campo_1 = get_parameter ('campo_1', '');
|
||||
$campo_2 = get_parameter ('campo_2', '');
|
||||
|
@ -282,22 +288,22 @@ if (isset($_POST["insert_alert"])){ // if created alert
|
|||
$time_to= get_parameter ("time_to");
|
||||
$other = get_parameter ("other",0);
|
||||
$disable_alert = get_parameter ("disable_alert");
|
||||
$alert_d1 = get_parameter("alert_d1",0);
|
||||
$alert_d2 = get_parameter("alert_d2",0);
|
||||
$alert_d3 = get_parameter("alert_d3",0);
|
||||
$alert_d4 = get_parameter("alert_d4",0);
|
||||
$alert_d5 = get_parameter("alert_d5",0);
|
||||
$alert_d6 = get_parameter("alert_d6",0);
|
||||
$alert_d7 = get_parameter("alert_d7",0);
|
||||
$alert_recovery = get_parameter("alert_recovery", 1);
|
||||
$alert_priority = get_parameter("alert_priority", 0);
|
||||
$campo2_rec = get_parameter ("campo_2_rec","");
|
||||
$campo3_rec = get_parameter ("campo_3_rec","");
|
||||
$alert_d1 = get_parameter("alert_d1",0);
|
||||
$alert_d2 = get_parameter("alert_d2",0);
|
||||
$alert_d3 = get_parameter("alert_d3",0);
|
||||
$alert_d4 = get_parameter("alert_d4",0);
|
||||
$alert_d5 = get_parameter("alert_d5",0);
|
||||
$alert_d6 = get_parameter("alert_d6",0);
|
||||
$alert_d7 = get_parameter("alert_d7",0);
|
||||
$alert_recovery = get_parameter("alert_recovery", 1);
|
||||
$alert_priority = get_parameter("alert_priority", 0);
|
||||
$campo2_rec = get_parameter ("campo_2_rec","");
|
||||
$campo3_rec = get_parameter ("campo_3_rec","");
|
||||
|
||||
if ($combined == 1)
|
||||
$alert_id_agent = $id_agente;
|
||||
else
|
||||
$alert_id_agent = 0;
|
||||
if ($combined == 1)
|
||||
$alert_id_agent = $id_agente;
|
||||
else
|
||||
$alert_id_agent = 0;
|
||||
if ($time_threshold == -1) {
|
||||
$time_threshold = $other;
|
||||
}
|
||||
|
@ -318,18 +324,18 @@ if (isset($_POST["insert_alert"])){ // if created alert
|
|||
'$disable_alert',
|
||||
'$time_from',
|
||||
'$time_to',
|
||||
$alert_id_agent,
|
||||
$alert_d1,
|
||||
$alert_d2,
|
||||
$alert_d3,
|
||||
$alert_d4,
|
||||
$alert_d5,
|
||||
$alert_d6,
|
||||
$alert_d7,
|
||||
$alert_recovery,
|
||||
$alert_priority,
|
||||
'$campo2_rec',
|
||||
'$campo2_rec' )";
|
||||
$alert_id_agent,
|
||||
$alert_d1,
|
||||
$alert_d2,
|
||||
$alert_d3,
|
||||
$alert_d4,
|
||||
$alert_d5,
|
||||
$alert_d6,
|
||||
$alert_d7,
|
||||
$alert_recovery,
|
||||
$alert_priority,
|
||||
'$campo2_rec',
|
||||
'$campo2_rec' )";
|
||||
$result=mysql_query($sql_insert);
|
||||
if (! $result) {
|
||||
echo "<h3 class='error'>".$lang_label["create_alert_no"]."</h3>";
|
||||
|
@ -343,17 +349,17 @@ if (isset($_POST["insert_alert"])){ // if created alert
|
|||
// Combined ALERT - Add component
|
||||
// ================================
|
||||
if (isset($_POST["add_alert_combined"])){ // Update an existing alert
|
||||
$alerta_id_aam = get_parameter ("update_alert",-1);
|
||||
$component_item = get_parameter ("component_item",-1);
|
||||
$component_operation = get_parameter ("component_operation","AND");
|
||||
$sql_insert = "INSERT INTO tcompound_alert (id, id_aam, operation)
|
||||
VALUES ($alerta_id_aam, $component_item, '$component_operation')";
|
||||
$result=mysql_query($sql_insert);
|
||||
if (! $result) {
|
||||
echo "<h3 class='error'>".lang_string ("Problem adding component alert")."</h3>";
|
||||
} else {
|
||||
echo "<h3 class='suc'>".lang_string ("Alert component added ok")."</h3>";
|
||||
}
|
||||
$alerta_id_aam = get_parameter ("update_alert",-1);
|
||||
$component_item = get_parameter ("component_item",-1);
|
||||
$component_operation = get_parameter ("component_operation","AND");
|
||||
$sql_insert = "INSERT INTO tcompound_alert (id, id_aam, operation)
|
||||
VALUES ($alerta_id_aam, $component_item, '$component_operation')";
|
||||
$result=mysql_query($sql_insert);
|
||||
if (! $result) {
|
||||
echo "<h3 class='error'>".lang_string ("Problem adding component alert")."</h3>";
|
||||
} else {
|
||||
echo "<h3 class='suc'>".lang_string ("Alert component added ok")."</h3>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -361,44 +367,44 @@ if (isset($_POST["add_alert_combined"])){ // Update an existing alert
|
|||
// =============
|
||||
if (isset($_POST["update_alert"])){ // Update an existing alert
|
||||
$id_agente_modulo = get_parameter ("agente_modulo",0);
|
||||
$id_aam = get_parameter ("id_aam",0);
|
||||
$maximo = get_parameter ("maximo",0);
|
||||
$minimo = get_parameter ("minimo",0);
|
||||
$descripcion= get_parameter ('descripcion', '');
|
||||
$campo_1 = get_parameter ('campo_1', '');
|
||||
$campo_2 = get_parameter ('campo_2', '');
|
||||
$campo_3 = get_parameter ('campo_3', '');
|
||||
$tipo_alerta = get_parameter ("tipo_alerta",3);
|
||||
$alert_text = get_parameter ("alert_text",'');
|
||||
$time_threshold = get_parameter ("time_threshold",900);
|
||||
$max_alerts = get_parameter ("max_alerts",1);
|
||||
$min_alerts = get_parameter ("min_alerts",0);
|
||||
$time_from = get_parameter ("time_from");
|
||||
$time_to= get_parameter ("time_to");
|
||||
$other = get_parameter ("other",0);
|
||||
$disable_alert = get_parameter ("disable_alert");
|
||||
$alert_d1 = get_parameter("alert_d1",0);
|
||||
$alert_d2 = get_parameter("alert_d2",0);
|
||||
$alert_d3 = get_parameter("alert_d3",0);
|
||||
$alert_d4 = get_parameter("alert_d4",0);
|
||||
$alert_d5 = get_parameter("alert_d5",0);
|
||||
$alert_d6 = get_parameter("alert_d6",0);
|
||||
$alert_d7 = get_parameter("alert_d7",0);
|
||||
$alert_recovery = get_parameter("alert_recovery", 1);
|
||||
$alert_priority = get_parameter("alert_priority", 0);
|
||||
$campo2_rec = get_parameter ("campo_2_rec","");
|
||||
$campo3_rec = get_parameter ("campo_3_rec","");
|
||||
$alert_d1 = get_parameter("alert_d1",0);
|
||||
$alert_d2 = get_parameter("alert_d2",0);
|
||||
$alert_d3 = get_parameter("alert_d3",0);
|
||||
$alert_d4 = get_parameter("alert_d4",0);
|
||||
$alert_d5 = get_parameter("alert_d5",0);
|
||||
$alert_d6 = get_parameter("alert_d6",0);
|
||||
$alert_d7 = get_parameter("alert_d7",0);
|
||||
$alert_recovery = get_parameter("alert_recovery", 1);
|
||||
$alert_priority = get_parameter("alert_priority", 0);
|
||||
$campo2_rec = get_parameter ("campo_2_rec","");
|
||||
$campo3_rec = get_parameter ("campo_3_rec","");
|
||||
$id_aam = get_parameter ("id_aam",0);
|
||||
$maximo = get_parameter ("maximo",0);
|
||||
$minimo = get_parameter ("minimo",0);
|
||||
$descripcion= get_parameter ('descripcion', '');
|
||||
$campo_1 = get_parameter ('campo_1', '');
|
||||
$campo_2 = get_parameter ('campo_2', '');
|
||||
$campo_3 = get_parameter ('campo_3', '');
|
||||
$tipo_alerta = get_parameter ("tipo_alerta",3);
|
||||
$alert_text = get_parameter ("alert_text",'');
|
||||
$time_threshold = get_parameter ("time_threshold",900);
|
||||
$max_alerts = get_parameter ("max_alerts",1);
|
||||
$min_alerts = get_parameter ("min_alerts",0);
|
||||
$time_from = get_parameter ("time_from");
|
||||
$time_to= get_parameter ("time_to");
|
||||
$other = get_parameter ("other",0);
|
||||
$disable_alert = get_parameter ("disable_alert");
|
||||
$alert_d1 = get_parameter("alert_d1",0);
|
||||
$alert_d2 = get_parameter("alert_d2",0);
|
||||
$alert_d3 = get_parameter("alert_d3",0);
|
||||
$alert_d4 = get_parameter("alert_d4",0);
|
||||
$alert_d5 = get_parameter("alert_d5",0);
|
||||
$alert_d6 = get_parameter("alert_d6",0);
|
||||
$alert_d7 = get_parameter("alert_d7",0);
|
||||
$alert_recovery = get_parameter("alert_recovery", 1);
|
||||
$alert_priority = get_parameter("alert_priority", 0);
|
||||
$campo2_rec = get_parameter ("campo_2_rec","");
|
||||
$campo3_rec = get_parameter ("campo_3_rec","");
|
||||
$alert_d1 = get_parameter("alert_d1",0);
|
||||
$alert_d2 = get_parameter("alert_d2",0);
|
||||
$alert_d3 = get_parameter("alert_d3",0);
|
||||
$alert_d4 = get_parameter("alert_d4",0);
|
||||
$alert_d5 = get_parameter("alert_d5",0);
|
||||
$alert_d6 = get_parameter("alert_d6",0);
|
||||
$alert_d7 = get_parameter("alert_d7",0);
|
||||
$alert_recovery = get_parameter("alert_recovery", 1);
|
||||
$alert_priority = get_parameter("alert_priority", 0);
|
||||
$campo2_rec = get_parameter ("campo_2_rec","");
|
||||
$campo3_rec = get_parameter ("campo_3_rec","");
|
||||
if ($time_threshold == -1) {
|
||||
$time_threshold = $other;
|
||||
}
|
||||
|
@ -418,18 +424,18 @@ if (isset($_POST["update_alert"])){ // Update an existing alert
|
|||
time_to = '$time_to',
|
||||
time_from = '$time_from',
|
||||
disable = '$disable_alert',
|
||||
monday = '$alert_d1',
|
||||
tuesday = '$alert_d2',
|
||||
wednesday = '$alert_d3',
|
||||
thursday = '$alert_d4',
|
||||
friday = '$alert_d5',
|
||||
saturday = '$alert_d6',
|
||||
sunday = '$alert_d7',
|
||||
recovery_notify = $alert_recovery,
|
||||
priority = $alert_priority,
|
||||
al_f2_recovery = '$campo2_rec',
|
||||
al_f3_recovery = '$campo3_rec',
|
||||
id_alerta = $tipo_alerta
|
||||
monday = '$alert_d1',
|
||||
tuesday = '$alert_d2',
|
||||
wednesday = '$alert_d3',
|
||||
thursday = '$alert_d4',
|
||||
friday = '$alert_d5',
|
||||
saturday = '$alert_d6',
|
||||
sunday = '$alert_d7',
|
||||
recovery_notify = $alert_recovery,
|
||||
priority = $alert_priority,
|
||||
al_f2_recovery = '$campo2_rec',
|
||||
al_f3_recovery = '$campo3_rec',
|
||||
id_alerta = $tipo_alerta
|
||||
WHERE id_aam = ".$id_aam;
|
||||
$result=mysql_query($sql_insert);
|
||||
if (! $result) {
|
||||
|
@ -457,14 +463,14 @@ if (isset($_POST["update_agent"])) { // if modified some agent paramenter
|
|||
$id_plugin_server = get_parameter ("plugin_server", 0);
|
||||
$id_wmi_server = get_parameter ("wmi_server", 0);
|
||||
$id_prediction_server = get_parameter_post ("prediction_server", 0);
|
||||
$id_parent = get_parameter_post ("id_parent", 0);
|
||||
$id_parent = get_parameter_post ("id_parent", 0);
|
||||
|
||||
if ($direccion_agente != $old_agent_address){
|
||||
agent_add_address ($id_agente, $direccion_agente);
|
||||
}
|
||||
$sql_update ="UPDATE tagente
|
||||
SET disabled = ".$disabled.", id_parent = $id_parent, id_os = ".$id_os." , modo = ".$modo." , nombre = '".$nombre_agente."', direccion = '".$direccion_agente."', id_grupo = '".$grupo."', intervalo = '".$intervalo."', comentarios = '".$comentarios."', id_network_server = '$id_network_server', id_plugin_server = $id_plugin_server, id_wmi_server = $id_wmi_server,
|
||||
id_prediction_server = $id_prediction_server
|
||||
id_prediction_server = $id_prediction_server
|
||||
WHERE id_agente = '".$id_agente."'";
|
||||
|
||||
// Delete one of associateds IP's ?
|
||||
|
@ -500,14 +506,14 @@ if (isset($_GET["id_agente"])) {
|
|||
$grupo = $row["id_grupo"];
|
||||
$ultima_act = $row["ultimo_contacto"];
|
||||
$comentarios = $row["comentarios"];
|
||||
$id_plugin_server = $row["id_plugin_server"];
|
||||
$id_plugin_server = $row["id_plugin_server"];
|
||||
$id_network_server = $row["id_network_server"];
|
||||
$id_prediction_server = $row["id_prediction_server"];
|
||||
$id_wmi_server = $row["id_wmi_server"];
|
||||
$id_prediction_server = $row["id_prediction_server"];
|
||||
$id_wmi_server = $row["id_wmi_server"];
|
||||
$modo = $row["modo"];
|
||||
$id_os = $row["id_os"];
|
||||
$disabled=$row["disabled"];
|
||||
$id_parent = $row["id_parent"];
|
||||
$id_parent = $row["id_parent"];
|
||||
} else {
|
||||
echo "<h3 class='error'>".$lang_label["agent_error"]."</h3>";
|
||||
echo "</table>";
|
||||
|
@ -576,8 +582,8 @@ if (isset($_GET["update_alert"])){
|
|||
$alerta_campo1 = $row["al_campo1"];
|
||||
$alerta_campo2 = $row["al_campo2"];
|
||||
$alerta_campo3 = $row["al_campo3"];
|
||||
$alerta_campo2_rec = $row["al_f2_recovery"];
|
||||
$alerta_campo3_rec = $row["al_f3_recovery"];
|
||||
$alerta_campo2_rec = $row["al_f2_recovery"];
|
||||
$alerta_campo3_rec = $row["al_f3_recovery"];
|
||||
$alerta_dis_max = $row["dis_max"];
|
||||
$alerta_dis_min = $row["dis_min"];
|
||||
$tipo_alerta = $row["id_alerta"];
|
||||
|
@ -590,17 +596,17 @@ if (isset($_GET["update_alert"])){
|
|||
$time_from = $row["time_from"];
|
||||
$time_to = $row["time_to"];
|
||||
$alerta_id_agentemodulo = $row["id_agente_modulo"]; // Only to show, cannot be changed
|
||||
$alert_id_agent = $row["id_agent"];
|
||||
$alert_d1 = $row["monday"];
|
||||
$alert_d2 = $row["tuesday"];
|
||||
$alert_d3 = $row["wednesday"];
|
||||
$alert_d4 = $row["thursday"];
|
||||
$alert_d5 = $row["friday"];
|
||||
$alert_d6 = $row["saturday"];
|
||||
$alert_d7 = $row["sunday"];
|
||||
$alert_recovery = $row["recovery_notify"];
|
||||
$alert_priority = $row["priority"];
|
||||
}
|
||||
$alert_id_agent = $row["id_agent"];
|
||||
$alert_d1 = $row["monday"];
|
||||
$alert_d2 = $row["tuesday"];
|
||||
$alert_d3 = $row["wednesday"];
|
||||
$alert_d4 = $row["thursday"];
|
||||
$alert_d5 = $row["friday"];
|
||||
$alert_d6 = $row["saturday"];
|
||||
$alert_d7 = $row["sunday"];
|
||||
$alert_recovery = $row["recovery_notify"];
|
||||
$alert_priority = $row["priority"];
|
||||
}
|
||||
}
|
||||
|
||||
// GET DATA for MODULE UPDATE OR MODULE INSERT
|
||||
|
@ -725,41 +731,40 @@ if (((!isset($_POST["nc"]) OR ($_POST["nc"]==-1))) && (!isset($_POST["oid"])) &&
|
|||
$form_tcp_port= "0";
|
||||
}
|
||||
$sql_insert = "INSERT INTO tagente_modulo
|
||||
(id_agente, id_tipo_modulo, nombre, descripcion, max, min, snmp_oid, snmp_community,
|
||||
id_module_group, module_interval, ip_target, tcp_port, tcp_rcv, tcp_send, id_export,
|
||||
plugin_user, plugin_pass, plugin_parameter, id_plugin, post_process, prediction_module,
|
||||
max_timeout, disabled, id_modulo)
|
||||
VALUES ($id_agente, $form_id_tipo_modulo, '$form_name', '$form_description', $form_maxvalue, $form_minvalue, '$form_snmp_oid', '$form_snmp_community', $form_id_module_group, $form_interval, '$form_ip_target', $form_tcp_port, '$form_tcp_rcv', '$form_tcp_send', $form_id_export, '$form_plugin_user', '$form_plugin_pass', '$form_plugin_parameter', $form_id_plugin, $form_post_process, $form_id_prediction_module, $form_max_timeout, $form_disabled, $form_id_modulo)";
|
||||
(id_agente, id_tipo_modulo, nombre, descripcion, max, min, snmp_oid, snmp_community,
|
||||
id_module_group, module_interval, ip_target, tcp_port, tcp_rcv, tcp_send, id_export,
|
||||
plugin_user, plugin_pass, plugin_parameter, id_plugin, post_process, prediction_module,
|
||||
max_timeout, disabled, id_modulo)
|
||||
VALUES ($id_agente, $form_id_tipo_modulo, '$form_name', '$form_description', $form_maxvalue, $form_minvalue, '$form_snmp_oid', '$form_snmp_community', $form_id_module_group, $form_interval, '$form_ip_target', $form_tcp_port, '$form_tcp_rcv', '$form_tcp_send', $form_id_export, '$form_plugin_user', '$form_plugin_pass', '$form_plugin_parameter', $form_id_plugin, $form_post_process, $form_id_prediction_module, $form_max_timeout, $form_disabled, $form_id_modulo)";
|
||||
$result=mysql_query($sql_insert);
|
||||
if (! $result){
|
||||
echo "<h3 class='error'>".$lang_label["add_module_no"]."</h3>";
|
||||
echo "<i>DEBUG: $sql_insert</i>";
|
||||
} else {
|
||||
echo "<h3 class='suc'>".$lang_label["add_module_ok"]."</h3>";
|
||||
$id_agente_modulo = mysql_insert_id();
|
||||
// Create with different estado if proc type or data type
|
||||
if (
|
||||
($form_id_tipo_modulo == 2) || // data_proc
|
||||
if (! $result){
|
||||
echo "<h3 class='error'>".$lang_label["add_module_no"]."</h3>";
|
||||
echo "<i>DEBUG: $sql_insert</i>";
|
||||
} else {
|
||||
echo "<h3 class='suc'>".$lang_label["add_module_ok"]."</h3>";
|
||||
$id_agente_modulo = mysql_insert_id();
|
||||
// Create with different estado if proc type or data type
|
||||
if (($form_id_tipo_modulo == 2) || // data_proc
|
||||
($form_id_tipo_modulo == 6) || // icmp_proc
|
||||
($form_id_tipo_modulo == 9) || // tcp_proc
|
||||
($form_id_tipo_modulo == 18) || //snmp proc
|
||||
($form_id_tipo_modulo == 21) || // async proc
|
||||
($form_id_tipo_modulo == 100) // Keepalive
|
||||
){
|
||||
($form_id_tipo_modulo == 21) || // async proc
|
||||
($form_id_tipo_modulo == 100) // Keepalive
|
||||
) {
|
||||
$sql_insert2 = "INSERT INTO tagente_estado
|
||||
(id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp)
|
||||
VALUES (
|
||||
$id_agente_modulo, 0,'0000-00-00 00:00:00',0,0,'".$id_agente."',0
|
||||
)";
|
||||
} else {
|
||||
$sql_insert2 = "INSERT INTO tagente_estado
|
||||
(id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp)
|
||||
VALUES (
|
||||
$id_agente_modulo, 0,'0000-00-00 00:00:00',0,0,'".$id_agente."',0
|
||||
)";
|
||||
} else {
|
||||
$sql_insert2 = "INSERT INTO tagente_estado
|
||||
(id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp)
|
||||
VALUES (
|
||||
$id_agente_modulo, 0,'0000-00-00 00:00:00',0,100,'".$id_agente."',0
|
||||
)";
|
||||
}
|
||||
$result=mysql_query($sql_insert2);
|
||||
}
|
||||
(id_agente_modulo,datos,timestamp,cambio,estado,id_agente, utimestamp)
|
||||
VALUES (
|
||||
$id_agente_modulo, 0,'0000-00-00 00:00:00',0,100,'".$id_agente."',0
|
||||
)";
|
||||
}
|
||||
$result=mysql_query($sql_insert2);
|
||||
}
|
||||
}
|
||||
|
||||
// MODULE DELETION
|
||||
|
@ -814,10 +819,10 @@ switch ($tab) {
|
|||
require "module_manager_editor.php";
|
||||
break;
|
||||
case "alert":
|
||||
if (($form_alerttype == "") AND (!isset($_GET["update_alert"])))
|
||||
require "alert_manager.php";
|
||||
else
|
||||
require "alert_manager_editor.php";
|
||||
if (($form_alerttype == "") && (!isset($_GET["update_alert"])))
|
||||
require "alert_manager.php";
|
||||
else
|
||||
require "alert_manager_editor.php";
|
||||
break;
|
||||
case "template":
|
||||
require "agent_template.php";
|
||||
|
|
|
@ -27,7 +27,7 @@ if (comprueba_login() == 0){
|
|||
|
||||
?>
|
||||
|
||||
<div class="tit bg3">:: <?php echo $lang_label["godmode_header"] ?> ::</div>
|
||||
<div class="tit bg3">:: <?php echo lang_string ("godmode_header") ?> ::</div>
|
||||
<div class="menug" id="god">
|
||||
|
||||
<?PHP
|
||||
|
@ -37,7 +37,7 @@ if (comprueba_login() == 0){
|
|||
}
|
||||
else
|
||||
echo '<div id="god1">';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente" class="mn">'.$lang_label["manage_agents"].'</a></li></ul></div>';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente" class="mn">'.lang_string ("manage_agents").'</a></li></ul></div>';
|
||||
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "gagente"){
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/agentes/manage_config"){
|
||||
|
@ -61,7 +61,7 @@ if (comprueba_login() == 0){
|
|||
}
|
||||
else
|
||||
echo "<div class='arrowg'>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gagente&sec2=godmode/groups/group_list' class='mn'>".$lang_label["manage_groups"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gagente&sec2=godmode/groups/group_list' class='mn'>".lang_string ("manage_groups")."</a></li></ul></div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,14 +71,14 @@ if (comprueba_login() == 0){
|
|||
echo '<div id="god_module_sel">';
|
||||
else
|
||||
echo '<div id="god_module">';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=gmodules&sec2=godmode/modules/module_list" class="mn">'.$lang_label["manage_modules"].'</a></li></ul></div>';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=gmodules&sec2=godmode/modules/module_list" class="mn">'.lang_string ("manage_modules").'</a></li></ul></div>';
|
||||
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "gmodules"){
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/modules/manage_nc_groups" || $_GET["sec2"] == "godmode/modules/manage_nc_groups_form")
|
||||
echo "<div class='arrowgs'>";
|
||||
else
|
||||
echo "<div class='arrowg'>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups' class='mn'>".$lang_label["nc_groups"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups' class='mn'>".lang_string ("nc_groups")."</a></li></ul></div>";
|
||||
}
|
||||
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "gmodules"){
|
||||
|
@ -86,7 +86,7 @@ if (comprueba_login() == 0){
|
|||
echo "<div class='arrowgs'>";
|
||||
else
|
||||
echo "<div class='arrowg'>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components' class='mn'>".$lang_label["network_components"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_components' class='mn'>".lang_string ("network_components")."</a></li></ul></div>";
|
||||
}
|
||||
// Network Profiles
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "gmodules"){
|
||||
|
@ -94,7 +94,7 @@ if (comprueba_login() == 0){
|
|||
echo "<div class='arrowgs'>";
|
||||
else
|
||||
echo "<div class='arrowg'>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates' class='mn'>".$lang_label["network_templates"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates' class='mn'>".lang_string ("network_templates")."</a></li></ul></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ if (comprueba_login() == 0){
|
|||
}
|
||||
else
|
||||
echo '<div id="god2">';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=galertas&sec2=godmode/alerts/modify_alert" class="mn">'.$lang_label["manage_alerts"].'</a></li></ul></div>';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=galertas&sec2=godmode/alerts/modify_alert" class="mn">'.lang_string ("manage_alerts").'</a></li></ul></div>';
|
||||
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "galertas"){
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/alerts/plugin"){
|
||||
|
@ -120,7 +120,7 @@ if (comprueba_login() == 0){
|
|||
echo '<div id="god3s">';
|
||||
}
|
||||
else echo '<div id="god3">';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=gusuarios&sec2=godmode/users/user_list" class="mn">'.$lang_label["manage_users"].'</a></li></ul></div>';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=gusuarios&sec2=godmode/users/user_list" class="mn">'.lang_string ("manage_users").'</a></li></ul></div>';
|
||||
}
|
||||
// Reporting
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -128,7 +128,7 @@ if (comprueba_login() == 0){
|
|||
|
||||
echo '<div id="god51">';
|
||||
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder" class="mn">'. $lang_label["manage_reporting"].'</a></li></ul></div>';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=greporting&sec2=godmode/reporting/reporting_builder" class="mn">'. lang_string ("manage_reporting").'</a></li></ul></div>';
|
||||
|
||||
// Custom report builder
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "greporting"){
|
||||
|
@ -137,7 +137,7 @@ if (comprueba_login() == 0){
|
|||
} else {
|
||||
echo "<div class='arrowg'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=greporting&sec2=godmode/reporting/reporting_builder' class='mn'>".$lang_label["report_builder"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=greporting&sec2=godmode/reporting/reporting_builder' class='mn'>".lang_string ("report_builder")."</a></li></ul></div>";
|
||||
}
|
||||
|
||||
// Custom graph builder
|
||||
|
@ -147,7 +147,7 @@ if (comprueba_login() == 0){
|
|||
} else {
|
||||
echo "<div class='arrowg'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=greporting&sec2=godmode/reporting/graph_builder' class='mn'>".$lang_label["graph_builder"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=greporting&sec2=godmode/reporting/graph_builder' class='mn'>".lang_string ("graph_builder")."</a></li></ul></div>";
|
||||
}
|
||||
|
||||
// Custom map builder
|
||||
|
@ -157,7 +157,7 @@ if (comprueba_login() == 0){
|
|||
} else {
|
||||
echo "<div class='arrowg'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=greporting&sec2=godmode/reporting/map_builder' class='mn'>".$lang_label["map_builder"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=greporting&sec2=godmode/reporting/map_builder' class='mn'>".lang_string ("map_builder")."</a></li></ul></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@ if (comprueba_login() == 0){
|
|||
echo '<div id="god4s">';
|
||||
}
|
||||
else echo '<div id="god4">';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=gperfiles&sec2=godmode/profiles/profile_list" class="mn">'.$lang_label["manage_profiles"].'</a></li></ul></div>';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=gperfiles&sec2=godmode/profiles/profile_list" class="mn">'.lang_string ("manage_profiles").'</a></li></ul></div>';
|
||||
|
||||
// SERVERS
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -179,14 +179,14 @@ if (comprueba_login() == 0){
|
|||
} else
|
||||
echo '<div id="god5">';
|
||||
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server" class="mn">'.$lang_label["manage_servers"].'</a></li></ul></div>';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server" class="mn">'.lang_string ("manage_servers").'</a></li></ul></div>';
|
||||
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "gservers"){
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/servers/manage_recontask"|| $_GET["sec2"] == "godmode/servers/manage_recontask_form"){
|
||||
echo "<div class='arrowgs'>";
|
||||
} else
|
||||
echo "<div class='arrowg'>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gservers&sec2=godmode/servers/manage_recontask' class='mn'>".$lang_label["manage_recontask"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gservers&sec2=godmode/servers/manage_recontask' class='mn'>".lang_string ("manage_recontask")."</a></li></ul></div>";
|
||||
}
|
||||
// AUDIT
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -194,7 +194,7 @@ if (comprueba_login() == 0){
|
|||
echo '<div id="god6s">';
|
||||
}
|
||||
else echo '<div id="god6">';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=glog&sec2=godmode/admin_access_logs" class="mn">'.$lang_label["system_audit"].'</a></li></ul></div>';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=glog&sec2=godmode/admin_access_logs" class="mn">'.lang_string ("system_audit").'</a></li></ul></div>';
|
||||
|
||||
// Main SETUP
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -202,14 +202,14 @@ if (comprueba_login() == 0){
|
|||
echo '<div id="god7s">';
|
||||
}
|
||||
else echo '<div id="god7">';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=gsetup&sec2=godmode/setup/setup" class="mn">'.$lang_label["setup_screen"].'</a></li></ul></div>';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=gsetup&sec2=godmode/setup/setup" class="mn">'.lang_string ("setup_screen").'</a></li></ul></div>';
|
||||
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "gsetup"){
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/setup/links"){
|
||||
echo "<div class='arrowgs'>";
|
||||
}
|
||||
else echo "<div class='arrowg'>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gsetup&sec2=godmode/setup/links' class='mn'>".$lang_label["setup_links"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gsetup&sec2=godmode/setup/links' class='mn'>".lang_string ("setup_links")."</a></li></ul></div>";
|
||||
}
|
||||
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "gsetup"){
|
||||
|
@ -217,7 +217,7 @@ if (comprueba_login() == 0){
|
|||
echo "<div class='arrowgs'>";
|
||||
}
|
||||
else echo "<div class='arrowg'>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gsetup&sec2=godmode/setup/news' class='mn'>".$lang_label["site_news"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gsetup&sec2=godmode/setup/news' class='mn'>".lang_string ("site_news")."</a></li></ul></div>";
|
||||
}
|
||||
}
|
||||
if ((give_acl($id_user, 0, "DM")==1)){
|
||||
|
@ -232,7 +232,7 @@ if (comprueba_login() == 0){
|
|||
} else {
|
||||
echo '<li class="bb0">';
|
||||
}
|
||||
echo '<a href="index.php?sec=gdbman&sec2=godmode/db/db_main" class="mn">'.$lang_label["db_maintenance"].'</a></li></ul></div>';
|
||||
echo '<a href="index.php?sec=gdbman&sec2=godmode/db/db_main" class="mn">'.lang_string ("db_maintenance").'</a></li></ul></div>';
|
||||
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "gdbman"){
|
||||
|
||||
|
@ -241,31 +241,31 @@ if (comprueba_login() == 0){
|
|||
echo "<div class='arrowgs'>";
|
||||
} else
|
||||
echo "<div class='arrowg'>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&sec2=godmode/db/db_info' class='mn'>".$lang_label["db_info"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&sec2=godmode/db/db_info' class='mn'>".lang_string ("db_info")."</a></li></ul></div>";
|
||||
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/db/db_purge"){
|
||||
echo "<div class='arrowgs'>";
|
||||
} else
|
||||
echo "<div class='arrowg'>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&sec2=godmode/db/db_purge' class='mn'>".$lang_label["db_purge"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&sec2=godmode/db/db_purge' class='mn'>".lang_string ("db_purge")."</a></li></ul></div>";
|
||||
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/db/db_refine"){
|
||||
echo "<div class='arrowgs'>";
|
||||
} else
|
||||
echo "<div class='arrowg'>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&sec2=godmode/db/db_refine' class='mn'>".$lang_label["db_refine"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&sec2=godmode/db/db_refine' class='mn'>".lang_string ("db_refine")."</a></li></ul></div>";
|
||||
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/db/db_audit"){
|
||||
echo "<div class='arrowgs'>";
|
||||
} else
|
||||
echo "<div class='arrowg'>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&sec2=godmode/db/db_audit' class='mn'>".$lang_label["db_audit"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=gdbman&sec2=godmode/db/db_audit' class='mn'>".lang_string ("db_audit")."</a></li></ul></div>";
|
||||
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/db/db_event"){
|
||||
echo "<div id='arrowgls'>";
|
||||
} else
|
||||
echo "<div id='arrowgl'>";
|
||||
echo "<ul class='mn'><li class='bb0'><a href='index.php?sec=gdbman&sec2=godmode/db/db_event' class='mn'>".$lang_label["db_event"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li class='bb0'><a href='index.php?sec=gdbman&sec2=godmode/db/db_event' class='mn'>".lang_string ("db_event")."</a></li></ul></div>";
|
||||
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "godmode/db/db_sanity"){
|
||||
echo "<div id='arrowgls'>";
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -229,7 +229,6 @@ if ($edit_sla_report_content) {
|
|||
if ($delete_sla) {
|
||||
$id_sla = (int) get_parameter ('id_sla');
|
||||
$sql = sprintf ('DELETE FROM treport_content_sla_combined WHERE id = %d', $id_sla);
|
||||
echo $sql;
|
||||
$result = mysql_query ($sql);
|
||||
if ($result)
|
||||
echo "<h3 class=suc>".lang_string ('delete_sla_ok')."</h3>";
|
||||
|
@ -308,7 +307,6 @@ if ($edit_sla_report_content) {
|
|||
print_submit_button (lang_string ('create'), 'add', false, 'class="sub wand"');
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
} else if ($edit_report || $id_report) {
|
||||
/* Edit and creation report form */
|
||||
if (isset($_POST["id_agent"]))
|
||||
|
@ -438,7 +436,6 @@ if ($edit_sla_report_content) {
|
|||
$table->head[6] = lang_string ('delete');
|
||||
}
|
||||
|
||||
|
||||
$sql = sprintf ('SELECT * FROM treport_content WHERE id_report = %d ORDER BY `order`', $id_report);
|
||||
$report_contents = get_db_all_rows_sqlfree ($sql);
|
||||
if (sizeof ($report_contents)) {
|
||||
|
|
|
@ -19,132 +19,98 @@
|
|||
// Load global vars
|
||||
require("include/config.php");
|
||||
|
||||
if (comprueba_login() == 0)
|
||||
if ((give_acl($id_user, 0, "PM")==1) or (dame_admin($id_user)==1)) {
|
||||
if (isset($_GET["update"])){
|
||||
$config["block_size"]=$_POST["block_size"];
|
||||
$config["language"]=$_POST["language_code"];
|
||||
$config["days_compact"]=$_POST["days_compact"];
|
||||
$config["days_purge"]=$_POST["days_purge"];
|
||||
$config["graph_res"]=$_POST["graph_res"];
|
||||
$config["step_compact"]=$_POST["step_compact"];
|
||||
$config["show_unknown"]=$_POST["show_unknown"];
|
||||
$config["show_lastalerts"]=$_POST["show_lastalerts"];
|
||||
$config["style"] = $_POST["style"];
|
||||
$config["remote_config"] = $_POST["remote_config"];
|
||||
|
||||
$config["graph_color1"] = $_POST["graph_color1"];
|
||||
$config["graph_color2"] = $_POST["graph_color2"];
|
||||
$config["graph_color3"] = $_POST["graph_color3"];
|
||||
|
||||
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config["remote_config"]."' WHERE TOKEN='remote_config'");
|
||||
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config["block_size"]."' WHERE TOKEN='block_size'");
|
||||
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config["language"]."' WHERE TOKEN='language_code'");
|
||||
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config["days_purge"]."' WHERE TOKEN='days_purge'");
|
||||
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config["days_compact"]." ' WHERE TOKEN='days_compact'");
|
||||
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config["graph_res"]."' WHERE TOKEN='graph_res'");
|
||||
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config["step_compact"]."' WHERE TOKEN='step_compact'");
|
||||
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config["show_unknown"]."' WHERE token='show_unknown'");
|
||||
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config["show_lastalerts"]."' WHERE token='show_lastalerts'");
|
||||
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config["style"]."' WHERE token='style'");
|
||||
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config["graph_color1"]."' WHERE token='graph_color1'");
|
||||
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config["graph_color2"]."' WHERE token='graph_color2'");
|
||||
$result2=mysql_query("UPDATE tconfig SET VALUE='".$config["graph_color3"]."' WHERE token='graph_color3'");
|
||||
|
||||
}
|
||||
echo "<h2>".$lang_label["setup_screen"]." > ";
|
||||
echo $lang_label["general_config"]."</h2>";
|
||||
echo "<form name='setup' method='POST' action='index.php?sec=gsetup&sec2=godmode/setup/setup&update=1'>";
|
||||
echo '<table width="500" cellpadding="4" cellspacing="4" class="databox">';
|
||||
echo '<tr><td class="datos">'.$lang_label["language_code"].'</td>';
|
||||
echo '<td class="datos"><select name="language_code" onChange="javascript:this.form.submit();" width="180px">';
|
||||
|
||||
$sql="SELECT * FROM tlanguage";
|
||||
$result=mysql_query($sql);
|
||||
|
||||
$result2=mysql_query("SELECT * FROM tlanguage WHERE id_language = '".$config["language"]."'");
|
||||
if ($row2=mysql_fetch_array($result2)){
|
||||
echo '<option value="'.$row2["id_language"].'">'.$row2["name"]."</option>";
|
||||
}
|
||||
while ($row=mysql_fetch_array($result)){
|
||||
echo "<option value=".$row["id_language"].">".$row["name"]."</option>";
|
||||
}
|
||||
echo '</select></td></tr>';
|
||||
|
||||
echo '<tr><td class="datos2">'.lang_string ("Remote config directory");
|
||||
echo '<td class="datos2"><input type="text" name="remote_config" size=30 value="'.$config["remote_config"].'"></td></tr>';
|
||||
|
||||
echo '<tr><td class="datos">'.lang_string("Graph color (min)");
|
||||
echo '<td class="datos"><input type="text" name="graph_color1" size=8 value="'.$config["graph_color1"].'"></td></tr>';
|
||||
|
||||
echo '<tr><td class="datos2">'.lang_string("Graph color (avg)");
|
||||
echo '<td class="datos2"><input type="text" name="graph_color2" size=8 value="'.$config["graph_color2"].'"></td></tr>';
|
||||
|
||||
echo '<tr><td class="datos">'.lang_string("Graph color (max)");
|
||||
echo '<td class="datos"><input type="text" name="graph_color3" size=8 value="'.$config["graph_color3"].'"></td></tr>';
|
||||
|
||||
echo '<tr><td class="datos2">'.$lang_label["days_compact"];
|
||||
echo '<td class="datos2"><input type="text" name="days_compact" size=5 value="'.$config["days_compact"].'"></td></tr>';
|
||||
|
||||
echo '<tr><td class="datos">'.$lang_label["days_purge"];
|
||||
echo '<td class="datos"><input type="text" name="days_purge" size=5 value="'.$config["days_purge"].'"></td></tr>';
|
||||
|
||||
echo '<tr><td class="datos2">'.$lang_label["graph_res"];
|
||||
echo '<td class="datos2"><input type="text" name="graph_res" size=5 value="'.$config["graph_res"].'"></td></tr>';
|
||||
|
||||
echo '<tr><td class="datos">'.$lang_label["step_compact"].'</td>';
|
||||
echo '<td class="datos"><input type="text" name="step_compact" size=5 value="'.$config["step_compact"].'"></td></tr>';
|
||||
|
||||
echo '<tr><td class="datos2">'.$lang_label["show_unknown"].'</td>';
|
||||
echo '<td class="datos2"><select name="show_unknown" class="w120">';
|
||||
if ($config["show_unknown"]==1) {
|
||||
echo '<option value="1">'.$lang_label["active"].'</option>';
|
||||
echo '<option value="0">'.$lang_label["disabled"].'</option>';
|
||||
}
|
||||
else {
|
||||
echo '<option value="0">'.$lang_label["disabled"].'</option>';
|
||||
echo '<option value="1">'.$lang_label["active"].'</option>';
|
||||
}
|
||||
|
||||
echo '<tr><td class="datos">'.$lang_label["show_lastalerts"];
|
||||
echo '<td class="datos"><select name="show_lastalerts" class="w120">';
|
||||
if ($config["show_lastalerts"]==1) {
|
||||
echo '<option value="1">'.$lang_label["active"].'</option>';
|
||||
echo '<option value="0">'.$lang_label["disabled"].'</option>';
|
||||
}
|
||||
else {
|
||||
echo '<option value="0">'.$lang_label["disabled"].'</option>';
|
||||
echo '<option value="1">'.$lang_label["active"].'</option>';
|
||||
}
|
||||
|
||||
echo '<tr><td class="datos2">'.$lang_label["style_template"].'</td>';
|
||||
echo '<td class="datos2">';
|
||||
echo '<select name="style" class="w155">';
|
||||
if ($config["style"] != ""){
|
||||
echo '<option>'.$config["style"].'</option>';
|
||||
}
|
||||
$ficheros2 = list_files('include/styles/', "pandora",1, 0);
|
||||
$a=0;
|
||||
while (isset($ficheros2[$a])){
|
||||
$fstyle = substr($ficheros2[$a],0,strlen($ficheros2[$a])-4);
|
||||
if (($fstyle != $config["style"]) AND ($fstyle != "pandora_minimal"))
|
||||
echo "<option>".$fstyle."</option>";
|
||||
$a++;
|
||||
}
|
||||
echo '</select>';
|
||||
|
||||
|
||||
echo '<tr><td class="datos">'.$lang_label["block_size"];
|
||||
echo '<td class="datos"><input type="text" name="block_size" size=5 value="'.$config["block_size"].'"></td></tr>';
|
||||
|
||||
echo "</table>";
|
||||
echo "<table width=500>";
|
||||
echo "<tr><td align='right'>";
|
||||
echo '<input type="submit" class="sub upd" value="'.$lang_label["update"].'">';
|
||||
echo "</td></tr>";
|
||||
echo "</table>";
|
||||
if (comprueba_login()) {
|
||||
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access Database Management");
|
||||
require ("general/noaccess.php");
|
||||
}
|
||||
else {
|
||||
audit_db($id_user,$REMOTE_ADDR, "ACL Violation","Trying to access Database Management");
|
||||
require ("general/noaccess.php");
|
||||
}
|
||||
if (! give_acl ($config['id_user'], 0, "PM") || ! dame_admin ($config['id_user'])) {
|
||||
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access Database Management");
|
||||
require ("general/noaccess.php");
|
||||
}
|
||||
|
||||
$update_settings = (bool) get_parameter ('update_settings');
|
||||
|
||||
if ($update_settings) {
|
||||
$config["block_size"] = (int) get_parameter ('block_size');
|
||||
$config["language"] = (string) get_parameter ('language_code');
|
||||
$config["days_compact"] = (int) get_parameter ('days_compact');
|
||||
$config["days_purge"] = (int) get_parameter ('days_purge');
|
||||
$config["graph_res"] = (int) get_parameter ('graph_res');
|
||||
$config["step_compact"] = (int) get_parameter ('step_compact');
|
||||
$config["show_unknown"] = (int) get_parameter ('show_unknown');
|
||||
$config["show_lastalerts"] = (int) get_parameter ('show_lastalerts');
|
||||
$config["style"] = (string) get_parameter ('style', 'pandora.css');
|
||||
$config["remote_config"] = (string) get_parameter ('remote_config');
|
||||
$config["graph_color1"] = (string) get_parameter ('graph_color1');
|
||||
$config["graph_color2"] = (string) get_parameter ('graph_color2');
|
||||
$config["graph_color3"] = (string) get_parameter ('graph_color3');
|
||||
|
||||
$config["style"] = substr ($config["style"], 0, strlen ($config["style"]) - 4);
|
||||
mysql_query ("UPDATE tconfig SET VALUE='".$config["remote_config"]."' WHERE token = 'remote_config'");
|
||||
mysql_query ("UPDATE tconfig SET VALUE='".$config["block_size"]."' WHERE token = 'block_size'");
|
||||
mysql_query ("UPDATE tconfig SET VALUE='".$config["language"]."' WHERE token = 'language_code'");
|
||||
mysql_query ("UPDATE tconfig SET VALUE='".$config["days_purge"]."' WHERE token = 'days_purge'");
|
||||
mysql_query ("UPDATE tconfig SET VALUE='".$config["days_compact"]." ' WHERE token = 'days_compact'");
|
||||
mysql_query ("UPDATE tconfig SET VALUE='".$config["graph_res"]."' WHERE token = 'graph_res'");
|
||||
mysql_query ("UPDATE tconfig SET VALUE='".$config["step_compact"]."' WHERE token = 'step_compact'");
|
||||
mysql_query ("UPDATE tconfig SET VALUE='".$config["show_unknown"]."' WHERE token = 'show_unknown'");
|
||||
mysql_query ("UPDATE tconfig SET VALUE='".$config["show_lastalerts"]."' WHERE token = 'show_lastalerts'");
|
||||
mysql_query ("UPDATE tconfig SET VALUE='".$config["style"]."' WHERE token = 'style'");
|
||||
mysql_query ("UPDATE tconfig SET VALUE='".$config["graph_color1"]."' WHERE token = 'graph_color1'");
|
||||
mysql_query ("UPDATE tconfig SET VALUE='".$config["graph_color2"]."' WHERE token = 'graph_color2'");
|
||||
mysql_query ("UPDATE tconfig SET VALUE='".$config["graph_color3"]."' WHERE token = 'graph_color3'");
|
||||
}
|
||||
|
||||
echo "<h2>".lang_string ("setup_screen")." > ";
|
||||
echo lang_string ("general_config")."</h2>";
|
||||
|
||||
$file_styles = list_files('include/styles/', "pandora", 1, 0);
|
||||
|
||||
$table->width = '500px';
|
||||
$table->data = array ();
|
||||
$table->data[0][0] = lang_string ('language_code');
|
||||
$table->data[0][1] = print_select_from_sql ('SELECT id_language, name FROM tlanguage', 'language_code', $config["language"], '', '', '', true);
|
||||
$table->data[1][0] = lang_string ('Remote config directory');
|
||||
$table->data[1][1] = print_input_text ('remote_config', $config["remote_config"], '', 30, 100, true);
|
||||
$table->data[2][0] = lang_string ('Graph color (min)');
|
||||
$table->data[2][1] = print_input_text ('graph_color1', $config["graph_color1"], '', 8, 8, true);
|
||||
$table->data[3][0] = lang_string ('Graph color (avg)');
|
||||
$table->data[3][1] = print_input_text ('graph_color2', $config["graph_color2"], '', 8, 8, true);
|
||||
$table->data[4][0] = lang_string ('Graph color (max)');
|
||||
$table->data[4][1] = print_input_text ('graph_color3', $config["graph_color3"], '', 8, 8, true);
|
||||
$table->data[5][0] = lang_string ('days_compact');
|
||||
$table->data[5][1] = print_input_text ('days_compact', $config["days_compact"], '', 5, 5, true);
|
||||
$table->data[6][0] = lang_string ('days_purge');
|
||||
$table->data[6][1] = print_input_text ('days_purge', $config["days_purge"], '', 5, 5, true);
|
||||
$table->data[7][0] = lang_string ('graph_res');
|
||||
$table->data[7][1] = print_input_text ('graph_res', $config["graph_res"], '', 5, 5, true);
|
||||
$table->data[8][0] = lang_string ('step_compact');
|
||||
$table->data[8][1] = print_input_text ('step_compact', $config["step_compact"], '', 5, 5, true);
|
||||
$table->data[9][0] = lang_string ('show_unknown');
|
||||
$table->data[9][1] = print_checkbox ('show_unknown', 1, $config["show_unknown"], true);
|
||||
$table->data[10][0] = lang_string ('show_lastalerts');
|
||||
$table->data[10][1] = print_checkbox ('show_lastalerts', 1, $config["show_lastalerts"], true);
|
||||
$table->data[11][0] = lang_string ('style_template');
|
||||
$table->data[11][1] = print_select ($file_styles, 'style', $config["style"], '', '', '', true);
|
||||
$table->data[12][0] = lang_string ('block_size');
|
||||
$table->data[12][1] = print_input_text ('block_size', $config["block_size"], '', 5, 5, true);
|
||||
|
||||
echo '<form id="form_setup" method="POST" action="index.php?sec=gsetup&sec2=godmode/setup/setup">';
|
||||
print_input_hidden ('update_settings', 1);
|
||||
print_table ($table);
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
print_submit_button (lang_string ('update'), 'update_button', false, 'class="sub upd"');
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="include/styles/color-picker.css" type="text/css" />
|
||||
<script type="text/javascript" src="include/javascript/jquery.js"></script>
|
||||
<script type="text/javascript" src="include/javascript/jquery.colorpicker.js"></script>
|
||||
<script language="javascript" type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
$("#form_setup #text-graph_color1").attachColorPicker();
|
||||
$("#form_setup #text-graph_color2").attachColorPicker();
|
||||
$("#form_setup #text-graph_color3").attachColorPicker();
|
||||
});
|
||||
</script>
|
||||
|
|
Binary file not shown.
After ![]() (image error) Size: 60 KiB |
Binary file not shown.
After ![]() (image error) Size: 74 KiB |
Binary file not shown.
After ![]() (image error) Size: 153 KiB |
Binary file not shown.
After ![]() (image error) Size: 250 KiB |
Binary file not shown.
After ![]() (image error) Size: 34 KiB |
Binary file not shown.
After ![]() (image error) Size: 67 KiB |
Binary file not shown.
After ![]() (image error) Size: 80 KiB |
Binary file not shown.
After ![]() (image error) Size: 8.2 KiB |
|
@ -2,7 +2,7 @@
|
|||
// Begin of automatic config file
|
||||
$config["dbname"]="pandora"; // MySQL DataBase name
|
||||
$config["dbuser"]="pandora"; // DB User
|
||||
$config["dbpass"]="wrvjsevp"; // DB Password
|
||||
$config["dbpass"]="pandora"; // DB Password
|
||||
$config["dbhost"]="localhost"; // DB Host
|
||||
$config["homedir"]="/var/www/pandora_console/"; // Config homedir
|
||||
$config["homeurl"]="http://192.168.13.211/pandora_console"; // Base URL
|
||||
|
|
|
@ -45,6 +45,13 @@ function pandora_help ($help_id, $return = false) {
|
|||
function safe_input ($value) {
|
||||
if (is_numeric ($value))
|
||||
return $value;
|
||||
if (is_array ($value)) {
|
||||
$retval = array ();
|
||||
foreach ($value as $id => $val) {
|
||||
$retval[$id] = htmlentities (utf8_decode ($val), ENT_QUOTES);
|
||||
}
|
||||
return $retval;
|
||||
}
|
||||
return htmlentities (utf8_decode ($value), ENT_QUOTES);
|
||||
}
|
||||
|
||||
|
@ -238,27 +245,27 @@ function unmanaged_error ($error = "") {
|
|||
*/
|
||||
function list_files ($directory, $stringSearch, $searchHandler, $return) {
|
||||
$errorHandler = false;
|
||||
$result = array();
|
||||
$result = array ();
|
||||
if (! $directoryHandler = @opendir ($directory)) {
|
||||
echo ("<pre>\nerror: directory \"$directory\" doesn't exist!\n</pre>\n");
|
||||
return $errorHandler = true;
|
||||
}
|
||||
if ($searchHandler == 0) {
|
||||
while (false !== ($fileName = @readdir ($directoryHandler))) {
|
||||
@array_push ($result, $fileName);
|
||||
$result[$fileName] = $fileName;
|
||||
}
|
||||
}
|
||||
if ($searchHandler == 1) {
|
||||
while(false !== ($fileName = @readdir ($directoryHandler))) {
|
||||
if(@substr_count ($fileName, $stringSearch) > 0) {
|
||||
@array_push ($result, $fileName);
|
||||
$result[$fileName] = $fileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (($errorHandler == true) && (@count ($result) === 0)) {
|
||||
echo ("<pre>\nerror: no filetype \"$fileExtension\" found!\n</pre>\n");
|
||||
} else {
|
||||
sort ($result);
|
||||
asort ($result);
|
||||
if ($return == 0) {
|
||||
return $result;
|
||||
}
|
||||
|
|
|
@ -1401,7 +1401,7 @@ function return_value_agent_module ($id_agentmodule) {
|
|||
*
|
||||
* @return The X axis coordinate value.
|
||||
*/
|
||||
function return_coordinate_X_layoutdata ($id_layoutdata) {
|
||||
function get_layoutdata_x ($id_layoutdata) {
|
||||
return (float) get_db_value ('pos_x', 'tlayout_data', 'id', $id_layoutdata);
|
||||
}
|
||||
|
||||
|
@ -1412,7 +1412,7 @@ function return_coordinate_X_layoutdata ($id_layoutdata) {
|
|||
*
|
||||
* @return The X axis coordinate value.
|
||||
*/
|
||||
function return_coordinate_y_layoutdata ($id_layoutdata){
|
||||
function get_layoutdata_y ($id_layoutdata){
|
||||
return (float) get_db_value ('pos_y', 'tlayout_data', 'id', $id_layoutdata);
|
||||
}
|
||||
|
||||
|
@ -1470,8 +1470,7 @@ function return_moduledata_avg_value ($id_agent_module, $period, $date = 0) {
|
|||
return ($previous_data['datos'] + $sum) / ($total + 1);
|
||||
if ($total > 0)
|
||||
return $sum / $total;
|
||||
else
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -428,7 +428,7 @@ function print_radio_button_extended ($name, $value, $label, $checkedvalue, $dis
|
|||
$output .= ' />';
|
||||
|
||||
if ($label != '') {
|
||||
$output .= '<label for="'.$htmlid.'">'. $label .'</label>' . "\n";
|
||||
$output .= '<label for="'.$htmlid.'">'. $label .'</label>' . "\n";
|
||||
}
|
||||
|
||||
if ($return)
|
||||
|
|
|
@ -0,0 +1,139 @@
|
|||
<?php
|
||||
// Pandora FMS - the Free monitoring system
|
||||
// ========================================
|
||||
// Copyright (c) 2004-2008 Sancho Lerena, slerena@gmail.com
|
||||
// Main PHP/SQL code development and project architecture and management
|
||||
// Copyright (c) 2005-2008 Artica Soluciones Tecnologicas, info@artica.es
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines = true) {
|
||||
global $config;
|
||||
$layout = get_db_row ('tlayout', 'id', $id_layout);
|
||||
|
||||
echo "<div id='layout_map' style='z-index: 0; position:relative; background: url(images/console/background/".$layout["background"]."); width:".$layout["width"]."px; height:".$layout["height"]."px;'>";
|
||||
$layout_datas = get_db_all_rows_field_filter ('tlayout_data', 'id_layout', $id_layout);
|
||||
$lines = array ();
|
||||
|
||||
foreach ($layout_datas as $layout_data) {
|
||||
// Linked to other layout ?? - Only if not module defined
|
||||
if (($layout_data['id_layout_linked'] != 0) && ($layout_data['id_agente_modulo'] == 0)) {
|
||||
$status = return_status_layout ($layout_data['id_layout_linked']);
|
||||
} else {
|
||||
$id_agent = get_db_value ("id_agente", "tagente_estado", "id_agente_modulo", $layout_data['id_agente_modulo']);
|
||||
$id_agent_module_parent = get_db_value ("id_agente_modulo", "tlayout_data", "id", $layout_data["parent_item"]);
|
||||
// Item value
|
||||
$status = return_status_agent_module ($layout_data['id_agente_modulo']);
|
||||
if ($layout_data['no_link_color'] == 1)
|
||||
$status_parent = -1;
|
||||
else
|
||||
$status_parent = return_status_agent_module ($id_agent_module_parent);
|
||||
}
|
||||
|
||||
// STATIC IMAGE (type = 0)
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if ($layout_data['type'] == 0) {
|
||||
// Link image
|
||||
//index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1
|
||||
|
||||
// Draw image
|
||||
echo '<div style="z-index: 1; color: '.$layout_data['label_color'].'; position: absolute; margin-left: '.$layout_data['pos_x'].'px; margin-top:'.$layout_data['pos_y'].'px;" id="layout-data-'.$layout_data['id'].'" class="layout-data">';
|
||||
if ($show_links) {
|
||||
if ($layout_data['id_layout_linked'] == "" || $layout_data['id_layout_linked'] == 0) {
|
||||
echo "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agent&tab=data'>";
|
||||
} else {
|
||||
echo '<a href="index.php?sec=visualc&sec2=operation/visual_console/render_view&pure='.$config["pure"].'&id='.$layout_data['id_layout_linked'].'">';
|
||||
}
|
||||
}
|
||||
if ($status == 0) {
|
||||
if ($layout_data['width'] != "" && $layout_data['width'] != 0)
|
||||
echo '<img src="images/console/icons/'.$layout_data['image'].'_bad.png" width="'.$layout_data['width'].'" height="'.$layout_data['height'].'" title="'.$layout_data['label'].'">';
|
||||
else
|
||||
echo '<img src="images/console/icons/'.$layout_data['image'].'_bad.png"
|
||||
title="'.$layout_data['label'].'">';
|
||||
} else {
|
||||
if ($layout_data['width'] != "" && $layout_data['width'] != 0)
|
||||
echo '<img src="images/console/icons/'.$layout_data['image'].'_ok.png" width="'.$layout_data['width'].'"
|
||||
height="'.$layout_data['height'].'" title="'.$layout_data['label'].'">';
|
||||
else
|
||||
echo '<img src="images/console/icons/'.$layout_data['image'].'_ok.png"
|
||||
title="'.$layout_data['label'].'">';
|
||||
}
|
||||
echo "</a>";
|
||||
|
||||
// Draw label
|
||||
echo "<br>";
|
||||
echo $layout_data['label'];
|
||||
echo "</div>";
|
||||
}
|
||||
// SINGLE GRAPH (type = 1)
|
||||
if ($layout_data['type'] == 1) { // single graph
|
||||
|
||||
// Draw image
|
||||
echo '<div style="z-index: 1; color: '.$layout_data['label_color'].'; position: absolute; margin-left: '.$layout_data['pos_x'].'px; margin-top:'.$layout_data['pos_y'].'px;" id="layout-data-'.$layout_data['id'].'" class="layout-data">';
|
||||
if ($show_links) {
|
||||
if (($layout_data['id_layout_linked'] == "") || ($layout_data['id_layout_linked'] == 0)) {
|
||||
echo '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agent.'&tab=data">';
|
||||
} else {
|
||||
echo '<a href="index.php?sec=visualc&sec2=operation/visual_console/render_view&pure='.$config["pure"].'&id='.$layout_data['id_layout_linked'].'">';
|
||||
}
|
||||
}
|
||||
echo '<img src="reporting/fgraph.php?tipo=sparse&id='.$layout_data['id_agente_modulo'].'&label='.$layout_data['label'].'&height='.$layout_data['height'].'&width='.$layout_data['width'].'&period='.$layout_data['period'].'" title="'.$layout_data['label'].'" border="0">';
|
||||
echo "</a>";
|
||||
echo "</div>";
|
||||
} else if ($layout_data['type'] == 2) {
|
||||
$line['id'] = $layout_data['id'];
|
||||
$line['x'] = $layout_data['pos_x'];
|
||||
$line['y'] = $layout_data['pos_y'];
|
||||
$line['width'] = $layout_data['width'];
|
||||
$line['height'] = $layout_data['height'];
|
||||
$line['color'] = $layout_data['label_color'];
|
||||
array_push ($lines, $line);
|
||||
}
|
||||
|
||||
// Get parent relationship - Create line data
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if ($layout_data["parent_item"] != "" && $layout_data["parent_item"] != 0) {
|
||||
$parent_x = get_layoutdata_x ($layout_data["parent_item"]);
|
||||
$parent_y = get_layoutdata_y ($layout_data["parent_item"]);
|
||||
$line['id'] = $layout_data['id'];
|
||||
$line['node_begin'] = 'layout-data-'.$layout_data["parent_item"];
|
||||
$line['node_end'] = 'layout-data-'.$layout_data["id"];
|
||||
$line['width'] = $parent_x + 15;
|
||||
$line['height'] = $parent_y + 15;
|
||||
$line['color'] = $status_parent ? '#00dd00' : '#dd0000';
|
||||
array_push ($lines, $line);
|
||||
}
|
||||
}
|
||||
if ($draw_lines) {
|
||||
/* If you want lines in the map, call using Javascript:
|
||||
draw_lines (lines, id_div);
|
||||
on body load, where id_div is the id of the div which holds the map */
|
||||
echo "\n".'<script type="text/javascript">'."\n";
|
||||
echo 'var lines = Array ();'."\n";
|
||||
|
||||
foreach ($lines as $line) {
|
||||
echo 'lines.push (eval ('.json_encode ($line)."));\n";
|
||||
}
|
||||
echo '</script>'."\n";
|
||||
}
|
||||
// End main div
|
||||
echo "</div>";
|
||||
}
|
||||
|
||||
function get_layout_data_types () {
|
||||
$types = array (0 => lang_string ("static_graph"),
|
||||
1 => lang_string ("module_graph"));
|
||||
return $types;
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,50 @@
|
|||
/* jQuery ColorPicker
|
||||
Written by Virgil Reboton(vreboton@gmail.com)
|
||||
|
||||
ColorPicker function structures and attahcment is base on
|
||||
jQuery UI Date Picker v3.3beta
|
||||
by Marc Grabanski (m@marcgrabanski.com) and Keith Wood (kbwood@virginbroadband.com.au).
|
||||
|
||||
ColorPicker render data is base on
|
||||
http://www.mattkruse.com/javascript/colorpicker/
|
||||
by Matt Kruse
|
||||
|
||||
*/
|
||||
|
||||
|
||||
(function($){function colorPicker()
|
||||
{this._nextId=0;this._inst=[];this._curInst=null;this._colorpickerShowing=false;this._colorPickerDiv=$('<div id="colorPickerDiv"></div>');}
|
||||
$.extend(colorPicker.prototype,{markerClassName:'hasColorPicker',_register:function(inst){var id=this._nextId++;this._inst[id]=inst;return id;},_getInst:function(id){return this._inst[id]||id;},_doKeyDown:function(e){var inst=$.colorPicker._getInst(this._colId);if($.colorPicker._colorpickerShowing){switch(e.keyCode){case 9:$.colorPicker.hideColorPicker();break;case 27:$.colorPicker.hideColorPicker();break;}}
|
||||
else if(e.keyCode==40){$.colorPicker.showFor(this);}},_resetSample:function(e){var inst=$.colorPicker._getInst(this._colId);inst._sampleSpan.css('background-color',inst._input.value);alert(inst._input.value);},_hasClass:function(element,className){var classes=element.attr('class');return(classes&&classes.indexOf(className)>-1);},showFor:function(control){control=(control.jquery?control[0]:(typeof control=='string'?$(control)[0]:control));var input=(control.nodeName&&control.nodeName.toLowerCase()=='input'?control:this);if($.colorPicker._lastInput==input){return;}
|
||||
if($.colorPicker._colorpickerShowing){return;}
|
||||
var inst=$.colorPicker._getInst(input._colId);$.colorPicker.hideColorPicker();$.colorPicker._lastInput=input;if(!$.colorPicker._pos){$.colorPicker._pos=$.colorPicker._findPos(input);$.colorPicker._pos[1]+=input.offsetHeight;}
|
||||
var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css('position')=='fixed';});if(isFixed&&$.browser.opera){$.colorPicker._pos[0]-=document.documentElement.scrollLeft;$.colorPicker._pos[1]-=document.documentElement.scrollTop;}
|
||||
inst._colorPickerDiv.css('position',($.blockUI?'static':(isFixed?'fixed':'absolute'))).css('left',$.colorPicker._pos[0]+'px').css('top',$.colorPicker._pos[1]+1+'px');$.colorPicker._pos=null;$.colorPicker._showColorPicker(inst);return this;},_findPos:function(obj){while(obj&&(obj.type=='hidden'||obj.nodeType!=1)){obj=obj.nextSibling;}
|
||||
var curleft=curtop=0;if(obj&&obj.offsetParent){curleft=obj.offsetLeft;curtop=obj.offsetTop;while(obj=obj.offsetParent){var origcurleft=curleft;curleft+=obj.offsetLeft;if(curleft<0){curleft=origcurleft;}
|
||||
curtop+=obj.offsetTop;}}
|
||||
return[curleft,curtop];},_checkExternalClick:function(event){if(!$.colorPicker._curInst)
|
||||
{return;}
|
||||
var target=$(event.target);if((target.parents("#colorPickerDiv").length==0)&&$.colorPicker._colorpickerShowing&&!($.blockUI))
|
||||
{if(target.text()!=$.colorPicker._curInst._colorPickerDiv.text())
|
||||
$.colorPicker.hideColorPicker();}},hideColorPicker:function(s){var inst=this._curInst;if(!inst){return;}
|
||||
if(this._colorpickerShowing)
|
||||
{this._colorpickerShowing=false;this._lastInput=null;this._colorPickerDiv.css('position','absolute').css('left','0px').css('top','-1000px');if($.blockUI)
|
||||
{$.unblockUI();$('body').append(this._colorPickerDiv);}
|
||||
this._curInst=null;}
|
||||
if(inst._input[0].value!=$.css(inst._sampleSpan,'background-color'))
|
||||
{inst._sampleSpan.css('background-color',inst._input[0].value);}},_connectColorPicker:function(target,inst){var input=$(target);if(this._hasClass(input,this.markerClassName)){return;}
|
||||
$(input).attr('autocomplete','OFF');inst._input=$(input);inst._sampleSpan=$('<span class="ColorPickerDivSample" style="background-color:'+inst._input[0].value+';height:'+inst._input[0].offsetHeight+';"> </span>');input.after(inst._sampleSpan);inst._sampleSpan.click(function(){input.focus();});input.focus(this.showFor);input.addClass(this.markerClassName).keydown(this._doKeyDown);input[0]._colId=inst._id;},_showColorPicker:function(id){var inst=this._getInst(id);this._updateColorPicker(inst);inst._colorPickerDiv.css('width',inst._startTime!=null?'10em':'6em');inst._colorPickerDiv.show('fast');if(inst._input[0].type!='hidden')
|
||||
{inst._input[0].focus();}
|
||||
this._curInst=inst;this._colorpickerShowing=true;},_updateColorPicker:function(inst){inst._colorPickerDiv.empty().append(inst._generateColorPicker());if(inst._input&&inst._input[0].type!='hidden')
|
||||
{inst._input[0].focus();$("td.color",inst._timePickerDiv).unbind().mouseover(function(){inst._sampleSpan.css('background-color',$.css(this,'background-color'));}).click(function(){inst._setValue(this);});}}});function ColorPickerInstance()
|
||||
{this._id=$.colorPicker._register(this);this._input=null;this._colorPickerDiv=$.colorPicker._colorPickerDiv;this._sampleSpan=null;}
|
||||
$.extend(ColorPickerInstance.prototype,{_get:function(name){return(this._settings[name]!=null?this._settings[name]:$.colorPicker._defaults[name]);},_getValue:function(){if(this._input&&this._input[0].type!='hidden'&&this._input[0].value!="")
|
||||
{return this._input[0].value;}
|
||||
return null;},_setValue:function(sel){if(this._input&&this._input[0].type!='hidden')
|
||||
{this._input[0].value=$.attr(sel,'title');$(this._input[0]).change();}
|
||||
$.colorPicker.hideColorPicker();},_generateColorPicker:function(){var colors=new Array("#000000","#000033","#000066","#000099","#0000CC","#0000FF","#330000","#330033","#330066","#330099","#3300CC","#3300FF","#660000","#660033","#660066","#660099","#6600CC","#6600FF","#990000","#990033","#990066","#990099","#9900CC","#9900FF","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#003300","#003333","#003366","#003399","#0033CC","#0033FF","#333300","#333333","#333366","#333399","#3333CC","#3333FF","#663300","#663333","#663366","#663399","#6633CC","#6633FF","#993300","#993333","#993366","#993399","#9933CC","#9933FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#006600","#006633","#006666","#006699","#0066CC","#0066FF","#336600","#336633","#336666","#336699","#3366CC","#3366FF","#666600","#666633","#666666","#666699","#6666CC","#6666FF","#996600","#996633","#996666","#996699","#9966CC","#9966FF","#CC6600","#CC6633","#CC6666","#CC6699","#CC66CC","#CC66FF","#FF6600","#FF6633","#FF6666","#FF6699","#FF66CC","#FF66FF","#009900","#009933","#009966","#009999","#0099CC","#0099FF","#339900","#339933","#339966","#339999","#3399CC","#3399FF","#669900","#669933","#669966","#669999","#6699CC","#6699FF","#999900","#999933","#999966","#999999","#9999CC","#9999FF","#CC9900","#CC9933","#CC9966","#CC9999","#CC99CC","#CC99FF","#FF9900","#FF9933","#FF9966","#FF9999","#FF99CC","#FF99FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#66CC00","#66CC33","#66CC66","#66CC99","#66CCCC","#66CCFF","#99CC00","#99CC33","#99CC66","#99CC99","#99CCCC","#99CCFF","#CCCC00","#CCCC33","#CCCC66","#CCCC99","#CCCCCC","#CCCCFF","#FFCC00","#FFCC33","#FFCC66","#FFCC99","#FFCCCC","#FFCCFF","#00FF00","#00FF33","#00FF66","#00FF99","#00FFCC","#00FFFF","#33FF00","#33FF33","#33FF66","#33FF99","#33FFCC","#33FFFF","#66FF00","#66FF33","#66FF66","#66FF99","#66FFCC","#66FFFF","#99FF00","#99FF33","#99FF66","#99FF99","#99FFCC","#99FFFF","#CCFF00","#CCFF33","#CCFF66","#CCFF99","#CCFFCC","#CCFFFF","#FFFF00","#FFFF33","#FFFF66","#FFFF99","#FFFFCC","#EEEEEE","#111111","#222222","#333333","#444444","#555555","#666666","#777777","#888888","#999999","#A5A5A5","#AAAAAA","#BBBBBB","#C3C3C3","#CCCCCC","#D2D2D2","#DDDDDD","#E1E1E1","#FFFFFF");var total=colors.length;var width=18;var html="<table border='1px' cellspacing='0' cellpadding='0'>";for(var i=0;i<total;i++)
|
||||
{if((i%width)==0){html+="<tr>";}
|
||||
html+='<td class="color" title="'+colors[i]+'" style="background-color:'+colors[i]+'"><label> </label></td>';if(((i+1)>=total)||(((i+1)%width)==0))
|
||||
{html+="</tr>";}}
|
||||
html+="</table>";return html}});$.fn.attachColorPicker=function(){return this.each(function(){var nodeName=this.nodeName.toLowerCase();if(nodeName=='input')
|
||||
{var inst=new ColorPickerInstance();$.colorPicker._connectColorPicker(this,inst);}});};$.fn.getValue=function(){var inst=(this.length>0?$.colorPicker._getInst(this[0]._colId):null);return(inst?inst._getValue():null);};$.fn.setValue=function(value){var inst=(this.length>0?$.colorPicker._getInst(this[0]._colId):null);if(inst)inst._setValue(value);};$(document).ready(function(){$.colorPicker=new colorPicker();$(document.body).append($.colorPicker._colorPickerDiv).mousedown($.colorPicker._checkExternalClick);});})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
(function(C){C.ui={plugin:{add:function(E,F,H){var G=C.ui[E].prototype;for(var D in H){G.plugins[D]=G.plugins[D]||[];G.plugins[D].push([F,H[D]])}},call:function(D,F,E){var H=D.plugins[F];if(!H){return }for(var G=0;G<H.length;G++){if(D.options[H[G][0]]){H[G][1].apply(D.element,E)}}}},cssCache:{},css:function(D){if(C.ui.cssCache[D]){return C.ui.cssCache[D]}var E=C('<div class="ui-resizable-gen">').addClass(D).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[D]=!!((!(/auto|default/).test(E.css("cursor"))||(/^[1-9]/).test(E.css("height"))||(/^[1-9]/).test(E.css("width"))||!(/none/).test(E.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(E.css("backgroundColor"))));try{C("body").get(0).removeChild(E.get(0))}catch(F){}return C.ui.cssCache[D]},disableSelection:function(D){D.unselectable="on";D.onselectstart=function(){return false};if(D.style){D.style.MozUserSelect="none"}},enableSelection:function(D){D.unselectable="off";D.onselectstart=function(){return true};if(D.style){D.style.MozUserSelect=""}},hasScroll:function(G,E){var D=/top/.test(E||"top")?"scrollTop":"scrollLeft",F=false;if(G[D]>0){return true}G[D]=1;F=G[D]>0?true:false;G[D]=0;return F}};var B=C.fn.remove;C.fn.remove=function(){C("*",this).add(this).trigger("remove");return B.apply(this,arguments)};function A(E,F,G){var D=C[E][F].getter||[];D=(typeof D=="string"?D.split(/,?\s+/):D);return(C.inArray(G,D)!=-1)}C.widget=function(E,D){var F=E.split(".")[0];E=E.split(".")[1];C.fn[E]=function(J){var H=(typeof J=="string"),I=Array.prototype.slice.call(arguments,1);if(H&&A(F,E,J)){var G=C.data(this[0],E);return(G?G[J].apply(G,I):undefined)}return this.each(function(){var K=C.data(this,E);if(H&&K&&C.isFunction(K[J])){K[J].apply(K,I)}else{if(!H){C.data(this,E,new C[F][E](this,J))}}})};C[F][E]=function(I,H){var G=this;this.widgetName=E;this.widgetBaseClass=F+"-"+E;this.options=C.extend({disabled:false},C[F][E].defaults,H);this.element=C(I).bind("setData."+E,function(L,J,K){return G.setData(J,K)}).bind("getData."+E,function(K,J){return G.getData(J)}).bind("remove",function(){return G.destroy()});this.init()};C[F][E].prototype=C.extend({},C.widget.prototype,D)};C.widget.prototype={init:function(){},destroy:function(){this.element.removeData(this.widgetName)},getData:function(D){return this.options[D]},setData:function(D,E){this.options[D]=E;if(D=="disabled"){this.element[E?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")}},enable:function(){this.setData("disabled",false)},disable:function(){this.setData("disabled",true)}};C.ui.mouse={mouseInit:function(){var D=this;this.element.bind("mousedown."+this.widgetName,function(E){return D.mouseDown(E)});if(C.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},mouseDestroy:function(){this.element.unbind("."+this.widgetName);(C.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},mouseDown:function(F){(this._mouseStarted&&this.mouseUp(F));this._mouseDownEvent=F;var E=this,G=(F.which==1),D=(typeof this.options.cancel=="string"?C(F.target).is(this.options.cancel):false);if(!G||D||!this.mouseCapture(F)){return true}this._mouseDelayMet=!this.options.delay;if(!this._mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){E._mouseDelayMet=true},this.options.delay)}if(this.mouseDistanceMet(F)&&this.mouseDelayMet(F)){this._mouseStarted=(this.mouseStart(F)!==false);if(!this._mouseStarted){F.preventDefault();return true}}this._mouseMoveDelegate=function(H){return E.mouseMove(H)};this._mouseUpDelegate=function(H){return E.mouseUp(H)};C(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false},mouseMove:function(D){if(C.browser.msie&&!D.button){return this.mouseUp(D)}if(this._mouseStarted){this.mouseDrag(D);return false}if(this.mouseDistanceMet(D)&&this.mouseDelayMet(D)){this._mouseStarted=(this.mouseStart(this._mouseDownEvent,D)!==false);(this._mouseStarted?this.mouseDrag(D):this.mouseUp(D))}return !this._mouseStarted},mouseUp:function(D){C(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this.mouseStop(D)}return false},mouseDistanceMet:function(D){return(Math.max(Math.abs(this._mouseDownEvent.pageX-D.pageX),Math.abs(this._mouseDownEvent.pageY-D.pageY))>=this.options.distance)},mouseDelayMet:function(D){return this._mouseDelayMet},mouseStart:function(D){},mouseDrag:function(D){},mouseStop:function(D){},mouseCapture:function(D){return true}};C.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery)
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,21 +1,21 @@
|
|||
|
||||
/* Function to hide/unhide a specific Div id */
|
||||
function toggleDiv (divid){
|
||||
if (document.getElementById(divid).style.display == 'none'){
|
||||
if (document.getElementById(divid).style.display == 'none') {
|
||||
document.getElementById(divid).style.display = 'block';
|
||||
} else {
|
||||
document.getElementById(divid).style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function winopeng(url,wid) {
|
||||
nueva_ventana=open(url,wid,"width=570,height=310,status=no,toolbar=no,menubar=no,scrollbar=no");
|
||||
// WARNING !! Internet Explorer DOESNT SUPPORT "-" CARACTERS IN WINDOW HANDLE VARIABLE
|
||||
status =wid;
|
||||
function winopeng (url, wid) {
|
||||
open (url, wid,"width=570,height=310,status=no,toolbar=no,menubar=no,scrollbar=no");
|
||||
// WARNING !! Internet Explorer DOESNT SUPPORT "-" CARACTERS IN WINDOW HANDLE VARIABLE
|
||||
status =wid;
|
||||
}
|
||||
|
||||
function pandora_help(help_id) {
|
||||
nueva_ventana=open("general/pandora_help.php?id="+help_id, "pandorahelp","width=600,height=500,status=no,toolbar=no,menubar=no,scrollbar=yes");
|
||||
open ("general/pandora_help.php?id="+help_id, "pandorahelp", "width=600,height=500,status=no,toolbar=no,menubar=no,scrollbar=yes");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -32,3 +32,4 @@ function html_entity_decode (str) {
|
|||
ta.innerHTML = str.replace (/</g, "<").replace (/>/g,">");
|
||||
return ta.value;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,83 @@
|
|||
/**************************************
|
||||
These functions require jQuery library
|
||||
**************************************/
|
||||
|
||||
/**
|
||||
* Draw a line between two elements in a div
|
||||
*
|
||||
* @param line Line to draw. JavaScript object with the following properties:
|
||||
- x1 X coordinate of the first point. If not set, it will get the coord from node_begin position
|
||||
- y1 Y coordinate of the first point. If not set, it will get the coord from node_begin position
|
||||
- x2 X coordinate of the second point. If not set, it will get the coord from node_end position
|
||||
- y2 Y coordinate of the second point. If not set, it will get the coord from node_end position
|
||||
- color Color of the line to draw
|
||||
- node_begin Id of the beginning node
|
||||
- node_end Id of the finishing node
|
||||
* @param id_div Div to draw the lines in
|
||||
*/
|
||||
function draw_line (line, id_div) {
|
||||
div = document.getElementById (id_div);
|
||||
brush = new jsGraphics (div);
|
||||
brush.setStroke (2);
|
||||
brush.setColor (line['color']);
|
||||
if (line['x1']) {
|
||||
x1 = line['x'];
|
||||
} else {
|
||||
x1 = parseInt ($('#'+line['node_begin']).css ('margin-left')) + 15;
|
||||
}
|
||||
if (line['y1']) {
|
||||
y1 = line['y1'];
|
||||
} else {
|
||||
y1 = parseInt ($('#'+line['node_begin']).css ('margin-top')) + 15;
|
||||
}
|
||||
if (line['x2']) {
|
||||
x2 = line['x2'];
|
||||
} else {
|
||||
x2 = parseInt ($('#'+line['node_end']).css ('margin-left')) + 15;
|
||||
}
|
||||
if (line['y2']) {
|
||||
y2 = line['y2'];
|
||||
} else {
|
||||
y2 = parseInt ($('#'+line['node_end']).css ('margin-top')) + 15;
|
||||
}
|
||||
brush.drawLine (x1, y1, x2, y2);
|
||||
brush.paint ();
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw all the lines in an array on a div
|
||||
*
|
||||
* @param lines Array with lines objects (see draw_line)
|
||||
* @param id_div Div to draw the lines in
|
||||
*/
|
||||
function draw_lines (lines, id_div) {
|
||||
jQuery.each (lines, function () {
|
||||
draw_line (this, id_div);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all the lines on a div
|
||||
*
|
||||
* The lines has the class 'map-line', so all the elements with this
|
||||
* class are removed.
|
||||
*
|
||||
* @param id_div Div to delete the lines in
|
||||
*/
|
||||
function delete_lines (id_div) {
|
||||
$('#' + id_div + ' .map-line').remove ();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Re-draw all the lines in an array on a div
|
||||
*
|
||||
* It deletes all the lines and create then again.
|
||||
*
|
||||
* @param lines Array with lines objects (see draw_line)
|
||||
* @param id_div Div to draw the lines in
|
||||
*/
|
||||
function refresh_lines (lines, id_div) {
|
||||
delete_lines (id_div);
|
||||
draw_lines (lines, id_div);
|
||||
}
|
|
@ -87,7 +87,7 @@ function pntN()
|
|||
|
||||
function mkDiv(x, y, w, h)
|
||||
{
|
||||
this.htm += '<div style="position:absolute;'+
|
||||
this.htm += '<div class="map-line" style="position:absolute;'+
|
||||
'left:' + x + 'px;'+
|
||||
'top:' + y + 'px;'+
|
||||
'width:' + w + 'px;'+
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
/* http://keith-wood.name/countdown.html
|
||||
* Spanish initialisation for the jQuery countdown extension
|
||||
* Written by Sergio Carracedo Martinez webmaster@neodisenoweb.com (2008) */
|
||||
$(document).ready(function() {
|
||||
$.countdown.regional['es'] = {
|
||||
labels: ['Años', 'Meses', 'Semanas', 'Dias', 'Horas', 'Minutos', 'Segundos'],
|
||||
labelsSingle: ['Años', 'Meses', 'Semanas', 'Dias', 'Horas', 'Minutos', 'Segundos'],
|
||||
compactLabels: ['a', 'm', 's', 'g'], compactLabelsSingle: ['a', 'm', 's', 'g'],
|
||||
timeSeparator: ':'};
|
||||
$.countdown.setDefaults($.countdown.regional['es']);
|
||||
});
|
|
@ -0,0 +1,11 @@
|
|||
/* http://keith-wood.name/countdown.html
|
||||
German initialisation for the jQuery countdown extension
|
||||
Written by Keith Wood (kbwood@virginbroadband.com.au) Jan 2008. */
|
||||
$(document).ready(function() {
|
||||
$.countdown.regional['de'] = {
|
||||
labels: ['Jahren', 'Monate', 'Wochen', 'Tage', 'Stunden', 'Minuten', 'Sekunden'],
|
||||
labelsSingle: ['Jahre', 'Monat', 'Woche', 'Tag', 'Stunde', 'Minute', 'Sekunde'],
|
||||
compactLabels: ['J', 'M', 'W', 'T'], compactLabelsSingle: ['J', 'M', 'W', 'T'],
|
||||
timeSeparator: ':'};
|
||||
$.countdown.setDefaults($.countdown.regional['de']);
|
||||
});
|
|
@ -0,0 +1 @@
|
|||
/* There's no need to add nothing here */
|
|
@ -0,0 +1,11 @@
|
|||
/* http://keith-wood.name/countdown.html
|
||||
* Spanish initialisation for the jQuery countdown extension
|
||||
* Written by Sergio Carracedo Martinez webmaster@neodisenoweb.com (2008) */
|
||||
$(document).ready(function() {
|
||||
$.countdown.regional['es'] = {
|
||||
labels: ['Años', 'Meses', 'Semanas', 'Dias', 'Horas', 'Minutos', 'Segundos'],
|
||||
labelsSingle: ['Años', 'Meses', 'Semanas', 'Dias', 'Horas', 'Minutos', 'Segundos'],
|
||||
compactLabels: ['a', 'm', 's', 'g'], compactLabelsSingle: ['a', 'm', 's', 'g'],
|
||||
timeSeparator: ':'};
|
||||
$.countdown.setDefaults($.countdown.regional['es']);
|
||||
});
|
|
@ -0,0 +1,11 @@
|
|||
/* http://keith-wood.name/countdown.html
|
||||
French initialisation for the jQuery countdown extension
|
||||
Written by Keith Wood (kbwood@virginbroadband.com.au) Jan 2008. */
|
||||
$(document).ready(function() {
|
||||
$.countdown.regional['fr'] = {
|
||||
labels: ['Années', 'Mois', 'Semaines', 'Jours', 'Heures', 'Minutes', 'Secondes'],
|
||||
labelsSingle: ['Année', 'Mois', 'Semaine', 'Jour', 'Heure', 'Minute', 'Seconde'],
|
||||
compactLabels: ['a', 'm', 's', 'j'], compactLabelsSingle: ['a', 'm', 's', 'j'],
|
||||
timeSeparator: ':'};
|
||||
$.countdown.setDefaults($.countdown.regional['fr']);
|
||||
});
|
|
@ -0,0 +1,11 @@
|
|||
/* http://keith-wood.name/countdown.html
|
||||
* Spanish initialisation for the jQuery countdown extension
|
||||
* Written by Sergio Carracedo Martinez webmaster@neodisenoweb.com (2008) */
|
||||
$(document).ready(function() {
|
||||
$.countdown.regional['es'] = {
|
||||
labels: ['Años', 'Meses', 'Semanas', 'Dias', 'Horas', 'Minutos', 'Segundos'],
|
||||
labelsSingle: ['Años', 'Meses', 'Semanas', 'Dias', 'Horas', 'Minutos', 'Segundos'],
|
||||
compactLabels: ['a', 'm', 's', 'g'], compactLabelsSingle: ['a', 'm', 's', 'g'],
|
||||
timeSeparator: ':'};
|
||||
$.countdown.setDefaults($.countdown.regional['es']);
|
||||
});
|
|
@ -0,0 +1,11 @@
|
|||
/* http://keith-wood.name/countdown.html
|
||||
* Italian initialisation for the jQuery countdown extension
|
||||
* Written by Davide Bellettini (davide.bellettini@gmail.com) Feb 2008. */
|
||||
$(document).ready(function() {
|
||||
$.countdown.regional['it'] = {
|
||||
labels: ['Anni', 'Mesi', 'Settimane', 'Giorni', 'Ore', 'Minuti', 'Secondi'],
|
||||
labelsSingle: ['Anni', 'Mesi', 'Settimane', 'Giorni', 'Ore', 'Minuti', 'Secondi'],
|
||||
compactLabels: ['a', 'm', 's', 'g'], compactLabelsSingle: ['a', 'm', 's', 'g'],
|
||||
timeSeparator: ':'};
|
||||
$.countdown.setDefaults($.countdown.regional['it']);
|
||||
});
|
|
@ -0,0 +1,11 @@
|
|||
/* http://keith-wood.name/countdown.html
|
||||
Brazilian initialisation for the jQuery countdown extension
|
||||
Translated by Marcelo Pellicano de Oliveira (pellicano@gmail.com) Feb 2008. */
|
||||
$(document).ready(function() {
|
||||
$.countdown.regional['pt-BR'] = {
|
||||
labels: ['Anos', 'Meses', 'Semanas', 'Dias', 'Horas', 'Minutos', 'Segundos'],
|
||||
labelsSingle: ['Anos', 'Meses', 'Semanas', 'Dias', 'Horas', 'Minutos', 'Segundos'],
|
||||
compactLabels: ['a', 'm', 's', 'd'], compactLabelsSingle: ['a', 'm', 's', 'd'],
|
||||
timeSeparator: ':'};
|
||||
$.countdown.setDefaults($.countdown.regional['pt-BR']);
|
||||
});
|
|
@ -0,0 +1,22 @@
|
|||
/* Inicialización en español para la extensión 'UI date picker' para jQuery. */
|
||||
/* Traducido por Vester (xvester@gmail.com). */
|
||||
jQuery(function($){
|
||||
$.datepicker.regional['es'] = {clearText: 'Limpiar', clearStatus: '',
|
||||
closeText: 'Cerrar', closeStatus: '',
|
||||
prevText: '<Ant', prevStatus: '',
|
||||
nextText: 'Sig>', nextStatus: '',
|
||||
currentText: 'Hoy', currentStatus: '',
|
||||
monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio',
|
||||
'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
|
||||
monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun',
|
||||
'Jul','Ago','Sep','Oct','Nov','Dic'],
|
||||
monthStatus: '', yearStatus: '',
|
||||
weekHeader: 'Sm', weekStatus: '',
|
||||
dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sádabo'],
|
||||
dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'],
|
||||
dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'],
|
||||
dayStatus: 'DD', dateStatus: 'D, M d',
|
||||
dateFormat: 'yy-mm-dd', firstDay: 1,
|
||||
initStatus: '', isRTL: false};
|
||||
$.datepicker.setDefaults($.datepicker.regional['es']);
|
||||
});
|
|
@ -0,0 +1,22 @@
|
|||
/* Inicialización en español para la extensión 'UI date picker' para jQuery. */
|
||||
/* Traducido por Vester (xvester@gmail.com). */
|
||||
jQuery(function($){
|
||||
$.datepicker.regional['es'] = {clearText: 'Limpiar', clearStatus: '',
|
||||
closeText: 'Cerrar', closeStatus: '',
|
||||
prevText: '<Ant', prevStatus: '',
|
||||
nextText: 'Sig>', nextStatus: '',
|
||||
currentText: 'Hoy', currentStatus: '',
|
||||
monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio',
|
||||
'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
|
||||
monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun',
|
||||
'Jul','Ago','Sep','Oct','Nov','Dic'],
|
||||
monthStatus: '', yearStatus: '',
|
||||
weekHeader: 'Sm', weekStatus: '',
|
||||
dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sádabo'],
|
||||
dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'],
|
||||
dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'],
|
||||
dayStatus: 'DD', dateStatus: 'D, M d',
|
||||
dateFormat: 'yy-mm-dd', firstDay: 1,
|
||||
initStatus: '', isRTL: false};
|
||||
$.datepicker.setDefaults($.datepicker.regional['es']);
|
||||
});
|
|
@ -0,0 +1,9 @@
|
|||
/* http://keith-wood.name/timeEntry.html
|
||||
Spanish initialisation for the jQuery time entry extension
|
||||
Written by diegok (diego@freekeylabs.com). */
|
||||
$(document).ready(function() {
|
||||
$.timeEntry.regional['es'] = {show24Hours: true, separator: ':',
|
||||
ampmPrefix: '', ampmNames: ['AM', 'PM'],
|
||||
spinnerTexts: ['Ahora', 'Campo anterior', 'Siguiente campo', 'Aumentar', 'Disminuir']};
|
||||
$.timeEntry.setDefaults($.timeEntry.regional['es']);
|
||||
});
|
|
@ -0,0 +1,9 @@
|
|||
/* http://keith-wood.name/timeEntry.html
|
||||
Spanish initialisation for the jQuery time entry extension
|
||||
Written by diegok (diego@freekeylabs.com). */
|
||||
$(document).ready(function() {
|
||||
$.timeEntry.regional['es'] = {show24Hours: true, separator: ':',
|
||||
ampmPrefix: '', ampmNames: ['AM', 'PM'],
|
||||
spinnerTexts: ['Ahora', 'Campo anterior', 'Siguiente campo', 'Aumentar', 'Disminuir']};
|
||||
$.timeEntry.setDefaults($.timeEntry.regional['es']);
|
||||
});
|
|
@ -0,0 +1,24 @@
|
|||
#ColorPickerDiv {
|
||||
display: block;
|
||||
display: none;
|
||||
position: relative;
|
||||
border: 1px solid #777;
|
||||
background: #fff
|
||||
}
|
||||
|
||||
#ColorPickerDiv td.color {
|
||||
cursor: pointer;
|
||||
font-size: xx-small;
|
||||
font-family: 'Arial' , 'Microsoft Sans Serif';
|
||||
}
|
||||
#ColorPickerDiv td.color label {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ColorPickerDivSample {
|
||||
margin: 0px 0px 0px 4px;
|
||||
border: solid 1px #000;
|
||||
padding: 0px 10px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/* countdown styles */
|
||||
#countdown {
|
||||
border: 1px dotted #990000;
|
||||
width: 200px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.countdown_row {
|
||||
clear: both;
|
||||
width: 200px;
|
||||
text-align: center;
|
||||
}
|
||||
.countdown_show1 div {
|
||||
width: 100%;
|
||||
}
|
||||
.countdown_show2 div {
|
||||
width: 50%;
|
||||
}
|
||||
.countdown_show3 div {
|
||||
width: 33%;
|
||||
}
|
||||
.countdown_show4 div {
|
||||
width: 25%;
|
||||
}
|
||||
.countdown_show5 div {
|
||||
width: 20%;
|
||||
}
|
||||
.countdown_show6 div {
|
||||
width: 16%;
|
||||
}
|
||||
.countdown_show7 div {
|
||||
width: 14%;
|
||||
}
|
||||
.countdown_section {
|
||||
float: left;
|
||||
font-size: 75%
|
||||
}
|
||||
.countdown_amount {
|
||||
font-size: 200%;
|
||||
}
|
||||
.countdown_descr {
|
||||
width: 200px;
|
||||
}
|
|
@ -400,13 +400,13 @@ td.datos_jus, td.datos2_jus {
|
|||
.w120 {
|
||||
width: 120px;
|
||||
}
|
||||
.w130 {
|
||||
.w130, #table-agent-configuration select {
|
||||
width: 130px;
|
||||
}
|
||||
.w135 {
|
||||
width: 135px;
|
||||
}
|
||||
.w155 {
|
||||
.w155, #table_layout_data select {
|
||||
width: 155px;
|
||||
}
|
||||
.top, .top_red, .bgt, td.datost, td.datos2t {
|
||||
|
@ -693,3 +693,27 @@ div#main_pure {
|
|||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#table-agent-configuration radio {
|
||||
margin-right: 40px;
|
||||
}
|
||||
|
||||
.ui-draggable {
|
||||
cursor:move;
|
||||
}
|
||||
|
||||
#layout_trash_drop {
|
||||
float: right;
|
||||
width: 300px;
|
||||
height: 180px;
|
||||
background: #fff url("../../images/trash.png") no-repeat bottom left;
|
||||
}
|
||||
|
||||
#layout_trash_drop div {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#layout_editor_drop {
|
||||
float: left;
|
||||
width: 300px;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ if (! isset($_SESSION["id_usuario"])) {
|
|||
}
|
||||
|
||||
?>
|
||||
<div class="tit bg">:: <?php echo $lang_label["operation_header"] ?> ::</div>
|
||||
<div class="tit bg">:: <?php echo lang_string ("operation_header") ?> ::</div>
|
||||
<div class="menuop" id="op">
|
||||
<?php
|
||||
|
||||
|
@ -39,7 +39,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
} else {
|
||||
echo '<div id="op1">';
|
||||
}
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=estado&sec2=operation/agentes/tactical&refr=60" class="mn">'.$lang_label["view_agents"].'</a></li></ul></div>';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=estado&sec2=operation/agentes/tactical&refr=60" class="mn">'.lang_string ("view_agents").'</a></li></ul></div>';
|
||||
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "estado"){
|
||||
|
||||
|
@ -48,14 +48,14 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
} else {
|
||||
echo "<div class='arrow'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=estado&sec2=operation/agentes/tactical&refr=60' class='mn'>".$lang_label["tactical_view"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=estado&sec2=operation/agentes/tactical&refr=60' class='mn'>".lang_string ("tactical_view")."</a></li></ul></div>";
|
||||
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/agentes/estado_grupo"){
|
||||
echo "<div class='arrows'>";
|
||||
} else {
|
||||
echo "<div class='arrow'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=estado&sec2=operation/agentes/estado_grupo&refr=60' class='mn'>".$lang_label["group_view_menu"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=estado&sec2=operation/agentes/estado_grupo&refr=60' class='mn'>".lang_string ("group_view_menu")."</a></li></ul></div>";
|
||||
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/agentes/networkmap"){
|
||||
echo "<div class='arrows'>";
|
||||
|
@ -69,28 +69,28 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
} else {
|
||||
echo "<div class='arrow'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60' class='mn'>".$lang_label["agent_detail"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60' class='mn'>".lang_string ("agent_detail")."</a></li></ul></div>";
|
||||
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/agentes/estado_alertas"){
|
||||
echo "<div class='arrows'>";
|
||||
} else {
|
||||
echo "<div class='arrow'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=estado&sec2=operation/agentes/estado_alertas&refr=60' class='mn'>".$lang_label["alert_detail"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=estado&sec2=operation/agentes/estado_alertas&refr=60' class='mn'>".lang_string ("alert_detail")."</a></li></ul></div>";
|
||||
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/agentes/status_monitor") {
|
||||
echo "<div class='arrows'>";
|
||||
} else {
|
||||
echo "<div class='arrow'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60' class='mn'>".$lang_label["detailed_monitoragent_state"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60' class='mn'>".lang_string ("detailed_monitoragent_state")."</a></li></ul></div>";
|
||||
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/agentes/exportdata") {
|
||||
echo "<div class='arrows'>";
|
||||
} else {
|
||||
echo "<div class='arrow'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=estado&sec2=operation/agentes/exportdata' class='mn'>".$lang_label["export_data"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=estado&sec2=operation/agentes/exportdata' class='mn'>".lang_string ("export_data")."</a></li></ul></div>";
|
||||
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
echo '<div id="op9">';
|
||||
}
|
||||
echo '<ul class="mn"><li>';
|
||||
echo '<a href="index.php?sec=visualc&sec2=operation/visual_console/index" class="mn">'.$lang_label["visual_console"].'</a></li></ul></div>';
|
||||
echo '<a href="index.php?sec=visualc&sec2=operation/visual_console/index" class="mn">'.lang_string ("visual_console").'</a></li></ul></div>';
|
||||
|
||||
if ( isset($_GET["sec"]) && $_GET["sec"] == "visualc") {
|
||||
$sql="SELECT * FROM tlayout";
|
||||
|
@ -127,7 +127,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
echo '<div id="op2">';
|
||||
}
|
||||
echo '<ul class="mn"><li>';
|
||||
echo '<a href="index.php?sec=estado_server&sec2=operation/servers/view_server&refr=60" class="mn">'.$lang_label["view_servers"].'</a></li></ul></div>';
|
||||
echo '<a href="index.php?sec=estado_server&sec2=operation/servers/view_server&refr=60" class="mn">'.lang_string ("view_servers").'</a></li></ul></div>';
|
||||
}
|
||||
|
||||
|
||||
|
@ -138,7 +138,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "IR")==1) {
|
|||
} else {
|
||||
echo '<div id="op3">';
|
||||
}
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=incidencias&sec2=operation/incidents/incident" class="mn">'.$lang_label["manage_incidents"].'</a></li></ul></div>';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=incidencias&sec2=operation/incidents/incident" class="mn">'.lang_string ("manage_incidents").'</a></li></ul></div>';
|
||||
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "incidencias"){
|
||||
if(isset($_GET["sec2"]) && $_GET["sec2"] == "operation/incidents/incident_search") {
|
||||
|
@ -146,14 +146,14 @@ if (give_acl($_SESSION["id_usuario"], 0, "IR")==1) {
|
|||
} else {
|
||||
echo "<div class='arrow'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=incidencias&sec2=operation/incidents/incident_search' class='mn'>".$lang_label["search_incident"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=incidencias&sec2=operation/incidents/incident_search' class='mn'>".lang_string ("search_incident")."</a></li></ul></div>";
|
||||
|
||||
if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/incidents/incident_statistics") {
|
||||
echo "<div class='arrows'>";
|
||||
} else {
|
||||
echo "<div class='arrow'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=incidencias&sec2=operation/incidents/incident_statistics' class='mn'>".$lang_label["statistics"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=incidencias&sec2=operation/incidents/incident_statistics' class='mn'>".lang_string ("statistics")."</a></li></ul></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
} else {
|
||||
echo '<div id="op4">';
|
||||
}
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=eventos&sec2=operation/events/events" class="mn">'.$lang_label["view_events"].'</a></li></ul></div>';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=eventos&sec2=operation/events/events" class="mn">'.lang_string ("view_events").'</a></li></ul></div>';
|
||||
// Event statistics submenu
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "eventos"){
|
||||
if(isset($_GET["sec2"]) && $_GET["sec2"] == "operation/events/event_statistics") {
|
||||
|
@ -175,7 +175,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
} else {
|
||||
echo "<div class='arrow'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=eventos&sec2=operation/events/event_statistics' class='mn'>".$lang_label["statistics"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=eventos&sec2=operation/events/event_statistics' class='mn'>".lang_string ("statistics")."</a></li></ul></div>";
|
||||
}
|
||||
|
||||
// Users
|
||||
|
@ -184,7 +184,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
} else {
|
||||
echo '<div id="op5">';
|
||||
}
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=usuarios&sec2=operation/users/user" class="mn">'.$lang_label["view_users"].'</a></li></ul></div>';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=usuarios&sec2=operation/users/user" class="mn">'.lang_string ("view_users").'</a></li></ul></div>';
|
||||
|
||||
// User edit (submenu)
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "usuarios"){
|
||||
|
@ -193,7 +193,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
} else {
|
||||
echo "<div class='arrow'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=usuarios&sec2=operation/users/user_edit&ver=".$_SESSION["id_usuario"]."' class='mn'>".$lang_label["index_myuser"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=usuarios&sec2=operation/users/user_edit&ver=".$_SESSION["id_usuario"]."' class='mn'>".lang_string ("index_myuser")."</a></li></ul></div>";
|
||||
|
||||
// User statistics require UM
|
||||
if (give_acl($_SESSION["id_usuario"], 0, "UM")==1) {
|
||||
|
@ -202,7 +202,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
} else {
|
||||
echo "<div class='arrow'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=usuarios&sec2=operation/users/user_statistics' class='mn'>".$lang_label["statistics"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=usuarios&sec2=operation/users/user_statistics' class='mn'>".lang_string ("statistics")."</a></li></ul></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
} else {
|
||||
echo '<div id="op6">';
|
||||
}
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&refr=30" class="mn">'.$lang_label["SNMP_console"].'</a></li></ul></div>';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view&refr=30" class="mn">'.lang_string ("SNMP_console").'</a></li></ul></div>';
|
||||
|
||||
if ((give_acl($_SESSION["id_usuario"], 0, "AW")==1)){
|
||||
// SNMP Console alert (submenu)
|
||||
|
@ -222,7 +222,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
} else {
|
||||
echo "<div class='arrow'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_alert' class='mn'>".$lang_label["snmp_console_alert"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_alert' class='mn'>".lang_string ("snmp_console_alert")."</a></li></ul></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -232,7 +232,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
} else {
|
||||
echo '<div id="op7">';
|
||||
}
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=messages&sec2=operation/messages/message" class="mn">'. $lang_label["messages"].'</a></li></ul></div>';
|
||||
echo '<ul class="mn"><li><a href="index.php?sec=messages&sec2=operation/messages/message" class="mn">'. lang_string ("messages").'</a></li></ul></div>';
|
||||
|
||||
// New message (submenu)
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "messages"){
|
||||
|
@ -241,7 +241,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
} else {
|
||||
echo "<div class='arrow'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=messages&sec2=operation/messages/message&nuevo_g' class='mn'>".$lang_label["messages_g"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=messages&sec2=operation/messages/message&nuevo_g' class='mn'>".lang_string ("messages_g")."</a></li></ul></div>";
|
||||
}
|
||||
|
||||
// Reporting
|
||||
|
@ -258,7 +258,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
} else {
|
||||
echo '<li class="bb0">';
|
||||
}
|
||||
echo '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer" class="mn">'. $lang_label["reporting"].'</a></li></ul></div>';
|
||||
echo '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer" class="mn">'. lang_string ("reporting").'</a></li></ul></div>';
|
||||
|
||||
// Custom reporting
|
||||
if (isset($_GET["sec"]) && $_GET["sec"] == "reporting"){
|
||||
|
@ -269,7 +269,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
} else {
|
||||
echo "<div class='arrow'>";
|
||||
}
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=reporting&sec2=operation/reporting/custom_reporting' class='mn'>".$lang_label["custom_reporting"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li><a href='index.php?sec=reporting&sec2=operation/reporting/custom_reporting' class='mn'>".lang_string ("custom_reporting")."</a></li></ul></div>";
|
||||
}
|
||||
|
||||
// Custom graph viewer
|
||||
|
@ -279,7 +279,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
|
|||
} else {
|
||||
echo "<div class='arrow'>";
|
||||
}
|
||||
echo "<ul class='mn'><li class='bb0'><a href='index.php?sec=reporting&sec2=operation/reporting/graph_viewer' class='mn'>".$lang_label["custom_graphs"]."</a></li></ul></div>";
|
||||
echo "<ul class='mn'><li class='bb0'><a href='index.php?sec=reporting&sec2=operation/reporting/graph_viewer' class='mn'>".lang_string ("custom_graphs")."</a></li></ul></div>";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?PHP
|
||||
<?php
|
||||
|
||||
// Pandora FMS - the Free monitoring system
|
||||
// ========================================
|
||||
|
@ -86,6 +86,7 @@ echo '</form>';
|
|||
<link rel="stylesheet" href="include/styles/datepicker.css" type="text/css" media="screen">
|
||||
<link rel="stylesheet" href="include/styles/timeentry.css" type="text/css" media="screen">
|
||||
<script type="text/javascript" src="include/javascript/jquery.js"></script>
|
||||
<script src="include/javascript/jquery.ui.core.js"></script>
|
||||
<script src="include/javascript/jquery.ui.datepicker.js"></script>
|
||||
<script src="include/languages/date_<?= $config['language'] ?>.js"></script>
|
||||
<script src="include/languages/time_<?= $config['language'] ?>.js"></script>
|
||||
|
|
|
@ -29,45 +29,39 @@ if (comprueba_login() != 0) {
|
|||
|
||||
echo "<h2>".$lang_label["visual_console"]." > ";
|
||||
echo $lang_label["summary"]."</h2>";
|
||||
$sql="SELECT * FROM tlayout";
|
||||
$res=mysql_query($sql);
|
||||
|
||||
if (mysql_num_rows($res)) {
|
||||
$layouts = get_db_all_rows_in_table ('tlayout');
|
||||
|
||||
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox_frame'>";
|
||||
echo "<tr>
|
||||
<th>".$lang_label["name"]."</th>
|
||||
<th>".$lang_label["group"]."</th>
|
||||
<th>".$lang_label["elements"]."</th>
|
||||
<th>".$lang_label["view"]."</th>";
|
||||
$color=1;
|
||||
while ($row = mysql_fetch_array($res)){
|
||||
// Calculate table line color
|
||||
if ($color == 1){
|
||||
$tdcolor = "datos";
|
||||
$color = 0;
|
||||
}
|
||||
else {
|
||||
$tdcolor = "datos2";
|
||||
$color = 1;
|
||||
}
|
||||
echo "<tr>";
|
||||
// Name
|
||||
echo "<td valign='top' class='$tdcolor'>".$row["name"]."</td>";
|
||||
$id_layout = $row["id"];
|
||||
// Group
|
||||
echo "<td valign='top' align='center' class='$tdcolor'><img src='images/".dame_grupo_icono($row["id_group"]).".png'></td>";
|
||||
// # elements
|
||||
$sql2="SELECT COUNT(*) FROM tlayout_data WHERE id_layout = $id_layout";
|
||||
$res2=mysql_query($sql2);
|
||||
$row2 = mysql_fetch_array($res2);
|
||||
echo "<td valign='top'align='center' class='$tdcolor'>".$row2[0]."</td>";
|
||||
// View icon
|
||||
echo "<td valign='middle' class='$tdcolor' align='center'><a href='index.php?sec=visualc&sec2=operation/visual_console/render_view&id=$id_layout'><img src='images/images.png'></a></td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
} else {
|
||||
if (sizeof ($layouts) == 0) {
|
||||
echo "<div class='nf'>".$lang_label["no_layout_def"]."</div>";
|
||||
return;
|
||||
}
|
||||
|
||||
$table->width = '500px';
|
||||
$table->data = array ();
|
||||
$table->head = array ();
|
||||
$table->head[0] = lang_string ('name');
|
||||
$table->head[1] = lang_string ('group');
|
||||
$table->head[2] = lang_string ('elements');
|
||||
$table->head[3] = lang_string ('view');
|
||||
$table->align = array ();
|
||||
$table->align[2] = 'center';
|
||||
$table->align[3] = 'center';
|
||||
|
||||
foreach ($layouts as $layout) {
|
||||
$data = array ();
|
||||
|
||||
$data[0] = $layout['name'];
|
||||
$data[1] = '<img src="images/'.dame_grupo_icono($layout["id_group"]).'.png"
|
||||
title="'.dame_nombre_grupo ($layout["id_group"]).'"> ';
|
||||
$data[1] .= dame_nombre_grupo ($layout["id_group"]);
|
||||
$data[2] = get_db_value ('COUNT(*)', 'tlayout_data', 'id_layout', $layout['id']);
|
||||
$data[3] = '<a href="index.php?sec=visualc&sec2=operation/visual_console/render_view&id='.
|
||||
$layout['id'].'"><img src="images/images.png"></a>';
|
||||
|
||||
array_push ($table->data, $data);
|
||||
}
|
||||
|
||||
print_table ($table);
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?PHP
|
||||
<?php
|
||||
|
||||
// Pandora FMS - the Free monitoring system
|
||||
// ========================================
|
||||
|
@ -17,42 +17,44 @@
|
|||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
|
||||
// Login check
|
||||
global $config;
|
||||
global $REMOTE_ADDR;
|
||||
|
||||
require ('include/functions_visual_map.php');
|
||||
|
||||
if (comprueba_login() != 0) {
|
||||
audit_db($config["id_user"],$REMOTE_ADDR, "ACL Violation","Trying to access graph builder");
|
||||
include ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$id_layout = (int) get_parameter ('id');
|
||||
$refr = (int) get_parameter ('refr');
|
||||
|
||||
// Get input parameter for layout id
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if (isset($_GET["id"])){
|
||||
$id_layout = $_GET["id"];
|
||||
$sql="SELECT * FROM tlayout WHERE id = $id_layout";
|
||||
$res=mysql_query($sql);
|
||||
if ($row = mysql_fetch_array($res)){
|
||||
$id_group = $row["id_group"];
|
||||
$layout_name = $row["name"];
|
||||
$fullscreen = $row["fullscreen"];
|
||||
$background = $row["background"];
|
||||
$bwidth = $row["width"];
|
||||
$bheight = $row["height"];
|
||||
} else {
|
||||
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access visual console without id layout");
|
||||
include ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
if (! $id_layout) {
|
||||
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access visual console without id layout");
|
||||
include ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$refr = get_parameter ("refr", 0);
|
||||
$layout = get_db_row ('tlayout', 'id', $id_layout);
|
||||
|
||||
if (! $layout) {
|
||||
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access visual console without id layout");
|
||||
include ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$id_group = $layout["id_group"];
|
||||
$layout_name = $layout["name"];
|
||||
$fullscreen = $layout["fullscreen"];
|
||||
$background = $layout["background"];
|
||||
$bwidth = $layout["width"];
|
||||
$bheight = $layout["height"];
|
||||
|
||||
$pure_url = "&pure=".$config["pure"];
|
||||
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -61,179 +63,67 @@ $pure_url = "&pure=".$config["pure"];
|
|||
echo "<h1>".$layout_name;
|
||||
|
||||
if ($config["pure"] == 0){
|
||||
echo lang_string("Full screen mode");
|
||||
echo " ";
|
||||
echo "<a href='index.php?sec=visualc&sec2=operation/visual_console/render_view&id=$id_layout&refr=$refr&pure=1'>";
|
||||
echo "<img src='images/monitor.png' title='".lang_string("Full screen mode")."'>";
|
||||
echo "</a>";
|
||||
echo lang_string("Full screen mode");
|
||||
echo " ";
|
||||
echo "<a href='index.php?sec=visualc&sec2=operation/visual_console/render_view&id=$id_layout&refr=$refr&pure=1'>";
|
||||
echo "<img src='images/monitor.png' title='".lang_string("Full screen mode")."'>";
|
||||
echo "</a>";
|
||||
} else {
|
||||
echo lang_string("Back to normal mode");
|
||||
echo " ";
|
||||
echo "<a href='index.php?sec=visualc&sec2=operation/visual_console/render_view&id=$id_layout&pure=0&refr=$refr'>";
|
||||
echo "<img src='images/monitor.png' title='".lang_string("Back to normal mode")."'>";
|
||||
echo "</a>";
|
||||
echo lang_string("Back to normal mode");
|
||||
echo " ";
|
||||
echo "<a href='index.php?sec=visualc&sec2=operation/visual_console/render_view&id=$id_layout&pure=0&refr=$refr'>";
|
||||
echo "<img src='images/monitor.png' title='".lang_string("Back to normal mode")."'>";
|
||||
echo "</a>";
|
||||
}
|
||||
|
||||
echo "</h1>";
|
||||
|
||||
echo "<div id='layout_db' style='z-index: 0; position:relative; background: url(images/console/background/".$background."); width:".$bwidth."px; height:".$bheight."px;'>";
|
||||
$sql="SELECT * FROM tlayout_data WHERE id_layout = $id_layout";
|
||||
$res=mysql_query($sql);
|
||||
$lines = 0;
|
||||
while ($row = mysql_fetch_array($res)){
|
||||
$id_agentmodule = $row["id_agente_modulo"];
|
||||
$pos_x = $row["pos_x"];
|
||||
$pos_y = $row["pos_y"];
|
||||
$height = $row["height"];
|
||||
$width = $row["width"];
|
||||
$period = $row["period"];
|
||||
$image = $row["image"];
|
||||
$type = $row["type"];
|
||||
$label = $row["label"];
|
||||
$label_color = $row["label_color"];
|
||||
$parent_item = $row["parent_item"];
|
||||
$link_layout = $row["id_layout_linked"];
|
||||
$no_link_color = $row["no_link_color"];
|
||||
|
||||
// Linked to other layout ?? - Only if not module defined
|
||||
if (($link_layout != 0) && ($id_agentmodule == 0)) {
|
||||
$status = return_status_layout ($link_layout);
|
||||
} else {
|
||||
$id_agent = get_db_value ("id_agente", "tagente_estado", "id_agente_modulo", $id_agentmodule);
|
||||
$id_agent_module_parent = get_db_value ("id_agente_modulo", "tlayout_data", "id", $parent_item);
|
||||
// Item value
|
||||
$status = return_status_agent_module ($id_agentmodule);
|
||||
if ($no_link_color == 1)
|
||||
$status_parent = -1;
|
||||
else
|
||||
$status_parent = return_status_agent_module ($id_agent_module_parent);
|
||||
}
|
||||
|
||||
// STATIC IMAGE (type = 0)
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if ($type == 0) {
|
||||
// Link image
|
||||
//index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1
|
||||
if (($link_layout == "") OR ($link_layout == 0)){
|
||||
$link_string = "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agent&tab=data'>";
|
||||
} else {
|
||||
$link_string = "<a href='index.php?sec=visualc&sec2=operation/visual_console/render_view$pure_url&id=$link_layout'>";
|
||||
}
|
||||
// Draw image
|
||||
echo "<div style='z-index: 1; color: #".$label_color."; position: absolute; margin-left: ".$pos_x."px; margin-top:".$pos_y."px; '>";
|
||||
echo $link_string;
|
||||
if ($status == 0){
|
||||
if (($width != "") AND ($width != 0))
|
||||
echo "<img src='images/console/icons/".$image."_bad.png' width='$width' height='$height' title='$label'>";
|
||||
else
|
||||
echo "<img src='images/console/icons/".$image."_bad.png' title='$label'>";
|
||||
} else {
|
||||
if (($width != "") AND ($width != 0))
|
||||
echo "<img src='images/console/icons/".$image."_ok.png' width='$width' height='$height' title='$label'>";
|
||||
else
|
||||
echo "<img src='images/console/icons/".$image."_ok.png' title='$label'>";
|
||||
}
|
||||
echo "</A>";
|
||||
|
||||
// Draw label
|
||||
echo "<br>";
|
||||
echo $label;
|
||||
echo "</div>";
|
||||
}
|
||||
// SINGLE GRAPH (type = 1)
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if ($type == 1) { // single graph
|
||||
if (($link_layout == "") OR ($link_layout == 0)){
|
||||
$link_string = "<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=$id_agent&tab=data'>";
|
||||
} else {
|
||||
$link_string = "<a href='http://index.php?sec=visualc&sec2=operation/visual_console/render_view$pure_url&id=$link_layout'>";
|
||||
}
|
||||
// Draw image
|
||||
echo "<div style='z-index: 1; color: #".$label_color."; position: absolute; margin-left: ".$pos_x."px; margin-top:".$pos_y."px; '>";
|
||||
echo $link_string;
|
||||
echo "<img src='reporting/fgraph.php?tipo=sparse&id=$id_agentmodule&label=$label&height=$height&width=$width&period=$period' border=0>";
|
||||
echo "</A>";
|
||||
echo "</div>";
|
||||
}
|
||||
if ($type == 2){
|
||||
$lines_data[$lines][0]=$pos_x;
|
||||
$lines_data[$lines][1]=$pos_y;
|
||||
$lines_data[$lines][2]=$width;
|
||||
$lines_data[$lines][3]=$height;
|
||||
$lines_data[$lines][4]="#".$label_color;
|
||||
$lines++;
|
||||
}
|
||||
|
||||
// Get parent relationship - Create line data
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if (($parent_item != "") AND ($parent_item != 0)){
|
||||
$ppos_x = return_coordinate_X_layoutdata($parent_item);
|
||||
$ppos_y = return_coordinate_Y_layoutdata($parent_item);
|
||||
$lines_data[$lines][0]=$pos_x+15;
|
||||
$lines_data[$lines][1]=$pos_y+15;
|
||||
$lines_data[$lines][2]=$ppos_x+15;
|
||||
$lines_data[$lines][3]=$ppos_y+15;
|
||||
$lines_data[$lines][4]=$status_parent;
|
||||
$lines++;
|
||||
}
|
||||
if ($refr) {
|
||||
echo '<div id="countdown">';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
// Javascript code generated on realtime to draw lines
|
||||
// http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm#docu
|
||||
echo '<script type="text/javascript">';
|
||||
echo 'function myDrawFunction(){';
|
||||
|
||||
for ($a=0; $a < $lines; $a++){
|
||||
echo " jg_doc_$a.setStroke(2);";
|
||||
|
||||
if (substr($lines_data[$a][4],0,1) == "#")
|
||||
echo " jg_doc_$a.setColor('".$lines_data[$a][4]."');"; // CUSTOM COLOR
|
||||
elseif ($lines_data[$a][4] >= 1)
|
||||
echo " jg_doc_$a.setColor('00dd00');"; // GREEN
|
||||
elseif ($lines_data[$a][4] == 0)
|
||||
echo " jg_doc_$a.setColor('#dd0000');"; // RED
|
||||
else
|
||||
echo " jg_doc_$a.setColor('#BBBBBB');"; // GREY
|
||||
echo " jg_doc_$a.drawLine(".$lines_data[$a][0].",".$lines_data[$a][1].",".$lines_data[$a][2].",".$lines_data[$a][3].");";
|
||||
echo " jg_doc_$a.paint();";
|
||||
}
|
||||
|
||||
echo '}';
|
||||
|
||||
echo "var cnv = document.getElementById('layout_db');";
|
||||
for ($a=0; $a < $lines; $a++){
|
||||
echo "var jg_doc_$a = new jsGraphics(cnv);";
|
||||
}
|
||||
echo "myDrawFunction();";
|
||||
echo "//--></script>";
|
||||
|
||||
// End main div
|
||||
echo "</div>";
|
||||
print_pandora_visual_map ($id_layout);
|
||||
|
||||
echo "<div style='height:30px'>";
|
||||
echo "</div>";
|
||||
|
||||
echo "<form method='post' action='index.php?sec=visualc&sec2=operation/visual_console/render_view$pure_url&id=$id_layout'>";
|
||||
echo "<table width=300 cellpadding=4 cellspacing=4 class='databox'>";
|
||||
echo "<tr><td>";
|
||||
echo $lang_label["auto_refresh_time"];
|
||||
echo "<td>";
|
||||
echo "<select name='refr'>";
|
||||
if ($refr > 0){
|
||||
echo "<option value=$refr> $refr ".$lang_label["seconds"];
|
||||
}
|
||||
$refresh_values = array ();
|
||||
$refresh_values[5] = "5 ". lang_string ('seconds');
|
||||
$refresh_values[30] = "30 ". lang_string ('seconds');
|
||||
$refresh_values[60] = "1 ". lang_string ('minutes');
|
||||
$refresh_values[120] = "2 ". lang_string ('minutes');
|
||||
$refresh_values[300] = "5 ". lang_string ('minutes');
|
||||
$refresh_values[600] = "10 ". lang_string ('minutes');
|
||||
$refresh_values[1800] = "30 ". lang_string ('minutes');
|
||||
|
||||
echo "<option value=0>".$lang_label["N/A"];
|
||||
echo "<option value=5>5 ".$lang_label["seconds"];
|
||||
echo "<option value=30>30 ".$lang_label["seconds"];
|
||||
echo "<option value=60>1 ".$lang_label["minutes"];
|
||||
echo "<option value=120>2 ".$lang_label["minutes"];
|
||||
echo "<option value=300>5 ".$lang_label["minutes"];
|
||||
echo "<option value=600>10 ".$lang_label["minutes"];
|
||||
echo "<option value=1800>30 ".$lang_label["minutes"];
|
||||
echo "</select>";
|
||||
echo "<td>";
|
||||
echo "<input type='submit' class='sub next' value='".$lang_label["refresh"]."'>";
|
||||
echo "</table>";
|
||||
$table->width = '300px';
|
||||
$table->data = array ();
|
||||
$table->data[0][0] = lang_string ('auto_refresh_time');
|
||||
$table->data[0][1] = print_select ($refresh_values, 'refr', $refr, '', 'N/A', 0, true);
|
||||
$table->data[0][2] = print_submit_button (lang_string ('refresh'), '', false, 'class="sub next"', true);
|
||||
|
||||
echo '<form method="post" action="index.php?sec=visualc&sec2=operation/visual_console/render_view">';
|
||||
print_input_hidden ('pure', $config["pure"]);
|
||||
print_input_hidden ('id', $id_layout);
|
||||
print_table ($table);
|
||||
echo "</form>";
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="include/styles/countdown.css" type="text/css" />
|
||||
<script type="text/javascript" src="include/javascript/jquery.js"></script>
|
||||
<script type="text/javascript" src="include/javascript/jquery.countdown.js"></script>
|
||||
<script type="text/javascript" src="include/languages/countdown_<?=$config['language']?>.js"></script>
|
||||
<script type="text/javascript" src="include/javascript/pandora_visual_console.js"></script>
|
||||
<script language="javascript" type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
<?php if ($refr) : ?>
|
||||
t = new Date();
|
||||
t.setTime (t.getTime() + <?=$refr * 1000?>);
|
||||
console.log (t);
|
||||
$.countdown.setDefaults($.countdown.regional["<?=$config['language']?>"]);
|
||||
$("#countdown").countdown({until: t, format: 'MS', description: '<?=lang_string ("Until refresh")?>'});
|
||||
<?php endif; ?>
|
||||
draw_lines (lines, 'layout_map');
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -373,7 +373,7 @@ function graphic_combined_module ($module_list, $weight_list, $periodo, $width,
|
|||
}
|
||||
|
||||
function grafico_modulo_sparse ($id_agente_modulo, $periodo, $show_event,
|
||||
$width, $height , $title, $unit_name, $show_alert, $avg_only = 0, $pure = 0, $date = 0 ) {
|
||||
$width, $height , $title, $unit_name, $show_alert, $avg_only = 0, $pure = 0, $date = 0) {
|
||||
include ("../include/config.php");
|
||||
require ("../include/languages/language_".$config['language'].".php");
|
||||
require_once 'Image/Graph.php';
|
||||
|
@ -459,6 +459,10 @@ function grafico_modulo_sparse ($id_agente_modulo, $periodo, $show_event,
|
|||
WHERE id_agente = %d AND id_agente_modulo = %d AND utimestamp > %d',
|
||||
$id_agente, $id_agente_modulo, $fechatope);
|
||||
$result = mysql_query ($sql);
|
||||
if (mysql_num_rows ($result) == 0) {
|
||||
graphic_error ();
|
||||
return;
|
||||
}
|
||||
while ($row = mysql_fetch_array ($result)) {
|
||||
$datos = $row[0];
|
||||
$utimestamp = $row[1];
|
||||
|
|
Loading…
Reference in New Issue