Skip to content

Commit

Permalink
ITC-2993 Add option to enable/disable search by regex to Dashboard ho…
Browse files Browse the repository at this point in the history
…st and service status lists
  • Loading branch information
nook24 committed May 4, 2023
1 parent b5163df commit d9e21ff
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/Template/Dashboards/hosts_status_list_extended_widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ class="btn btn-xs btn-info btn-lower-padding"
ng-model-options="{debounce: 500}">
<div class="input-group-append">
<span class="input-group-text pt-0 pb-0">
<label>
<?= __('Enable RegEx'); ?>
&nbsp;
<input type="checkbox"
ng-model="filter.Host.name_regex">
</label>
&nbsp;
<regex-helper-tooltip></regex-helper-tooltip>
</span>
</div>
Expand Down
9 changes: 8 additions & 1 deletion src/Template/Dashboards/hosts_status_list_widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class="btn btn-xs btn-primary">
<td>
<?php if ($this->Acl->hasPermission('browser', 'hosts')): ?>
<a ui-sref="HostsBrowser({id: host.Host.id})">
{{ host.Host.hostname }}
{{ host.Host.hostname }}
</a>
<?php else: ?>
{{ host.Host.hostname }}
Expand Down Expand Up @@ -144,6 +144,13 @@ class="btn btn-xs btn-primary">
ng-model-options="{debounce: 500}">
<div class="input-group-append">
<span class="input-group-text pt-0 pb-0">
<label>
<?= __('Enable RegEx'); ?>
&nbsp;
<input type="checkbox"
ng-model="filter.Host.name_regex">
</label>
&nbsp;
<regex-helper-tooltip></regex-helper-tooltip>
</span>
</div>
Expand Down
14 changes: 14 additions & 0 deletions src/Template/Dashboards/services_status_list_extended_widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ class="btn btn-xs btn-info btn-lower-padding"
ng-model-options="{debounce: 500}">
<div class="input-group-append">
<span class="input-group-text pt-0 pb-0">
<label>
<?= __('Enable RegEx'); ?>
&nbsp;
<input type="checkbox"
ng-model="filter.Host.name_regex">
</label>
&nbsp;
<regex-helper-tooltip></regex-helper-tooltip>
</span>
</div>
Expand All @@ -200,6 +207,13 @@ class="btn btn-xs btn-info btn-lower-padding"
ng-model-options="{debounce: 500}">
<div class="input-group-append">
<span class="input-group-text pt-0 pb-0">
<label>
<?= __('Enable RegEx'); ?>
&nbsp;
<input type="checkbox"
ng-model="filter.Service.name_regex">
</label>
&nbsp;
<regex-helper-tooltip></regex-helper-tooltip>
</span>
</div>
Expand Down
14 changes: 14 additions & 0 deletions src/Template/Dashboards/services_status_list_widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ class="btn btn-xs btn-primary">
ng-model-options="{debounce: 500}">
<div class="input-group-append">
<span class="input-group-text pt-0 pb-0">
<label>
<?= __('Enable RegEx'); ?>
&nbsp;
<input type="checkbox"
ng-model="filter.Host.name_regex">
</label>
&nbsp;
<regex-helper-tooltip></regex-helper-tooltip>
</span>
</div>
Expand All @@ -174,6 +181,13 @@ class="btn btn-xs btn-primary">
ng-model-options="{debounce: 500}">
<div class="input-group-append">
<span class="input-group-text pt-0 pb-0">
<label>
<?= __('Enable RegEx'); ?>
&nbsp;
<input type="checkbox"
ng-model="filter.Service.name_regex">
</label>
&nbsp;
<regex-helper-tooltip></regex-helper-tooltip>
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class HostStatusListJson extends DashboardJsonStandardizer {
],
'Host' => [
'name' => '',
'name_regex' => false,
'keywords' => '',
'not_keywords' => ''
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ class ServiceStatusListJson extends DashboardJsonStandardizer {
],
'Host' => [
'name' => '',
'name_regex' => false,
'keywords' => '',
'not_keywords' => ''
],
'Service' => [
'name' => '',
'name_regex' => false,
'keywords' => '',
'not_keywords' => ''
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ angular.module('openITCOCKPIT').directive('hostsStatusExtendedWidget', function(
},
Host: {
name: '',
name_regex: false,
keywords: '',
not_keywords: ''
}
Expand All @@ -57,6 +58,7 @@ angular.module('openITCOCKPIT').directive('hostsStatusExtendedWidget', function(
$scope.filter.Hoststatus.not_acknowledged = result.data.config.Hoststatus.not_acknowledged;
$scope.filter.Hoststatus.in_downtime = result.data.config.Hoststatus.in_downtime;
$scope.filter.Hoststatus.not_in_downtime = result.data.config.Hoststatus.not_in_downtime;
$scope.filter.Host.name_regex = result.data.config.Host.name_regex;
$scope.direction = result.data.config.direction;
$scope.sort = result.data.config.sort;
$scope.useScroll = result.data.config.useScroll;
Expand Down Expand Up @@ -100,6 +102,7 @@ angular.module('openITCOCKPIT').directive('hostsStatusExtendedWidget', function(
'includes[]': ['downtimes', 'acknowledgements'],
'direction': $scope.direction,
'filter[Hosts.name]': $scope.filter.Host.name,
'filter[Hosts.name_regex]': $scope.filter.Host.name_regex,
'filter[Hosts.keywords][]': $scope.filter.Host.keywords.split(','),
'filter[Hosts.not_keywords][]': $scope.filter.Host.not_keywords.split(','),
'filter[Hoststatus.output]': $scope.filter.Hoststatus.output,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ angular.module('openITCOCKPIT').directive('hostsStatusWidget', function($http, $
},
Host: {
name: '',
name_regex: false,
keywords: '',
not_keywords: ''
}
Expand All @@ -57,6 +58,7 @@ angular.module('openITCOCKPIT').directive('hostsStatusWidget', function($http, $
$scope.filter.Hoststatus.not_acknowledged = result.data.config.Hoststatus.not_acknowledged;
$scope.filter.Hoststatus.in_downtime = result.data.config.Hoststatus.in_downtime;
$scope.filter.Hoststatus.not_in_downtime = result.data.config.Hoststatus.not_in_downtime;
$scope.filter.Host.name_regex = result.data.config.Host.name_regex;
$scope.direction = result.data.config.direction;
$scope.sort = result.data.config.sort;
$scope.useScroll = result.data.config.useScroll;
Expand Down Expand Up @@ -99,6 +101,7 @@ angular.module('openITCOCKPIT').directive('hostsStatusWidget', function($http, $
'page': $scope.currentPage,
'direction': $scope.direction,
'filter[Hosts.name]': $scope.filter.Host.name,
'filter[Hosts.name_regex]': $scope.filter.Host.name_regex,
'filter[Hosts.keywords][]': $scope.filter.Host.keywords.split(','),
'filter[Hosts.not_keywords][]': $scope.filter.Host.not_keywords.split(','),
'filter[Hoststatus.output]': $scope.filter.Hoststatus.output,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ angular.module('openITCOCKPIT').directive('servicesStatusExtendedWidget', functi
},
Host: {
name: '',
name_regex: false,
keywords: '',
not_keywords: ''
},
Service: {
name: '',
name_regex: false,
keywords: '',
not_keywords: ''
}
Expand All @@ -71,6 +73,8 @@ angular.module('openITCOCKPIT').directive('servicesStatusExtendedWidget', functi
$scope.direction = result.data.config.direction;
$scope.sort = result.data.config.sort;
$scope.useScroll = result.data.config.useScroll;
$scope.filter.Host.name_regex = result.data.config.Host.name_regex;
$scope.filter.Service.name_regex = result.data.config.Service.name_regex;
var scrollInterval = parseInt(result.data.config.scroll_interval);
if(scrollInterval < 5000){
scrollInterval = 5000;
Expand Down Expand Up @@ -110,9 +114,11 @@ angular.module('openITCOCKPIT').directive('servicesStatusExtendedWidget', functi
'direction': $scope.direction,
'includes[]': ['downtimes', 'acknowledgements'],
'filter[Hosts.name]': $scope.filter.Host.name,
'filter[Hosts.name_regex]': $scope.filter.Host.name_regex,
'filter[Hosts.keywords][]': $scope.filter.Host.keywords.split(','),
'filter[Hosts.not_keywords][]': $scope.filter.Host.not_keywords.split(','),
'filter[servicename]': $scope.filter.Service.name,
'filter[servicename_regex]': $scope.filter.Service.name_regex,
'filter[keywords][]': $scope.filter.Service.keywords.split(','),
'filter[not_keywords][]': $scope.filter.Service.not_keywords.split(','),
'filter[Servicestatus.output]': $scope.filter.Servicestatus.output,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ angular.module('openITCOCKPIT').directive('servicesStatusWidget', function($http
},
Host: {
name: '',
name_regex: false,
keywords: '',
not_keywords: ''
},
Service: {
name: '',
name_regex: false,
keywords: '',
not_keywords: ''
}
Expand All @@ -71,6 +73,8 @@ angular.module('openITCOCKPIT').directive('servicesStatusWidget', function($http
$scope.direction = result.data.config.direction;
$scope.sort = result.data.config.sort;
$scope.useScroll = result.data.config.useScroll;
$scope.filter.Host.name_regex = result.data.config.Host.name_regex;
$scope.filter.Service.name_regex = result.data.config.Service.name_regex;
var scrollInterval = parseInt(result.data.config.scroll_interval);
if(scrollInterval < 5000){
scrollInterval = 5000;
Expand Down Expand Up @@ -109,9 +113,11 @@ angular.module('openITCOCKPIT').directive('servicesStatusWidget', function($http
'page': $scope.currentPage,
'direction': $scope.direction,
'filter[Hosts.name]': $scope.filter.Host.name,
'filter[Hosts.name_regex]': $scope.filter.Host.name_regex,
'filter[Hosts.keywords][]': $scope.filter.Host.keywords.split(','),
'filter[Hosts.not_keywords][]': $scope.filter.Host.not_keywords.split(','),
'filter[servicename]': $scope.filter.Service.name,
'filter[servicename_regex]': $scope.filter.Service.name_regex,
'filter[keywords][]': $scope.filter.Service.keywords.split(','),
'filter[not_keywords][]': $scope.filter.Service.not_keywords.split(','),
'filter[Servicestatus.output]': $scope.filter.Servicestatus.output,
Expand Down

0 comments on commit d9e21ff

Please sign in to comment.