fix: statistics at the top of page
This commit is contained in:
parent
44b322371c
commit
15cc1f708f
5 changed files with 147 additions and 96 deletions
|
|
@ -42,14 +42,14 @@ pub fn RealmHeader(
|
|||
realm_description: Option<String>,
|
||||
scene_name: String,
|
||||
scene_description: Option<String>,
|
||||
online_count: i32,
|
||||
online_count: Signal<i32>,
|
||||
total_members: i32,
|
||||
max_capacity: i32,
|
||||
can_admin: bool,
|
||||
on_logout: Callback<()>,
|
||||
) -> impl IntoView {
|
||||
let stats_tooltip = format!("Members: {} / Max: {}", total_members, max_capacity);
|
||||
let online_text = format!("{} ONLINE", online_count);
|
||||
let online_text = move || format!("{} ONLINE", online_count.get());
|
||||
let admin_url = format!("/admin/realms/{}", realm_slug);
|
||||
|
||||
view! {
|
||||
|
|
|
|||
|
|
@ -686,7 +686,8 @@ pub fn RealmPage() -> impl IntoView {
|
|||
let realm_name = realm.name.clone();
|
||||
let realm_slug_val = realm.slug.clone();
|
||||
let realm_description = realm.tagline.clone();
|
||||
let online_count = realm.current_user_count;
|
||||
// Derive online count reactively from members signal
|
||||
let online_count = Signal::derive(move || members.get().len() as i32);
|
||||
let total_members = realm.member_count;
|
||||
let max_capacity = realm.max_users;
|
||||
let scene_name = scene_info.0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue