Horrible fix to prevent variable from being modified later

This commit is contained in:
Benjamin Drieu 2022-09-09 11:40:55 +02:00 committed by Benjamin Drieu
parent d51f470428
commit 07a62e5280
3 changed files with 3 additions and 4 deletions

View File

@ -110,7 +110,7 @@ class Icinga extends GenericServer {
getUrlForService ( service )
{
return '%s/?type=2&host=%s&service=%s'.format ( this._settings.get_string ( 'urlcgi' ).replace ( /status.cgi/, 'extinfo.cgi' ),
return '%s?type=2&host=%s&service=%s'.format ( this._settings.get_string ( 'urlcgi' ).replace ( /status.cgi/, 'extinfo.cgi' ),
encodeURI ( service.real_host_name ),
encodeURI ( service.service_display_name ) );
}

View File

@ -82,9 +82,8 @@ class Icinga2 extends GenericServer {
getUrlForService ( service )
{
log ( service );
return '%s/monitoring/service/show?host=%s&service=%s'.format ( this._settings.get_string ( 'url' ),
service.host_name,
service.real_host_name,
service.service_display_name );
}

View File

@ -102,7 +102,7 @@ class Icinga2API extends GenericServer {
// log ( JSON.stringify(entry) );
this.status.service_status.push ( {
status: _statuses[entry.attrs.state],
real_host_name: entry.attrs.host_name,
real_host_name: entry.attrs.host_name + '',
host_name: entry.attrs.host_name,
service_display_name: entry.attrs.display_name,
has_been_acknowledged: parseInt(entry.attrs.acknowledgement),