mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-03 15:18:11 +08:00
Revert "wider column for cluster_id, and cast to string"
This reverts commit a37d3b7af0.
This commit is contained in:
+3
-4
@@ -25,14 +25,13 @@ def monitor(run_once=False, broker=None):
|
|||||||
val = None
|
val = None
|
||||||
start_width = int(term.width / 8)
|
start_width = int(term.width / 8)
|
||||||
while val not in (u'q', u'Q',):
|
while val not in (u'q', u'Q',):
|
||||||
cluster_id_width = 36 # UUID4
|
col_width = int(term.width / 8)
|
||||||
col_width = int((term.width - cluster_id_width) / 7)
|
|
||||||
# In case of resize
|
# In case of resize
|
||||||
if col_width != start_width:
|
if col_width != start_width:
|
||||||
print(term.clear())
|
print(term.clear())
|
||||||
start_width = col_width
|
start_width = col_width
|
||||||
print(term.move(0, 0) + term.black_on_green(term.center(_('Host'), width=col_width - 1)))
|
print(term.move(0, 0) + term.black_on_green(term.center(_('Host'), width=col_width - 1)))
|
||||||
print(term.move(0, 1 * col_width) + term.black_on_green(term.center(_('Id'), width=cluster_id_width - 1)))
|
print(term.move(0, 1 * col_width) + term.black_on_green(term.center(_('Id'), width=col_width - 1)))
|
||||||
print(term.move(0, 2 * col_width) + term.black_on_green(term.center(_('State'), width=col_width - 1)))
|
print(term.move(0, 2 * col_width) + term.black_on_green(term.center(_('State'), width=col_width - 1)))
|
||||||
print(term.move(0, 3 * col_width) + term.black_on_green(term.center(_('Pool'), width=col_width - 1)))
|
print(term.move(0, 3 * col_width) + term.black_on_green(term.center(_('Pool'), width=col_width - 1)))
|
||||||
print(term.move(0, 4 * col_width) + term.black_on_green(term.center(_('TQ'), width=col_width - 1)))
|
print(term.move(0, 4 * col_width) + term.black_on_green(term.center(_('TQ'), width=col_width - 1)))
|
||||||
@@ -73,7 +72,7 @@ def monitor(run_once=False, broker=None):
|
|||||||
uptime = '%d:%02d:%02d' % (hours, minutes, seconds)
|
uptime = '%d:%02d:%02d' % (hours, minutes, seconds)
|
||||||
# print to the terminal
|
# print to the terminal
|
||||||
print(term.move(i, 0) + term.center(stat.host[:col_width - 1], width=col_width - 1))
|
print(term.move(i, 0) + term.center(stat.host[:col_width - 1], width=col_width - 1))
|
||||||
print(term.move(i, 1 * col_width) + term.center(str(stat.cluster_id), width=cluster_id_width - 1))
|
print(term.move(i, 1 * col_width) + term.center(stat.cluster_id[:8], width=col_width - 1))
|
||||||
print(term.move(i, 2 * col_width) + term.center(status, width=col_width - 1))
|
print(term.move(i, 2 * col_width) + term.center(status, width=col_width - 1))
|
||||||
print(term.move(i, 3 * col_width) + term.center(workers, width=col_width - 1))
|
print(term.move(i, 3 * col_width) + term.center(workers, width=col_width - 1))
|
||||||
print(term.move(i, 4 * col_width) + term.center(tasks, width=col_width - 1))
|
print(term.move(i, 4 * col_width) + term.center(tasks, width=col_width - 1))
|
||||||
|
|||||||
Reference in New Issue
Block a user