-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a85e9d
commit 8b76009
Showing
12 changed files
with
157 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod status_bar; | ||
pub mod torrents; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use fnord_ui::components::{Text, View}; | ||
use human_bytes::human_bytes; | ||
use leptos::prelude::*; | ||
|
||
use qbittorrent_rs_proto::transfer::ServerStateFull; | ||
|
||
#[component] | ||
pub fn StatusBar(server_state: Signal<ServerStateFull>) -> impl IntoView { | ||
let dl_speed = move || human_bytes(server_state.get().dl_info_speed); | ||
let up_speed = move || human_bytes(server_state.get().up_info_speed); | ||
let dl_data = move || human_bytes(server_state.get().dl_info_data); | ||
let up_data = move || human_bytes(server_state.get().up_info_data); | ||
|
||
view! { | ||
<View class="flex-row bg-background-highlight justify-between fixed bottom-0 left-0 right-0 h-10 text-sm"> | ||
<View class="gap-0"> | ||
<div>{move || dl_speed()}"/s"</div> | ||
<div>{move || up_speed()}"/s"</div> | ||
</View> | ||
<View class="gap-0"> | ||
<div>"Downloaded: "{move || dl_data()}</div> | ||
<div>"Uploaded: "{move || up_data()}</div> | ||
</View> | ||
</View> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
use leptos::prelude::*; | ||
|
||
#[component] | ||
pub fn TorrentList() -> impl IntoView { | ||
view! { | ||
<div></div> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
mod button; | ||
mod input; | ||
mod navbar; | ||
mod typography; | ||
mod view; | ||
|
||
pub use button::*; | ||
pub use input::*; | ||
pub use navbar::*; | ||
pub use typography::*; | ||
pub use view::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
use leptos::html; | ||
use leptos::prelude::*; | ||
use tailwind_fuse::*; | ||
|
||
#[component] | ||
pub fn H1( | ||
#[prop(optional, into)] class: String, | ||
#[prop(optional)] node_ref: NodeRef<html::H1>, | ||
children: Children, | ||
) -> impl IntoView { | ||
view! { | ||
<h1 | ||
class=tw_merge!("font-bold scroll-m-20 mt-5 text-4xl tracking-tight lg:text-5xl", class) | ||
node_ref=node_ref | ||
> | ||
{children()} | ||
</h1> | ||
} | ||
} | ||
|
||
#[component] | ||
pub fn H2( | ||
#[prop(optional, into)] class: String, | ||
#[prop(optional)] node_ref: NodeRef<html::H2>, | ||
children: Children, | ||
) -> impl IntoView { | ||
view! { | ||
<h2 | ||
class=tw_merge!( | ||
"font-bold mt-5 scroll-m-20 border-b pb-2 text-3xl tracking-tight transition-colors first:mt-0", | ||
class | ||
) | ||
|
||
node_ref=node_ref | ||
> | ||
{children()} | ||
</h2> | ||
} | ||
} | ||
|
||
#[component] | ||
pub fn H3( | ||
#[prop(optional, into)] class: String, | ||
#[prop(optional)] node_ref: NodeRef<html::H3>, | ||
children: Children, | ||
) -> impl IntoView { | ||
view! { | ||
<h3 | ||
class=tw_merge!("mt-8 scroll-m-20 text-2xl font-semibold tracking-tight", class) | ||
node_ref=node_ref | ||
> | ||
{children()} | ||
</h3> | ||
} | ||
} | ||
|
||
#[component] | ||
pub fn Text( | ||
#[prop(optional, into)] class: String, | ||
#[prop(optional)] node_ref: NodeRef<html::P>, | ||
children: Children, | ||
) -> impl IntoView { | ||
view! { | ||
<p class=tw_merge!("leading-7", class) node_ref=node_ref> | ||
{children()} | ||
</p> | ||
} | ||
} | ||
|
||
#[component] | ||
pub fn TextSpan( | ||
#[prop(optional, into)] class: String, | ||
#[prop(optional)] node_ref: NodeRef<html::Span>, | ||
children: Children, | ||
) -> impl IntoView { | ||
view! { | ||
<span class=tw_merge!("leading-7", class) node_ref=node_ref> | ||
{children()} | ||
</span> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use leptos::html; | ||
use leptos::prelude::*; | ||
use tailwind_fuse::*; | ||
|
||
#[component] | ||
pub fn View( | ||
#[prop(optional, into)] class: String, | ||
#[prop(optional)] node_ref: NodeRef<html::Div>, | ||
children: Children, | ||
) -> impl IntoView { | ||
view! { | ||
<div class=tw_merge!("flex flex-col gap-6", class) node_ref=node_ref> | ||
{children()} | ||
</div> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters