mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Update navigation loading and NGINX try_file
This commit is contained in:
@@ -68,9 +68,9 @@
|
|||||||
];
|
];
|
||||||
locations = {
|
locations = {
|
||||||
"/" = {
|
"/" = {
|
||||||
root = "/var/www/archtika-websites/";
|
root = "/var/www/archtika-websites";
|
||||||
index = "index.html";
|
index = "index.html";
|
||||||
tryFiles = "$uri $uri/ $uri.html $uri/index.html index.html =404";
|
tryFiles = "$uri $uri/ $uri.html =404";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
autoindex on;
|
autoindex on;
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -158,16 +158,14 @@ in
|
|||||||
proxyPass = "http://localhost:${toString cfg.webAppPort}";
|
proxyPass = "http://localhost:${toString cfg.webAppPort}";
|
||||||
};
|
};
|
||||||
"/previews/" = {
|
"/previews/" = {
|
||||||
alias = "/var/www/archtika-websites/previews/";
|
root = "/var/www/archtika-websites/previews";
|
||||||
index = "index.html";
|
index = "index.html";
|
||||||
tryFiles = "$uri $uri/ $uri.html $uri/index.html index.html =404";
|
tryFiles = "$uri $uri/ $uri.html =404"
|
||||||
};
|
};
|
||||||
"/api/" = {
|
"/api/" = {
|
||||||
proxyPass = "http://localhost:${toString cfg.apiPort}/";
|
proxyPass = "http://localhost:${toString cfg.apiPort}/";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
default_type application/json;
|
default_type application/json;
|
||||||
proxy_hide_header Content-Location;
|
|
||||||
add_header Content-Location /api/$upstream_http_content_location;
|
|
||||||
proxy_set_header Connection "";
|
proxy_set_header Connection "";
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
'';
|
'';
|
||||||
@@ -179,9 +177,9 @@ in
|
|||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
locations = {
|
locations = {
|
||||||
"/" = {
|
"/" = {
|
||||||
alias = "/var/www/archtika-websites/$subdomain/";
|
root = "/var/www/archtika-websites/$subdomain";
|
||||||
index = "index.html";
|
index = "index.html";
|
||||||
tryFiles = "$uri $uri/ $uri.html $uri/index.html index.html =404";
|
tryFiles = "$uri $uri/ $uri.html =404";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,20 +3,11 @@
|
|||||||
import { page } from "$app/stores";
|
import { page } from "$app/stores";
|
||||||
import type { LayoutServerData } from "./$types";
|
import type { LayoutServerData } from "./$types";
|
||||||
import type { Snippet } from "svelte";
|
import type { Snippet } from "svelte";
|
||||||
import { beforeNavigate, afterNavigate } from "$app/navigation";
|
import { navigating } from "$app/stores";
|
||||||
import LoadingSpinner from "$lib/components/LoadingSpinner.svelte";
|
import LoadingSpinner from "$lib/components/LoadingSpinner.svelte";
|
||||||
|
|
||||||
const { data, children }: { data: LayoutServerData; children: Snippet } = $props();
|
const { data, children }: { data: LayoutServerData; children: Snippet } = $props();
|
||||||
|
|
||||||
let loading = $state(false);
|
|
||||||
|
|
||||||
beforeNavigate(() => {
|
|
||||||
loading = true;
|
|
||||||
});
|
|
||||||
afterNavigate(() => {
|
|
||||||
loading = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
const isProjectRoute = $derived($page.url.pathname.startsWith("/website") && !$page.error);
|
const isProjectRoute = $derived($page.url.pathname.startsWith("/website") && !$page.error);
|
||||||
const routeName = $derived(
|
const routeName = $derived(
|
||||||
$page.url.pathname === "/"
|
$page.url.pathname === "/"
|
||||||
@@ -25,7 +16,7 @@
|
|||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if loading}
|
{#if $navigating}
|
||||||
<LoadingSpinner />
|
<LoadingSpinner />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user