Skip to content

Commit

Permalink
Check if server name is not null in the Glances browser - Related to #…
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolargo committed Jul 6, 2024
1 parent 18bade9 commit 6f7a096
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions glances/outputs/glances_curses_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ def __display_server_list(self, stats, x, y, screen_x, screen_y):
for c in column_def:
if xc < screen_x and y < screen_y:
# Display server stats
value = format(server_stat.get(c[0], '?'))
if c[0] == 'name' and 'alias' in server_stat:
value = server_stat.get(c[0], '?')
if c[0] == 'name' and 'alias' in server_stat and server_stat['alias'] is not None:
value = server_stat['alias']
decoration = self.colors_list.get(
server_stat[c[0] + '_decoration'].replace('_LOG', '')
Expand All @@ -359,7 +359,7 @@ def __display_server_list(self, stats, x, y, screen_x, screen_y):
)
if c[0] == 'status':
decoration = self.colors_list[server_stat['status']]
self.term_window.addnstr(y, xc, value, c[2], decoration)
self.term_window.addnstr(y, xc, format(value), c[2], decoration)
xc += c[2] + self.space_between_column
cpt += 1
# Next line, next server...
Expand Down

0 comments on commit 6f7a096

Please sign in to comment.