Hello community, here is the log from the commit of package nagvis for openSUSE:Factory checked in at 2018-01-30 15:44:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/nagvis (Old) and /work/SRC/openSUSE:Factory/.nagvis.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nagvis" Tue Jan 30 15:44:53 2018 rev:4 rq:570879 version:1.9.5 Changes: -------- --- /work/SRC/openSUSE:Factory/nagvis/nagvis.changes 2017-12-08 21:48:36.095937328 +0100 +++ /work/SRC/openSUSE:Factory/.nagvis.new/nagvis.changes 2018-01-30 15:44:58.976982351 +0100 @@ -1,0 +2,15 @@ +Tue Jan 30 08:37:57 UTC 2018 - [email protected] + +- update to 1.9.5 + Frontend: + * FIX: Fixed wrong hostname label in service hover menus + * FIX: Fixed repeated zoom of background image on state updates + * FIX: Fixed errors when saving viewport as new map + * FIX: Fixed rare issue when cloning just added objects + * FIX: Fixed broken worldmap when using relative objects + * FIX: Fixed displaying wrong backend option "-b" in summary output + * FIX: Don't display "update backend configuration" confirm in quiet mode + * FIX: Don't fail updating map configurations when no maps are defined + * FIX: Don't register demo rotation when using the "-o" option + +------------------------------------------------------------------- Old: ---- nagvis-1.9.4.tar.gz New: ---- nagvis-1.9.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nagvis.spec ++++++ --- /var/tmp/diff_new_pack.9eVnhB/_old 2018-01-30 15:44:59.736946873 +0100 +++ /var/tmp/diff_new_pack.9eVnhB/_new 2018-01-30 15:44:59.740946686 +0100 @@ -1,7 +1,7 @@ # # spec file for package nagvis # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2012-2015 Lars Vogdt <[email protected]> # # All modifications and additions to the file contributed by third parties @@ -18,7 +18,7 @@ Name: nagvis -Version: 1.9.4 +Version: 1.9.5 Release: 0 Summary: Visualization addon for Nagios License: GPL-2.0 ++++++ nagvis-1.9.4.tar.gz -> nagvis-1.9.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagvis-1.9.4/ChangeLog new/nagvis-1.9.5/ChangeLog --- old/nagvis-1.9.4/ChangeLog 2017-10-25 16:41:31.000000000 +0200 +++ new/nagvis-1.9.5/ChangeLog 2018-01-07 12:54:02.000000000 +0100 @@ -1,3 +1,19 @@ +1.9.5 +Frontend: + * FIX: Fixed wrong hostname label in service hover menus + * FIX: Fixed repeated zoom of background image on state updates + +Worldmap: + * FIX: Fixed errors when saving viewport as new map + * FIX: Fixed rare issue when cloning just added objects + * FIX: Fixed broken worldmap when using relative objects + +Installer: + * FIX: Fixed displaying wrong backend option "-b" in summary output + * FIX: Don't display "update backend configuration" confirm in quiet mode + * FIX: Don't fail updating map configurations when no maps are defined + * FIX: Don't register demo rotation when using the "-o" option + 1.9.4 Core: * List of hover menu childs (e.g. services in host object hover) can now be diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagvis-1.9.4/etc/conf.d/demo.ini.php new/nagvis-1.9.5/etc/conf.d/demo.ini.php --- old/nagvis-1.9.4/etc/conf.d/demo.ini.php 2017-10-25 16:41:31.000000000 +0200 +++ new/nagvis-1.9.5/etc/conf.d/demo.ini.php 2018-01-07 12:54:02.000000000 +0100 @@ -3,9 +3,17 @@ ; viewing this file from web. ; DON'T REMOVE IT! -; This file defines a backend instance of the Test backend +; This file defines the rotation object for default maps. This +; can be removed when you are not interested in demo maps rotation. + +; This file also defines a backend instance of the Test backend ; which is used by some demo maps. This can be removed when ; you are not interested in the demo maps. + +[rotation_demo] +maps="demo-germany,demo-ham-racks,demo-load,demo-muc-srv1,demo-geomap,demo-automap" +interval=15 + [backend_demo] backendtype=Test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagvis-1.9.4/etc/nagvis.ini.php-sample new/nagvis-1.9.5/etc/nagvis.ini.php-sample --- old/nagvis-1.9.4/etc/nagvis.ini.php-sample 2017-10-25 16:41:31.000000000 +0200 +++ new/nagvis-1.9.5/etc/nagvis.ini.php-sample 2018-01-07 12:54:02.000000000 +0100 @@ -441,15 +441,15 @@ ; ---------------------------- ; in this example the browser switches between the maps demo and demo2 every 15 -; seconds, the rotation is enabled by url: index.php?rotation=demo -[rotation_demo] +; seconds, the rotation is enabled by url: index.php?rotation=example +;[rotation_example] ; These steps are rotated. The single steps may have optional prefixes like "Demo2:" ; which are used as display text on the index pages rotation list. ; You may also add external URLs as steps. Simply enclose the url using [] ; instead of the map name. -maps="demo-germany,demo-ham-racks,demo-load,demo-muc-srv1,demo-geomap,demo-automap" +;maps="map1,map2,map3" ; rotation interval (seconds) -interval=15 +;interval=15 ; ---------------------------- ; Action definitions diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagvis-1.9.4/install.sh new/nagvis-1.9.5/install.sh --- old/nagvis-1.9.4/install.sh 2017-10-25 16:41:31.000000000 +0200 +++ new/nagvis-1.9.5/install.sh 2018-01-07 12:54:02.000000000 +0100 @@ -421,6 +421,11 @@ # Check Backend module prerequisites check_backend() { + # Do not ask in quiet mode + if [ $INSTALLER_QUIET -eq 0 ]; then + return + fi + # Ask to configure the backends during update if [ $INSTALLER_ACTION = "update" ]; then confirm "Do you want to update the backend configuration?" "n" @@ -562,7 +567,7 @@ fi BACKENDS=${BACKENDS#,} - [ ! -z "$BACKENDS" ] && CALL="$CALL -b $NAGVIS_BACKEND" + [ ! -z "$BACKENDS" ] && CALL="$CALL -i $BACKENDS" } # Check Apache PHP module diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagvis-1.9.4/share/frontend/nagvis-js/classes/NagVisHeaderMenu.php new/nagvis-1.9.5/share/frontend/nagvis-js/classes/NagVisHeaderMenu.php --- old/nagvis-1.9.4/share/frontend/nagvis-js/classes/NagVisHeaderMenu.php 2017-10-25 16:41:31.000000000 +0200 +++ new/nagvis-1.9.5/share/frontend/nagvis-js/classes/NagVisHeaderMenu.php 2018-01-07 12:54:02.000000000 +0100 @@ -414,8 +414,8 @@ 'langToStaticMap' => l('Export to static map'), 'langModifyParams' => l('Modify view'), 'langMapViewport' => l('Viewport'), - 'langSaveView' => l('Save View'), - 'langSaveViewAsNewMap' => l('Save as new Map'), + 'langSaveView' => l('Save view'), + 'langSaveViewAsNewMap' => l('Save as new map'), 'langScaleToAll' => l('Show all objects'), // Supported by backend and not using trusted auth 'supportedChangePassword' => $AUTH->checkFeature('changePassword') && !$AUTH->authedTrusted(), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagvis-1.9.4/share/frontend/nagvis-js/js/ElementHover.js new/nagvis-1.9.5/share/frontend/nagvis-js/js/ElementHover.js --- old/nagvis-1.9.4/share/frontend/nagvis-js/js/ElementHover.js 2017-10-25 16:41:31.000000000 +0200 +++ new/nagvis-1.9.5/share/frontend/nagvis-js/js/ElementHover.js 2018-01-07 12:54:02.000000000 +0100 @@ -579,7 +579,7 @@ oMacros.lang_name = _('hostname'); oMacros.lang_child_name = _('servicename'); } else if (this.obj.conf.type == 'service') { - oMacros.lang_name = _('servicename'); + oMacros.lang_name = _('hostname'); } else if (this.obj.conf.type == 'hostgroup') { oMacros.lang_name = _('hostgroupname'); oMacros.lang_child_name = _('hostname'); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagvis-1.9.4/share/frontend/nagvis-js/js/ViewMap.js new/nagvis-1.9.5/share/frontend/nagvis-js/js/ViewMap.js --- old/nagvis-1.9.4/share/frontend/nagvis-js/js/ViewMap.js 2017-10-25 16:41:31.000000000 +0200 +++ new/nagvis-1.9.5/share/frontend/nagvis-js/js/ViewMap.js 2018-01-07 12:54:02.000000000 +0100 @@ -292,9 +292,11 @@ var oImage = document.createElement('img'); oImage.setAttribute('id', 'backgroundImage'); document.getElementById('map').appendChild(oImage); + addZoomHandler(oImage, true); } - addZoomHandler(oImage, true); + oImage.removeAttribute("width"); + oImage.removeAttribute("height"); oImage.src = sImage; } else if (oImage) { oImage.parentNode.removeChild(oImage); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagvis-1.9.4/share/frontend/nagvis-js/js/nagvis.js new/nagvis-1.9.5/share/frontend/nagvis-js/js/nagvis.js --- old/nagvis-1.9.4/share/frontend/nagvis-js/js/nagvis.js 2017-10-25 16:41:31.000000000 +0200 +++ new/nagvis-1.9.5/share/frontend/nagvis-js/js/nagvis.js 2018-01-07 12:54:02.000000000 +0100 @@ -1151,7 +1151,8 @@ // san francisco and zooming to new your will lead to a negative 5 digit // negative coord). function isRelativeCoord(v) { - return isset(v) && ((!isInt(v) && !isFloat(v)) || (v.length === 6 && v.charAt(0) != "-")); + return isset(v) && ((!isInt(v) && !isFloat(v)) + || (v.length === 6 && v.charAt(0) != "-" && v.indexOf(".") == -1)); } // Helper function to determine the number of entries in an object diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagvis-1.9.4/share/server/core/classes/ViewToNewMap.php new/nagvis-1.9.5/share/server/core/classes/ViewToNewMap.php --- old/nagvis-1.9.4/share/server/core/classes/ViewToNewMap.php 2017-10-25 16:41:31.000000000 +0200 +++ new/nagvis-1.9.5/share/server/core/classes/ViewToNewMap.php 2018-01-07 12:54:02.000000000 +0100 @@ -29,6 +29,17 @@ global $CORE; ob_start(); + + $view_params = array(); + $params = ltrim(req('view_params'), '&'); + if ($params) { + $parts = explode('&', $params); + foreach ($parts as $part) { + list($key, $val) = explode('=', $part); + $view_params[$key] = $val; + } + } + if (is_action()) { try { $name = post('name'); @@ -42,6 +53,18 @@ if (count($CORE->getAvailableMaps('/^'.$name.'$/')) > 0) throw new FieldInputError('name', l('A map with this name already exists.')); + if (!isset($view_params["worldmap_center"])) + throw new FieldInputError('view_params', l('Please change your viewport before saving as new map.')); + + if (!preg_match(MATCH_COORDS_MULTI, $view_params["worldmap_center"])) + throw new FieldInputError('view_params', l('This is not a valid worldmap center')); + + if (!isset($view_params["worldmap_zoom"])) + throw new FieldInputError('view_params', l('Worldmap zoom parameter missing.')); + + if (!preg_match(MATCH_INTEGER, $view_params["worldmap_zoom"])) + throw new FieldInputError('view_params', l('This is not a valid worldmap zoom')); + // Read the old config $MAPCFG = new GlobalMapCfg($orig_name); $MAPCFG->readMapConfig(); @@ -53,6 +76,10 @@ $NEW->addElement($cfg['type'], $cfg, $perm = true, $object_id); } + $NEW->setValue(0, "worldmap_center", $view_params["worldmap_center"]); + $NEW->setValue(0, "worldmap_zoom", $view_params["worldmap_zoom"]); + $NEW->storeUpdateElement(0); + success(l('The map has been created.')); reload(cfg('paths','htmlbase').'/frontend/nagvis-js/index.php?mod=Map&show='.$name, 1); } catch (FieldInputError $e) { @@ -75,13 +102,8 @@ focus('name'); // Keep the view parameters the users has set - $params = ltrim(req('view_params'), '&'); - if ($params) { - $parts = explode('&', $params); - foreach ($parts as $part) { - list($key, $val) = explode('=', $part); - hidden($key, $val); - } + foreach ($view_params AS $key => $val) { + hidden($key, $val); } form_end(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagvis-1.9.4/share/server/core/defines/global.php new/nagvis-1.9.5/share/server/core/defines/global.php --- old/nagvis-1.9.4/share/server/core/defines/global.php 2017-10-25 16:41:31.000000000 +0200 +++ new/nagvis-1.9.5/share/server/core/defines/global.php 2018-01-07 12:54:02.000000000 +0100 @@ -23,7 +23,7 @@ *****************************************************************************/ // NagVis Version -define('CONST_VERSION', '1.9.4'); +define('CONST_VERSION', '1.9.5'); // Set PHP error handling to standard level // Different levels for php versions below 5.1 because PHP 5.1 reports diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagvis-1.9.4/share/server/core/mapcfg/default.php new/nagvis-1.9.5/share/server/core/mapcfg/default.php --- old/nagvis-1.9.4/share/server/core/mapcfg/default.php 2017-10-25 16:41:31.000000000 +0200 +++ new/nagvis-1.9.5/share/server/core/mapcfg/default.php 2018-01-07 12:54:02.000000000 +0100 @@ -115,7 +115,7 @@ } elseif ($objId !== null) { $backendIds = $MAPCFG->getValue($objId, 'backend_id'); } else { - $backendIds = $MAPCFG->getValue('0', 'backend_id'); + $backendIds = $MAPCFG->getValue(0, 'backend_id'); } // Return simply nothing when a user just choosen to insert multiple backends diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nagvis-1.9.4/share/server/core/sources/worldmap.php new/nagvis-1.9.5/share/server/core/sources/worldmap.php --- old/nagvis-1.9.4/share/server/core/sources/worldmap.php 2017-10-25 16:41:31.000000000 +0200 +++ new/nagvis-1.9.5/share/server/core/sources/worldmap.php 2018-01-07 12:54:02.000000000 +0100 @@ -184,12 +184,12 @@ // When an object has relative coordinates also fetch the referenced object if ($referenced) { - $keys = array_keys($referenced); + $keys = array_unique(array_keys($referenced)); $count = count($keys); $oids = array(); $filter = array(); for ($i = 1; $i <= $count; $i++) { - $id = "o$i"; + $id = ":o$i"; $oids[] = $id; $filter[$id] = $keys[$i - 1]; } @@ -243,6 +243,10 @@ if ($obj['type'] == 'global') return false; // adding global section (during map creation) + // disable creating new objects during "view to new map" action + if (val($_GET, 'act', null) == 'viewToNewMap') + return true; + $lat = $obj['x']; $lng = $obj['y']; $lat2 = null;
