Now supports running under a sub path

Just set the SPOOLMAN_BASE_PATH environment variable and it should work.

Resolves #95
This commit is contained in:
Donkie
2024-05-10 11:36:33 +02:00
parent fc532ff697
commit bc32f1e890
18 changed files with 158 additions and 43 deletions

View File

@@ -26,6 +26,8 @@ import loadable from "@loadable/component";
import SpoolmanNotificationProvider from "./components/notificationProvider";
import { SpoolmanLayout } from "./components/layout";
import liveProvider from "./components/liveProvider";
import { getAPIURL, getBasePath } from "./utils/url";
import { Favicon } from "./components/favicon";
interface ResourcePageProps {
resource: "spools" | "filaments" | "vendors";
@@ -84,7 +86,7 @@ function App() {
}
return (
<BrowserRouter>
<BrowserRouter basename={getBasePath() + "/"}>
<RefineKbarProvider>
<ColorModeContextProvider>
<ConfigProvider
@@ -96,11 +98,11 @@ function App() {
}}
>
<Refine
dataProvider={dataProvider(import.meta.env.VITE_APIURL)}
dataProvider={dataProvider(getAPIURL())}
notificationProvider={SpoolmanNotificationProvider}
i18nProvider={i18nProvider}
routerProvider={routerBindings}
liveProvider={liveProvider(import.meta.env.VITE_APIURL)}
liveProvider={liveProvider(getAPIURL())}
resources={[
{
name: "home",
@@ -227,6 +229,7 @@ function App() {
<UnsavedChangesNotifier />
<DocumentTitleHandler />
<ReactQueryDevtools />
<Favicon url={getBasePath() + "/favicon.svg"} />
</Refine>
</ConfigProvider>
</ColorModeContextProvider>