Class: EnhanceSwarm::WebUI

Inherits:
Object
  • Object
show all
Defined in:
lib/enhance_swarm/web_ui.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(port: 4567, host: 'localhost') ⇒ WebUI



14
15
16
17
18
19
20
# File 'lib/enhance_swarm/web_ui.rb', line 14

def initialize(port: 4567, host: 'localhost')
  @port = port
  @host = host
  @orchestrator = Orchestrator.new
  @process_monitor = ProcessMonitor.new
  setup_server
end

Instance Attribute Details

#portObject (readonly)

Returns the value of attribute port.



12
13
14
# File 'lib/enhance_swarm/web_ui.rb', line 12

def port
  @port
end

#serverObject (readonly)

Returns the value of attribute server.



12
13
14
# File 'lib/enhance_swarm/web_ui.rb', line 12

def server
  @server
end

Instance Method Details

#startObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/enhance_swarm/web_ui.rb', line 22

def start
  Logger.info("Starting EnhanceSwarm Web UI on http://#{@host}:#{@port}")
  puts "🌐 EnhanceSwarm Web UI starting on http://#{@host}:#{@port}".colorize(:blue)
  puts "   šŸ“‹ Features: Task Management, Kanban Board, Agent Monitoring"
  puts "   šŸš€ Open your browser to access the interface"
  puts "   ā¹ļø  Press Ctrl+C to stop the server"
  
  trap 'INT' do
    puts "\nšŸ‘‹ Shutting down EnhanceSwarm Web UI..."
    @server.shutdown
  end

  @server.start
end

#stopObject



37
38
39
# File 'lib/enhance_swarm/web_ui.rb', line 37

def stop
  @server&.shutdown
end