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,
|
||||
FaGear,
|
||||
FaLayerGroup,
|
||||
FaList,
|
||||
FaMagnifyingGlass,
|
||||
FaTags,
|
||||
},
|
||||
|
|
@ -53,6 +54,7 @@ use crate::{
|
|||
import,
|
||||
library,
|
||||
media_player::PlayQueue,
|
||||
playlists,
|
||||
search,
|
||||
settings,
|
||||
statistics,
|
||||
|
|
@ -77,6 +79,7 @@ enum View {
|
|||
Detail,
|
||||
Tags,
|
||||
Collections,
|
||||
Playlists,
|
||||
Books,
|
||||
Audit,
|
||||
Import,
|
||||
|
|
@ -100,6 +103,7 @@ impl View {
|
|||
Self::Detail => "Detail",
|
||||
Self::Tags => "Tags",
|
||||
Self::Collections => "Collections",
|
||||
Self::Playlists => "Playlists",
|
||||
Self::Books => "Books",
|
||||
Self::Audit => "Audit Log",
|
||||
Self::Import => "Import",
|
||||
|
|
@ -128,6 +132,7 @@ fn parse_plugin_route(route: &str) -> View {
|
|||
["settings"] => View::Settings,
|
||||
["tags"] => View::Tags,
|
||||
["collections"] => View::Collections,
|
||||
["playlists"] => View::Playlists,
|
||||
["books"] => View::Books,
|
||||
["audit"] => View::Audit,
|
||||
["import"] => View::Import,
|
||||
|
|
@ -682,6 +687,14 @@ pub fn App() -> Element {
|
|||
span { class: "nav-item-text", "Collections" }
|
||||
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 {
|
||||
class: if *current_view.read() == View::Books { "nav-item active" } else { "nav-item" },
|
||||
onclick: {
|
||||
|
|
@ -1851,6 +1864,9 @@ pub fn App() -> Element {
|
|||
},
|
||||
}
|
||||
},
|
||||
View::Playlists => rsx! {
|
||||
playlists::Playlists { client }
|
||||
},
|
||||
View::Audit => {
|
||||
let page_size = *audit_page_size.read();
|
||||
let total = *audit_total_count.read();
|
||||
|
|
@ -2658,6 +2674,8 @@ pub fn App() -> Element {
|
|||
}
|
||||
settings::Settings {
|
||||
config: cfg.clone(),
|
||||
client: Some(client.read().clone()),
|
||||
current_user_role: current_user.read().as_ref().map(|u| u.role.clone()),
|
||||
on_add_root: {
|
||||
let client = client.read().clone();
|
||||
move |path: String| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue