Compare commits
6 Commits
release-20
...
release-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
253067b417 | ||
|
|
8d5edc659f | ||
|
|
c122290f37 | ||
|
|
999cef34a7 | ||
|
|
93a43d1b38 | ||
|
|
91ca6ff96f |
@@ -7,6 +7,11 @@ stage = "build"
|
|||||||
command = "sh"
|
command = "sh"
|
||||||
command_arguments = ["-c", "npx @tailwindcss/cli -i input.css -o public/tailwind.css"]
|
command_arguments = ["-c", "npx @tailwindcss/cli -i input.css -o public/tailwind.css"]
|
||||||
|
|
||||||
|
[[hooks]]
|
||||||
|
stage = "post_build"
|
||||||
|
command = "sh"
|
||||||
|
command_arguments = ["-c", "sed -i '' -e 's/<link rel=\"modulepreload\"[^>]*>//g' -e 's/<link rel=\"preload\"[^>]*>//g' \"$TRUNK_STAGING_DIR/index.html\" || sed -i -e 's/<link rel=\"modulepreload\"[^>]*>//g' -e 's/<link rel=\"preload\"[^>]*>//g' \"$TRUNK_STAGING_DIR/index.html\""]
|
||||||
|
|
||||||
[build]
|
[build]
|
||||||
target = "index.html"
|
target = "index.html"
|
||||||
dist = "dist"
|
dist = "dist"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
|
<link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
|
||||||
|
|
||||||
<!-- Trunk Assets -->
|
<!-- Trunk Assets -->
|
||||||
<script data-trunk rel="rust" src="Cargo.toml" data-wasm-opt="0" data-preload="false"></script>
|
<link data-trunk rel="rust" href="Cargo.toml" data-wasm-opt="0" />
|
||||||
<link data-trunk rel="css" href="public/tailwind.css" />
|
<link data-trunk rel="css" href="public/tailwind.css" />
|
||||||
<link data-trunk rel="copy-file" href="manifest.json" />
|
<link data-trunk rel="copy-file" href="manifest.json" />
|
||||||
<link data-trunk rel="copy-file" href="icon-192.png" />
|
<link data-trunk rel="copy-file" href="icon-192.png" />
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -49,14 +49,10 @@ fn InnerApp() -> impl IntoView {
|
|||||||
|
|
||||||
Effect::new(move |_| {
|
Effect::new(move |_| {
|
||||||
spawn_local(async move {
|
spawn_local(async move {
|
||||||
log::info!("App initialization started...");
|
|
||||||
gloo_console::log!("APP INIT: Checking setup status...");
|
|
||||||
|
|
||||||
// Check if setup is needed via Server Function
|
// Check if setup is needed via Server Function
|
||||||
match shared::server_fns::auth::get_setup_status().await {
|
match shared::server_fns::auth::get_setup_status().await {
|
||||||
Ok(status) => {
|
Ok(status) => {
|
||||||
if !status.completed {
|
if !status.completed {
|
||||||
log::info!("Setup not completed");
|
|
||||||
needs_setup.1.set(true);
|
needs_setup.1.set(true);
|
||||||
is_loading.1.set(false);
|
is_loading.1.set(false);
|
||||||
return;
|
return;
|
||||||
@@ -68,15 +64,12 @@ fn InnerApp() -> impl IntoView {
|
|||||||
// Check authentication via GetUser Server Function
|
// Check authentication via GetUser Server Function
|
||||||
match shared::server_fns::auth::get_user().await {
|
match shared::server_fns::auth::get_user().await {
|
||||||
Ok(Some(user_info)) => {
|
Ok(Some(user_info)) => {
|
||||||
log::info!("Authenticated as {}", user_info.username);
|
|
||||||
if let Some(s) = store {
|
if let Some(s) = store {
|
||||||
s.user.set(Some(user_info.username));
|
s.user.set(Some(user_info.username));
|
||||||
}
|
}
|
||||||
is_authenticated.1.set(true);
|
is_authenticated.1.set(true);
|
||||||
}
|
}
|
||||||
Ok(None) => {
|
Ok(None) => {}
|
||||||
log::info!("Not authenticated");
|
|
||||||
}
|
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
log::error!("Auth check failed: {:?}", e);
|
log::error!("Auth check failed: {:?}", e);
|
||||||
}
|
}
|
||||||
@@ -111,7 +104,6 @@ fn InnerApp() -> impl IntoView {
|
|||||||
let navigate = use_navigate();
|
let navigate = use_navigate();
|
||||||
navigate("/setup", Default::default());
|
navigate("/setup", Default::default());
|
||||||
} else if authenticated {
|
} else if authenticated {
|
||||||
log::info!("Already authenticated, redirecting to home");
|
|
||||||
let navigate = use_navigate();
|
let navigate = use_navigate();
|
||||||
navigate("/", Default::default());
|
navigate("/", Default::default());
|
||||||
}
|
}
|
||||||
@@ -135,10 +127,8 @@ fn InnerApp() -> impl IntoView {
|
|||||||
Effect::new(move |_| {
|
Effect::new(move |_| {
|
||||||
if !is_loading.0.get() {
|
if !is_loading.0.get() {
|
||||||
if needs_setup.0.get() {
|
if needs_setup.0.get() {
|
||||||
log::info!("Setup not completed, redirecting to setup");
|
|
||||||
navigate("/setup", Default::default());
|
navigate("/setup", Default::default());
|
||||||
} else if !is_authenticated.0.get() {
|
} else if !is_authenticated.0.get() {
|
||||||
log::info!("Not authenticated, redirecting to login");
|
|
||||||
navigate("/login", Default::default());
|
navigate("/login", Default::default());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ pub fn TorrentDetailsSheet() -> impl IntoView {
|
|||||||
</SheetClose>
|
</SheetClose>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex-1 min-h-0 overflow-hidden p-6 flex flex-col">
|
<div class="flex-1 overflow-hidden flex flex-col pt-4 px-6 pb-0">
|
||||||
<Tabs default_value="general" class="flex-1 min-h-0 flex flex-col">
|
<Tabs default_value="general" class="flex-1 h-full min-h-0 flex flex-col">
|
||||||
<TabsList class="w-full justify-start rounded-none border-b bg-transparent p-0">
|
<TabsList class="w-full justify-start rounded-none border-b bg-transparent p-0 shrink-0">
|
||||||
<TabsTrigger value="general" class="data-[state=active]:bg-transparent data-[state=active]:shadow-none data-[state=active]:border-b-2 data-[state=active]:border-primary rounded-none">
|
<TabsTrigger value="general" class="data-[state=active]:bg-transparent data-[state=active]:shadow-none data-[state=active]:border-b-2 data-[state=active]:border-primary rounded-none">
|
||||||
"Genel"
|
"Genel"
|
||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
@@ -68,9 +68,8 @@ pub fn TorrentDetailsSheet() -> impl IntoView {
|
|||||||
</TabsTrigger>
|
</TabsTrigger>
|
||||||
</TabsList>
|
</TabsList>
|
||||||
|
|
||||||
<div class="relative flex-1 min-h-0 mt-4">
|
<crate::components::ui::scroll_area::ScrollArea class="flex-1 min-h-0 mt-4 pb-12 pr-4">
|
||||||
<div class="absolute inset-0 overflow-y-auto pb-12 pr-2">
|
<TabsContent value="general" class="space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300">
|
||||||
<TabsContent value="general" class="space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300">
|
|
||||||
<crate::components::ui::shimmer::Shimmer
|
<crate::components::ui::shimmer::Shimmer
|
||||||
loading=Signal::derive(move || selected_torrent.get().is_none())
|
loading=Signal::derive(move || selected_torrent.get().is_none())
|
||||||
shimmer_color="rgba(0,0,0,0.06)"
|
shimmer_color="rgba(0,0,0,0.06)"
|
||||||
@@ -187,8 +186,7 @@ pub fn TorrentDetailsSheet() -> impl IntoView {
|
|||||||
<p class="text-sm font-medium">"Eş listesi yakında eklenecek"</p>
|
<p class="text-sm font-medium">"Eş listesi yakında eklenecek"</p>
|
||||||
</div>
|
</div>
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
</div>
|
</crate::components::ui::scroll_area::ScrollArea>
|
||||||
</div>
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
</SheetContent>
|
</SheetContent>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ pub mod input;
|
|||||||
pub mod multi_select;
|
pub mod multi_select;
|
||||||
pub mod select;
|
pub mod select;
|
||||||
pub mod separator;
|
pub mod separator;
|
||||||
|
pub mod scroll_area;
|
||||||
pub mod sheet;
|
pub mod sheet;
|
||||||
pub mod sidenav;
|
pub mod sidenav;
|
||||||
pub mod skeleton;
|
pub mod skeleton;
|
||||||
|
|||||||
102
frontend/src/components/ui/scroll_area.rs
Normal file
102
frontend/src/components/ui/scroll_area.rs
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
use leptos::prelude::*;
|
||||||
|
use leptos_ui::void;
|
||||||
|
use tw_merge::*;
|
||||||
|
|
||||||
|
// Removed unused fake components
|
||||||
|
|
||||||
|
/* ========================================================== */
|
||||||
|
/* ✨ COMPONENTS ✨ */
|
||||||
|
/* ========================================================== */
|
||||||
|
|
||||||
|
#[component]
|
||||||
|
pub fn ScrollArea(children: Children, #[prop(into, optional)] class: String) -> impl IntoView {
|
||||||
|
let merged_class = tw_merge!("relative overflow-hidden", class);
|
||||||
|
view! {
|
||||||
|
<div data-name="ScrollArea" class=merged_class>
|
||||||
|
<ScrollAreaViewport class="pr-3 pb-3 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-border/60 [&::-webkit-scrollbar-thumb]:rounded-full hover:[&::-webkit-scrollbar-thumb]:bg-border/80">{children()}</ScrollAreaViewport>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[component]
|
||||||
|
pub fn ScrollAreaViewport(children: Children, #[prop(into, optional)] class: String) -> impl IntoView {
|
||||||
|
let merged_class = tw_merge!(
|
||||||
|
"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 overflow-auto",
|
||||||
|
class
|
||||||
|
);
|
||||||
|
view! {
|
||||||
|
<div data-name="ScrollAreaViewport" class=merged_class>
|
||||||
|
{children()}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ========================================================== */
|
||||||
|
/* 🧬 ENUMS 🧬 */
|
||||||
|
/* ========================================================== */
|
||||||
|
|
||||||
|
// Real scrollbars are now utilized in the viewport directly.
|
||||||
|
|
||||||
|
/* ========================================================== */
|
||||||
|
/* 🧬 STRUCT 🧬 */
|
||||||
|
/* ========================================================== */
|
||||||
|
|
||||||
|
#[component]
|
||||||
|
pub fn SnapScrollArea(
|
||||||
|
#[prop(into, default = SnapAreaVariant::default())] variant: SnapAreaVariant,
|
||||||
|
#[prop(into, optional)] class: String,
|
||||||
|
children: Children,
|
||||||
|
) -> impl IntoView {
|
||||||
|
let snap_item = SnapAreaClass { variant };
|
||||||
|
let merged_class = snap_item.with_class(class);
|
||||||
|
view! {
|
||||||
|
<div data-name="SnapScrollArea" class=merged_class>
|
||||||
|
{children()}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(TwClass, Default)]
|
||||||
|
#[tw(class = "")]
|
||||||
|
pub struct SnapAreaClass {
|
||||||
|
variant: SnapAreaVariant,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(TwVariant)]
|
||||||
|
pub enum SnapAreaVariant {
|
||||||
|
// * snap-x by default
|
||||||
|
#[tw(default, class = "overflow-x-auto snap-x")]
|
||||||
|
Center,
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ========================================================== */
|
||||||
|
/* 🧬 STRUCT 🧬 */
|
||||||
|
/* ========================================================== */
|
||||||
|
|
||||||
|
#[component]
|
||||||
|
pub fn SnapItem(
|
||||||
|
#[prop(into, default = SnapVariant::default())] variant: SnapVariant,
|
||||||
|
#[prop(into, optional)] class: String,
|
||||||
|
children: Children,
|
||||||
|
) -> impl IntoView {
|
||||||
|
let snap_item = SnapItemClass { variant };
|
||||||
|
let merged_class = snap_item.with_class(class);
|
||||||
|
view! {
|
||||||
|
<div data-name="SnapItem" class=merged_class>
|
||||||
|
{children()}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(TwClass, Default)]
|
||||||
|
#[tw(class = "shrink-0")]
|
||||||
|
pub struct SnapItemClass {
|
||||||
|
variant: SnapVariant,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(TwVariant)]
|
||||||
|
pub enum SnapVariant {
|
||||||
|
// * snap-center by default
|
||||||
|
#[tw(default, class = "snap-center")]
|
||||||
|
Center,
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user