Compare commits
2 Commits
release-20
...
release-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89ad42f24d | ||
|
|
bec804131b |
@@ -22,12 +22,32 @@ jobs:
|
|||||||
git fetch --depth=1 origin ${{ gitea.sha }}
|
git fetch --depth=1 origin ${{ gitea.sha }}
|
||||||
git checkout FETCH_HEAD
|
git checkout FETCH_HEAD
|
||||||
|
|
||||||
|
- name: Cache Cargo
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/bin/
|
||||||
|
~/.cargo/registry/index/
|
||||||
|
~/.cargo/registry/cache/
|
||||||
|
~/.cargo/git/db/
|
||||||
|
target/
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-cargo-
|
||||||
|
|
||||||
|
- name: Cache Node Modules
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: frontend/node_modules
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('frontend/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
- name: Build Frontend
|
- name: Build Frontend
|
||||||
run: |
|
run: |
|
||||||
cd frontend
|
cd frontend
|
||||||
npm install
|
npm install
|
||||||
npx @tailwindcss/cli -i input.css -o public/tailwind.css --minify --content './src/**/*.rs'
|
npx @tailwindcss/cli -i input.css -o public/tailwind.css --minify --content './src/**/*.rs'
|
||||||
# Trunk'ın optimizasyonunu kapalı (0) tutuyoruz çünkü Cargo.toml'daki opt-level='z' zaten o işi yapıyor.
|
|
||||||
trunk build --release
|
trunk build --release
|
||||||
|
|
||||||
- name: Build Backend (MIPS)
|
- name: Build Backend (MIPS)
|
||||||
|
|||||||
@@ -131,51 +131,25 @@ fn InnerApp() -> impl IntoView {
|
|||||||
view! { <Setup /> }
|
view! { <Setup /> }
|
||||||
} />
|
} />
|
||||||
|
|
||||||
<Route path=leptos_router::path!("/") view=move || {
|
<Route path=leptos_router::path!("/") view=move || {
|
||||||
let navigate = use_navigate();
|
let navigate = use_navigate();
|
||||||
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");
|
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");
|
log::info!("Not authenticated, redirecting to login");
|
||||||
navigate("/login", Default::default());
|
navigate("/login", Default::default());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
view! {
|
||||||
view! {
|
<Show when=move || !is_loading.0.get() fallback=|| {
|
||||||
<Show when=move || !is_loading.0.get() fallback=move || {
|
// Standard 1: Always show Dashboard Skeleton
|
||||||
let path = loc.pathname.get();
|
|
||||||
if path == "/login" {
|
|
||||||
// Login Skeleton
|
|
||||||
view! {
|
view! {
|
||||||
<div class="flex items-center justify-center min-h-screen bg-muted/40 px-4">
|
<div class="flex h-screen bg-background text-foreground overflow-hidden">
|
||||||
<Card class="w-full max-w-sm shadow-lg border-none">
|
|
||||||
<CardHeader class="pb-2 items-center space-y-4">
|
|
||||||
<Skeleton class="w-12 h-12 rounded-xl" />
|
|
||||||
<Skeleton class="h-8 w-32" />
|
|
||||||
<Skeleton class="h-4 w-48" />
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent class="pt-4 space-y-6">
|
|
||||||
<div class="space-y-2">
|
|
||||||
<Skeleton class="h-4 w-24" />
|
|
||||||
<Skeleton class="h-10 w-full" />
|
|
||||||
</div>
|
|
||||||
<div class="space-y-2">
|
|
||||||
<Skeleton class="h-4 w-24" />
|
|
||||||
<Skeleton class="h-10 w-full" />
|
|
||||||
</div>
|
|
||||||
<Skeleton class="h-10 w-full rounded-md mt-4" />
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
</div>
|
|
||||||
}.into_any()
|
|
||||||
} else {
|
|
||||||
// Dashboard Skeleton
|
|
||||||
view! {
|
|
||||||
<div class="flex h-screen bg-background">
|
|
||||||
// Sidebar skeleton
|
// Sidebar skeleton
|
||||||
<div class="w-56 border-r border-border p-4 space-y-4">
|
<div class="w-56 border-r border-border p-4 space-y-4">
|
||||||
<Skeleton class="h-8 w-3/4" />
|
<Skeleton class="h-8 w-3/4" />
|
||||||
@@ -189,7 +163,7 @@ fn InnerApp() -> impl IntoView {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
// Main content skeleton
|
// Main content skeleton
|
||||||
<div class="flex-1 flex flex-col">
|
<div class="flex-1 flex flex-col min-w-0">
|
||||||
<div class="border-b border-border p-4 flex items-center gap-4">
|
<div class="border-b border-border p-4 flex items-center gap-4">
|
||||||
<Skeleton class="h-8 w-48" />
|
<Skeleton class="h-8 w-48" />
|
||||||
<Skeleton class="h-8 w-64" />
|
<Skeleton class="h-8 w-64" />
|
||||||
@@ -209,20 +183,19 @@ fn InnerApp() -> impl IntoView {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}.into_any()
|
}.into_any()
|
||||||
}
|
}>
|
||||||
}>
|
<Show when=move || is_authenticated.0.get() fallback=|| ()>
|
||||||
<Show when=move || is_authenticated.0.get() fallback=|| ()>
|
<Protected>
|
||||||
<Protected>
|
<div class="flex flex-col h-full overflow-hidden">
|
||||||
<div class="flex flex-col h-full overflow-hidden">
|
<div class="flex-1 overflow-hidden">
|
||||||
<div class="flex-1 overflow-hidden">
|
<TorrentTable />
|
||||||
<TorrentTable />
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Protected>
|
||||||
</Protected>
|
</Show>
|
||||||
</Show>
|
</Show>
|
||||||
</Show>
|
}.into_any()
|
||||||
}.into_any()
|
}/>
|
||||||
}/>
|
|
||||||
|
|
||||||
<Route path=leptos_router::path!("/settings") view=move || {
|
<Route path=leptos_router::path!("/settings") view=move || {
|
||||||
let authenticated = is_authenticated.0.get();
|
let authenticated = is_authenticated.0.get();
|
||||||
|
|||||||
Reference in New Issue
Block a user