pinakes-ui: format all rsx blocks
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I21e7b73da193609c5d15b7f19d9668f96a6a6964
This commit is contained in:
parent
b4ffd56460
commit
26db7279d6
4 changed files with 128 additions and 85 deletions
|
|
@ -98,32 +98,38 @@ pub fn Statistics(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if !s.media_by_type.is_empty() {
|
||||
{
|
||||
let max_count = s.media_by_type.iter().map(|i| i.count).max().unwrap_or(1) as f64;
|
||||
let max_count = s.media_by_type.iter().map(|i| i.count).max().unwrap_or(1)
|
||||
|
||||
as f64;
|
||||
rsx! {
|
||||
div { class: "stats-section",
|
||||
h4 { class: "section-title",
|
||||
Icon { icon: FaChartBar, width: 16, height: 16, style: "margin-right: 8px; vertical-align: middle;" }
|
||||
Icon {
|
||||
icon: FaChartBar,
|
||||
width: 16,
|
||||
height: 16,
|
||||
style: "margin-right: 8px; vertical-align: middle;",
|
||||
}
|
||||
"Media by Type"
|
||||
}
|
||||
div { class: "chart-bars",
|
||||
for item in s.media_by_type.iter() {
|
||||
{
|
||||
let percentage = (item.count as f64 / max_count) * 100.0;
|
||||
let name = item.name.clone();
|
||||
let count = item.count;
|
||||
rsx! {
|
||||
div { key: "{name}", class: "bar-item",
|
||||
div { class: "bar-label", "{name}" }
|
||||
div { class: "bar-track",
|
||||
div {
|
||||
class: "bar-fill bar-primary",
|
||||
style: "width: {percentage}%",
|
||||
{
|
||||
let percentage = (item.count as f64 / max_count) * 100.0;
|
||||
let name = item.name.clone();
|
||||
let count = item.count;
|
||||
rsx! {
|
||||
div { key: "{name}", class: "bar-item",
|
||||
div { class: "bar-label", "{name}" }
|
||||
div { class: "bar-track",
|
||||
div { class: "bar-fill bar-primary", style: "width: {percentage}%" }
|
||||
}
|
||||
div { class: "bar-value", "{count}" }
|
||||
}
|
||||
div { class: "bar-value", "{count}" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -131,17 +137,22 @@ pub fn Statistics(
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !s.storage_by_type.is_empty() {
|
||||
{
|
||||
let max_size = s.storage_by_type.iter().map(|i| i.count).max().unwrap_or(1) as f64;
|
||||
let max_size = s.storage_by_type.iter().map(|i| i.count).max().unwrap_or(1)
|
||||
|
||||
as f64;
|
||||
rsx! {
|
||||
div { class: "stats-section",
|
||||
h4 { class: "section-title",
|
||||
Icon { icon: FaDatabase, width: 16, height: 16, style: "margin-right: 8px; vertical-align: middle;" }
|
||||
Icon {
|
||||
icon: FaDatabase,
|
||||
width: 16,
|
||||
height: 16,
|
||||
style: "margin-right: 8px; vertical-align: middle;",
|
||||
}
|
||||
"Storage by Type"
|
||||
}
|
||||
div { class: "chart-bars",
|
||||
|
|
@ -154,10 +165,7 @@ pub fn Statistics(
|
|||
div { key: "{name}", class: "bar-item",
|
||||
div { class: "bar-label", "{name}" }
|
||||
div { class: "bar-track",
|
||||
div {
|
||||
class: "bar-fill bar-success",
|
||||
style: "width: {percentage}%",
|
||||
}
|
||||
div { class: "bar-fill bar-success", style: "width: {percentage}%" }
|
||||
}
|
||||
div { class: "bar-value", "{size_str}" }
|
||||
}
|
||||
|
|
@ -173,7 +181,12 @@ pub fn Statistics(
|
|||
if !s.top_tags.is_empty() {
|
||||
div { class: "stats-section",
|
||||
h4 { class: "section-title",
|
||||
Icon { icon: FaTags, width: 16, height: 16, style: "margin-right: 8px; vertical-align: middle;" }
|
||||
Icon {
|
||||
icon: FaTags,
|
||||
width: 16,
|
||||
height: 16,
|
||||
style: "margin-right: 8px; vertical-align: middle;",
|
||||
}
|
||||
"Top Tags"
|
||||
}
|
||||
div { class: "tag-list",
|
||||
|
|
@ -190,13 +203,23 @@ pub fn Statistics(
|
|||
if !s.top_collections.is_empty() {
|
||||
div { class: "stats-section",
|
||||
h4 { class: "section-title",
|
||||
Icon { icon: FaCircle, width: 16, height: 16, style: "margin-right: 8px; vertical-align: middle;" }
|
||||
Icon {
|
||||
icon: FaCircle,
|
||||
width: 16,
|
||||
height: 16,
|
||||
style: "margin-right: 8px; vertical-align: middle;",
|
||||
}
|
||||
"Top Collections"
|
||||
}
|
||||
div { class: "collection-list",
|
||||
for item in s.top_collections.iter() {
|
||||
div { class: "collection-item",
|
||||
Icon { icon: FaFolder, width: 16, height: 16, class: "collection-icon" }
|
||||
Icon {
|
||||
icon: FaFolder,
|
||||
width: 16,
|
||||
height: 16,
|
||||
class: "collection-icon",
|
||||
}
|
||||
span { class: "collection-name", "{item.name}" }
|
||||
span { class: "collection-count", "{item.count}" }
|
||||
}
|
||||
|
|
@ -207,7 +230,12 @@ pub fn Statistics(
|
|||
|
||||
div { class: "stats-section",
|
||||
h4 { class: "section-title",
|
||||
Icon { icon: FaClock, width: 16, height: 16, style: "margin-right: 8px; vertical-align: middle;" }
|
||||
Icon {
|
||||
icon: FaClock,
|
||||
width: 16,
|
||||
height: 16,
|
||||
style: "margin-right: 8px; vertical-align: middle;",
|
||||
}
|
||||
"Date Range"
|
||||
}
|
||||
div { class: "date-range",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue