diff --git a/.gitignore b/.gitignore index 83f000cf..941bcae7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /node_modules/* -dist \ No newline at end of file +dist +server \ No newline at end of file diff --git a/packages/main/.env b/packages/main/.env index 816f33fa..9e943cda 100644 --- a/packages/main/.env +++ b/packages/main/.env @@ -1,2 +1,3 @@ VITE_API_URL= -VITE_APP_VERSION= \ No newline at end of file +VITE_APP_VERSION= +VITE_APP_BASE_URL=/ \ No newline at end of file diff --git a/packages/main/package.json b/packages/main/package.json index 17696636..5f7beef4 100644 --- a/packages/main/package.json +++ b/packages/main/package.json @@ -1,7 +1,7 @@ { "name": "@ui/main", "private": true, - "version": "0.28.2", + "version": "0.28.8", "type": "module", "scripts": { "dev": "VITE_APP_VERSION=$npm_package_version vite", diff --git a/packages/main/plugins/settingsmenu/MainMenu.tsx b/packages/main/plugins/settingsmenu/MainMenu.tsx index a7a872d7..fb9d9216 100644 --- a/packages/main/plugins/settingsmenu/MainMenu.tsx +++ b/packages/main/plugins/settingsmenu/MainMenu.tsx @@ -115,7 +115,7 @@ export default function MainMenu() { - + Search diff --git a/packages/main/src/components/LabelBrowser/components/QueryBar/QueryBar.tsx b/packages/main/src/components/LabelBrowser/components/QueryBar/QueryBar.tsx index 184c21ae..6650fcfa 100644 --- a/packages/main/src/components/LabelBrowser/components/QueryBar/QueryBar.tsx +++ b/packages/main/src/components/LabelBrowser/components/QueryBar/QueryBar.tsx @@ -384,8 +384,12 @@ const QueryBar: React.FC = (props) => { let customStep = 0; + const dateStart = new Date(start); + const dateStop = new Date(stop); + if (query.includes(`$__interval`)) { - const timeDiff = (stop.getTime() - start.getTime()) / 1000; + const timeDiff = + (dateStop?.getTime() - dateStart?.getTime()) / 1000; const timeProportion = timeDiff / 30; @@ -661,7 +665,8 @@ const QueryBar: React.FC = (props) => { if (queryExpr.includes("$__interval")) { isMatrix = true; - const timeDiff = (data.stop.getTime() - data.start.getTime()) / 1000; + const timeDiff = + (data.stop.getTime() - data.start.getTime()) / 1000; const timeProportion = timeDiff / 30; const screenProportion = Number( (width / window.innerWidth).toFixed(1) diff --git a/packages/main/src/main.tsx b/packages/main/src/main.tsx index 91349e0d..cfbbbe6a 100644 --- a/packages/main/src/main.tsx +++ b/packages/main/src/main.tsx @@ -35,7 +35,7 @@ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( - + }> }> diff --git a/packages/main/src/providers/ProtectedRoute.tsx b/packages/main/src/providers/ProtectedRoute.tsx index cf51fab9..6a70680f 100644 --- a/packages/main/src/providers/ProtectedRoute.tsx +++ b/packages/main/src/providers/ProtectedRoute.tsx @@ -24,7 +24,7 @@ export default function ProtectedRoute({ children }: { children: any }) { }, []); if (cookieMemo.cookie || (userType !== 'admin' && userType !== 'superAdmin')) { - return ; + return ; } return children; } diff --git a/packages/main/views/DataSources/DataSource.tsx b/packages/main/views/DataSources/DataSource.tsx index 0a25dee6..a52c16ad 100644 --- a/packages/main/views/DataSources/DataSource.tsx +++ b/packages/main/views/DataSources/DataSource.tsx @@ -112,7 +112,7 @@ export function DataSourceSetting(props: any) { setCookie( "qryn-settings", setCookieFromParams(url, user.value, password.value), - { path: "/" } + { path: "" } ); } catch (e) { console.log(e); diff --git a/packages/main/views/DataSources/components/Header.tsx b/packages/main/views/DataSources/components/Header.tsx index 036ead7b..de0ff105 100644 --- a/packages/main/views/DataSources/components/Header.tsx +++ b/packages/main/views/DataSources/components/Header.tsx @@ -12,7 +12,6 @@ export interface HeaderProps { } export function Header(props: HeaderProps) { - console.log(props) const navigate = useNavigate(); const theme = useTheme(); const urlLocation = useSelector((store: any) => store.urlLocation); @@ -35,7 +34,7 @@ export function Header(props: HeaderProps) { ) { navigate(-1); } else { - navigate("/"); + navigate(""); } }; diff --git a/packages/main/views/Main/Breadcrumbs.tsx b/packages/main/views/Main/Breadcrumbs.tsx index 58a0cfcb..b13433f1 100644 --- a/packages/main/views/Main/Breadcrumbs.tsx +++ b/packages/main/views/Main/Breadcrumbs.tsx @@ -9,7 +9,7 @@ const Breadcrumbs = () => { if (el === "" && id === 0) { return { name: "home", - link: "/", + link: "", }; } return { diff --git a/packages/main/vite.config.ts b/packages/main/vite.config.ts index b4bd47f4..cbe20de1 100644 --- a/packages/main/vite.config.ts +++ b/packages/main/vite.config.ts @@ -19,11 +19,12 @@ const customTransformers = [ ignorePlugin.contextRegExp.test(id) ); }, - transform: () => 'export {}', + transform: () => "export {}", }, ]; let configOpts = { + base: "", server: {}, plugins: [ basicSsl(), @@ -38,12 +39,13 @@ let configOpts = { globals: true, environment: "happy-dom", }, - optimizeDeps:{ - exclude: ['moment'], // Exclude 'moment' from automatic dependency optimization - include: ['**/*.+(js|ts)'], // Include JavaScript and TypeScript files for manual dependency optimization - customTransformers + optimizeDeps: { + exclude: ["moment"], // Exclude 'moment' from automatic dependency optimization + include: ["**/*.+(js|ts)"], // Include JavaScript and TypeScript files for manual dependency optimization + customTransformers, }, build: { + base: "", sourcemap: false, rollupOptions: { output: { @@ -69,7 +71,6 @@ let configOpts = { "prismjs", "javascript-time-ago", "json-markup", - ], reactDnd: ["react-dnd", "react-dnd-html5-backend"], memoize: [