Restructure: move clients/openrpc to client/ and clients/admin-ui to ui/

This commit is contained in:
Timur Gordon
2025-11-06 14:07:55 +01:00
parent af5cd30516
commit 4a5f19e091
38 changed files with 43 additions and 11 deletions

2604
ui/src/app.rs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,54 @@
use yew::prelude::*;
use crate::app::{App, Msg, ContentView};
pub fn view_header(app: &App, ctx: &Context<App>) -> Html {
html! {
<header class="app-header">
<div class="header-island">
<div class="server-info">
<span class="server-label">{ "Server" }</span>
<span class="server-url">{ &app.server_url }</span>
<span class={classes!("status-dot", if app.connected { "connected" } else { "disconnected" })}>
</span>
</div>
</div>
// Breadcrumbs island
<div class="header-island breadcrumbs-island">
{
match &app.content_view {
ContentView::JobsList => {
html! {
<span class="breadcrumb-item">{ "Jobs" }</span>
}
}
ContentView::JobDetail(job_id) => {
html! {
<>
<button
class="breadcrumb-link"
onclick={ctx.link().callback(|_| Msg::BackToJobsList)}
>
{ "Jobs" }
</button>
<span class="breadcrumb-separator">{ "/" }</span>
<span class="breadcrumb-item">{ &job_id[..12.min(job_id.len())] }</span>
</>
}
}
}
}
</div>
<div class="header-island">
<div class="user-info">
<span class="user-name">{ &app.user_name }</span>
<span class="user-scope">{ &app.user_scope }</span>
</div>
<button onclick={ctx.link().callback(|_| Msg::Logout)} class="logout-btn">
{ "" }
</button>
</div>
</header>
}
}

View File

@@ -0,0 +1,11 @@
// Component modules
pub mod header;
// pub mod runners;
// pub mod jobs;
// pub mod keys;
// Re-export commonly used items
pub use header::*;
// pub use runners::*;
// pub use jobs::*;
// pub use keys::*;

10
ui/src/lib.rs Normal file
View File

@@ -0,0 +1,10 @@
use wasm_bindgen::prelude::*;
pub mod app;
pub mod app_components;
#[wasm_bindgen(start)]
pub fn main() {
wasm_logger::init(wasm_logger::Config::default());
yew::Renderer::<app::App>::new().render();
}