feat(gui): Add block/unblock buttons to ticket queue
This commit is contained in:
22
src/gui_2.py
22
src/gui_2.py
@@ -1954,6 +1954,22 @@ class App:
|
|||||||
if self.controller and self.controller.engine:
|
if self.controller and self.controller.engine:
|
||||||
self.controller.engine.kill_worker(ticket_id)
|
self.controller.engine.kill_worker(ticket_id)
|
||||||
|
|
||||||
|
def _cb_block_ticket(self, ticket_id: str) -> None:
|
||||||
|
t = next((t for t in self.active_tickets if str(t.get('id', '')) == ticket_id), None)
|
||||||
|
if t:
|
||||||
|
t['status'] = 'blocked'
|
||||||
|
t['manual_block'] = True
|
||||||
|
t['blocked_reason'] = '[MANUAL] User blocked'
|
||||||
|
self._push_mma_state_update()
|
||||||
|
|
||||||
|
def _cb_unblock_ticket(self, ticket_id: str) -> None:
|
||||||
|
t = next((t for t in self.active_tickets if str(t.get('id', '')) == ticket_id), None)
|
||||||
|
if t and t.get('manual_block', False):
|
||||||
|
t['status'] = 'todo'
|
||||||
|
t['manual_block'] = False
|
||||||
|
t['blocked_reason'] = None
|
||||||
|
self._push_mma_state_update()
|
||||||
|
|
||||||
def _reorder_ticket(self, src_idx: int, dst_idx: int) -> None:
|
def _reorder_ticket(self, src_idx: int, dst_idx: int) -> None:
|
||||||
if src_idx == dst_idx: return
|
if src_idx == dst_idx: return
|
||||||
new_tickets = list(self.active_tickets)
|
new_tickets = list(self.active_tickets)
|
||||||
@@ -2072,6 +2088,12 @@ class App:
|
|||||||
if status == 'in_progress':
|
if status == 'in_progress':
|
||||||
if imgui.button(f"Kill##{tid}"):
|
if imgui.button(f"Kill##{tid}"):
|
||||||
self._cb_kill_ticket(tid)
|
self._cb_kill_ticket(tid)
|
||||||
|
elif status == 'todo':
|
||||||
|
if imgui.button(f"Block##{tid}"):
|
||||||
|
self._cb_block_ticket(tid)
|
||||||
|
elif status == 'blocked' and t.get('manual_block', False):
|
||||||
|
if imgui.button(f"Unblock##{tid}"):
|
||||||
|
self._cb_unblock_ticket(tid)
|
||||||
|
|
||||||
imgui.end_table()
|
imgui.end_table()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user