Skip to content

Commit

Permalink
ITC-2993 Add option to enable/disable search by regex to services act…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
nook24 committed May 4, 2023
1 parent f40ccec commit b5163df
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 9 deletions.
14 changes: 14 additions & 0 deletions src/Template/Services/disabled.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@
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.Hosts.name_regex">
</label>
&nbsp;
<regex-helper-tooltip></regex-helper-tooltip>
</span>
</div>
Expand All @@ -123,6 +130,13 @@
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.Services.name_regex">
</label>
&nbsp;
<regex-helper-tooltip></regex-helper-tooltip>
</span>
</div>
Expand Down
14 changes: 14 additions & 0 deletions src/Template/Services/not_monitored.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@
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.Hosts.name_regex">
</label>
&nbsp;
<regex-helper-tooltip></regex-helper-tooltip>
</span>
</div>
Expand All @@ -123,6 +130,13 @@
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.Services.name_regex">
</label>
&nbsp;
<regex-helper-tooltip></regex-helper-tooltip>
</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/itnovum/openITCOCKPIT/Filter/ServiceFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ public function indexFilter() {
*/
public function notMonitoredFilter() {
$filters = [
'rlike' => [
'like_or_rlike' => [
'Hosts.name',
'servicename',
],
'equals' => [
'equals' => [
'Hosts.id',
'Services.uuid'
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ angular.module('openITCOCKPIT')
var defaultFilter = function(){
$scope.filter = {
Hosts: {
name: ''
name: '',
name_regex: false
},
Services: {
name: ''
name: '',
name_regex: false
}
};
};
Expand Down Expand Up @@ -77,7 +79,9 @@ angular.module('openITCOCKPIT')
'page': $scope.currentPage,
'direction': SortService.getDirection(),
'filter[Hosts.name]': $scope.filter.Hosts.name,
'filter[servicename]': $scope.filter.Services.name
'filter[Hosts.name_regex]': $scope.filter.Hosts.name_regex,
'filter[servicename]': $scope.filter.Services.name,
'filter[servicename_regex]': $scope.filter.Services.name_regex
};


Expand Down Expand Up @@ -171,4 +175,4 @@ angular.module('openITCOCKPIT')
$scope.selectedElements = MassChangeService.getCount();
}, true);

});
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ angular.module('openITCOCKPIT')
var defaultFilter = function(){
$scope.filter = {
Hosts: {
name: ''
name: '',
name_regex: false
},
Services: {
name: ''
name: '',
name_regex: ''
}
};
};
Expand All @@ -45,7 +47,9 @@ angular.module('openITCOCKPIT')
'page': $scope.currentPage,
'direction': SortService.getDirection(),
'filter[Hosts.name]': $scope.filter.Hosts.name,
'filter[servicename]': $scope.filter.Services.name
'filter[Hosts.name_regex]': $scope.filter.Hosts.name_regex,
'filter[servicename]': $scope.filter.Services.name,
'filter[servicename_regex]': $scope.filter.Services.name_regex
};


Expand Down

0 comments on commit b5163df

Please sign in to comment.