Author: Lars Michelsen <[email protected]>
Date: Fri Aug 23 21:47:14 2013 +0200
Committer: Lars Michelsen <[email protected]>
Commit-Date: Fri Aug 23 21:47:14 2013 +0200
Showing hostname in hover menus of dynamic groups which engroup services
---
share/frontend/nagvis-js/js/NagVisObject.js | 2 +-
share/frontend/nagvis-js/js/hover.js | 4 ++--
.../server/core/classes/objects/NagVisDynGroup.php | 7 ++++---
share/server/core/classes/objects/NagVisObject.php | 9 ++++++---
4 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/share/frontend/nagvis-js/js/NagVisObject.js
b/share/frontend/nagvis-js/js/NagVisObject.js
index 6e4186e..aa766fb 100644
--- a/share/frontend/nagvis-js/js/NagVisObject.js
+++ b/share/frontend/nagvis-js/js/NagVisObject.js
@@ -289,7 +289,7 @@ var NagVisObject = Base.extend({
oSectionMacros.hostgroup =
'<!--\\sBEGIN\\shostgroup\\s-->.+?<!--\\sEND\\shostgroup\\s-->';
// Replace servicegroup range macros when not in a servicegroup
- if(this.conf.type !== 'servicegroup')
+ if(this.conf.type !== 'servicegroup' && !(this.conf.type ===
'dyngroup' && this.conf.object_types == 'service'))
oSectionMacros.servicegroup =
'<!--\\sBEGIN\\sservicegroup\\s-->.+?<!--\\sEND\\sservicegroup\\s-->';
// Replace map range macros when not in a hostgroup
diff --git a/share/frontend/nagvis-js/js/hover.js
b/share/frontend/nagvis-js/js/hover.js
index 1eacb4a..c28f4a9 100644
--- a/share/frontend/nagvis-js/js/hover.js
+++ b/share/frontend/nagvis-js/js/hover.js
@@ -113,7 +113,7 @@ function replaceHoverTemplateMacrosChild(oObj,
sTemplateCode) {
else
oMacros.obj_name = oObj.conf.name;
- if(oObj.parent_type === 'servicegroup' && oObj.conf.type === 'service')
+ if((oObj.parent_type === 'servicegroup' || oObj.parent_type ===
'dyngroup') && oObj.conf.type === 'service')
oMacros.obj_name1 = oObj.conf.name;
else {
var regex = getRegEx('section-sgchild',
'<!--\\sBEGIN\\sservicegroup_child\\s-->.+?<!--\\sEND\\sservicegroup_child\\s-->',
'gm');
@@ -264,7 +264,7 @@ function replaceHoverTemplateStaticMacros(oObj,
sTemplateCode) {
oSectionMacros.host =
'<!--\\sBEGIN\\shost\\s-->.+?<!--\\sEND\\shost\\s-->';
// Replace servicegroup sections when not servicegroup object
- if(oObj.conf.type !== 'servicegroup') {
+ if(oObj.conf.type !== 'servicegroup' && !(oObj.conf.type === 'dyngroup' &&
oObj.conf.object_types == 'service')) {
oSectionMacros.servicegroup =
'<!--\\sBEGIN\\sservicegroup\\s-->.+?<!--\\sEND\\sservicegroup\\s-->';
}
diff --git a/share/server/core/classes/objects/NagVisDynGroup.php
b/share/server/core/classes/objects/NagVisDynGroup.php
index 11e50d7..a5a0603 100644
--- a/share/server/core/classes/objects/NagVisDynGroup.php
+++ b/share/server/core/classes/objects/NagVisDynGroup.php
@@ -25,9 +25,10 @@
class NagVisDynGroup extends NagVisStatefulObject {
protected $type = 'dyngroup';
- protected static $langType = null;
- protected static $langSelf = null;
- protected static $langChild = null;
+ protected static $langType = null;
+ protected static $langSelf = null;
+ protected static $langChild = null;
+ protected static $langChild1 = null;
protected $name;
diff --git a/share/server/core/classes/objects/NagVisObject.php
b/share/server/core/classes/objects/NagVisObject.php
index 66b1a08..d41794f 100644
--- a/share/server/core/classes/objects/NagVisObject.php
+++ b/share/server/core/classes/objects/NagVisObject.php
@@ -278,14 +278,17 @@ class NagVisObject {
break;
case 'dyngroup':
if(NagVisDynGroup::$langType === null) {
- NagVisDynGroup::$langType = l('Dynamic Group');
- NagVisDynGroup::$langSelf = l('Dynamic Group Name');
- NagVisDynGroup::$langChild = l('Object Name');
+ NagVisDynGroup::$langType = l('Dynamic Group');
+ NagVisDynGroup::$langSelf = l('Dynamic Group Name');
+ NagVisDynGroup::$langChild = l('Object Name');
+ NagVisDynGroup::$langChild1 = l('hostname');
}
$arr['lang_obj_type'] = NagVisDynGroup::$langType;
$arr['lang_name'] = NagVisDynGroup::$langSelf;
$arr['lang_child_name'] = NagVisDynGroup::$langChild;
+ if ($this->object_types == 'service')
+ $arr['lang_child_name1'] = NagVisDynGroup::$langChild1;
break;
case 'map':
if(NagVisMapObj::$langType === null) {
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins