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

@@ -666,22 +666,6 @@ version = "0.8.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
[[package]]
name = "crossterm"
version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df"
dependencies = [
"bitflags 2.9.3",
"crossterm_winapi",
"libc",
"mio 0.8.11",
"parking_lot",
"signal-hook",
"signal-hook-mio",
"winapi",
]
[[package]]
name = "crossterm"
version = "0.28.1"
@@ -690,7 +674,7 @@ checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6"
dependencies = [
"bitflags 2.9.3",
"crossterm_winapi",
"mio 1.0.4",
"mio",
"parking_lot",
"rustix 0.38.44",
"signal-hook",
@@ -822,6 +806,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d630bccd429a5bb5a64b5e94f693bfc48c9f8566418fda4c494cc94f911f87cc"
dependencies = [
"powerfmt",
"serde",
]
[[package]]
@@ -1405,16 +1390,15 @@ version = "0.1.0"
dependencies = [
"anyhow",
"async-trait",
"base64 0.22.1",
"chrono",
"clap",
"env_logger 0.10.2",
"hyper 1.7.0",
"hyper-util",
"jsonrpsee",
"log",
"rand 0.8.5",
"redis 0.25.4",
"reqwest 0.12.23",
"runner_rust",
"runner_rust 0.1.0 (git+https://git.ourworld.tf/herocode/runner_rust.git)",
"serde",
"serde_json",
"thiserror 1.0.69",
@@ -1430,19 +1414,21 @@ name = "hero-supervisor-openrpc-client"
version = "0.1.0"
dependencies = [
"chrono",
"clap",
"console_log",
"crossterm 0.27.0",
"env_logger 0.11.8",
"getrandom 0.2.16",
"hero-supervisor",
"hex",
"indexmap",
"js-sys",
"jsonrpsee",
"log",
"ratatui",
"runner_rust",
"runner_rust 0.1.0 (git+https://git.ourworld.tf/herocode/runner_rust.git?branch=main)",
"secp256k1 0.29.1",
"serde",
"serde-wasm-bindgen",
"serde_json",
"sha2",
"thiserror 1.0.69",
"tokio",
"tokio-test",
@@ -1514,6 +1500,12 @@ dependencies = [
"serde",
]
[[package]]
name = "hex"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "hkdf"
version = "0.12.4"
@@ -2499,18 +2491,6 @@ dependencies = [
"adler2",
]
[[package]]
name = "mio"
version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
dependencies = [
"libc",
"log",
"wasi 0.11.1+wasi-snapshot-preview1",
"windows-sys 0.48.0",
]
[[package]]
name = "mio"
version = "1.0.4"
@@ -2717,6 +2697,36 @@ dependencies = [
"num-traits",
]
[[package]]
name = "osiris"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/osiris.git#097360ad12d2ea73ac4d38552889d97702d9a889"
dependencies = [
"anyhow",
"clap",
"env_logger 0.10.2",
"osiris_derive",
"redis 0.24.0",
"serde",
"serde_json",
"time",
"tokio",
"toml",
"tracing",
"tracing-subscriber",
"uuid",
]
[[package]]
name = "osiris_derive"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/osiris.git#097360ad12d2ea73ac4d38552889d97702d9a889"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.106",
]
[[package]]
name = "ourdb"
version = "0.1.0"
@@ -2922,19 +2932,6 @@ version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
[[package]]
name = "plist"
version = "1.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3af6b589e163c5a788fab00ce0c0366f6efbb9959c2f9874b224936af7fce7e1"
dependencies = [
"base64 0.22.1",
"indexmap",
"quick-xml",
"serde",
"time",
]
[[package]]
name = "poly1305"
version = "0.8.0"
@@ -3097,15 +3094,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "quick-xml"
version = "0.38.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42a232e7487fc2ef313d96dde7948e7a3c05101870d8985e4fd8d26aedd27b89"
dependencies = [
"memchr",
]
[[package]]
name = "quote"
version = "1.0.40"
@@ -3216,7 +3204,7 @@ dependencies = [
"bitflags 2.9.3",
"cassowary",
"compact_str",
"crossterm 0.28.1",
"crossterm",
"instability",
"itertools",
"lru",
@@ -3237,6 +3225,27 @@ dependencies = [
"bitflags 2.9.3",
]
[[package]]
name = "redis"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c580d9cbbe1d1b479e8d67cf9daf6a62c957e6846048408b80b43ac3f6af84cd"
dependencies = [
"async-trait",
"bytes",
"combine",
"futures-util",
"itoa",
"percent-encoding",
"pin-project-lite",
"ryu",
"sha1_smol",
"socket2 0.4.10",
"tokio",
"tokio-util",
"url",
]
[[package]]
name = "redis"
version = "0.25.4"
@@ -3565,18 +3574,22 @@ checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746"
[[package]]
name = "runner_rust"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/runner_rust.git?branch=main#268128f7fd53e9586288efd95f9288595c4a74e9"
dependencies = [
"anyhow",
"async-trait",
"chrono",
"clap",
"crossterm 0.28.1",
"crossterm",
"env_logger 0.10.2",
"hero_logger",
"heromodels",
"heromodels-derive",
"heromodels_core",
"hex",
"log",
"osiris",
"rand 0.8.5",
"ratatui",
"redis 0.25.4",
"rhai",
@@ -3590,13 +3603,61 @@ dependencies = [
"sal-postgresclient",
"sal-process",
"sal-redisclient",
"sal-service-manager",
"sal-text",
"sal-vault",
"sal-virt",
"sal-zinit-client",
"secp256k1 0.28.2",
"serde",
"serde_json",
"sha2",
"thiserror 1.0.69",
"tokio",
"toml",
"tracing",
"uuid",
]
[[package]]
name = "runner_rust"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/runner_rust.git#268128f7fd53e9586288efd95f9288595c4a74e9"
dependencies = [
"anyhow",
"async-trait",
"chrono",
"clap",
"crossterm",
"env_logger 0.10.2",
"hero_logger",
"heromodels",
"heromodels-derive",
"heromodels_core",
"hex",
"log",
"osiris",
"rand 0.8.5",
"ratatui",
"redis 0.25.4",
"rhai",
"rhailib_dsl",
"sal-git",
"sal-hetzner",
"sal-kubernetes",
"sal-mycelium",
"sal-net",
"sal-os",
"sal-postgresclient",
"sal-process",
"sal-redisclient",
"sal-text",
"sal-vault",
"sal-virt",
"sal-zinit-client",
"secp256k1 0.28.2",
"serde",
"serde_json",
"sha2",
"thiserror 1.0.69",
"tokio",
"toml",
@@ -3906,24 +3967,6 @@ dependencies = [
"rhai",
]
[[package]]
name = "sal-service-manager"
version = "0.1.0"
source = "git+https://git.ourworld.tf/herocode/herolib_rust.git#7afa5ea1c0d9bb240fd2a96e5a0a01b04372fa1c"
dependencies = [
"async-trait",
"chrono",
"futures",
"log",
"once_cell",
"plist",
"serde",
"serde_json",
"thiserror 1.0.69",
"tokio",
"zinit-client",
]
[[package]]
name = "sal-text"
version = "0.1.0"
@@ -4059,6 +4102,44 @@ dependencies = [
"zeroize",
]
[[package]]
name = "secp256k1"
version = "0.28.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10"
dependencies = [
"rand 0.8.5",
"secp256k1-sys 0.9.2",
]
[[package]]
name = "secp256k1"
version = "0.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113"
dependencies = [
"rand 0.8.5",
"secp256k1-sys 0.10.1",
]
[[package]]
name = "secp256k1-sys"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb"
dependencies = [
"cc",
]
[[package]]
name = "secp256k1-sys"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9"
dependencies = [
"cc",
]
[[package]]
name = "secrecy"
version = "0.8.0"
@@ -4124,6 +4205,17 @@ dependencies = [
"serde",
]
[[package]]
name = "serde-wasm-bindgen"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b"
dependencies = [
"js-sys",
"serde",
"wasm-bindgen",
]
[[package]]
name = "serde_derive"
version = "1.0.219"
@@ -4253,8 +4345,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd"
dependencies = [
"libc",
"mio 0.8.11",
"mio 1.0.4",
"mio",
"signal-hook",
]
@@ -4326,6 +4417,16 @@ dependencies = [
"version_check",
]
[[package]]
name = "socket2"
version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d"
dependencies = [
"libc",
"winapi",
]
[[package]]
name = "socket2"
version = "0.5.10"
@@ -4727,7 +4828,7 @@ dependencies = [
"bytes",
"io-uring",
"libc",
"mio 1.0.4",
"mio",
"parking_lot",
"pin-project-lite",
"signal-hook-registry",