From 5f75c542df74e0d8eb4a324da55bb8ac45248f85 Mon Sep 17 00:00:00 2001 From: despiegk Date: Mon, 25 Aug 2025 06:34:39 +0200 Subject: [PATCH] ... --- examples/osal/sshagent/sshagent_example2.vsh | 6 +++--- examples/tmux/server_dashboard.vsh | 14 ++++++-------- examples/tmux/tmux.vsh | 8 +++----- examples/tmux/tmux_pane_resize.vsh | 12 ++++++------ 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/examples/osal/sshagent/sshagent_example2.vsh b/examples/osal/sshagent/sshagent_example2.vsh index 116cd691..9933cbee 100755 --- a/examples/osal/sshagent/sshagent_example2.vsh +++ b/examples/osal/sshagent/sshagent_example2.vsh @@ -24,7 +24,7 @@ if agent.keys.len == 0 { console.print_header('No keys found, generating example key...') mut key := agent.generate('example_key', '')! console.print_debug('Generated key: ${key}') - + // Load the generated key key.load()! console.print_debug('Key loaded into agent') @@ -35,7 +35,7 @@ if agent.keys.len > 0 { console.print_header('Working with existing keys...') for i, key in agent.keys { - console.print_debug('Key ${i+1}: ${key.name}') + console.print_debug('Key ${i + 1}: ${key.name}') console.print_debug(' Type: ${key.cat}') console.print_debug(' Loaded: ${key.loaded}') console.print_debug(' Email: ${key.email}') @@ -82,4 +82,4 @@ console.print_debug('Test key exists: ${existing_key.name}') console.print_header('Final SSH Agent Status:') println(agent) -console.print_header('SSH Agent example completed successfully') \ No newline at end of file +console.print_header('SSH Agent example completed successfully') diff --git a/examples/tmux/server_dashboard.vsh b/examples/tmux/server_dashboard.vsh index 13224c16..00161c26 100755 --- a/examples/tmux/server_dashboard.vsh +++ b/examples/tmux/server_dashboard.vsh @@ -6,12 +6,10 @@ import time import os // Configuration -const ( - session_name = 'server_dashboard' - window_name = 'dashboard' - python_port = 8000 - ttyd_port = 7890 -) +const session_name = 'server_dashboard' +const window_name = 'dashboard' +const python_port = 8000 +const ttyd_port = 7890 println('=== Server Dashboard with 3 Panes ===') println('Setting up tmux session with:') @@ -123,7 +121,7 @@ window = session.window_get(name: window_name)! println('\n=== Current Dashboard State ===') for i, mut pane in window.panes { stats := pane.stats() or { - println(' Pane ${i+1}: ID=%${pane.id}, PID=${pane.pid} (stats unavailable)') + println(' Pane ${i + 1}: ID=%${pane.id}, PID=${pane.pid} (stats unavailable)') continue } memory_mb := f64(stats.memory_bytes) / (1024.0 * 1024.0) @@ -133,7 +131,7 @@ for i, mut pane in window.panes { 2 { 'CPU Monitor' } else { 'Unknown' } } - println(' Pane ${i+1} (${service_name}): ID=%${pane.id}, CPU=${stats.cpu_percent:.1f}%, Memory=${memory_mb:.1f}MB') + println(' Pane ${i + 1} (${service_name}): ID=%${pane.id}, CPU=${stats.cpu_percent:.1f}%, Memory=${memory_mb:.1f}MB') } println('\n=== Access Information ===') diff --git a/examples/tmux/tmux.vsh b/examples/tmux/tmux.vsh index 89f2cbe4..3fbc4d29 100755 --- a/examples/tmux/tmux.vsh +++ b/examples/tmux/tmux.vsh @@ -5,11 +5,9 @@ import freeflowuniverse.herolib.osal.core as osal import time // Constants for display formatting -const ( - bytes_to_mb = 1024.0 * 1024.0 - cpu_precision = 1 - memory_precision = 3 -) +const bytes_to_mb = 1024.0 * 1024.0 +const cpu_precision = 1 +const memory_precision = 3 println('=== Tmux Pane Example ===') diff --git a/examples/tmux/tmux_pane_resize.vsh b/examples/tmux/tmux_pane_resize.vsh index aa738d9c..be443ca9 100755 --- a/examples/tmux/tmux_pane_resize.vsh +++ b/examples/tmux/tmux_pane_resize.vsh @@ -68,9 +68,9 @@ println('\n=== Demonstrating Pane Resizing ===') // Get references to panes for resizing window.scan()! if window.panes.len >= 4 { - mut top_left := window.panes[1] // bash - mut top_right := window.panes[0] // htop - mut bottom_left := window.panes[2] // top + mut top_left := window.panes[1] // bash + mut top_right := window.panes[0] // htop + mut bottom_left := window.panes[2] // top mut bottom_right := window.panes[3] // tail println('Resizing top-left pane (bash) to be wider...') @@ -116,7 +116,7 @@ if window.panes.len >= 4 { bash_pane.send_command('pwd')! time.sleep(500 * time.millisecond) - // Send command to top pane + // Send command to top pane mut top_pane := window.panes[2] top_pane.send_command('echo "=== Top Pane ==="')! time.sleep(500 * time.millisecond) @@ -127,12 +127,12 @@ t.scan()! println('Session: ${session.name}') println('Window: ${window.name} (${window.panes.len} panes)') for i, pane in window.panes { - println(' ${i+1}. Pane %${pane.id} - ${pane.cmd}') + println(' ${i + 1}. Pane %${pane.id} - ${pane.cmd}') } println('\n=== Pane Resize Operations Available ===') println('✓ resize_up(cells) - Make pane taller by shrinking pane above') -println('✓ resize_down(cells) - Make pane taller by shrinking pane below') +println('✓ resize_down(cells) - Make pane taller by shrinking pane below') println('✓ resize_left(cells) - Make pane wider by shrinking pane to the left') println('✓ resize_right(cells) - Make pane wider by shrinking pane to the right') println('✓ resize(direction: "up/down/left/right", cells: N) - Generic resize method')