mirror of
https://github.com/nicolargo/glances.git
synced 2024-11-25 08:33:22 +03:00
Browsing for servers which are in the [serverlist] seems to be broken #819
This commit is contained in:
parent
85203539c7
commit
d841781d01
@ -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:
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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'] = ''
|
||||
|
Loading…
Reference in New Issue
Block a user