Compare commits
4 Commits
release-20
...
release-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
253067b417 | ||
|
|
8d5edc659f | ||
|
|
c122290f37 | ||
|
|
999cef34a7 |
@@ -7,6 +7,11 @@ stage = "build"
|
||||
command = "sh"
|
||||
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]
|
||||
target = "index.html"
|
||||
dist = "dist"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
|
||||
|
||||
<!-- 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="copy-file" href="manifest.json" />
|
||||
<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 |_| {
|
||||
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
|
||||
match shared::server_fns::auth::get_setup_status().await {
|
||||
Ok(status) => {
|
||||
if !status.completed {
|
||||
log::info!("Setup not completed");
|
||||
needs_setup.1.set(true);
|
||||
is_loading.1.set(false);
|
||||
return;
|
||||
@@ -68,15 +64,12 @@ fn InnerApp() -> impl IntoView {
|
||||
// Check authentication via GetUser Server Function
|
||||
match shared::server_fns::auth::get_user().await {
|
||||
Ok(Some(user_info)) => {
|
||||
log::info!("Authenticated as {}", user_info.username);
|
||||
if let Some(s) = store {
|
||||
s.user.set(Some(user_info.username));
|
||||
}
|
||||
is_authenticated.1.set(true);
|
||||
}
|
||||
Ok(None) => {
|
||||
log::info!("Not authenticated");
|
||||
}
|
||||
Ok(None) => {}
|
||||
Err(e) => {
|
||||
log::error!("Auth check failed: {:?}", e);
|
||||
}
|
||||
@@ -111,7 +104,6 @@ fn InnerApp() -> impl IntoView {
|
||||
let navigate = use_navigate();
|
||||
navigate("/setup", Default::default());
|
||||
} else if authenticated {
|
||||
log::info!("Already authenticated, redirecting to home");
|
||||
let navigate = use_navigate();
|
||||
navigate("/", Default::default());
|
||||
}
|
||||
@@ -135,10 +127,8 @@ fn InnerApp() -> impl IntoView {
|
||||
Effect::new(move |_| {
|
||||
if !is_loading.0.get() {
|
||||
if needs_setup.0.get() {
|
||||
log::info!("Setup not completed, redirecting to setup");
|
||||
navigate("/setup", Default::default());
|
||||
} else if !is_authenticated.0.get() {
|
||||
log::info!("Not authenticated, redirecting to login");
|
||||
navigate("/login", Default::default());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,7 @@ use leptos::prelude::*;
|
||||
use leptos_ui::void;
|
||||
use tw_merge::*;
|
||||
|
||||
mod components {
|
||||
use super::*;
|
||||
void! {ScrollAreaThumb, div, "bg-border relative flex-1 rounded-full"}
|
||||
void! {ScrollAreaCorner, div, "bg-border"}
|
||||
}
|
||||
pub use components::*;
|
||||
// Removed unused fake components
|
||||
|
||||
/* ========================================================== */
|
||||
/* ✨ COMPONENTS ✨ */
|
||||
@@ -18,9 +13,7 @@ pub fn ScrollArea(children: Children, #[prop(into, optional)] class: String) ->
|
||||
let merged_class = tw_merge!("relative overflow-hidden", class);
|
||||
view! {
|
||||
<div data-name="ScrollArea" class=merged_class>
|
||||
<ScrollAreaViewport>{children()}</ScrollAreaViewport>
|
||||
<ScrollBar />
|
||||
<ScrollAreaCorner />
|
||||
<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>
|
||||
}
|
||||
}
|
||||
@@ -42,29 +35,7 @@ pub fn ScrollAreaViewport(children: Children, #[prop(into, optional)] class: Str
|
||||
/* 🧬 ENUMS 🧬 */
|
||||
/* ========================================================== */
|
||||
|
||||
#[derive(Clone, Copy, Default)]
|
||||
pub enum ScrollBarOrientation {
|
||||
#[default]
|
||||
Vertical,
|
||||
Horizontal,
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn ScrollBar(
|
||||
#[prop(default = ScrollBarOrientation::default())] orientation: ScrollBarOrientation,
|
||||
#[prop(into, optional)] class: String,
|
||||
) -> impl IntoView {
|
||||
let orientation_class = match orientation {
|
||||
ScrollBarOrientation::Vertical => "h-full w-2.5 border-l border-l-transparent",
|
||||
ScrollBarOrientation::Horizontal => "h-2.5 flex-col border-t border-t-transparent",
|
||||
};
|
||||
let merged_class = tw_merge!("flex touch-none p-px transition-colors select-none", orientation_class, class);
|
||||
view! {
|
||||
<div data-name="ScrollBar" class=merged_class>
|
||||
<ScrollAreaThumb />
|
||||
</div>
|
||||
}
|
||||
}
|
||||
// Real scrollbars are now utilized in the viewport directly.
|
||||
|
||||
/* ========================================================== */
|
||||
/* 🧬 STRUCT 🧬 */
|
||||
|
||||
Reference in New Issue
Block a user