Add osTicket pane to ddrescue-tui

Addresses issue #10
This commit is contained in:
2Shirt 2022-02-18 17:03:29 -07:00
parent a8fada86fd
commit 4550b13565
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 20 additions and 4 deletions

View file

@ -9,6 +9,7 @@ from collections import OrderedDict
TMUX_SIDE_WIDTH = 21
TMUX_LAYOUT = OrderedDict({
'Source': {'height': 2, 'Check': True},
'Ticket': {'height': 2, 'Check': True},
'Started': {'width': TMUX_SIDE_WIDTH, 'Check': True},
'Progress': {'width': TMUX_SIDE_WIDTH, 'Check': True},
})

View file

@ -697,6 +697,12 @@ class State():
std.print_error("I'm sorry but image mode is currently broken...")
std.abort()
# Progress pane
self.panes['Progress'] = tmux.split_window(
lines=cfg.ddrescue.TMUX_SIDE_WIDTH,
watch_file=f'{self.log_dir}/progress.out',
)
# Select source
self.source = get_object(docopt_args['<source>'])
if not self.source:
@ -719,10 +725,6 @@ class State():
)
# Update panes
self.panes['Progress'] = tmux.split_window(
lines=cfg.ddrescue.TMUX_SIDE_WIDTH,
watch_file=f'{self.log_dir}/progress.out',
)
self.update_progress_pane('Idle')
# Set working dir
@ -1171,6 +1173,19 @@ class State():
),
)
# Ticket Details
if self.ost and self.ost.ticket_id and not self.panes.get('Ticket', None):
self.panes['Ticket'] = tmux.split_window(
behind=True,
lines=2,
text=std.color_string(
[self.ost.ticket_name, '\n', f'Ticket #{self.ost.ticket_id}'],
['CYAN', None, None],
sep='',
),
vertical=True,
)
# Functions
def build_block_pair_report(block_pairs, settings):