2014-03-06 Miguel de Dios <miguel.dedios@artica.es>
* operation/agentes/snapshot_view.php: fixed the lost scrollbars. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9519 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
3255ca3dc9
commit
3b670464be
|
@ -1,3 +1,7 @@
|
||||||
|
2014-03-06 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* operation/agentes/snapshot_view.php: fixed the lost scrollbars.
|
||||||
|
|
||||||
2014-03-06 Sergio Martin <sergio.martin@artica.es>
|
2014-03-06 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* include/javascript/pandora_alerts.js: Added missed code
|
* include/javascript/pandora_alerts.js: Added missed code
|
||||||
|
|
|
@ -40,32 +40,62 @@ $id = get_parameter('id');
|
||||||
$label = get_parameter ("label");
|
$label = get_parameter ("label");
|
||||||
|
|
||||||
// TODO - Put ACL here
|
// TODO - Put ACL here
|
||||||
|
|
||||||
// Parsing the refresh before sending any header
|
|
||||||
$refresh = (int) get_parameter ("refr", -1);
|
|
||||||
if ($refresh > 0) {
|
|
||||||
$query = ui_get_url_refresh (false);
|
|
||||||
echo '<meta http-equiv="refresh" content="'.$refresh.'; URL='.$query.'" />';
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
|
<html>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<head>
|
||||||
<title>Pandora FMS Snapshot data view for module (<?php echo $label; ?>)</title>
|
<?php
|
||||||
<body style='background:#000; color: #ccc;'>
|
// Parsing the refresh before sending any header
|
||||||
|
$refresh = (int) get_parameter ("refr", -1);
|
||||||
<?php
|
if ($refresh > 0) {
|
||||||
|
$query = ui_get_url_refresh (false);
|
||||||
$row = db_get_row_sql("SELECT * FROM tagente_estado WHERE id_agente_modulo = $id");
|
echo '<meta http-equiv="refresh" content="'.$refresh.'; URL='.$query.'" />';
|
||||||
|
}
|
||||||
echo "<h2>";
|
?>
|
||||||
echo __("Current data at");
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
echo " ";
|
<title>Pandora FMS Snapshot data view for module (<?php echo $label; ?>)</title>
|
||||||
echo $row["timestamp"];
|
<script type='text/javascript' src='../../include/javascript/jquery-1.7.1.js'></script>
|
||||||
echo "</h2>";
|
</head>
|
||||||
$datos = io_safe_output($row["datos"]);
|
<body style='background:#000; color: #ccc;'>
|
||||||
$datos = preg_replace ('/\n/i','<br>',$datos);
|
<?php
|
||||||
$datos = preg_replace ('/\s/i',' ',$datos);
|
$row = db_get_row_sql("SELECT *
|
||||||
echo "<div style='padding: 10px; font-size: 14px; line-height: 16px; font-family: mono,monospace; text-align: left'>";
|
FROM tagente_estado
|
||||||
echo $datos;
|
WHERE id_agente_modulo = $id");
|
||||||
echo "</div>";
|
|
||||||
|
echo "<h2 id='title_snapshot_view'>";
|
||||||
|
echo __("Current data at");
|
||||||
|
echo " ";
|
||||||
|
echo $row["timestamp"];
|
||||||
|
echo "</h2>";
|
||||||
|
$datos = io_safe_output($row["datos"]);
|
||||||
|
$datos = preg_replace ('/\n/i','<br>',$datos);
|
||||||
|
$datos = preg_replace ('/\s/i',' ',$datos);
|
||||||
|
echo "<div id='result_div' style='width: 100%; height: 100%; overflow: scroll; padding: 10px; font-size: 14px; line-height: 16px; font-family: mono,monospace; text-align: left'>";
|
||||||
|
echo $datos;
|
||||||
|
echo "</div>";
|
||||||
|
?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
function getScrollbarWidth() {
|
||||||
|
var div = $('<div style="width:50px;height:50px;overflow:hidden;position:absolute;top:-200px;left:-200px;"><div style="height:100px;"></div></div>');
|
||||||
|
$('body').append(div);
|
||||||
|
var w1 = $('div', div).innerWidth();
|
||||||
|
div.css('overflow-y', 'auto');
|
||||||
|
var w2 = $('div', div).innerWidth();
|
||||||
|
$(div).remove();
|
||||||
|
|
||||||
|
return (w1 - w2);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
width = $("#result_div").css("width");
|
||||||
|
width = width.replace("px", "");
|
||||||
|
width = parseInt(width);
|
||||||
|
$("#result_div").css("width", (width - getScrollbarWidth()) + "px");
|
||||||
|
|
||||||
|
height = $("#result_div").css("height");
|
||||||
|
height = height.replace("px", "");
|
||||||
|
height = parseInt(height);
|
||||||
|
$("#result_div").css("height", (height - getScrollbarWidth() - $("#title_snapshot_view").height() - 16) + "px");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue