Implement comprehensive admin UI with job management and API key display
Admin UI Features:
- Complete job lifecycle: create, run, view status, view output, delete
- Job table with sorting, filtering, and real-time status updates
- Status polling with countdown timers for running jobs
- Job output modal with result/error display
- API keys management: create keys, list keys with secrets visible
- Sidebar toggle between runners and keys views
- Toast notifications for errors
- Modern dark theme UI with responsive design
Supervisor Improvements:
- Fixed job status persistence using client methods
- Refactored get_job_result to use client.get_status, get_result, get_error
- Changed runner_rust dependency from git to local path
- Authentication system with API key scopes (admin, user, register)
- Job listing with status fetching from Redis
- Services module for job and auth operations
OpenRPC Client:
- Added auth_list_keys method for fetching API keys
- WASM bindings for browser usage
- Proper error handling and type conversions
Build Status: ✅ All components build successfully
This commit is contained in:
@@ -1 +1,70 @@
|
||||
cargo run
|
||||
#!/bin/bash
|
||||
|
||||
# Hero Supervisor Development Runner
|
||||
# Runs both the supervisor backend and admin UI frontend
|
||||
|
||||
set -e
|
||||
|
||||
# Colors for output
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
echo -e "${BLUE}╔════════════════════════════════════════════════════════════╗${NC}"
|
||||
echo -e "${BLUE}║ Starting Hero Supervisor Development Environment ║${NC}"
|
||||
echo -e "${BLUE}╚════════════════════════════════════════════════════════════╝${NC}"
|
||||
|
||||
# Function to cleanup background processes on exit
|
||||
cleanup() {
|
||||
echo -e "\n${YELLOW}Shutting down...${NC}"
|
||||
kill $(jobs -p) 2>/dev/null || true
|
||||
exit 0
|
||||
}
|
||||
|
||||
trap cleanup SIGINT SIGTERM
|
||||
|
||||
# Check if Redis is running
|
||||
if ! pgrep -x "redis-server" > /dev/null; then
|
||||
echo -e "${YELLOW}⚠️ Redis not detected. Starting Redis...${NC}"
|
||||
redis-server --daemonize yes
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
# Start the supervisor with bootstrap admin key
|
||||
echo -e "${GREEN}🚀 Starting Hero Supervisor...${NC}"
|
||||
cargo run --bin supervisor -- \
|
||||
--bootstrap-admin-key "admin" \
|
||||
--redis-url "redis://localhost:6379" \
|
||||
--port 3030 \
|
||||
--bind-address "127.0.0.1" &
|
||||
|
||||
SUPERVISOR_PID=$!
|
||||
|
||||
# Wait for supervisor to start
|
||||
echo -e "${BLUE}⏳ Waiting for supervisor to initialize...${NC}"
|
||||
sleep 3
|
||||
|
||||
# Start the admin UI
|
||||
echo -e "${GREEN}🎨 Starting Admin UI...${NC}"
|
||||
cd clients/admin-ui
|
||||
trunk serve --port 8080 &
|
||||
|
||||
ADMIN_UI_PID=$!
|
||||
|
||||
# Wait a bit for trunk to start
|
||||
sleep 2
|
||||
|
||||
echo -e "\n${GREEN}╔════════════════════════════════════════════════════════════╗${NC}"
|
||||
echo -e "${GREEN}║ ✅ Development Environment Ready! ║${NC}"
|
||||
echo -e "${GREEN}╚════════════════════════════════════════════════════════════╝${NC}"
|
||||
echo -e "${BLUE} 📡 Supervisor API:${NC} http://127.0.0.1:3030"
|
||||
echo -e "${BLUE} 🎨 Admin UI:${NC} http://127.0.0.1:8080"
|
||||
echo -e "${BLUE} 🔗 Redis:${NC} redis://localhost:6379"
|
||||
echo -e "${GREEN}╚════════════════════════════════════════════════════════════╝${NC}"
|
||||
echo -e "\n${YELLOW}💡 Check the supervisor output above for your admin API key!${NC}"
|
||||
echo -e "${YELLOW} Use it to login to the Admin UI at http://127.0.0.1:8080${NC}\n"
|
||||
echo -e "${YELLOW}Press Ctrl+C to stop all services${NC}\n"
|
||||
|
||||
# Wait for both processes
|
||||
wait
|
||||
Reference in New Issue
Block a user