From 591429b0c9531aafc7cd786f77d069255e1b0866 Mon Sep 17 00:00:00 2001 From: catborise Date: Sat, 26 Sep 2026 12:10:35 +0300 Subject: [PATCH] feat(console): add comprehensive test suite and expand send keys menu - Add 23 unit and integration tests covering console views, authorization, URL/path normalization, and novncd daemon token extraction - Refactor console/novncd arg parsing into __main__ block for clean test imports - Expand Send Key(s) menu into categorized sections (System, Navigation/Desktop, Terminal Control, Virtual Consoles) - Implement non-destructive LIFO sendKeyCombo using public rfb.sendKey API, eliminating vendor debt - Wire Send Key actions across Lite, Full, and PTY (xterm) console templates - Add modern navigator.keyboard.lock support during fullscreen sessions --- console/novncd | 21 +- console/templates/console-base.html | 53 ++-- console/templates/console-vnc-full.html | 110 ++++++++ console/templates/console-vnc-lite.html | 158 ++++++++--- console/templates/console-xterm.html | 32 ++- console/tests.py | 354 +++++++++++++++++++++++- console/views.py | 31 ++- 7 files changed, 679 insertions(+), 80 deletions(-) diff --git a/console/novncd b/console/novncd index 402e3cdc..d16806fe 100755 --- a/console/novncd +++ b/console/novncd @@ -65,16 +65,6 @@ def get_parser(default_host=WS_HOST, default_port=WS_PORT or 6080, default_cert= return parser -options = get_parser().parse_args() - -FORMAT = "%(asctime)s - %(name)s - %(levelname)s : %(message)s" -if options.debug: - logging.basicConfig(level=logging.DEBUG, format=FORMAT) - options.verbose = True -elif options.verbose: - logging.basicConfig(level=logging.INFO, format=FORMAT) -else: - logging.basicConfig(level=logging.WARNING, format=FORMAT) try: from websockify import WebSocketProxy @@ -302,6 +292,17 @@ else: if __name__ == "__main__": + options = get_parser().parse_args() + + FORMAT = "%(asctime)s - %(name)s - %(levelname)s : %(message)s" + if options.debug: + logging.basicConfig(level=logging.DEBUG, format=FORMAT) + options.verbose = True + elif options.verbose: + logging.basicConfig(level=logging.INFO, format=FORMAT) + else: + logging.basicConfig(level=logging.WARNING, format=FORMAT) + if USE_HANDLER: # Create the WebSocketProxy with NovaProxyRequestHandler handler server = WebSocketProxy( diff --git a/console/templates/console-base.html b/console/templates/console-base.html index 11e38fd4..ecb8ed21 100644 --- a/console/templates/console-base.html +++ b/console/templates/console-base.html @@ -35,7 +35,7 @@
-