Module: check_mk
Branch: master
Commit: bc102589fbdca304e3dccf9d397637b3731d1b56
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bc102589fbdca3…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jul 31 10:29:53 2013 +0200
Added new filter for downtime_id field and api_downtimes view
---
web/plugins/views/builtin.py | 39 +++++++++++++++++++++++++++++++++++++++
web/plugins/views/filters.py | 2 ++
2 files changed, 41 insertions(+)
diff --git a/web/plugins/views/builtin.py b/web/plugins/views/builtin.py
index 013674e..4f65c4b 100644
--- a/web/plugins/views/builtin.py
+++ b/web/plugins/views/builtin.py
@@ -277,6 +277,45 @@ multisite_builtin_views.update({
'sorters': [('downtime_what', False),
('downtime_start_time', False)],
'title': _('Downtimes')},
+ 'api_downtimes': {'column_headers': 'pergroup',
+ 'datasource': 'downtimes',
+ 'description': 'All host- and service-downtimes (including
ids)',
+ 'group_painters': [('downtime_what', None)],
+ 'hard_filters': [],
+ 'hard_filtervars':
[('is_service_scheduled_downtime_depth',
+ '-1'),
+ ('host', ''),
+ ('service', '')],
+ 'hidden': False,
+ 'hide_filters': [],
+ 'icon' : 'downtime',
+ 'layout': 'table',
+ 'mustsearch': False,
+ 'name': 'downtimes',
+ 'num_columns': 1,
+ 'owner': '',
+ 'painters': [
+ ('host', 'host'),
+ ('service_description', 'service'),
+ ('downtime_author', None),
+ ('downtime_entry_time', None),
+ ('downtime_start_time', None),
+ ('downtime_end_time', None),
+ ('downtime_fixed', None),
+ ('downtime_duration', None),
+ ('downtime_comment', None),
+ ('downtime_id', None),
+ ],
+ 'public': True,
+ 'show_filters': [
+ 'service_scheduled_downtime_depth',
+ 'hostregex',
+ 'serviceregex',
+ 'downtime_id',
+ ],
+ 'sorters': [('downtime_what', False),
+ ('downtime_start_time', False)],
+ 'title': _('Downtimes')},
'downtimes_of_host': {'column_headers': 'pergroup',
'datasource': 'downtimes',
'description': '',
diff --git a/web/plugins/views/filters.py b/web/plugins/views/filters.py
index 321870b..ac7d9bb 100644
--- a/web/plugins/views/filters.py
+++ b/web/plugins/views/filters.py
@@ -672,3 +672,5 @@ class BIServiceIsUsedFilter(FilterTristate):
return new_rows
declare_filter(300, BIServiceIsUsedFilter())
+
+declare_filter(301, FilterText("downtime_id", _("Downtime ID"),
"downtime", "downtime_id", "downtime_id", "="))