From 7371579156da9c7a4a94cd5b653b34014eeed868 Mon Sep 17 00:00:00 2001 From: slerena Date: Fri, 16 Feb 2007 18:29:37 +0000 Subject: [PATCH] 2007-02-16 Sancho Lerena * pandoradb.sql: added unixtime field to tagente_datos, tagente_datos_string and tagente_estado tables. Future queries will use UNIX time instead of "Human" timestamp strings. * index.php: Small fix of duplicated body html tag. * agentes/estado_ultimopaquete.php: [DEBUG] Add a debug ICON for new graph... need to be delted. * /active_console/styles/main.css, and many .js: Style correction (massive changes), only indented and commented, no changes in code. * reporting/fgraph.php: CURRENTLY CHANGING CODE, NOT USE. * reporting/stat_win.php: Unified parameter parsing. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@374 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 19 + pandora_console/index.php | 4 +- .../operation/active_console/index.php | 69 +-- .../active_console/scripts/x_core.js | 346 +++++++++++++- .../operation/active_console/scripts/x_dom.js | 206 ++++++++- .../active_console/scripts/x_drag.js | 101 +++- .../active_console/scripts/x_event.js | 171 ++++++- .../active_console/scripts/x_slide.js | 58 ++- .../active_console/scripts/xformulario.js | 73 ++- .../active_console/scripts/xmenu2_html.js | 1 - .../operation/active_console/styles/main.css | 1 + .../agentes/estado_ultimopaquete.php | 11 +- pandora_console/pandoradb.sql | 5 +- pandora_console/reporting/fgraph.php | 435 ++++++++++++++---- pandora_console/reporting/stat_win.php | 141 +++--- 15 files changed, 1390 insertions(+), 251 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 8b2949b245..7c20c9f98d 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,22 @@ +2007-02-16 Sancho Lerena + + * pandoradb.sql: added unixtime field to tagente_datos, + tagente_datos_string and tagente_estado tables. Future queries + will use UNIX time instead of "Human" timestamp strings. + + * index.php: Small fix of duplicated body html tag. + + * agentes/estado_ultimopaquete.php: [DEBUG] Add a debug ICON for new + graph... need to be delted. + + * /active_console/styles/main.css, and many .js: Style correction + (massive changes), only indented and commented, no changes in + code. + + * reporting/fgraph.php: CURRENTLY CHANGING CODE, NOT USE. + + * reporting/stat_win.php: Unified parameter parsing. + 2007-02-06 Sancho Lerena * include/functions.php: Pagination function now works fine. diff --git a/pandora_console/index.php b/pandora_console/index.php index 8f19eb815e..e9c5a476e2 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -58,8 +58,8 @@ if (isset ($_GET["refr"])){ - - '; $REMOTE_ADDR = getenv ("REMOTE_ADDR"); diff --git a/pandora_console/operation/active_console/index.php b/pandora_console/operation/active_console/index.php index e4d2f97bab..d61e523d2c 100644 --- a/pandora_console/operation/active_console/index.php +++ b/pandora_console/operation/active_console/index.php @@ -24,7 +24,7 @@ global $dbpassword; global $dbtype; global $dbhost; -require("lib/db_functions.php"); // añadimos el php que contiene las funciones de acceso a base de datos +require("lib/db_functions.php"); // Add external functions to database require("lib/extra_functions.php"); //Variables globales @@ -32,52 +32,43 @@ require("lib/extra_functions.php"); $widthGraph=200; $heigthGraph=200; -// session_start(); +session_start(); ?> - - -"); } ?> -Pandora Console +Pandora FMS Active Console - + - - - - - - - - - \n"; echo "\n"; +//background='/images/console/background/europa.jpg' echo "
diff --git a/pandora_console/operation/active_console/scripts/x_core.js b/pandora_console/operation/active_console/scripts/x_core.js index 6b45ee0804..9e95fe05d7 100644 --- a/pandora_console/operation/active_console/scripts/x_core.js +++ b/pandora_console/operation/active_console/scripts/x_core.js @@ -1,2 +1,344 @@ -/* x_core.js compiled from X 4.0 with XC 0.27b. Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com */ -var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase();if(window.opera){var i=xUA.indexOf('opera');if(i!=-1){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7;xOp6Dn=v<7;}}else if(navigator.vendor!='KDE' && document.all && xUA.indexOf('msie')!=-1){xIE4Up=parseFloat(navigator.appVersion)>=4;xIE4=xUA.indexOf('msie 4')!=-1;xIE5=xUA.indexOf('msie 5')!=-1;}else if(document.layers){xNN4=true;}xMac=xUA.indexOf('mac')!=-1;function xBackground(e,c,i){if(!(e=xGetElementById(e))) return '';var bg='';if(e.style) {if(xStr(c)) {if(!xOp6Dn) e.style.backgroundColor=c;else e.style.background=c;}if(xStr(i)) e.style.backgroundImage=(i!='')? 'url('+i+')' : null;if(!xOp6Dn) bg=e.style.backgroundColor;else bg=e.style.background;}return bg;}function xClientHeight(){var h=0;if(xOp6Dn) h=window.innerHeight;else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientHeight)h=document.documentElement.clientHeight;else if(document.body && document.body.clientHeight)h=document.body.clientHeight;else if(xDef(window.innerWidth,window.innerHeight,document.width)) {h=window.innerHeight;if(document.width>window.innerWidth) h-=16;}return h;}function xClientWidth(){var w=0;if(xOp6Dn) w=window.innerWidth;else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientWidth)w=document.documentElement.clientWidth;else if(document.body && document.body.clientWidth)w=document.body.clientWidth;else if(xDef(window.innerWidth,window.innerHeight,document.height)) {w=window.innerWidth;if(document.height>window.innerHeight) w-=16;}return w;}function xClip(e,t,r,b,l){if(!(e=xGetElementById(e))) return;if(e.style) {if (xNum(l)) e.style.clip='rect('+t+'px '+r+'px '+b+'px '+l+'px)';else e.style.clip='rect(0 '+parseInt(e.style.width)+'px '+parseInt(e.style.height)+'px 0)';}}function xColor(e,s){if(!(e=xGetElementById(e))) return '';var c='';if(e.style && xDef(e.style.color)) {if(xStr(s)) e.style.color=s;c=e.style.color;}return c;}function xDef(){for(var i=0; i= eX + l && x <= eX + xWidth(e) - r &&y >= eY + t && y <= eY + xHeight(e) - b );}function xHeight(e,h){if(!(e=xGetElementById(e))) return 0;if (xNum(h)) {if (h<0) h = 0;else h=Math.round(h);}else h=-1;var css=xDef(e.style);if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') {h = xClientHeight();}else if(css && xDef(e.offsetHeight) && xStr(e.style.height)) {if(h>=0) {var pt=0,pb=0,bt=0,bb=0;if (document.compatMode=='CSS1Compat') {var gcs = xGetComputedStyle;pt=gcs(e,'padding-top',1);if (pt !== null) {pb=gcs(e,'padding-bottom',1);bt=gcs(e,'border-top-width',1);bb=gcs(e,'border-bottom-width',1);}else if(xDef(e.offsetHeight,e.style.height)){e.style.height=h+'px';pt=e.offsetHeight-h;}}h-=(pt+pb+bt+bb);if(isNaN(h)||h<0) return;else e.style.height=h+'px';}h=e.offsetHeight;}else if(css && xDef(e.style.pixelHeight)) {if(h>=0) e.style.pixelHeight=h;h=e.style.pixelHeight;}return h;}function xHide(e){return xVisibility(e,0);}function xLeft(e, iX){if(!(e=xGetElementById(e))) return 0;var css=xDef(e.style);if (css && xStr(e.style.left)) {if(xNum(iX)) e.style.left=iX+'px';else {iX=parseInt(e.style.left);if(isNaN(iX)) iX=0;}}else if(css && xDef(e.style.pixelLeft)) {if(xNum(iX)) e.style.pixelLeft=iX;else iX=e.style.pixelLeft;}return iX;}function xMoveTo(e,x,y){xLeft(e,x);xTop(e,y);}function xNum(){for(var i=0; i=0) {var pl=0,pr=0,bl=0,br=0;if (document.compatMode=='CSS1Compat') {var gcs = xGetComputedStyle;pl=gcs(e,'padding-left',1);if (pl !== null) {pr=gcs(e,'padding-right',1);bl=gcs(e,'border-left-width',1);br=gcs(e,'border-right-width',1);}else if(xDef(e.offsetWidth,e.style.width)){e.style.width=w+'px';pl=e.offsetWidth-w;}}w-=(pl+pr+bl+br);if(isNaN(w)||w<0) return;else e.style.width=w+'px';}w=e.offsetWidth;}else if(css && xDef(e.style.pixelWidth)) {if(w>=0) e.style.pixelWidth=w;w=e.style.pixelWidth;}return w;}function xZIndex(e,uZ){if(!(e=xGetElementById(e))) return 0;if(e.style && xDef(e.style.zIndex)) {if(xNum(uZ)) e.style.zIndex=uZ;uZ=parseInt(e.style.zIndex);}return uZ;} \ No newline at end of file +/* x_core.js compiled from X 4.0 with XC 0.27b. +Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com */ + +var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase(); +if(window.opera){ + var i=xUA.indexOf('opera'); + if(i!=-1){ + var v=parseInt(xUA.charAt(i+6)); + xOp7Up=v>=7; + xOp6Dn=v<7; + } +} +else if(navigator.vendor!='KDE' && + document.all && xUA.indexOf('msie')!=-1){ + xIE4Up=parseFloat(navigator.appVersion)>=4; + xIE4=xUA.indexOf('msie 4')!=-1; + xIE5=xUA.indexOf('msie 5')!=-1; +} else if(document.layers){ + xNN4=true; +} +xMac=xUA.indexOf('mac')!=-1; + +function xBackground(e,c,i){ + if(!(e=xGetElementById(e))) return ''; + var bg=''; + if (e.style) { + if(xStr(c)) { + if(!xOp6Dn) + e.style.backgroundColor=c; + else + e.style.background=c; + } + + if(xStr(i)) + e.style.backgroundImage=(i!='')? 'url('+i+')' : null;if(!xOp6Dn) bg=e.style.backgroundColor; + else + bg=e.style.background; + } + return bg; +} + + +function xClientHeight(){ + var h=0; + if(xOp6Dn) + h=window.innerHeight; + else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientHeight) + h=document.documentElement.clientHeight; + else if (document.body && document.body.clientHeight) + h=document.body.clientHeight; + else if (xDef(window.innerWidth,window.innerHeight,document.width)) { + h=window.innerHeight; + if(document.width>window.innerWidth) + h-=16; + } + return h; +} + +function xClientWidth(){ + var w=0; + if(xOp6Dn) + w=window.innerWidth; + else if(document.compatMode == 'CSS1Compat' && + !window.opera && document.documentElement && + document.documentElement.clientWidth) + w=document.documentElement.clientWidth; + else if(document.body && document.body.clientWidth) + w=document.body.clientWidth; + else if(xDef(window.innerWidth,window.innerHeight,document.height)) { + w=window.innerWidth; + if (document.height>window.innerHeight) + w-=16; + } + return w; +} + +function xClip(e,t,r,b,l){ + if(!(e=xGetElementById(e))) + return; + if(e.style) { + if (xNum(l)) + e.style.clip='rect('+t+'px '+r+'px '+b+'px '+l+'px)'; + else + e.style.clip='rect(0 '+parseInt(e.style.width)+'px '+parseInt(e.style.height)+'px 0)'; + } +} + +function xColor(e,s){ + if (!(e=xGetElementById(e))) + return ''; + var c=''; + if(e.style && xDef(e.style.color)) { + if(xStr(s)) + e.style.color=s; + c=e.style.color; + } + return c; +} + +function xDef(){ + for(var i=0; i= eX + l && x <= eX + xWidth(e) - r &&y >= eY + t && y <= eY + xHeight(e) - b ); +} + +function xHeight(e,h){ + if(!(e=xGetElementById(e))) + return 0; + if (xNum(h)) { + if (h<0) + h = 0; + else + h=Math.round(h); + } else + h=-1; + var css=xDef(e.style); + if (e == document || e.tagName.toLowerCase() == 'html' || e.tagName.toLowerCase() == 'body') { + h = xClientHeight(); + } else if(css && xDef(e.offsetHeight) && xStr(e.style.height)) { + if(h>=0) { + var pt=0,pb=0,bt=0,bb=0; + if (document.compatMode=='CSS1Compat') { + var gcs = xGetComputedStyle;pt=gcs(e,'padding-top',1); + if (pt !== null) { + pb=gcs(e,'padding-bottom',1); + bt=gcs(e,'border-top-width',1); + bb=gcs(e,'border-bottom-width',1); + } else + if(xDef(e.offsetHeight,e.style.height)){ + e.style.height=h+'px'; + pt=e.offsetHeight-h; + } + } + h-=(pt+pb+bt+bb); + if(isNaN(h)||h<0) + return; + else + e.style.height=h+'px'; + } + h=e.offsetHeight; + } + else if(css && xDef(e.style.pixelHeight)) { + if(h>=0) + e.style.pixelHeight=h; + h=e.style.pixelHeight; + } + return h; +} + +function xHide(e){ + return xVisibility(e,0); +} + + +function xLeft(e, iX){if(!(e=xGetElementById(e))) return 0;var css=xDef(e.style);if (css && xStr(e.style.left)) {if(xNum(iX)) e.style.left=iX+'px';else {iX=parseInt(e.style.left);if(isNaN(iX)) iX=0;}}else if(css && xDef(e.style.pixelLeft)) {if(xNum(iX)) e.style.pixelLeft=iX;else iX=e.style.pixelLeft;}return iX;} + + +function xMoveTo(e,x,y){ + xLeft(e,x); + xTop(e,y); +} + +function xNum(){ + for(var i=0; i=0) { + var pl=0,pr=0,bl=0,br=0; + if (document.compatMode=='CSS1Compat') { + var gcs = xGetComputedStyle; + pl=gcs(e,'padding-left',1); + if (pl !== null) { + pr=gcs(e,'padding-right',1); + bl=gcs(e,'border-left-width',1); + br=gcs(e,'border-right-width',1); + } else if (xDef(e.offsetWidth,e.style.width)){ + e.style.width = w+'px'; + pl=e.offsetWidth-w; + } + } + w-=(pl+pr+bl+br); + if (isNaN(w)||w<0) + return; + else + e.style.width=w+'px'; + } + w=e.offsetWidth; + } else if(css && xDef(e.style.pixelWidth)) { + if(w>=0) + e.style.pixelWidth=w; + w=e.style.pixelWidth; + } + return w; +} + + +function xZIndex(e,uZ){ + if (!(e=xGetElementById(e))) + return 0; + if (e.style && xDef(e.style.zIndex)) { + if(xNum(uZ)) + e.style.zIndex=uZ; + uZ=parseInt(e.style.zIndex); + } + return uZ; +} \ No newline at end of file diff --git a/pandora_console/operation/active_console/scripts/x_dom.js b/pandora_console/operation/active_console/scripts/x_dom.js index f28a226fdd..ce3bff1c9b 100644 --- a/pandora_console/operation/active_console/scripts/x_dom.js +++ b/pandora_console/operation/active_console/scripts/x_dom.js @@ -1,2 +1,204 @@ -/* x_dom.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 xAppendChild(oParent, oChild){if (oParent.appendChild) return oParent.appendChild(oChild);else return null;}function xCreateElement(sTag){if (document.createElement) return document.createElement(sTag);else return null;}function xFirstChild(e, t){var c = e ? e.firstChild : null;if (t) while (c && c.nodeName != t) { c = c.nextSibling; }else while (c && c.nodeType != 1) { c = c.nextSibling; }return c;}function xGetComputedStyle(oEle, sProp, bInt){var s, p = 'undefined';var dv = document.defaultView;if(dv && dv.getComputedStyle){s = dv.getComputedStyle(oEle,'');if (s) p = s.getPropertyValue(sProp);}else if(oEle.currentStyle) {var a = sProp.split('-');sProp = a[0];for (var i=1; i -function FormSetup() -{ +function FormSetup(){ -var cBtn = xGetElementById('formCerrBtn'); -var xForm = xGetElementById('xForm'); + var cBtn = xGetElementById('formCerrBtn'); + var xForm = xGetElementById('xForm'); -posLeft = 0; -posTop = 0; + posLeft = 0; + posTop = 0; -if (xClientWidth()>xWidth(xForm)) -{ -posLeft = xClientWidth()/2 -xWidth(xForm)/2; + if (xClientWidth()>xWidth(xForm)) { + posLeft = xClientWidth()/2 -xWidth(xForm)/2; + } + + if (xClientHeight()>xHeight(xForm)) { + posTop = xClientHeight()/2 -xHeight(xForm)/2 + } + + xMoveTo('xForm',posLeft ,posTop); + formPaint(); + xEnableDrag('xFormBar', formOnDragStart, formOnDrag, null); + xZIndex('xForm', highZ++); + cBtn.onclick = cBtnOnClick; + xShow('xForm'); } -if (xClientHeight()>xHeight(xForm)) -{ -posTop = xClientHeight()/2 -xHeight(xForm)/2 -} - xMoveTo('xForm',posLeft ,posTop); -formPaint(); - xEnableDrag('xFormBar', formOnDragStart, formOnDrag, null); - xZIndex('xForm', highZ++); - cBtn.onclick = cBtnOnClick; - xShow('xForm'); -} -function formPaint() -{ - var xForm = xGetElementById('xForm'); - var cBtn = xGetElementById('formCerrBtn'); - xMoveTo(cBtn, xWidth(xForm) - xWidth(cBtn), 0); +function formPaint(){ + var xForm = xGetElementById('xForm'); + var cBtn = xGetElementById('formCerrBtn'); + xMoveTo(cBtn, xWidth(xForm) - xWidth(cBtn), 0); } -function formOnDragStart(ele, mx, my) -{ - xZIndex('xForm', highZ++); -} -function formOnDrag(ele, mdx, mdy) -{ - xMoveTo('xForm', xLeft('xForm') + mdx, xTop('xForm') + mdy); -} -function cBtnOnClick() -{ -var cBtn = xGetElementById('formCerrBtn'); -var xForm = xGetElementById('xForm'); -xHide(xForm); +function formOnDragStart(ele, mx, my){ + xZIndex('xForm', highZ++); +} + +function formOnDrag(ele, mdx, mdy){ + xMoveTo('xForm', xLeft('xForm') + mdx, xTop('xForm') + mdy); +} + +function cBtnOnClick(){ + var cBtn = xGetElementById('formCerrBtn'); + var xForm = xGetElementById('xForm'); + xHide(xForm); } diff --git a/pandora_console/operation/active_console/scripts/xmenu2_html.js b/pandora_console/operation/active_console/scripts/xmenu2_html.js index 366d6d11de..0985c757a1 100644 --- a/pandora_console/operation/active_console/scripts/xmenu2_html.js +++ b/pandora_console/operation/active_console/scripts/xmenu2_html.js @@ -26,7 +26,6 @@ if (n == '3') // MENU EDICION document.write("