2007-06-21 Sancho Lerena <slerena@artica.es>

* include/languages/language_en.php: More new tokens added.

        * include/functions.php: Added function render time for alert time
        limiters format (multiplier of 30).

        * pandoradb.sql: Added support for alert time limiters format.

        * operation/visual_console/render_view.php: Added support for
        single lines a few fixes.

        * images/console/background/globalmap.jpg: Nice world background.

        * images/console/icons/computer.png: Added new icon for workstation.

        * godmode/agentes/configurar_agente.ph,
        godmode/agentes/alert_manager.php: Added support for alert time
        limiters.

        * godmode/reporting/map_builder.php: Tool to build/manage maps
        elements. Finished!.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@529 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2007-06-21 15:48:47 +00:00
parent e1993d412b
commit ff334cefc8
19 changed files with 322 additions and 92 deletions

View File

@ -1,3 +1,27 @@
2007-06-21 Sancho Lerena <slerena@artica.es>
* include/languages/language_en.php: More new tokens added.
* include/functions.php: Added function render time for alert time
limiters format (multiplier of 30).
* pandoradb.sql: Added support for alert time limiters format.
* operation/visual_console/render_view.php: Added support for
single lines a few fixes.
* images/console/background/globalmap.jpg: Nice world background.
* images/console/icons/computer.png: Added new icon for workstation.
* godmode/agentes/configurar_agente.ph,
godmode/agentes/alert_manager.php: Added support for alert time
limiters.
* godmode/reporting/map_builder.php: Tool to build/manage maps
elements. Finished!.
2007-06-19 Manuel Arostegui <marostegui@artica.es>
* pandora_console.spec: Ready for 1.3 packaging.
@ -6,7 +30,8 @@
* include/languages/language_en.php: Updated text.
* include/styles/pandora.css: Removed lb style not uses. Added ok style.
* include/styles/pandora.css: Removed lb style not uses. Added ok
style.
* operation/agentes/estado_grupo.php: Changed old td.lb style to th.
@ -15,8 +40,8 @@
* operation/events/events.php: Use ok style. Closed table.
* operation/agentes/estado_ultimopaquete.php,
godmode/agentes/configurar_agente.php, godmode/agentes/module_manager.php:
Closed html tags.
godmode/agentes/configurar_agente.php,
godmode/agentes/module_manager.php: Closed html tags.
2007-06-17 Sancho Lerena <slerena@artica.es>

View File

