pinakes-ui: playlists view and settings updates
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I7f39eca04360e78cd76c7cb43c2ad2776a6a6964
This commit is contained in:
parent
cabead92cf
commit
651b9ef3f0
1 changed files with 18 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ use dioxus_free_icons::{
|
||||||
FaDownload,
|
FaDownload,
|
||||||
FaGear,
|
FaGear,
|
||||||
FaLayerGroup,
|
FaLayerGroup,
|
||||||
|
FaList,
|
||||||
FaMagnifyingGlass,
|
FaMagnifyingGlass,
|
||||||
FaTags,
|
FaTags,
|
||||||
},
|
},
|
||||||
|
|
@ -53,6 +54,7 @@ use crate::{
|
||||||
import,
|
import,
|
||||||
library,
|
library,
|
||||||
media_player::PlayQueue,
|
media_player::PlayQueue,
|
||||||
|
playlists,
|
||||||
search,
|
search,
|
||||||
settings,
|
settings,
|
||||||
statistics,
|
statistics,
|
||||||
|
|
@ -77,6 +79,7 @@ enum View {
|
||||||
Detail,
|
Detail,
|
||||||
Tags,
|
Tags,
|
||||||
Collections,
|
Collections,
|
||||||
|
Playlists,
|
||||||
Books,
|
Books,
|
||||||
Audit,
|
Audit,
|
||||||
Import,
|
Import,
|
||||||
|
|
@ -100,6 +103,7 @@ impl View {
|
||||||
Self::Detail => "Detail",
|
Self::Detail => "Detail",
|
||||||
Self::Tags => "Tags",
|
Self::Tags => "Tags",
|
||||||
Self::Collections => "Collections",
|
Self::Collections => "Collections",
|
||||||
|
Self::Playlists => "Playlists",
|
||||||
Self::Books => "Books",
|
Self::Books => "Books",
|
||||||
Self::Audit => "Audit Log",
|
Self::Audit => "Audit Log",
|
||||||
Self::Import => "Import",
|
Self::Import => "Import",
|
||||||
|
|
@ -128,6 +132,7 @@ fn parse_plugin_route(route: &str) -> View {
|
||||||
["settings"] => View::Settings,
|
["settings"] => View::Settings,
|
||||||
["tags"] => View::Tags,
|
["tags"] => View::Tags,
|
||||||
["collections"] => View::Collections,
|
["collections"] => View::Collections,
|
||||||
|
["playlists"] => View::Playlists,
|
||||||
["books"] => View::Books,
|
["books"] => View::Books,
|
||||||
["audit"] => View::Audit,
|
["audit"] => View::Audit,
|
||||||
["import"] => View::Import,
|
["import"] => View::Import,
|
||||||
|
|
@ -682,6 +687,14 @@ pub fn App() -> Element {
|
||||||
span { class: "nav-item-text", "Collections" }
|
span { class: "nav-item-text", "Collections" }
|
||||||
span { class: "nav-badge", "{collections_list.read().len()}" }
|
span { class: "nav-badge", "{collections_list.read().len()}" }
|
||||||
}
|
}
|
||||||
|
button {
|
||||||
|
class: if *current_view.read() == View::Playlists { "nav-item active" } else { "nav-item" },
|
||||||
|
onclick: move |_| current_view.set(View::Playlists),
|
||||||
|
span { class: "nav-icon",
|
||||||
|
NavIcon { icon: FaList }
|
||||||
|
}
|
||||||
|
span { class: "nav-item-text", "Playlists" }
|
||||||
|
}
|
||||||
button {
|
button {
|
||||||
class: if *current_view.read() == View::Books { "nav-item active" } else { "nav-item" },
|
class: if *current_view.read() == View::Books { "nav-item active" } else { "nav-item" },
|
||||||
onclick: {
|
onclick: {
|
||||||
|
|
@ -1851,6 +1864,9 @@ pub fn App() -> Element {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
View::Playlists => rsx! {
|
||||||
|
playlists::Playlists { client }
|
||||||
|
},
|
||||||
View::Audit => {
|
View::Audit => {
|
||||||
let page_size = *audit_page_size.read();
|
let page_size = *audit_page_size.read();
|
||||||
let total = *audit_total_count.read();
|
let total = *audit_total_count.read();
|
||||||
|
|
@ -2658,6 +2674,8 @@ pub fn App() -> Element {
|
||||||
}
|
}
|
||||||
settings::Settings {
|
settings::Settings {
|
||||||
config: cfg.clone(),
|
config: cfg.clone(),
|
||||||
|
client: Some(client.read().clone()),
|
||||||
|
current_user_role: current_user.read().as_ref().map(|u| u.role.clone()),
|
||||||
on_add_root: {
|
on_add_root: {
|
||||||
let client = client.read().clone();
|
let client = client.read().clone();
|
||||||
move |path: String| {
|
move |path: String| {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue