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

@@ -35,7 +35,7 @@ if agent.keys.len > 0 {
console.print_header('Working with existing keys...') console.print_header('Working with existing keys...')
for i, key in agent.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(' Type: ${key.cat}')
console.print_debug(' Loaded: ${key.loaded}') console.print_debug(' Loaded: ${key.loaded}')
console.print_debug(' Email: ${key.email}') console.print_debug(' Email: ${key.email}')

View File

@@ -6,12 +6,10 @@ import time
import os import os
// Configuration // Configuration
const ( const session_name = 'server_dashboard'
session_name = 'server_dashboard' const window_name = 'dashboard'
window_name = 'dashboard' const python_port = 8000
python_port = 8000 const ttyd_port = 7890
ttyd_port = 7890
)
println('=== Server Dashboard with 3 Panes ===') println('=== Server Dashboard with 3 Panes ===')
println('Setting up tmux session with:') println('Setting up tmux session with:')
@@ -123,7 +121,7 @@ window = session.window_get(name: window_name)!
println('\n=== Current Dashboard State ===') println('\n=== Current Dashboard State ===')
for i, mut pane in window.panes { for i, mut pane in window.panes {
stats := pane.stats() or { 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 continue
} }
memory_mb := f64(stats.memory_bytes) / (1024.0 * 1024.0) memory_mb := f64(stats.memory_bytes) / (1024.0 * 1024.0)
@@ -133,7 +131,7 @@ for i, mut pane in window.panes {
2 { 'CPU Monitor' } 2 { 'CPU Monitor' }
else { 'Unknown' } 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 ===') println('\n=== Access Information ===')

View File

@@ -5,11 +5,9 @@ import freeflowuniverse.herolib.osal.core as osal
import time import time
// Constants for display formatting // Constants for display formatting
const ( const bytes_to_mb = 1024.0 * 1024.0
bytes_to_mb = 1024.0 * 1024.0 const cpu_precision = 1
cpu_precision = 1 const memory_precision = 3
memory_precision = 3
)
println('=== Tmux Pane Example ===') println('=== Tmux Pane Example ===')

View File

@@ -68,9 +68,9 @@ println('\n=== Demonstrating Pane Resizing ===')
// Get references to panes for resizing // Get references to panes for resizing
window.scan()! window.scan()!
if window.panes.len >= 4 { if window.panes.len >= 4 {
mut top_left := window.panes[1] // bash mut top_left := window.panes[1] // bash
mut top_right := window.panes[0] // htop mut top_right := window.panes[0] // htop
mut bottom_left := window.panes[2] // top mut bottom_left := window.panes[2] // top
mut bottom_right := window.panes[3] // tail mut bottom_right := window.panes[3] // tail
println('Resizing top-left pane (bash) to be wider...') println('Resizing top-left pane (bash) to be wider...')
@@ -127,7 +127,7 @@ t.scan()!
println('Session: ${session.name}') println('Session: ${session.name}')
println('Window: ${window.name} (${window.panes.len} panes)') println('Window: ${window.name} (${window.panes.len} panes)')
for i, pane in window.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('\n=== Pane Resize Operations Available ===')