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:
Timur Gordon
2025-10-28 03:32:25 +01:00
parent 5f5dd35dbc
commit f249c8b49b
36 changed files with 4811 additions and 6421 deletions

View File

@@ -58,6 +58,10 @@ struct Args {
/// Bind address for OpenRPC HTTP server
#[arg(long, default_value = "127.0.0.1")]
bind_address: String,
/// Bootstrap an initial admin API key with the given name
#[arg(long = "bootstrap-admin-key", value_name = "NAME")]
bootstrap_admin_key: Option<String>,
}
#[tokio::main]
@@ -105,6 +109,20 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
}
};
// Bootstrap admin key if requested
if let Some(admin_key_name) = args.bootstrap_admin_key {
info!("Bootstrapping admin API key: {}", admin_key_name);
let admin_key = supervisor.bootstrap_admin_key(admin_key_name).await;
println!("\n╔════════════════════════════════════════════════════════════╗");
println!("║ 🔑 Admin API Key Created ║");
println!("╚════════════════════════════════════════════════════════════╝");
println!(" Name: {}", admin_key.name);
println!(" Key: {}", admin_key.key);
println!(" Scope: {}", admin_key.scope.as_str());
println!(" ⚠️ SAVE THIS KEY - IT WILL NOT BE SHOWN AGAIN!");
println!("╚════════════════════════════════════════════════════════════╝\n");
}
// Print startup information
let server_url = format!("http://{}:{}", args.bind_address, args.port);
println!("\n╔════════════════════════════════════════════════════════════╗");