Browsing for servers which are in the [serverlist] seems to be broken #819

This commit is contained in:
nicolargo 2016-03-19 23:08:00 +01:00
parent 85203539c7
commit d841781d01
3 changed files with 7 additions and 4 deletions

View File

@ -160,7 +160,7 @@ class GlancesClientBrowser(object):
"Server list dictionnary change inside the loop (wait next update)")
# Update the screen (list or Glances client)
if not self.screen.active_server:
if self.screen.active_server is None:
# Display the Glances browser
self.screen.update(self.get_servers_list())
else:

View File

@ -1104,6 +1104,9 @@ class GlancesCursesBrowser(_GlancesCurses):
# Catch the browser pressed key
self.pressedkey = self.get_key(self.term_window)
if self.pressedkey != -1:
logger.debug("Key pressed. Code=%s" % self.pressedkey)
# Actions...
if self.pressedkey == ord('\x1b') or self.pressedkey == ord('q'):
# 'ESC'|'q' > Quit
@ -1114,10 +1117,10 @@ class GlancesCursesBrowser(_GlancesCurses):
# 'ENTER' > Run Glances on the selected server
logger.debug("Server number {0} selected".format(self.cursor + 1))
self.active_server = self.cursor
elif self.pressedkey == 259:
elif self.pressedkey == 65:
# 'UP' > Up in the server list
self.cursor_up(servers_list)
elif self.pressedkey == 258:
elif self.pressedkey == 66:
# 'DOWN' > Down in the server list
self.cursor_down(servers_list)

View File

@ -56,7 +56,7 @@ class GlancesStaticServer(object):
if new_server['name'] is not None:
# Manage optionnal information
if new_server['port'] is None:
new_server['port'] = 61209
new_server['port'] = '61209'
new_server['username'] = 'glances'
# By default, try empty (aka no) password
new_server['password'] = ''