Module: nagvis Branch: master Commit: 29941b2288ce8d4efbccc49f6293437e97af8172 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/commit/?id=29941b2288ce8d4efbccc49f6293437e97af8172
Author: Lars Michelsen <[email protected]> Date: Wed Aug 19 19:28:44 2009 +0200 #83: Improved gadget_scale handling --- share/nagvis/gadgets/gadgets_core.php | 11 +++++++++++ share/wui/includes/classes/WuiMap.php | 2 +- 2 files changed, 12 insertions(+), 1 deletions(-) diff --git a/share/nagvis/gadgets/gadgets_core.php b/share/nagvis/gadgets/gadgets_core.php index e14729c..96f3d2e 100644 --- a/share/nagvis/gadgets/gadgets_core.php +++ b/share/nagvis/gadgets/gadgets_core.php @@ -36,6 +36,7 @@ * - name2: Service description * - state: Current state * - stateType: Current state type (soft/hard) + * - scale: Scale of the gadget in percent (default 100) * ***************************************************************************** * @@ -64,6 +65,7 @@ * aOpts['state'] - State of the service (OK, WARNING, * CRITICAL, UNKNOWN) * aOpts['stateType'] - Type of the state (HARD, SOFT) + * aOpts['scale'] - Scale of the gadget in percent (INTEGER) * ******************************************************************************/ @@ -178,6 +180,7 @@ $aPerfdata = Array(); * name2=Current Load * state=OK * stateType=HARD + * scale=100 */ if(isset($_GET['perfdata']) && $_GET['perfdata'] != '') { @@ -204,6 +207,14 @@ if(isset($_GET['stateType']) && $_GET['stateType'] != '') { $aOpts['stateType'] = $_GET['stateType']; } +if (isset($_GET['scale']) && $_GET['scale'] != '') { + $aOpts['scale'] = $_GET['scale']; +} else { + /* If no scale is set, default to 100 */ + $aOpts['scale'] = 100; +} + + /* Now parse the perfdata */ $aPerfdata = parsePerfdata($aOpts['perfdata']); diff --git a/share/wui/includes/classes/WuiMap.php b/share/wui/includes/classes/WuiMap.php index df120dd..b7af3a5 100755 --- a/share/wui/includes/classes/WuiMap.php +++ b/share/wui/includes/classes/WuiMap.php @@ -254,7 +254,7 @@ class WuiMap extends GlobalMap { $sDelim = '?'; } - $obj['iconParams'] = $sDelim . 'name1=dummyHost&name2=dummyService&state=OK&stateType=HARD&conf=1'; + $obj['iconParams'] = $sDelim . 'name1=dummyHost&name2=dummyService&state=OK&stateType=HARD&conf=1&scale=' . $obj['gadget_scale']; } else { $obj['iconParams'] = ''; } ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
