Compare commits
2 Commits
146ffe7b09
...
5aee2cb9f2
Author | SHA1 | Date | |
---|---|---|---|
5aee2cb9f2 | |||
51bfedd349 |
@ -164,6 +164,7 @@ class Indicator extends PanelMenu.Button {
|
||||
});
|
||||
this._searchField.connect('secondary-icon-clicked', Lang.bind(this, this._onSearchFieldActivate ) );
|
||||
this._searchField.clutter_text.connect('activate', Lang.bind(this, this._onSearchFieldActivate ) );
|
||||
this._searchField.clutter_text.connect('text-changed', Lang.bind(this, this._onSearchFieldActivate ) );
|
||||
|
||||
this._buttonMenu.actor.add_child (this._searchField);
|
||||
|
||||
@ -444,9 +445,9 @@ class Indicator extends PanelMenu.Button {
|
||||
for ( let entry of processedStatus )
|
||||
{
|
||||
if ( this._searchString &&
|
||||
! ( entry [ 'host_name' ].includes ( this._searchString ) ||
|
||||
entry [ 'service_display_name' ].includes ( this._searchString ) ||
|
||||
entry [ 'status_information' ].includes ( this._searchString ) ) )
|
||||
! ( entry [ 'host_name' ].toLowerCase().includes ( this._searchString ) ||
|
||||
entry [ 'service_display_name' ].toLowerCase().includes ( this._searchString ) ||
|
||||
entry [ 'status_information' ].toLowerCase().includes ( this._searchString ) ) )
|
||||
continue;
|
||||
|
||||
if ( ( ! _status [ 'WARNING' ] && ! _status [ 'CRITICAL' ] && ! _status [ 'UNKNOWN' ] && entry.status == 'OK' ) ||
|
||||
@ -532,7 +533,7 @@ class Indicator extends PanelMenu.Button {
|
||||
|
||||
_onSearchFieldActivate ( e ) {
|
||||
monitoLog ( 'Search: ' + e.text );
|
||||
this._searchString = e.text;
|
||||
this._searchString = e.text.toLowerCase();
|
||||
this.refreshUI ( );
|
||||
return;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class Icinga2API extends GenericServer {
|
||||
{
|
||||
let message = Soup.form_request_new_from_hash ( 'POST', this.urlcgi + '/actions/reschedule-check', { } );
|
||||
|
||||
let params = '{ "type": "Service", "filter": "host.name==\\"%s\\" && service.name==\\"%s\\"", "force": true, "pretty": true }' . format ( encodeURI ( entry.real_host_name ), encodeURI ( entry.real_service_display_name ) );
|
||||
let params = '{ "type": "Service", "filter": "host.name==\\"%s\\" && service.name==\\"%s\\"", "force": true, "pretty": true }' . format ( entry.real_host_name, entry.real_service_display_name );
|
||||
|
||||
message.request_body.truncate();
|
||||
message.request_body.append ( params );
|
||||
@ -63,7 +63,6 @@ class Icinga2API extends GenericServer {
|
||||
message.button = entry.button;
|
||||
|
||||
message.request_headers.append ( 'Accept', 'application/json' );
|
||||
// log ( message.request_headers );
|
||||
|
||||
this.authenticateAndSend ( message, this.handleCMDMessage );
|
||||
}
|
||||
@ -80,7 +79,6 @@ class Icinga2API extends GenericServer {
|
||||
message.button = button;
|
||||
|
||||
message.request_headers.append ( 'Accept', 'application/json' );
|
||||
// log ( message.request_headers );
|
||||
|
||||
this.authenticateAndSend ( message, this.handleCMDMessage );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user