Include ticket ID and name in top pane
* Only if ticket ID and name are set * Expands on fix for issue #58
This commit is contained in:
parent
4c3fe1d66f
commit
c73bf2521c
1 changed files with 16 additions and 24 deletions
|
|
@ -491,6 +491,8 @@ class State():
|
||||||
def init(self):
|
def init(self):
|
||||||
"""Remove test objects, set log, and add devices."""
|
"""Remove test objects, set log, and add devices."""
|
||||||
self.disks = []
|
self.disks = []
|
||||||
|
self.ticket_id = None
|
||||||
|
self.ticket_name = None
|
||||||
for k, v in self.tests.items():
|
for k, v in self.tests.items():
|
||||||
v['Objects'] = []
|
v['Objects'] = []
|
||||||
|
|
||||||
|
|
@ -533,6 +535,15 @@ class State():
|
||||||
self.tmux_layout = TMUX_LAYOUT.copy()
|
self.tmux_layout = TMUX_LAYOUT.copy()
|
||||||
start_thread(fix_tmux_panes_loop, args=[self])
|
start_thread(fix_tmux_panes_loop, args=[self])
|
||||||
|
|
||||||
|
def set_top_pane_text(self, text):
|
||||||
|
"""Set top pane text using TOP_PANE_TEXT and provided text."""
|
||||||
|
ticket_details = ''
|
||||||
|
if self.ticket_id and self.ticket_name:
|
||||||
|
ticket_details = '#{} {}'.format(self.ticket_id, self.ticket_name)
|
||||||
|
tmux_update_pane(
|
||||||
|
self.panes['Top'],
|
||||||
|
text='{} {}\n{}'.format(TOP_PANE_TEXT, ticket_details, text))
|
||||||
|
|
||||||
|
|
||||||
class TestObj():
|
class TestObj():
|
||||||
"""Object to track test data."""
|
"""Object to track test data."""
|
||||||
|
|
@ -875,10 +886,7 @@ def run_badblocks_test(state, test):
|
||||||
update_progress_pane(state)
|
update_progress_pane(state)
|
||||||
|
|
||||||
# Update tmux layout
|
# Update tmux layout
|
||||||
tmux_update_pane(
|
state.set_top_pane_text(dev.description)
|
||||||
state.panes['Top'],
|
|
||||||
text='{}\n{}'.format(
|
|
||||||
TOP_PANE_TEXT, dev.description))
|
|
||||||
|
|
||||||
# Create monitor pane
|
# Create monitor pane
|
||||||
test.badblocks_out = '{}/badblocks_{}.out'.format(
|
test.badblocks_out = '{}/badblocks_{}.out'.format(
|
||||||
|
|
@ -1124,10 +1132,7 @@ def run_io_benchmark(state, test):
|
||||||
update_progress_pane(state)
|
update_progress_pane(state)
|
||||||
|
|
||||||
# Update tmux layout
|
# Update tmux layout
|
||||||
tmux_update_pane(
|
state.set_top_pane_text(dev.description)
|
||||||
state.panes['Top'],
|
|
||||||
text='{}\n{}'.format(
|
|
||||||
TOP_PANE_TEXT, dev.description))
|
|
||||||
state.tmux_layout['Current'] = {'y': 15, 'Check': True}
|
state.tmux_layout['Current'] = {'y': 15, 'Check': True}
|
||||||
|
|
||||||
# Create monitor pane
|
# Create monitor pane
|
||||||
|
|
@ -1286,9 +1291,7 @@ def run_mprime_test(state, test):
|
||||||
test.thermal_abort = False
|
test.thermal_abort = False
|
||||||
|
|
||||||
# Update tmux layout
|
# Update tmux layout
|
||||||
tmux_update_pane(
|
state.set_top_pane_text(dev.name)
|
||||||
state.panes['Top'],
|
|
||||||
text='{}\n{}'.format(TOP_PANE_TEXT, dev.name))
|
|
||||||
|
|
||||||
# Start live sensor monitor
|
# Start live sensor monitor
|
||||||
test.sensors_out = '{}/sensors.out'.format(global_vars['TmpDir'])
|
test.sensors_out = '{}/sensors.out'.format(global_vars['TmpDir'])
|
||||||
|
|
@ -1501,10 +1504,7 @@ def run_nvme_smart_tests(state, test, update_mode=False):
|
||||||
update_progress_pane(state)
|
update_progress_pane(state)
|
||||||
|
|
||||||
# Update tmux layout
|
# Update tmux layout
|
||||||
tmux_update_pane(
|
state.set_top_pane_text(dev.description)
|
||||||
state.panes['Top'],
|
|
||||||
text='{}\n{}'.format(
|
|
||||||
TOP_PANE_TEXT, dev.description))
|
|
||||||
|
|
||||||
# SMART short self-test
|
# SMART short self-test
|
||||||
if dev.smart_attributes and not (state.quick_mode or update_mode):
|
if dev.smart_attributes and not (state.quick_mode or update_mode):
|
||||||
|
|
@ -1643,15 +1643,7 @@ def show_report(report, log_report=False):
|
||||||
def show_results(state):
|
def show_results(state):
|
||||||
"""Show results for all tests."""
|
"""Show results for all tests."""
|
||||||
clear_screen()
|
clear_screen()
|
||||||
if state.ticket_id and state.ticket_name:
|
state.set_top_pane_text('Results')
|
||||||
tmux_update_pane(
|
|
||||||
state.panes['Top'],
|
|
||||||
text='{}\nResults for #{} {}'.format(
|
|
||||||
TOP_PANE_TEXT, state.ticket_id, state.ticket_name))
|
|
||||||
else:
|
|
||||||
tmux_update_pane(
|
|
||||||
state.panes['Top'],
|
|
||||||
text='{}\nResults'.format(TOP_PANE_TEXT))
|
|
||||||
|
|
||||||
# CPU tests
|
# CPU tests
|
||||||
_enabled = False
|
_enabled = False
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue