diff options
author | metamuffin <metamuffin@disroot.org> | 2025-04-29 17:06:23 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-04-29 17:06:23 +0200 |
commit | 212a0f23bc894faf88e159560c113f504349cc05 (patch) | |
tree | ee2ff0ff3b185d1874eb0e8fc4b75f1badf659b8 /ui/src/stats.rs | |
parent | f73aa32549743b2967160d38c1622199c41524a4 (diff) | |
download | jellything-212a0f23bc894faf88e159560c113f504349cc05.tar jellything-212a0f23bc894faf88e159560c113f504349cc05.tar.bz2 jellything-212a0f23bc894faf88e159560c113f504349cc05.tar.zst |
comiles again but still many logic holes
Diffstat (limited to 'ui/src/stats.rs')
-rw-r--r-- | ui/src/stats.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/ui/src/stats.rs b/ui/src/stats.rs index c3e5a14..11163f3 100644 --- a/ui/src/stats.rs +++ b/ui/src/stats.rs @@ -5,6 +5,7 @@ */ use crate::{ + Page, format::{format_duration, format_duration_long, format_kind, format_size}, locale::{Language, tr, trs}, }; @@ -14,6 +15,15 @@ use jellycommon::{ }; use markup::raw; +impl Page for StatsPage<'_> { + fn title(&self) -> String { + tr(*self.lang, "stats.title").to_string() + } + fn to_render(&self) -> markup::DynRender { + markup::new!(@self) + } +} + markup::define! { StatsPage<'a>(lang: &'a Language, r: ApiStatsResponse) { .page.stats { @@ -57,12 +67,6 @@ markup::define! { } } -impl StatsPage<'_> { - pub fn title(&self) -> String { - tr(*self.lang, "stats.title").to_string() - } -} - trait BinExt { fn average_runtime(&self) -> f64; fn average_size(&self) -> f64; |