mirror of
https://github.com/sergi0g/cup.git
synced 2025-11-16 17:13:46 -05:00
refactor: load web UI assets with a relative URL to allow for hosting under a different path.
Might fix #53.
This commit is contained in:
@@ -26,9 +26,9 @@
|
||||
content="#030712"
|
||||
>
|
||||
{% endif %}
|
||||
<link rel="icon" type="image/svg+xml" href="favicon.svg">
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
<link rel="apple-touch-icon" href="apple-touch-icon.png">
|
||||
<link rel="icon" type="image/svg+xml" href="./favicon.svg">
|
||||
<link rel="icon" type="image/x-icon" href="./favicon.ico">
|
||||
<link rel="apple-touch-icon" href="./apple-touch-icon.png">
|
||||
<title>Cup</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -6,7 +6,7 @@ import { LoaderCircle } from "lucide-react";
|
||||
export default function Loading({ onLoad }: { onLoad: (data: Data) => void }) {
|
||||
fetch(
|
||||
process.env.NODE_ENV === "production"
|
||||
? "/api/v3/json"
|
||||
? "./api/v3/json"
|
||||
: `http://${window.location.hostname}:8000/api/v3/json`,
|
||||
).then((response) =>
|
||||
response.json().then((data) => {
|
||||
@@ -26,9 +26,9 @@ export default function Loading({ onLoad }: { onLoad: (data: Data) => void }) {
|
||||
<Logo />
|
||||
</div>
|
||||
<div
|
||||
className={`flex flex-col h-full items-center justify-center gap-1 text-${theme}-500 dark:text-${theme}-400`}
|
||||
className={`flex h-full flex-col items-center justify-center gap-1 text-${theme}-500 dark:text-${theme}-400`}
|
||||
>
|
||||
<div className="flex gap-1 mb-8">
|
||||
<div className="mb-8 flex gap-1">
|
||||
Loading <LoaderCircle className="animate-spin" />
|
||||
</div>
|
||||
<p>
|
||||
|
||||
@@ -4,6 +4,7 @@ import react from "@vitejs/plugin-react-swc";
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
base: "./",
|
||||
build: {
|
||||
rollupOptions: {
|
||||
// https://stackoverflow.com/q/69614671/vite-without-hash-in-filename#75344943
|
||||
|
||||
Reference in New Issue
Block a user