Added set sail button and much nicer artist enrichment
This commit is contained in:
@@ -142,6 +142,26 @@ pub fn dashboard() -> Html {
|
||||
})
|
||||
};
|
||||
|
||||
let on_pipeline = {
|
||||
let message = message.clone();
|
||||
let error = error.clone();
|
||||
let fetch = fetch_status.clone();
|
||||
Callback::from(move |_: MouseEvent| {
|
||||
let message = message.clone();
|
||||
let error = error.clone();
|
||||
let fetch = fetch.clone();
|
||||
wasm_bindgen_futures::spawn_local(async move {
|
||||
match api::trigger_pipeline().await {
|
||||
Ok(p) => {
|
||||
message.set(Some(format!("Pipeline started — {} tasks queued", p.task_ids.len())));
|
||||
fetch.emit(());
|
||||
}
|
||||
Err(e) => error.set(Some(e.0)),
|
||||
}
|
||||
});
|
||||
})
|
||||
};
|
||||
|
||||
if let Some(ref err) = *error {
|
||||
return html! { <div class="error">{ format!("Error: {err}") }</div> };
|
||||
}
|
||||
@@ -150,6 +170,8 @@ pub fn dashboard() -> Html {
|
||||
return html! { <p class="loading">{ "Loading..." }</p> };
|
||||
};
|
||||
|
||||
let pipeline_active = s.tasks.iter().any(|t| t.status == "Pending" || t.status == "Running");
|
||||
|
||||
html! {
|
||||
<div>
|
||||
<div class="page-header">
|
||||
@@ -182,12 +204,25 @@ pub fn dashboard() -> Html {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
// Actions
|
||||
// Pipeline
|
||||
<div class="card">
|
||||
<h3>{ "Actions" }</h3>
|
||||
<div class="flex items-center justify-between">
|
||||
<h3>{ "Pipeline" }</h3>
|
||||
<button class="btn btn-primary" onclick={on_pipeline} disabled={pipeline_active}>
|
||||
{ "Set Sail" }
|
||||
</button>
|
||||
</div>
|
||||
<p class="text-sm text-muted mt-1">
|
||||
{ "Sync \u{2192} Download \u{2192} Index \u{2192} Tag \u{2192} Organize \u{2192} Enrich" }
|
||||
</p>
|
||||
</div>
|
||||
|
||||
// Individual Actions
|
||||
<div class="card">
|
||||
<h3>{ "Individual Actions" }</h3>
|
||||
<div class="actions mt-1">
|
||||
<button class="btn btn-primary" onclick={on_sync}>{ "Sync Watchlist" }</button>
|
||||
<button class="btn btn-success" onclick={on_process}>{ "Process Downloads" }</button>
|
||||
<button class="btn btn-secondary" onclick={on_sync}>{ "Sync Watchlist" }</button>
|
||||
<button class="btn btn-secondary" onclick={on_process}>{ "Process Downloads" }</button>
|
||||
<button class="btn btn-secondary" onclick={on_index}>{ "Re-index" }</button>
|
||||
<button class="btn btn-secondary" onclick={on_tag}>{ "Auto-tag" }</button>
|
||||
<button class="btn btn-secondary" onclick={on_organize}>{ "Organize" }</button>
|
||||
|
||||
Reference in New Issue
Block a user