Fix short_name and display_name properties.

Refs #4973
This commit is contained in:
Gunnar Beutner 2013-10-30 09:55:00 +01:00
parent 266afc9ee9
commit 24d018a058
7 changed files with 48 additions and 13 deletions

View File

@ -32,7 +32,12 @@ enum StateType
class Host : DynamicObject
{
[config] String display_name {
default {{{ return GetName(); }}}
get {{{
if (m_DisplayName.IsEmpty())
return GetName();
else
return m_DisplayName;
}}}
};
[config] Array::Ptr groups;
[config] Dictionary::Ptr macros;

View File

@ -6,7 +6,12 @@ namespace icinga
class HostGroup : DynamicObject
{
[config] String display_name {
default {{{ return GetName(); }}}
get {{{
if (m_DisplayName.IsEmpty())
return GetName();
else
return m_DisplayName;
}}}
};
};

View File

@ -48,7 +48,12 @@ class Service : DynamicObject
[config] String event_command (EventCommandRaw);
[config] bool volatile;
[config] String short_name {
default {{{ return GetName(); }}}
get {{{
if (m_ShortName.IsEmpty())
return GetName();
else
return m_ShortName;
}}}
};
[config] String host (HostRaw);
[config] double flapping_threshold {

View File

@ -6,7 +6,12 @@ namespace icinga
class ServiceGroup : DynamicObject
{
[config] String display_name {
default {{{ return GetName(); }}}
get {{{
if (m_DisplayName.IsEmpty())
return GetName();
else
return m_DisplayName;
}}}
};
};

View File

@ -6,7 +6,12 @@ namespace icinga
class TimePeriod : DynamicObject
{
[config] String display_name {
default {{{ return GetName(); }}}
get {{{
if (m_DisplayName.IsEmpty())
return GetName();
else
return m_DisplayName;
}}}
};
[config] Dictionary::Ptr ranges;
[state] Value valid_begin;

View File

@ -6,7 +6,12 @@ namespace icinga
class User : DynamicObject
{
[config] String display_name {
default {{{ return GetName(); }}}
get {{{
if (m_DisplayName.IsEmpty())
return GetName();
else
return m_DisplayName;
}}}
};
[config] Dictionary::Ptr macros;
[config] Array::Ptr groups;

View File

@ -6,7 +6,12 @@ namespace icinga
class UserGroup : DynamicObject
{
[config] String display_name {
default {{{ return GetName(); }}}
get {{{
if (m_DisplayName.IsEmpty())
return GetName();
else
return m_DisplayName;
}}}
};
};