2013-02-18 Sergio Martin <sergio.martin@artica.es>
* include/functions_html.php include/styles/pandora_minimal.css include/javascript/x_event.js include/javascript/x_slide.js include/javascript/x_core.js operation/agentes/stat_win.php: Encapsulated the hidded side menu (stat_win menu) to used from other parts of Pandora. Change the technology of this menu to jquery, eliminating dependences: x_event x_slide and x_core git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7673 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
0fedf42ef7
commit
eadb829879
|
@ -1,3 +1,15 @@
|
|||
2013-02-18 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_html.php
|
||||
include/styles/pandora_minimal.css
|
||||
include/javascript/x_event.js
|
||||
include/javascript/x_slide.js
|
||||
include/javascript/x_core.js
|
||||
operation/agentes/stat_win.php: Encapsulated the hidded side menu
|
||||
(stat_win menu) to used from other parts of Pandora. Change the
|
||||
technology of this menu to jquery, eliminating dependences: x_event
|
||||
x_slide and x_core
|
||||
|
||||
2013-02-18 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_modules.php,
|
||||
|
|
|
@ -89,6 +89,203 @@ function html_f2str($function, $params) {
|
|||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Print side layer
|
||||
*
|
||||
* @params mixed Hash with all the params:
|
||||
*
|
||||
* position: left or right
|
||||
* width: width of the layer
|
||||
* height: height of the layer
|
||||
* icon_closed: icon showed when layer is hidden
|
||||
* icon_open: icon showed when layer is showed
|
||||
* top_text: text over the content
|
||||
* body_text: content of layer
|
||||
* bottom_text: text under the contet
|
||||
*
|
||||
* @return string HTML code if return parameter is true.
|
||||
*/
|
||||
|
||||
function html_print_side_layer ($params) {
|
||||
global $config;
|
||||
|
||||
// Check mandatory values, if any of them is missed, return ''
|
||||
$mandatory = array('icon_closed', 'body_text');
|
||||
|
||||
foreach($mandatory as $man) {
|
||||
if(!isset($params[$man])) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
// Set default values if not setted
|
||||
$defaults = array(
|
||||
'position' => 'left',
|
||||
'width' => '400',
|
||||
'height' => '97%',
|
||||
'top_text' => '',
|
||||
'bottom_text' => '',
|
||||
'icon_open' => $params['icon_closed']
|
||||
);
|
||||
|
||||
foreach($defaults as $token => $value) {
|
||||
if(!isset($params[$token])) {
|
||||
$params[$token] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
//z-index is 1 because 2 made the calendar show under the side_layer
|
||||
|
||||
switch($params['position']) {
|
||||
case 'left':
|
||||
$round_class = 'menu_radius_right';
|
||||
$body_float = 'left';
|
||||
$button_float = 'right';
|
||||
break;
|
||||
case 'right':
|
||||
$round_class = 'menu_radius_left';
|
||||
$body_float = 'right';
|
||||
$button_float = 'left';
|
||||
break;
|
||||
}
|
||||
|
||||
$out_html = '<div id="side_layer" class="menu ' . $round_class . '" style="z-index:1; overflow: hidden; height: ' . $params['height'] . ';">';
|
||||
|
||||
$table->id = 'side_layer_layout';
|
||||
$table->width = $params['width'] . 'px';
|
||||
$table->cellspacing = 2;
|
||||
$table->cellpadding = 2;
|
||||
$table->class = 'none';
|
||||
|
||||
$top = '<div id="side_top_text" style="width: 100%";">' . $params['top_text'] . '</div>';
|
||||
|
||||
$button = '<div id="show_menu" style="vertical-align: middle; position: relative; border:1px solid #FFF; height: 50px; width: 50px;">';
|
||||
$button .= html_print_image($params['position'] == 'left' ? $params['icon_open'] : $params['icon_closed'], true, array('id' => 'graph_menu_arrow'));
|
||||
$button .= '</div>';
|
||||
|
||||
$body = '<div id="side_body_text" style="width: 100%;">' . $params['body_text'] . '</div>';
|
||||
|
||||
$bottom = '<div id="side_bottom_text" style="text-align: ' . $params['position'] . ';">' . $params['bottom_text'] . '</div>';
|
||||
|
||||
switch($params['position']) {
|
||||
case 'left':
|
||||
$table->size[1] = '15%';
|
||||
|
||||
$table->data[0][0] = $top;
|
||||
$table->data[0][1] = '';
|
||||
$table->rowclass[0] = '';
|
||||
|
||||
$table->data[1][0] = $body;
|
||||
|
||||
$table->data[1][1] = $button;
|
||||
$table->rowclass[1] = '';
|
||||
|
||||
$table->data[2][0] = $bottom;
|
||||
$table->data[2][1] = '';
|
||||
$table->rowclass[2] = '';
|
||||
break;
|
||||
case 'right':
|
||||
$table->size[0] = '15%';
|
||||
|
||||
$table->data[0][0] = '';
|
||||
$table->data[0][1] = $top;
|
||||
$table->rowclass[0] = '';
|
||||
|
||||
$table->data[1][0] = $button;
|
||||
|
||||
$table->data[1][1] = $body;
|
||||
$table->rowclass[1] = '';
|
||||
|
||||
$table->data[2][0] = '';
|
||||
$table->data[2][1] = $bottom;
|
||||
$table->rowclass[2] = '';
|
||||
break;
|
||||
}
|
||||
|
||||
$out_html .= html_print_table($table, true);
|
||||
|
||||
$out_html .= '</div>';
|
||||
|
||||
$out_js = "<script type='text/javascript'>
|
||||
<!--
|
||||
var defSlideTime = 220;
|
||||
var visibleMargin = 55;
|
||||
var menuW = " . $params['width'] . ";
|
||||
var hiddenMargin = menuW - visibleMargin;
|
||||
var windowWidth = $(window).width();
|
||||
var position = '" . $params['position'] . "';
|
||||
var sideClosed = 1;
|
||||
|
||||
window.onload = function() {
|
||||
// SET INITIAL POSITION AND SHOW LAYER
|
||||
$('#side_layer').css('top', 0);
|
||||
switch (position) {
|
||||
case 'left':
|
||||
$('#side_layer').css('left', -hiddenMargin);
|
||||
break;
|
||||
case 'right':
|
||||
$('#side_layer').css('left', windowWidth - visibleMargin - 12);
|
||||
$('#side_layer').css('width', visibleMargin + 'px');
|
||||
|
||||
break;
|
||||
}
|
||||
$('#side_layer').show();
|
||||
|
||||
$(\"#graph_menu_arrow\").click(function(){
|
||||
switch(position) {
|
||||
case 'right':
|
||||
if (sideClosed == 0){
|
||||
$('#side_layer').animate({\"width\": \"-=\" + (hiddenMargin) + \"px\", \"left\": \"+=\" + (hiddenMargin) + \"px\"}, defSlideTime);
|
||||
$(\"#graph_menu_arrow\").attr(\"src\", \"" . $config['homeurl'] . $params['icon_closed'] . "\");
|
||||
}
|
||||
else {
|
||||
$('#side_layer').animate({\"width\": \"+=\" + (hiddenMargin) + \"px\", \"left\": \"-=\" + (hiddenMargin) + \"px\"}, defSlideTime);
|
||||
$(\"#graph_menu_arrow\").attr(\"src\", \"" . $config['homeurl'] . $params['icon_open'] . "\");
|
||||
}
|
||||
break;
|
||||
case 'left':
|
||||
if (sideClosed == 1){
|
||||
$('#side_layer').animate({\"left\": \"+=\" + (hiddenMargin) + \"px\"}, defSlideTime);
|
||||
|
||||
$(\"#graph_menu_arrow\").attr(\"src\", \"" . $config['homeurl'] . $params['icon_closed'] . "\");
|
||||
}
|
||||
else {
|
||||
$('#side_layer').animate({\"left\": \"-=\" + (hiddenMargin) + \"px\"}, defSlideTime);
|
||||
$(\"#graph_menu_arrow\").attr(\"src\", \"" . $config['homeurl'] . $params['icon_open'] . "\");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if(sideClosed == 0) {
|
||||
//$('#side_top_text').hide();
|
||||
//$('#side_body_text').hide();
|
||||
//$('#side_bottom_text').hide();
|
||||
sideClosed = 1;
|
||||
}
|
||||
else {
|
||||
$('#side_top_text').show();
|
||||
$('#side_body_text').show();
|
||||
$('#side_bottom_text').show();
|
||||
sideClosed = 0;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if(position == 'right') {
|
||||
// Move the right menu if window is resized
|
||||
$(window).resize(function() {
|
||||
var newWindowWidth = $(window).width();
|
||||
var widthVariation = newWindowWidth - windowWidth;
|
||||
$('#side_layer').animate({\"left\": \"+=\" + (widthVariation) + \"px\"}, 0);
|
||||
|
||||
windowWidth = newWindowWidth;
|
||||
});
|
||||
}
|
||||
//-->
|
||||
</script>";
|
||||
|
||||
echo $out_html . $out_js;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints an array of fields in a popup menu of a form.
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,2 +0,0 @@
|
|||
/* x_event.js compiled from X 4.0 with XC 0.27b. Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com */
|
||||
function xAddEventListener(e,eT,eL,cap){if(!(e=xGetElementById(e))) return;eT=eT.toLowerCase();if((!xIE4Up && !xOp7Up) && e==window) {if(eT=='resize') { window.xPCW=xClientWidth(); window.xPCH=xClientHeight(); window.xREL=eL; xResizeEvent(); return; }if(eT=='scroll') { window.xPSL=xScrollLeft(); window.xPST=xScrollTop(); window.xSEL=eL; xScrollEvent(); return; }}var eh='e.on'+eT+'=eL';if(e.addEventListener) e.addEventListener(eT,eL,cap);else if(e.attachEvent) e.attachEvent('on'+eT,eL);else eval(eh);}function xResizeEvent(){if (window.xREL) setTimeout('xResizeEvent()', 250);var cw = xClientWidth(), ch = xClientHeight();if (window.xPCW != cw || window.xPCH != ch) { window.xPCW = cw; window.xPCH = ch; if (window.xREL) window.xREL(); }}function xScrollEvent(){if (window.xSEL) setTimeout('xScrollEvent()', 250);var sl = xScrollLeft(), st = xScrollTop();if (window.xPSL != sl || window.xPST != st) { window.xPSL = sl; window.xPST = st; if (window.xSEL) window.xSEL(); }}function xEvent(evt) {var e = evt || window.event;if(!e) return;if(e.type) this.type = e.type;if(e.target) this.target = e.target;else if(e.srcElement) this.target = e.srcElement;if (e.relatedTarget) this.relatedTarget = e.relatedTarget;else if (e.type == 'mouseover' && e.fromElement) this.relatedTarget = e.fromElement;else if (e.type == 'mouseout') this.relatedTarget = e.toElement;if(xOp6Dn) { this.pageX = e.clientX; this.pageY = e.clientY; }else if(xDef(e.pageX,e.pageY)) { this.pageX = e.pageX; this.pageY = e.pageY; }else if(xDef(e.clientX,e.clientY)) { this.pageX = e.clientX + xScrollLeft(); this.pageY = e.clientY + xScrollTop(); }if (xDef(e.offsetX,e.offsetY)) {this.offsetX = e.offsetX;this.offsetY = e.offsetY;}else if (xDef(e.layerX,e.layerY)) {this.offsetX = e.layerX;this.offsetY = e.layerY;}else {this.offsetX = this.pageX - xPageX(this.target);this.offsetY = this.pageY - xPageY(this.target);}if (e.keyCode) { this.keyCode = e.keyCode; } else if (xDef(e.which) && e.type.indexOf('key')!=-1) { this.keyCode = e.which; }this.shiftKey = e.shiftKey;this.ctrlKey = e.ctrlKey;this.altKey = e.altKey;}function xPreventDefault(e){if (e && e.preventDefault) e.preventDefault();else if (window.event) window.event.returnValue = false;}function xRemoveEventListener(e,eT,eL,cap){if(!(e=xGetElementById(e))) return;eT=eT.toLowerCase();if((!xIE4Up && !xOp7Up) && e==window) {if(eT=='resize') { window.xREL=null; return; }if(eT=='scroll') { window.xSEL=null; return; }}var eh='e.on'+eT+'=null';if(e.removeEventListener) e.removeEventListener(eT,eL,cap);else if(e.detachEvent) e.detachEvent('on'+eT,eL);else eval(eh);}function xStopPropagation(evt){if (evt && evt.stopPropagation) evt.stopPropagation();else if (window.event) window.event.cancelBubble = true;}
|
|
@ -1,2 +0,0 @@
|
|||
/* x_slide.js compiled from X 4.0 with XC 0.27b. Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com */
|
||||
function xSlideTo(e, x, y, uTime){if (!(e=xGetElementById(e))) return;if (!e.timeout) e.timeout = 25;e.xTarget = x; e.yTarget = y; e.slideTime = uTime; e.stop = false;e.yA = e.yTarget - xTop(e); e.xA = e.xTarget - xLeft(e); if (e.slideLinear) e.B = 1/e.slideTime;else e.B = Math.PI / (2 * e.slideTime); e.yD = xTop(e); e.xD = xLeft(e); var d = new Date(); e.C = d.getTime();if (!e.moving) _xSlideTo(e);}function _xSlideTo(e){if (!(e=xGetElementById(e))) return;var now, s, t, newY, newX;now = new Date();t = now.getTime() - e.C;if (e.stop) { e.moving = false; }else if (t < e.slideTime) {setTimeout("_xSlideTo('"+e.id+"')", e.timeout);if (e.slideLinear) s = e.B * t;else s = Math.sin(e.B * t);newX = Math.round(e.xA * s + e.xD);newY = Math.round(e.yA * s + e.yD);xMoveTo(e, newX, newY);e.moving = true;} else {xMoveTo(e, e.xTarget, e.yTarget);e.moving = false;} }
|
|
@ -79,7 +79,8 @@ table, img {
|
|||
background:#cccacb url('../../images/login_background.png') right center no-repeat;
|
||||
|
||||
margin-left: 10px;
|
||||
padding-left: 10px;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
padding-top: 10px;
|
||||
text-align: left;
|
||||
font-family:arial,sans-serif,verdana;
|
||||
|
@ -89,21 +90,28 @@ table, img {
|
|||
margin:0;
|
||||
width:400px;
|
||||
height:260px;
|
||||
visibility:hidden;
|
||||
|
||||
-moz-box-shadow: 0px 6px 6px #010E1B !important;
|
||||
-webkit-box-shadow: 0px 6px 6px #010E1B !important;
|
||||
box-shadow: 0px 6px 6px #010E1B !important;
|
||||
|
||||
-moz-border-top-right-radius: 10px;
|
||||
-webkit-border-top-right-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
|
||||
filter:alpha(opacity=97);
|
||||
-moz-opacity: 0.97;
|
||||
opacity: 0.97;
|
||||
}
|
||||
|
||||
.menu_radius_left {
|
||||
-moz-border-top-left-radius: 10px;
|
||||
-webkit-border-top-left-radius: 10px;
|
||||
border-top-left-radius: 10px;
|
||||
}
|
||||
|
||||
.menu_radius_right {
|
||||
-moz-border-top-right-radius: 10px;
|
||||
-webkit-border-top-right-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
}
|
||||
|
||||
#show_menu {
|
||||
background:#cccacb;
|
||||
}
|
||||
|
|
|
@ -72,91 +72,17 @@ $label = base64_decode(get_parameter('label', ''));
|
|||
<title>Pandora FMS Graph (<?php echo modules_get_agentmodule_agent_name ($id) . ' - ' . $label; ?>)</title>
|
||||
<link rel="stylesheet" href="../../include/styles/pandora_minimal.css" type="text/css" />
|
||||
<script type='text/javaScript' src='../../include/javascript/calendar.js'></script>
|
||||
<script type='text/javascript' src='../../include/javascript/x_core.js'></script>
|
||||
<script type='text/javascript' src='../../include/javascript/x_event.js'></script>
|
||||
<script type='text/javascript' src='../../include/javascript/x_slide.js'></script>
|
||||
<script type='text/javascript' src='../../include/javascript/pandora.js'></script>
|
||||
<script type='text/javascript' src='../../include/javascript/jquery-1.7.1.js'></script>
|
||||
<script type='text/javascript'>
|
||||
<!--
|
||||
var defOffset = 2;
|
||||
var defSlideTime = 220;
|
||||
var tnActive = 0;
|
||||
var visibleMargin = 45;
|
||||
var menuW = 400;
|
||||
var menuH = 310;
|
||||
var showed = 0;
|
||||
window.onload = function() {
|
||||
var d;
|
||||
d = xGetElementById('divmenu');
|
||||
d.termNumber = 1;
|
||||
xMoveTo(d, visibleMargin - menuW, 0);
|
||||
xShow(d);
|
||||
|
||||
// If navigator is IE then call attachEvent, else call addEventListener
|
||||
if ('\v'=='v')
|
||||
document.getElementById('show_menu').attachEvent('onclick', docOnMousemoveIn);
|
||||
else
|
||||
document.getElementById('show_menu').addEventListener('click', docOnMousemoveIn, false);
|
||||
|
||||
|
||||
|
||||
// Hack to repeat the init process to period select
|
||||
var periodSelectId = $('[name="period"]').attr('class');
|
||||
|
||||
period_select_init(periodSelectId);
|
||||
|
||||
$("#graph_menu_arrow").click(function(){
|
||||
if ($("#graph_menu_arrow").attr("src").indexOf("hide") == -1){
|
||||
$("#graph_menu_arrow").attr("src", <?php echo '"' . $config['homeurl'] . '"'; ?> + "/images/graphmenu_arrow_hide.png");
|
||||
}
|
||||
else {
|
||||
$("#graph_menu_arrow").attr("src", <?php echo '"' . $config['homeurl'] . '"'; ?> + "/images/graphmenu_arrow.png");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function docOnMousemoveIn(evt) {
|
||||
var e = new xEvent(evt);
|
||||
var d = getTermEle(e.target);
|
||||
|
||||
// mouse is over a term, activate its def
|
||||
if (showed == 0) {
|
||||
xSlideTo('divmenu', 0, xPageY(d), defSlideTime);
|
||||
showed = 1;
|
||||
}
|
||||
else {
|
||||
xSlideTo('divmenu', visibleMargin - menuW, xPageY(d), defSlideTime);
|
||||
showed = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function docOnMousemove(evt) {
|
||||
var e = new xEvent(evt);
|
||||
var d = getTermEle(e.target);
|
||||
if (!tnActive) { // no def is active
|
||||
if (d) { // mouse is over a term, activate its def
|
||||
xSlideTo('divmenu', 0, xPageY(d), defSlideTime);
|
||||
tnActive = 1;
|
||||
}
|
||||
}
|
||||
else { // a def is active
|
||||
if (!d) { // mouse is not over a term, deactivate active def
|
||||
xSlideTo('divmenu', visibleMargin - menuW, xPageY(d), defSlideTime);
|
||||
tnActive = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getTermEle(ele) {
|
||||
//window.status = ele;
|
||||
while(ele && !ele.termNumber) {
|
||||
if (ele == document) return null;
|
||||
ele = xParent(ele);
|
||||
}
|
||||
return ele;
|
||||
}
|
||||
|
||||
function show_others() {
|
||||
if (!$("#checkbox-avg_only").attr('checked')) {
|
||||
$("#hidden-show_other").val(1);
|
||||
|
@ -276,9 +202,145 @@ $label = base64_decode(get_parameter('label', ''));
|
|||
}
|
||||
echo '</div>';
|
||||
|
||||
//z-index is 1 because 2 made the calendar show under the divmenu.
|
||||
///////////////////////////
|
||||
// SIDE MENU
|
||||
///////////////////////////
|
||||
$params = array();
|
||||
// TOP TEXT
|
||||
$params['top_text'] = "<b>" . __('Pandora FMS Graph configuration menu') . "</b>";
|
||||
$params['top_text'] .= "<br /><br />";
|
||||
$params['top_text'] .=__('Please, make your changes and apply with the <i>Reload</i> button');
|
||||
|
||||
// MENU
|
||||
$params['body_text'] = '<form method="get" action="stat_win.php">';
|
||||
$params['body_text'] .= html_print_input_hidden ("id", $id, true);
|
||||
$params['body_text'] .= html_print_input_hidden ("label", $label);
|
||||
|
||||
if (isset($hash_connection_data)) {
|
||||
$params['body_text'] .= html_print_input_hidden("loginhash", "auto", true);
|
||||
$params['body_text'] .= html_print_input_hidden("loginhash_data", $loginhash_data, true);
|
||||
$params['body_text'] .= html_print_input_hidden("loginhash_user", $loginhash_user, true);
|
||||
}
|
||||
|
||||
$params['body_text'] .= html_print_input_hidden ("id", $id, true);
|
||||
$params['body_text'] .= html_print_input_hidden ("label", $label, true);
|
||||
|
||||
if (isset($_GET["type"])) {
|
||||
$type = get_parameter_get ("type");
|
||||
$params['body_text'] .= html_print_input_hidden ("type", $type, true);
|
||||
}
|
||||
|
||||
$table->id = 'stat_win_form';
|
||||
$table->width = '100%';
|
||||
$table->size[0] = '50%';
|
||||
$table->cellspacing = 2;
|
||||
$table->cellpadding = 2;
|
||||
$table->class = 'databox_frame';
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Refresh time');
|
||||
$data[1] = html_print_extended_select_for_time("refresh", $refresh, '', '', 0, 7, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
if ($graph_type != "boolean") {
|
||||
$data = array();
|
||||
$data[0] = __('Avg. Only');
|
||||
$data[1] = html_print_checkbox ("avg_only", 1, (bool) $avg_only, true, false, 'show_others()');
|
||||
$data[1] .= html_print_input_hidden('show_other', 0, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Begin date');
|
||||
$data[1] = html_print_input_text ("start_date", substr ($start_date, 0, 10),'', 15, 255, true);
|
||||
$data[1] .= html_print_image ("images/calendar_view_day.png", true, array ("onclick" => "scwShow(scwID('text-start_date'),this);"));
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Zoom factor');
|
||||
$options = array ();
|
||||
$options[$zoom] = 'x'.$zoom;
|
||||
$options[1] = 'x1';
|
||||
$options[2] = 'x2';
|
||||
$options[3] = 'x3';
|
||||
$options[4] = 'x4';
|
||||
$data[1] = html_print_select ($options, "zoom", $zoom, '', '', 0, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Time range');
|
||||
$data[1] = html_print_extended_select_for_time('period', $period, '', '', 0, 7, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Show events');
|
||||
$data[1] = html_print_checkbox ("draw_events", 1, (bool) $draw_events, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Show alerts');
|
||||
$data[1] = html_print_checkbox ("draw_alerts", 1, (bool) $draw_alerts, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Show event graph');
|
||||
$data[1] = html_print_checkbox ("show_events_graph", 1, (bool) $show_events_graph, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
switch ($graph_type) {
|
||||
case 'boolean':
|
||||
case 'sparse':
|
||||
$data = array();
|
||||
$data[0] = __('Time compare') . ' (' . __('Overlapped') . ')';
|
||||
$data[1] = html_print_checkbox ("time_compare_overlapped", 1, (bool) $time_compare_overlapped, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Time compare') . ' (' . __('Separated') . ')';
|
||||
$data[1] = html_print_checkbox ("time_compare_separated", 1, (bool) $time_compare_separated, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$data = array();
|
||||
$data[0] = __('Show unknown graph');
|
||||
$data[1] = html_print_checkbox ("unknown_graph", 1, (bool) $unknown_graph, true);
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
break;
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data[0] = '';
|
||||
$data[1] = '<div style="width:100%; text-align:right;">' . html_print_submit_button (__('Reload'), "submit", false, 'class="sub next"', true) . "</div>";
|
||||
$table->data[] = $data;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$params['body_text'] .= html_print_table($table, true);
|
||||
$params['body_text'] .= '</form>';
|
||||
|
||||
// ICONS
|
||||
$params['icon_closed'] = '/images/graphmenu_arrow_hide.png';
|
||||
$params['icon_open'] = '/images/graphmenu_arrow.png';
|
||||
|
||||
// SIZE
|
||||
$params['width'] = 400;
|
||||
|
||||
// POSITION
|
||||
$params['position'] = 'left';
|
||||
|
||||
html_print_side_layer($params);
|
||||
?>
|
||||
<div id="divmenu" class="menu" style="z-index:1; height: 98%;">
|
||||
<!-- z-index is 1 because 2 made the calendar show under the divmenu. -->
|
||||
<div id="divmenu2" class="menu menu_radius_left" style="display:none; z-index:1; height: 97%;">
|
||||
<b> <?php echo __('Pandora FMS Graph configuration menu');?></b>
|
||||
<br />
|
||||
<br />
|
||||
|
@ -288,151 +350,7 @@ $label = base64_decode(get_parameter('label', ''));
|
|||
<div style="float: left; width: 85%;">
|
||||
|
||||
<form method="get" action="stat_win.php">
|
||||
<?php
|
||||
html_print_input_hidden ("id", $id);
|
||||
html_print_input_hidden ("label", $label);
|
||||
|
||||
if (isset($hash_connection_data)) {
|
||||
|
||||
html_print_input_hidden("loginhash", "auto");
|
||||
html_print_input_hidden("loginhash_data", $loginhash_data);
|
||||
html_print_input_hidden("loginhash_user", $loginhash_user);
|
||||
}
|
||||
|
||||
html_print_input_hidden ("id", $id);
|
||||
html_print_input_hidden ("label", $label);
|
||||
|
||||
if (isset($_GET["type"])) {
|
||||
$type = get_parameter_get ("type");
|
||||
html_print_input_hidden ("type", $type);
|
||||
}
|
||||
?>
|
||||
<table class="databox_frame" cellspacing="2" width="100%">
|
||||
<tr>
|
||||
<td><?php echo __('Refresh time');?></td>
|
||||
<td width="50%">
|
||||
<?php
|
||||
html_print_extended_select_for_time(
|
||||
"refresh", $refresh, '', '', 0, 7);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if ($graph_type != "boolean") {
|
||||
echo '<tr>
|
||||
<td>'.
|
||||
__('Avg. Only').
|
||||
'</td>
|
||||
<td>';
|
||||
html_print_checkbox ("avg_only", 1, (bool) $avg_only, false, false, 'show_others()');
|
||||
html_print_input_hidden('show_other', 0);
|
||||
echo '</td>
|
||||
</tr>';
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo __('Begin date'); ?></td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_input_text ("start_date", substr ($start_date, 0, 10),'', 10);
|
||||
html_print_image ("images/calendar_view_day.png", false, array ("onclick" => "scwShow(scwID('text-start_date'),this);"));
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo __('Zoom factor');?></td>
|
||||
<td>
|
||||
<?php
|
||||
$options = array ();
|
||||
$options[$zoom] = 'x'.$zoom;
|
||||
$options[1] = 'x1';
|
||||
$options[2] = 'x2';
|
||||
$options[3] = 'x3';
|
||||
$options[4] = 'x4';
|
||||
html_print_select ($options, "zoom", $zoom);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo __('Time range'); ?></td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_extended_select_for_time('period',
|
||||
$period, '', '', 0, 7);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo __('Show events');?></td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_checkbox ("draw_events", 1, (bool) $draw_events);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo __('Show alerts');?></td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_checkbox ("draw_alerts", 1, (bool) $draw_alerts);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo __('Show event graph');?></td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_checkbox ("show_events_graph",
|
||||
1, (bool) $show_events_graph);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
switch ($graph_type) {
|
||||
case 'boolean':
|
||||
case 'sparse':
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
echo __('Time compare') . ' (' .
|
||||
__('Overlapped') . ')';
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_checkbox ("time_compare_overlapped",
|
||||
1, (bool) $time_compare_overlapped);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
echo __('Time compare') . ' ('.
|
||||
__('Separated').')';
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_checkbox ("time_compare_separated",
|
||||
1, (bool) $time_compare_separated);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php echo __('Show unknown graph');?></td>
|
||||
<td>
|
||||
<?php
|
||||
html_print_checkbox ("unknown_graph",
|
||||
1, (bool) $unknown_graph);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td style="text-align: right">
|
||||
|
@ -444,7 +362,7 @@ $label = base64_decode(get_parameter('label', ''));
|
|||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div id="show_menu" style="position: relative; border:1px solid #FFF; float: right; height: 50px; width: 50px;">
|
||||
<div id="show_menu2" style="position: relative; border:1px solid #FFF; float: right; height: 50px; width: 50px;">
|
||||
<?php
|
||||
html_print_image("images/graphmenu_arrow.png", false, array('id' => 'graph_menu_arrow'));
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue