Module: check_mk
Branch: master
Commit: a84b8d25413ae5bd1bc57c68790509b89e6e9545
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a84b8d25413ae5…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Dec 14 10:10:01 2011 +0100
MobileUI: Changes
---
web/htdocs/mobile.py | 7 ++-
web/htdocs/views.py | 2 +-
web/plugins/views/mobile.py | 109 ++++++++++++++++++++++---------------------
3 files changed, 61 insertions(+), 57 deletions(-)
diff --git a/web/htdocs/mobile.py b/web/htdocs/mobile.py
index c3ee1f5..178aad2 100755
--- a/web/htdocs/mobile.py
+++ b/web/htdocs/mobile.py
@@ -254,13 +254,14 @@ def render_view(view, rows, datasource, group_painters, painters,
html.write(_("Error showing view: %s" % e))
html.write("</div>")
html.javascript("""
- $('.pnpgraph').children('div').css('max-width',
'100px');
+ $('.pnpgraph').children('div').css('max-width',
'100%');
$('.pnpgraph').children('div').css('overflow',
'scroll');
""")
jqm_page_navfooter(navbar, 'data', page_id)
# Page: Context buttons
- if context_links:
+ #if context_links:
+ elif page == "context":
jqm_page_header(_("Context"), left_button=home,
id="context")
show_context_links(context_links)
jqm_page_navfooter(navbar, 'context', page_id)
@@ -341,6 +342,6 @@ def do_commands(view, what, rows):
def show_context_links(context_links):
items = []
for view, title, uri, icon, buttonid in context_links:
- items.append((uri, title))
+ items.append(('Context', uri, title))
jqm_page_index(_("Related Views"), items)
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 0da8881..95f23b8 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1263,7 +1263,7 @@ def show_view(view, show_heading = False, show_buttons = True,
# TODO: Use livestatus Stats: instead of fetching rows!
if only_count:
for varname, value in view["hard_filtervars"]:
- html.del_var(varname, value)
+ html.del_var(varname)
return len(rows)
# Set browser reload
diff --git a/web/plugins/views/mobile.py b/web/plugins/views/mobile.py
index 25d967b..b343a80 100644
--- a/web/plugins/views/mobile.py
+++ b/web/plugins/views/mobile.py
@@ -59,67 +59,70 @@ def mobile_view(d):
multisite_builtin_views.update({
#Service search
- 'mobil_searchsvc': mobile_view({'browser_reload': 60,
+ 'mobile_searchsvc': mobile_view({'browser_reload': 60,
'datasource': 'services',
'description': 'Almost all available filters, used for
searching services and maybe doing actions',
- 'group_painters': [('sitealias', 'sitehosts'),
- ('host', 'host')],
+ 'group_painters': [
+ ('sitealias', 'sitehosts'),
+ ('host', 'host')],
'hard_filters': [],
- 'hard_filtervars': [('is_service_in_notification_period',
- '-1'),
- ('optservicegroup', ''),
- ('is_service_notifications_enabled',
- '-1'),
- ('is_host_in_notification_period',
'-1'),
- ('is_in_downtime', '-1'),
- ('is_service_scheduled_downtime_depth',
- '-1'),
- ('is_service_acknowledged', '-1'),
- ('host', ''),
- ('is_service_active_checks_enabled',
- '-1'),
- ('is_summary_host', '-1'),
- ('service', ''),
- ('check_command', ''),
- ('st0', 'on'),
- ('st1', 'on'),
- ('st2', 'on'),
- ('st3', 'on'),
- ('stp', 'on'),
- ('opthostgroup', ''),
- ('service_output', ''),
- ('is_service_is_flapping', '-1')],
+ 'hard_filtervars': [
+ ('is_service_in_notification_period', '-1'),
+ ('optservicegroup', ''),
+ ('is_service_notifications_enabled', '-1'),
+ ('is_host_in_notification_period', '-1'),
+ ('is_in_downtime', '-1'),
+ ('is_service_scheduled_downtime_depth', '-1'),
+ ('is_service_acknowledged', '-1'),
+ ('host', ''),
+ ('is_service_active_checks_enabled', '-1'),
+ ('is_summary_host', '-1'),
+ ('service', ''),
+ ('check_command', ''),
+ ('st0', 'on'),
+ ('st1', 'on'),
+ ('st2', 'on'),
+ ('st3', 'on'),
+ ('stp', 'on'),
+ ('opthostgroup', ''),
+ ('service_output', ''),
+ ('is_service_is_flapping', '-1')
+ ],
'hidden': False,
'hide_filters': [],
- 'layout': 'table',
+ 'layout': 'mobilelist',
'mustsearch': True,
'name': 'mobile_searchsvc',
- 'num_columns': 1,
+ 'num_columns': 2,
'owner': '',
- 'painters': [('service_state', None),
- ('service_description', 'service'),
- ('svc_plugin_output', None),
- ('service_icons', None),
- ('svc_state_age', None),
- ('svc_check_age', None)],
- 'play_sounds': False,
- 'public': True,
- 'show_filters': ['service_in_notification_period',
- 'service_notifications_enabled',
- 'host_in_notification_period',
- 'in_downtime',
- 'service_scheduled_downtime_depth',
- 'service_acknowledged',
- 'hostregex',
- 'serviceregex',
- 'hoststate',
- 'svcstate',
- 'svchardstate',
- 'opthostgroup',
- 'output'],
- 'sorters': [('site', False),
- ('site_host', False),
- ('svcdescr', False)],
+ 'painters': [
+ ('service_state', None, ''),
+ ('host', 'mobile_hoststatus',
''),
+ ('service_description', 'mobile_service',
''),
+ ('svc_plugin_output', '' ),
+ ('svc_state_age', None, ''),
+ ],
+ 'play_sounds': False,
+ 'public': True,
+ 'show_filters': [
+ 'service_in_notification_period',
+ 'service_notifications_enabled',
+ 'host_in_notification_period',
+ 'in_downtime',
+ 'service_scheduled_downtime_depth',
+ 'service_acknowledged',
+ 'hostregex',
+ 'serviceregex',
+ 'hoststate',
+ 'svcstate',
+ 'svchardstate',
+ 'opthostgroup',
+ 'output'
+ ],
+ 'sorters': [
+ ('site', False),
+ ('site_host', False),
+ ('svcdescr', False)],
'title': _('Search'),
'topic': _('Services')
}),