Skip to content

Commit

Permalink
LEA -> Simplify About page.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbfm committed Jan 20, 2025
1 parent 4189be7 commit 99129f4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 49 deletions.
70 changes: 22 additions & 48 deletions opendut-lea/src/about/overview.rs
Original file line number Diff line number Diff line change
@@ -1,66 +1,40 @@
use leptos::prelude::*;
use crate::app::use_app_globals;
use crate::components::{BasePageContainer, LoadingSpinner};
use crate::components::BasePageContainer;

use shadow_rs::shadow;
use opendut_types::proto::util::VersionInfo;
use crate::util::NON_BREAKING_SPACE;
shadow!(build);

#[component]
pub fn AboutOverview() -> impl IntoView {

let globals = use_app_globals();

let metadata: LocalResource<VersionInfo> = LocalResource::new(move || {
let carl = globals.client.clone();
async move {
let mut carl = carl.clone();
carl.metadata.version().await
.expect("Failed to request the version from carl.")
}
});

view! {
<BasePageContainer
title="About"
breadcrumbs=Vec::new()
controls=view! { <> }
>
<div class="mt-4">
<Transition fallback=LoadingSpinner>
{ move || Suspend::new(async move {
let metadata = metadata.await;
view! {
<table class="table is-bordered">
<tbody>
<tr>
<td>LEA</td>
<td>Version</td>
<td>{ build::PKG_VERSION }</td>
</tr>
<tr>
<td rowspan="4">CARL</td>
<td>Version</td>
<td>{ metadata.name }</td>
</tr>
<tr>
<td>Revision</td>
<td>{ metadata.revision }</td>
</tr>
<tr>
<td>Revision Date</td>
<td>{ metadata.revision_date }</td>
</tr>
<tr>
<td>Build Date</td>
<td>{ metadata.build_date }</td>
</tr>
</tbody>
</table>
}
})}
</Transition>
<table class="table">
<tbody>
<tr>
<td>Version</td>
<td>{ build::PKG_VERSION }</td>
</tr>
<tr>
<td>Revision</td>
<td>{ build::COMMIT_HASH }</td>
</tr>
<tr>
<td>Revision Date</td>
<td>{ build::COMMIT_DATE }</td>
</tr>
<tr>
<td>Build Date</td>
<td>{ build::BUILD_TIME }</td>
</tr>
</tbody>
</table>

<a href="https://opendut.eclipse.dev/"><i class="fa-solid fa-arrow-up-right-from-square"></i>{ NON_BREAKING_SPACE } openDuT Project Overview</a>
</div>
</BasePageContainer>
Expand Down
2 changes: 1 addition & 1 deletion opendut-lea/src/routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ mod routes {
/>
<Route
path=path!("/about")
view=move || view! { <Initialized app_globals><AboutOverview/></Initialized> }
view=move || view! { <Initialized app_globals><AboutOverview/></Initialized> } //require Initialized to protect with authentication
/>
<Route
path=path!("/licenses")
Expand Down

0 comments on commit 99129f4

Please sign in to comment.