Skip to content

Commit

Permalink
Now each menu link to filtered table
Browse files Browse the repository at this point in the history
Refs #12
  • Loading branch information
algorys committed Jul 16, 2016
1 parent fad11a8 commit f939d1c
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions alignak_app/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,25 @@ def open_url(self, item):
assert isinstance(item, Gtk.ImageMenuItem)

webui_url = self.Config.get('Webui', 'webui_url')
if "Hosts" in item.get_label():
webbrowser.open(webui_url + '/hosts_table')
if "Services" in item.get_label():
webbrowser.open(webui_url + '/services_table')

if "UP" in item.get_label():
endurl = '/livestate_table?search=type:host%20state:UP'
elif "DOWN" in item.get_label():
endurl = '/livestate_table?search=type:host%20state:DOWN'
elif "UNREACHABLE" in item.get_label():
endurl = '/livestate_table?search=type:host%20state:UNREACHABLE'
elif 'OK' in item.get_label():
endurl = '/livestate_table?search=type:service%20state:OK'
elif 'CRITICAL' in item.get_label():
endurl = '/livestate_table?search=type:service%20state:CRITICAL'
elif 'WARNING' in item.get_label():
endurl = '/livestate_table?search=type:service%20state:WARNING'
elif 'UNKNOWN' in item.get_label():
endurl = '/livestate_table?search=type:service%20state:UNKNOWN'
else:
endurl = '/livestate_table'

webbrowser.open(webui_url + endurl)

def create_items(self, style):
"""
Expand Down

0 comments on commit f939d1c

Please sign in to comment.