Use hero-job crate instead of runner_rust for job types
This commit is contained in:
54
clients/admin-ui/src/app_components/header.rs
Normal file
54
clients/admin-ui/src/app_components/header.rs
Normal 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>
|
||||
}
|
||||
}
|
||||
11
clients/admin-ui/src/app_components/mod.rs
Normal file
11
clients/admin-ui/src/app_components/mod.rs
Normal 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::*;
|
||||
Reference in New Issue
Block a user