@ -87,7 +87,7 @@ $result=mysql_query($sql1);
else
$mymax = $row3["dis_max"];
$mymax = format_for_graph($mymax );
// We have alert text ?
if ($row3["alert_text"] != "")
$string = $string."<td colspan=2 class='$tdcolor'>".$lang_label["text"];
@ -95,6 +95,14 @@ $result=mysql_query($sql1);
$string = $string."<td class='$tdcolor'>".$mymin;
$string = $string."<td class='$tdcolor'>".$mymax;
}
$mytimefrom =$row3["time_from"];
$mytimeto =$row3["time_to"];
$string = $string."<td class='$tdcolor'>";
if ($mytimeto == $mytimefrom)
$string .= $lang_label["N/A"];
else
$string .= render_time($mytimefrom)." - ".render_time($mytimeto);
$string = $string."<td class='$tdcolor'>".salida_limpia($row3["descripcion"]);
$string = $string."<td class='$tdcolor'>";
$id_grupo = dame_id_grupo($id_agente);
@ -112,13 +120,14 @@ $result=mysql_query($sql1);
}
}
if (isset($string) & $string!='') {
echo "<table cellpadding='4' cellspacing='4' width='720' class='databox'>
echo "<table cellpadding='4' cellspacing='4' width='750' class='databox'>
<tr><th>".$lang_label["name"]."</th>
<th>".$lang_label["type"]."</th>
<th>".$lang_label["alert"]."</th>
<th>".$lang_label["threshold"]."</th>
<th>".$lang_label["min."]."</th>
<th>".$lang_label["max."]."</th>
<th>".$lang_label["time"]."</th>
<th>".$lang_label["description"]."</th>
<th width='50'>".$lang_label["action"]."</th></tr>";
echo $string;
@ -234,36 +243,68 @@ _timestamp_<br>
_data_<br>
</span></a>
<tr><td class="datos2"><?php echo $lang_label["time_threshold"] ?>
<?PHP
echo "<tr><td class='datos2'>".$lang_label["time_from"];
echo "<td class='datos2'><select name='time_from'>";
if ($time_from != ""){
echo "<option value='$time_from'>".render_time($time_from);
}
for ($a=0; $a < 48; $a++){
echo "<option value='";
echo $a;
echo "'>";
echo render_time ($a);
}
echo "</select>";
echo "<td class='datos2'>".$lang_label["time_to"];
echo "<td class='datos2'><select name='time_to'>";
if ($time_from != ""){
echo "<option value='$time_to'>".render_time($time_to);
}
for ($a=0; $a < 48; $a++){
echo "<option value='";
echo $a;
echo "'>";
echo render_time ($a);
}
echo "</select>";
?>
<tr><td class="datos"><?php echo $lang_label["time_threshold"] ?>
<a href='#' class='tip'>&nbsp;<span><?PHP echo $lang_label["alert_time_threshold_help"]; ?></span></a>
<td class="datos2" colspan=4>
<td class="datos">
<select name="time_threshold" style="margin-right: 60px;">
<?php
if ($alerta_time_threshold != ""){
echo "<option value='".$alerta_time_threshold."'>".human_time_description($alerta_time_threshold)."</option>";
}
?>
<option value=300>5 Min.</option>
<option value=600>10 Min.</option>
<option value=900>15 Min.</option>
<option value=1800>30 Min.</option>
<option value=3600>1 Hour</option>
<option value=7200>2 Hour</option>
<option value=18000>5 Hour</option>
<option value=43200>12 Hour</option>
<option value=86400>1 Day</option>
<option value=604800>1 Week</option>
<option value=-1>Other value</option>
</select>
<?php echo $lang_label["other"] ?>
&nbsp;&nbsp;
<input type="text" name="other" size="5">
echo '
<option value=300>5 Min.</option>
<option value=600>10 Min.</option>
<option value=900>15 Min.</option>
<option value=1800>30 Min.</option>
<option value=3600>1 Hour</option>
<option value=7200>2 Hour</option>
<option value=18000>5 Hour</option>
<option value=43200>12 Hour</option>
<option value=86400>1 Day</option>
<option value=604800>1 Week</option>
<option value=-1>Other value</option>
</select>';
<?PHP
// Max / Min alerts
echo "<tr><td class='datos'>".$lang_label["min_alerts"];
echo '<td class="datos">';
echo $lang_label["other"];
echo '<td class="datos">';
echo '<input type="text" name="other" size="5">';
// Max / Min alerts
echo "<tr><td class='datos2'>".$lang_label["min_alerts"];
echo '<td class="datos2">';
echo '<input type="text" name="min_alerts" size="5" value="';
if (isset($alerta_min_alerts))
echo $alerta_min_alerts;
@ -272,9 +313,9 @@ _data_<br>
echo '" style="margin-right: 10px;">';
echo '<td class="datos">';
echo '<td class="datos2">';
echo $lang_label["max_alerts"];
echo '<td class="datos">';
echo '<td class="datos2">';
echo '<input type="text" name="max_alerts" size="5" value="';
if (isset($alerta_max_alerts))
echo $alerta_max_alerts;
@ -283,8 +324,8 @@ _data_<br>
echo '" style="margin-right: 10px;">';
?>
<tr><td class="datos2"><?php echo $lang_label["assigned_module"] ?>
<td class="datos2" colspan=3>
<tr><td class="datos"><?php echo $lang_label["assigned_module"] ?>
<td class="datos" colspan=3>
<?php
if ($update_alert != 1) {

View File

@ -83,6 +83,8 @@ $combo_snmp_oid="";
$agent_created_ok = 0;
$create_agent = 0;
$alert_text = "";
$time_from= "";
$time_to = "";
// ================================
// Create AGENT
@ -224,26 +226,30 @@ if (isset($_POST["insert_alert"])){ // if created alert
$time_threshold = entrada_limpia($_POST["time_threshold"]);
$max_alerts = entrada_limpia($_POST["max_alerts"]);
$min_alerts = entrada_limpia($_POST["min_alerts"]);
$time_from = entrada_limpia($_POST["time_from"]);
$time_to= entrada_limpia($_POST["time_to"]);
$other = entrada_limpia($_POST["other"]);
$disable_alert = entrada_limpia($_POST["disable_alert"]);
if ($time_threshold == -1) {
$time_threshold = $other;
}
$sql_insert="INSERT INTO talerta_agente_modulo
(id_agente_modulo,id_alerta,al_campo1,al_campo2,al_campo3,descripcion,dis_max,dis_min,time_threshold,max_alerts, min_alerts, alert_text, disable) VALUES
('$id_agente_modulo',
'$tipo_alerta',
'$campo_1',
'$campo_2',
'$campo_3',
'$descripcion',
'$maximo',
'$minimo',
'$time_threshold',
'$max_alerts',
'$min_alerts',
'$alert_text',
'$disable_alert')";
(id_agente_modulo,id_alerta,al_campo1,al_campo2,al_campo3,descripcion,dis_max,dis_min,time_threshold,max_alerts, min_alerts, alert_text, disable, time_from, time_to) VALUES
('$id_agente_modulo',
'$tipo_alerta',
'$campo_1',
'$campo_2',
'$campo_3',
'$descripcion',
'$maximo',
'$minimo',
'$time_threshold',
'$max_alerts',
'$min_alerts',
'$alert_text',
'$disable_alert',
'$time_from',
'$time_to' )";
$result=mysql_query($sql_insert);
if (! $result) {
echo "<h3 class='error'>".$lang_label["create_alert_no"]."</h3>";
@ -272,6 +278,8 @@ if (isset($_POST["update_alert"])){ // Update an existing alert
$min_alerts = entrada_limpia($_POST["min_alerts"]);
$other = entrada_limpia($_POST["other"]);
$alert_text = entrada_limpia($_POST["alert_text"]);
$time_from = entrada_limpia($_POST["time_from"]);
$time_to= entrada_limpia($_POST["time_to"]);
$disable_alert = entrada_limpia($_POST["disable_alert"]);
if ($time_threshold == -1) {
$time_threshold = $other;
@ -289,6 +297,8 @@ if (isset($_POST["update_alert"])){ // Update an existing alert
al_campo1 = '$campo_1' ,
descripcion = '$descripcion',
alert_text = '$alert_text',
time_to = '$time_to',
time_from = '$time_from',
disable = '$disable_alert'
WHERE id_aam = ".$id_aam;
$result=mysql_query($sql_insert);
@ -439,6 +449,8 @@ if (isset($_GET["update_alert"])){
$alerta_time_threshold = $row["time_threshold"];
$alerta_descripcion = $row["descripcion"];
$alerta_disable = $row["disable"];
$time_from = $row["time_from"];
$time_to = $row["time_to"];
$alerta_id_agentemodulo = $row["id_agente_modulo"]; // Only to show, cannot be changed
}
@ -641,6 +653,8 @@ if (((!isset($_POST["nc"]) OR ($_POST["nc"]==-1)) ) &&
$snmp_community = "";
$id_module_group = "";
$module_interval = "";
$time_to = "";
$time_from = "";
}
// MODULE DELETION

View File

@ -16,7 +16,18 @@
// 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.
?>
<script language="javascript">
/* Function to hide/unhide a specific Div id */
function toggleDiv (divid){
if (document.getElementById(divid).style.display == 'none'){
document.getElementById(divid).style.display = 'block';
} else {
document.getElementById(divid).style.display = 'none';
}
}
</script>
<?PHP
// Login check
$id_user=$_SESSION["id_usuario"];
global $REMOTE_ADDR;
@ -54,8 +65,8 @@ if (isset($_GET["delete"])){
}
// Delete module SQL code
if (isset($_GET["delete_report"])){
$id = $_GET["delete_report"];
if (isset($_GET["delete_map"])){
$id = $_GET["delete_map"];
$sql = "DELETE FROM tlayout_data WHERE id_layout = $id";
$sql2 = "DELETE FROM tlayout WHERE id = $id";
$res=mysql_query($sql);
@ -68,33 +79,75 @@ if (isset($_GET["delete_report"])){
}
// Create new report. First step
if (isset($_GET["create_graph"])){
if (isset($_GET["create_map"])){
$createmode = 2;
}
// Add module SQL code
if (isset($_GET["add_module"])){
if (isset($_POST["id_report"]))
$id_report = $_POST["id_report"];
if (isset($_GET["update_module"])){
if (isset($_GET["update_module"]))
$id_element = $_GET["update_module"];
else {
audit_db($id_user,$REMOTE_ADDR, "Hack attempt","Parameter trash in map builder");
include ("general/noaccess.php");
exit;
}
$my_id_agent = entrada_limpia($_POST["id_agent"]);
$my_id_module = entrada_limpia($_POST["id_module"]);
$my_period = entrada_limpia($_POST["period"]);
$my_type = entrada_limpia($_POST["type"]);
$my_cg = entrada_limpia($_POST["id_custom_graph"]);
$my_slamax = entrada_limpia($_POST["sla_max"]);
$my_slamin = entrada_limpia($_POST["sla_min"]);
$my_slalimit = entrada_limpia($_POST["sla_limit"]);
$pos_x = give_parameter_post ("pos_x",0);
$pos_y = give_parameter_post ("pos_y",0);
$my_height = give_parameter_post ("height");
$my_width = give_parameter_post ("width");
$my_label = give_parameter_post ("label");
$my_image = give_parameter_post ("image");
$sql = "INSERT INTO tlayout_data (id_layout, id_gs, id_agent_module, type, sla_max, sla_min, sla_limit, period) VALUES ('$id_report', '$my_cg', '$my_id_module', '$my_type', '$my_slamax', '$my_slamin', '$my_slalimit', '$my_period')";
$sql = "UPDATE tlayout_data SET
pos_x = '$pos_x',
pos_y = '$pos_y',
width = '$my_width',
height = '$my_height',
image = '$my_image',
label = '$my_label'
WHERE id = $id_element";
if ($res=mysql_query($sql))
$result = "<h3 class=suc>".$lang_label["modify_ok"]."</h3>";
else {
$result = "<h3 class=error>".$lang_label["modify_no"]."</h3>";
echo $sql;
echo "<br><br>";
}
echo $result;
}
// Add module SQL code
if (isset($_GET["add_module"])){
if (isset($_POST["id_map"]))
$id_map = $_POST["id_map"];
else {
audit_db($id_user,$REMOTE_ADDR, "Hack attempt","Parameter trash in map builder");
include ("general/noaccess.php");
exit;
}
$my_id_map = give_parameter_post ("id_map",0);
$my_id_agent = give_parameter_post ("id_agent",0);
$my_id_module = give_parameter_post ("id_module",0);
$my_period = give_parameter_post ("period",3600);
$my_type = give_parameter_post ("type",0);
$my_pos_x = give_parameter_post ("pos_x",0);
$my_pos_y = give_parameter_post ("pos_y",0);
$my_height = give_parameter_post ("height");
$my_width = give_parameter_post ("width");
$my_label = give_parameter_post ("label");
$my_image = give_parameter_post ("image");
$my_map_linked = give_parameter_post ("map_linked");
$my_parent_item = give_parameter_post ("parent_item");
$my_label_color = give_parameter_post ("label_color","");
$my_link_color = give_parameter_post ("link_color",0);
$sql = "INSERT INTO tlayout_data (id_layout, pos_x, pos_y, height, width, label, image, type, period, id_agente_modulo, id_layout_linked, parent_item, label_color, no_link_color) VALUES ('$my_id_map', '$my_pos_x', '$my_pos_y', '$my_height', '$my_width', '$my_label', '$my_image', '$my_type', '$my_period', '$my_id_module', '$my_map_linked', '$my_parent_item', '$my_label_color', '$my_link_color')";
if ($res=mysql_query($sql))
$result = "<h3 class=suc>".$lang_label["create_ok"]."</h3>";
else
else {
$result = "<h3 class=error>".$lang_label["create_no"]."</h3>";
echo $sql;
echo "<br><br>";
}
echo $result;
}
@ -110,7 +163,7 @@ if (isset($_POST["createmode"])){
// INSERT REPORT DATA
if ($createmode == 1){
$form_id_user = $id_user;
$sql = "INSERT INTO tlayout (name, background, width, height) VALUES ('$map_name', '$map_background', '$map_width', '$map_height')";
$sql = "INSERT INTO tlayout (name, background, width, height, id_group) VALUES ('$map_name', '$map_background', '$map_width', '$map_height', 1)";
if ($res=mysql_query($sql))
$result = "<h3 class=suc>".$lang_label["create_ok"]."</h3>";
else
@ -166,7 +219,7 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
echo "<h2>".$lang_label["reporting"]." &gt; ";
echo $lang_label["map_builder"]."</h2>";
echo "<form method='post' action='index.php?sec=greporting&sec2=godmode/reporting/map_builder'>";
echo "<form method='post' action='index.php?sec=greporting&sec2=godmode/reporting/map_builder&id=$id_map'>";
echo "<input type='hidden' name=createmode value='$createmode'>";
if ($createmode == 0){
echo "<input type='hidden' name=id_map value='$id_map'>";
@ -182,7 +235,18 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
echo "<tr><td class='datos'>";
echo $lang_label["background"];
echo "</td><td class='datos'>";
echo "<input type=text size=45 name='map_background' value='$map_background'>";
// echo "<input type=text size=45 name='map_background' value='$map_background'>";
echo '<select name="map_background" class="w155">';
if ($map_background != "")
echo "<option>".$map_background;
$ficheros2 = list_files('images/console/background/', "",0, 0);
$a=0;
while (isset($ficheros2[$a])){
echo "<option>".$ficheros2[$a]."</option>";
$a++;
}
echo '</select>';
echo "<tr><td class='datos'>";
echo $lang_label["width"];
@ -209,13 +273,19 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
// Part 2 - Add new items to report
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo "<h2>".$lang_label["reporting_item_add"]."</h2>";
echo "<h2>".$lang_label["map_item_add"];
?>
<A HREF="javascript:;" onmousedown="toggleDiv('map_control');">
<?PHP
echo "<img src='images/wand.png'>";
echo "</a></h2>";
echo "<div id='map_control' style='display:none'>";
// Show combo with agents
// ----------------------
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox_color'>";
echo "<form method='post' action='index.php?sec=greporting&sec2=godmode/reporting/map_builder&get_agent=1'>";
echo "<form method='post' action='index.php?sec=greporting&sec2=godmode/reporting/map_builder&get_agent=1&id=$id_map'>";
echo "<input type='hidden' name=id_map value='$id_map'>";
echo "<tr>";
@ -238,7 +308,7 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
// Modules combo
// -----------------------
echo "<form method='post' action='index.php?sec=greporting&sec2=godmode/reporting/map_builder&add_module=1'>";
echo "<form method='post' action='index.php?sec=greporting&sec2=godmode/reporting/map_builder&add_module=1&id=$id_map'>";
echo "<input type='hidden' name=id_map value='$id_map'>";
if (isset($id_agent))
echo "<input type='hidden' name='id_agent' value='$id_agent'>";
@ -263,8 +333,8 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
echo "<b>".$lang_label["reporting_type"]."</b>";
echo "<td class='datos' colspan=3>";
echo "<select name='type' size=1 style='width:180px;'>";
echo "<option value=1>".$lang_label["simple_graph"]."</option>";
echo "<option value=0>".$lang_label["static_graph"]."</option>";
echo "<option value=1>".$lang_label["module_graph"]."</option>";
echo "<option value=2>".$lang_label["line"]."</option>";
echo "</select>";
@ -308,7 +378,6 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
echo "<td class='datos2'>";
echo "<input type=text size=6 name='width'>";
echo "<tr><td class='datos'>";
echo "<b>".$lang_label["label"]."</b></td>";
echo "<td class='datos' colspan=3>";
@ -317,8 +386,17 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
echo "<tr><td class='datos2'>";
echo "<b>".$lang_label["image"]."</b></td>";
echo "<td class='datos2' colspan=3>";
echo "<input type=text size=35 name='image'>";
echo '<select name="image" class="w155">';
$ficheros = list_files('images/console/icons/', "",0, 0);
$a=0;
while (isset($ficheros[$a])){
$myfichero = substr($ficheros[$a],0,strlen($ficheros[$a])-4);
if ((strpos($myfichero,"_bad") == 0) && (strpos($myfichero,"_ok") == 0) && ($myfichero != "" ))
echo "<option>".$myfichero."</option>";
$a++;
}
echo '</select>';
echo "<tr><td class='datos'>";
echo "<b>".$lang_label["map_linked"]."</b>";
@ -347,17 +425,17 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
echo "<tr><td class='datos'>";
echo "<b>".$lang_label["label_color"]."</b>";
echo "<td class='datos'>";
echo "<select name='type' size=1>";
echo "<option value='#ffffff'>".$lang_label["white"]."</option>";
echo "<option value='#000000'>".$lang_label["black"]."</option>";
echo "<select name='label_color' size=1>";
echo "<option value='ffffff'>".$lang_label["white"]."</option>";
echo "<option value='000000'>".$lang_label["black"]."</option>";
echo "</select>";
echo "<td class='datos'>";
echo "<b>".$lang_label["link_color"]."</b>";
echo "<td class='datos'>";
echo "<select name='type' size=1 >";
echo "<option value=1>".$lang_label["yes"]."</option>";
echo "<option value=0>".$lang_label["no"]."</option>";
echo "<td class='link_color'>";
echo "<select name='link_color' size=1 >";
echo "<option value=0>".$lang_label["yes"]."</option>";
echo "<option value=1>".$lang_label["no"]."</option>";
echo "</select>";
@ -370,19 +448,27 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
echo "<input type='submit' class='sub wand' value='".$lang_label["add"]."'>";
echo "</td></tr></table>";
echo "</form>";
echo "<br></div>";
// Part 3 - List of already assigned report items
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo "<h2>".$lang_label["report_items"]."</h2>";
echo "<table width=500 cellspacing=4 cellpadding=4 class='databox'>";
echo "<table width=720 cellspacing=4 cellpadding=4 class='databox'>";
echo "<tr><th>".$lang_label["type"]."</th>
<th>".$lang_label["agent_name"]."</th>
<th>".$lang_label["module_name"]."</th>
<th>".$lang_label["label"]."</th>
<th>".$lang_label["image"]."</th>
<th>".$lang_label["pos_x"]."</th>
<th>".$lang_label["pos_y"]."</th>
<th>".$lang_label["width"]."</th>
<th>".$lang_label["height"]."</th>
<th>".$lang_label["delete"]."</th>
<th>".$lang_label["update"]."</th>
</tr>";
$sql = "SELECT * FROM tlayout_data WHERE id_layout = $id_map";
$res=mysql_query($sql);
@ -404,10 +490,15 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
case "1": $type_desc = "Module graph"; break;
case "2": $type_desc = "Line"; break;
}
$id_element = $row["id"];
$period = $row["period"];
$id_am = $row["id_agente_modulo"];
$x = $row["pos_x"];
$y = $row["pos_y"];
$myimage = $row["image"];
$width= $row["width"];
$height = $row["height"];
$label = $row["label"];
$name = "N/A";
$agent_name = "N/A";
if ($id_am != ""){
@ -415,13 +506,42 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
$module_name = dame_nombre_modulo_agentemodulo ($id_am);
}
echo "<tr>";
echo "<form method='POST' action='index.php?sec=greporting&sec2=godmode/reporting/map_builder&id=$id_map&update_module=$id_element'>";
echo "<td class='$tdcolor'>".$type_desc."</td>";
echo "<td class='$tdcolor'>".$agent_name."</td>";
echo "<td class='$tdcolor'>".$module_name."</td>";
echo "<td class='$tdcolor'>".$x."</td>";
echo "<td class='$tdcolor'>".$y."</td>";
echo "<td class='$tdcolor'>".$agent_name." / ";
echo $module_name."</td>";
echo "<td class='$tdcolor'>";
echo "<input type=text size=4 name='label' value='$label'></td>";
echo "<td class='$tdcolor'>";
echo '<select name="image">';
echo "<option>".$myimage;
$ficheros = list_files('images/console/icons/', "",0, 0);
$a=0;
while (isset($ficheros[$a])){
$myfichero = substr($ficheros[$a],0,strlen($ficheros[$a])-4);
if ((strpos($myfichero,"_bad") == 0) && (strpos($myfichero,"_ok") == 0) && ($myfichero != "" ))
echo "<option>".$myfichero."</option>";
$a++;
}
echo '</select>';
echo "<td class='$tdcolor'>";
echo "<input type=text size=4 name=pos_x value='$x'></td>";
echo "<td class='$tdcolor'>";
echo "<input type=text size=4 name=pos_y value='$y'></td>";
echo "<td class='$tdcolor'>";
echo "<input type=text size=4 name='width' value='$width'></td>";
echo "<td class='$tdcolor'>";
echo "<input type=text size=4 name='height' value='$height'></td>";
echo "<td class='$tdcolor'>";
echo "<a href='index.php?sec=greporting&sec2=godmode/reporting/map_builder&id=$id_map&delete=$id_layoutdata'><img src='images/cancel.gif'></a>";
echo "<td class='$tdcolor' align='center'>";
echo "<a href='index.php?sec=greporting&sec2=godmode/reporting/map_builder&id=1&delete=$id_layoutdata'><img src='images/cancel.gif'></a>";
echo "<input type=submit class='sub next' value='".$lang_label["update"]."'>";
echo "</form>";
}
echo "</table>";
}
@ -458,12 +578,12 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
echo "<td valign='top' class='$tdcolor'>".$row["width"]."x".$row["height"]."</td>";
$id_map = $row["id"];
echo "<td valign='middle' class='$tdcolor' align='center'><a href='index.php?sec=greporting&sec2=godmode/reporting/map_builder&id=$id_map'><img src='images/setup.png'></a>";
echo "<td valign='middle' class='$tdcolor' align='center'><a href='index.php?sec=greporting&sec2=godmode/reporting/map_builder&delete_graph=$id_map'><img src='images/cancel.gif'></a>";
echo "<td valign='middle' class='$tdcolor' align='center'><a href='index.php?sec=greporting&sec2=godmode/reporting/map_builder&delete_map=$id_map'><img src='images/cancel.gif'></a>";
}
}
echo "</table>";
echo "<table width=500 cellpadding=4 cellpadding=4>";
echo "<form method=post action='index.php?sec=greporting&sec2=godmode/reporting/map_builder&create_graph=1'>";
echo "<form method=post action='index.php?sec=greporting&sec2=godmode/reporting/map_builder&create_map=1'>";
echo "<tr><td align='right'>";
echo "<input type=submit class='sub next' value='".$lang_label["add"]."'>";
echo "</form>";

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -491,5 +491,19 @@ function human_date_relative ( $seconds ) {
return $ayer;
}
function render_time ($lapse) {
$myhour = intval(($lapse*30)/60);
if ($myhour == 0)
$output = "00";
else
$output = $myhour;
$output .=":";
$mymin = fmod(($lapse*30),60);
if ($mymin == 0)
$output .= "00";
else
$output .= $mymin;
return $output;
}
?>

View File

@ -868,7 +868,11 @@ $lang_label["link_color"]="Link color";
$lang_label["label_color"]="Label color";
$lang_label["white"]="White";
$lang_label["black"]="Black";
$lang_label["time_from"]="Time from";
$lang_label["time_to"]="Time to";
$lang_label["time"]="Time";
$lang_label["module_graph"] = "Module graph";
$lang_label["map_item_add"] = "Add map item";
global $lang_label;
global $help_label;
?>

View File

@ -57,7 +57,6 @@ if (isset($_GET["id"])){
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo "<h1>".$layout_name."</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);
@ -126,7 +125,15 @@ while ($row = mysql_fetch_array($res)){
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)){
@ -148,7 +155,10 @@ echo 'function myDrawFunction(){';
for ($a=0; $a < $lines; $a++){
echo " jg_doc_$a.setStroke(2);";
if ($lines_data[$a][4] >= 1)
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

View File

@ -180,6 +180,8 @@ CREATE TABLE `talerta_agente_modulo` (
`internal_counter` int(4) default '0',
`alert_text` varchar(255) default '',
`disable` int(4) default '0',
`time_from` int(8) default '0',
`time_to` int(8) default '0',
PRIMARY KEY (`id_aam`)
) ENGINE=InnoDB;