fix(navigation): back button on host detail returns to application when coming from there

- application_detail: host links now include ?back=/applications/:id
- host_detail: back_label handles /applications/ prefix → "← Application"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-16 23:01:05 +02:00
parent 5b3170c6d1
commit e68845a2ce
2 changed files with 4 additions and 2 deletions

View File

@@ -178,7 +178,7 @@ pub fn ApplicationDetailPage() -> impl IntoView {
view! {
<div class="app-row">
<a class="table-link"
href=format!("/hosts/{}", host.id)>
href=format!("/hosts/{}?back=/applications/{}", host.id, id)>
{host.name}
</a>
<span class="cell-mono">{host.ip}</span>

View File

@@ -232,7 +232,9 @@ pub fn HostDetailPage() -> impl IntoView {
.unwrap_or_else(|| "/hosts".to_string())
};
let back_label = move || {
if back_url().starts_with("/networks/") { "← Network" } else { "← Hosts" }
if back_url().starts_with("/networks/") { "← Network" }
else if back_url().starts_with("/applications/") { "← Application" }
else { "← Hosts" }
};
let update_action = ServerAction::<UpdateHost>::new();