This commit is contained in:
2025-08-25 06:34:39 +02:00
parent 43e7c087db
commit 5f75c542df
4 changed files with 18 additions and 22 deletions

View File

@@ -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')
console.print_header('SSH Agent example completed successfully')

View File

@@ -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 ===')

View File

@@ -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 ===')

View File

@@ -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')