mirror of
https://github.com/overcuriousity/trace.git
synced 2025-12-20 21:12:22 +00:00
optical enhancements, user experience enhancements
This commit is contained in:
@@ -41,6 +41,7 @@ def quick_add_note(content: str):
|
|||||||
# Try signing if enabled
|
# Try signing if enabled
|
||||||
if settings.get("pgp_enabled", True):
|
if settings.get("pgp_enabled", True):
|
||||||
gpg_key_id = settings.get("gpg_key_id", None)
|
gpg_key_id = settings.get("gpg_key_id", None)
|
||||||
|
if gpg_key_id:
|
||||||
signature = Crypto.sign_content(f"Hash: {note.content_hash}\nContent: {note.content}", key_id=gpg_key_id)
|
signature = Crypto.sign_content(f"Hash: {note.content_hash}\nContent: {note.content}", key_id=gpg_key_id)
|
||||||
if signature:
|
if signature:
|
||||||
note.signature = signature
|
note.signature = signature
|
||||||
|
|||||||
38
trace/tui.py
38
trace/tui.py
@@ -2117,6 +2117,7 @@ class TUI:
|
|||||||
y = int(self.height * 0.1)
|
y = int(self.height * 0.1)
|
||||||
x = int(self.width * 0.1)
|
x = int(self.width * 0.1)
|
||||||
|
|
||||||
|
while True:
|
||||||
win = curses.newwin(h, w, y, x)
|
win = curses.newwin(h, w, y, x)
|
||||||
win.box()
|
win.box()
|
||||||
win.addstr(1, 2, f"Notes: {self.active_case.case_number}", curses.A_BOLD)
|
win.addstr(1, 2, f"Notes: {self.active_case.case_number}", curses.A_BOLD)
|
||||||
@@ -2135,11 +2136,25 @@ class TUI:
|
|||||||
display_str = self._safe_truncate(display_str, w - 4)
|
display_str = self._safe_truncate(display_str, w - 4)
|
||||||
win.addstr(3 + i, 2, display_str)
|
win.addstr(3 + i, 2, display_str)
|
||||||
|
|
||||||
win.addstr(h-2, 2, "Press any key to close")
|
win.addstr(h-2, 2, "[n] Add Note [b/q/Esc] Close", curses.color_pair(3))
|
||||||
win.refresh()
|
win.refresh()
|
||||||
win.getch()
|
key = win.getch()
|
||||||
del win
|
del win
|
||||||
|
|
||||||
|
# Handle key presses
|
||||||
|
if key == ord('n') or key == ord('N'):
|
||||||
|
# Save current view and switch to case_detail temporarily for context
|
||||||
|
saved_view = self.current_view
|
||||||
|
self.current_view = "case_detail"
|
||||||
|
self.dialog_add_note()
|
||||||
|
self.current_view = saved_view
|
||||||
|
# Continue loop to refresh with new note
|
||||||
|
elif key == ord('b') or key == ord('B') or key == ord('q') or key == ord('Q') or key == 27: # 27 is Esc
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
# Any other key also closes (backwards compatibility)
|
||||||
|
break
|
||||||
|
|
||||||
def view_evidence_notes(self):
|
def view_evidence_notes(self):
|
||||||
if not self.active_evidence: return
|
if not self.active_evidence: return
|
||||||
|
|
||||||
@@ -2148,6 +2163,7 @@ class TUI:
|
|||||||
y = int(self.height * 0.1)
|
y = int(self.height * 0.1)
|
||||||
x = int(self.width * 0.1)
|
x = int(self.width * 0.1)
|
||||||
|
|
||||||
|
while True:
|
||||||
win = curses.newwin(h, w, y, x)
|
win = curses.newwin(h, w, y, x)
|
||||||
win.box()
|
win.box()
|
||||||
win.addstr(1, 2, f"Notes: {self.active_evidence.name}", curses.A_BOLD)
|
win.addstr(1, 2, f"Notes: {self.active_evidence.name}", curses.A_BOLD)
|
||||||
@@ -2166,11 +2182,25 @@ class TUI:
|
|||||||
display_str = self._safe_truncate(display_str, w - 4)
|
display_str = self._safe_truncate(display_str, w - 4)
|
||||||
win.addstr(3 + i, 2, display_str)
|
win.addstr(3 + i, 2, display_str)
|
||||||
|
|
||||||
win.addstr(h-2, 2, "Press any key to close")
|
win.addstr(h-2, 2, "[n] Add Note [b/q/Esc] Close", curses.color_pair(3))
|
||||||
win.refresh()
|
win.refresh()
|
||||||
win.getch()
|
key = win.getch()
|
||||||
del win
|
del win
|
||||||
|
|
||||||
|
# Handle key presses
|
||||||
|
if key == ord('n') or key == ord('N'):
|
||||||
|
# Save current view and switch to evidence_detail temporarily for context
|
||||||
|
saved_view = self.current_view
|
||||||
|
self.current_view = "evidence_detail"
|
||||||
|
self.dialog_add_note()
|
||||||
|
self.current_view = saved_view
|
||||||
|
# Continue loop to refresh with new note
|
||||||
|
elif key == ord('b') or key == ord('B') or key == ord('q') or key == ord('Q') or key == 27: # 27 is Esc
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
# Any other key also closes (backwards compatibility)
|
||||||
|
break
|
||||||
|
|
||||||
def export_iocs(self):
|
def export_iocs(self):
|
||||||
"""Export IOCs from current context to a text file"""
|
"""Export IOCs from current context to a text file"""
|
||||||
import os
|
import os
|
||||||
|
|||||||
Reference in New Issue
Block a user