Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#2443] refactor(web): Restructure web and configure production mode for the static export (#2519)

Qian Xiae09770961111
diff --git a/build.gradle.kts b/build.gradle.kts
index d0781ab893..b560f7f406 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -504,9 +504,9 @@ tasks.rat {
"web/next-env.d.ts",
"web/dist/**/*",
"web/node_modules/**/*",
- "web/lib/utils/axios/**/*",
- "web/lib/enums/httpEnum.ts",
- "web/types/axios.d.ts",
+ "web/src/lib/utils/axios/**/*",
+ "web/src/lib/enums/httpEnum.ts",
+ "web/src/types/axios.d.ts",
"web/yarn.lock",
"web/package-lock.json",
"web/pnpm-lock.yaml",
diff --git a/server/src/main/java/com/datastrato/gravitino/server/web/ui/WebUIFilter.java b/server/src/main/java/com/datastrato/gravitino/server/web/ui/WebUIFilter.java
index 3dae5bdf51..d9a2800333 100644
--- a/server/src/main/java/com/datastrato/gravitino/server/web/ui/WebUIFilter.java
+++ b/server/src/main/java/com/datastrato/gravitino/server/web/ui/WebUIFilter.java
@@ -22,7 +22,7 @@ public class WebUIFilter implements Filter {
HttpServletRequest httpRequest = (HttpServletRequest) request;
String path = httpRequest.getRequestURI();
String lastPathSegment = path.substring(path.lastIndexOf("/") + 1);
- if (path.equals("/")) {
+ if (path.equals("/") || path.equals("/ui") || path.equals("/ui/")) {
// Redirect to the index page.
httpRequest.getRequestDispatcher("/ui/index.html").forward(request, response);
} else if (path.startsWith("/ui/") && !lastPathSegment.contains(".")) {
diff --git a/web/.env b/web/.env
index 053c43ed24..3dc5bc434a 100644
--- a/web/.env
+++ b/web/.env
@@ -5,6 +5,7 @@
OUTPUT_MODE=standalone
# Development ENV
+NEXT_PUBLIC_BASE_PATH=''
NEXT_PUBLIC_API_URL=http://localhost:8090
NEXT_PUBLIC_OAUTH_URI=http://localhost:9000
NEXT_PUBLIC_OAUTH_PATH=/oauth2/token
diff --git a/web/.env.static b/web/.env.static
index a8652c4d60..8731900fa1 100644
--- a/web/.env.static
+++ b/web/.env.static
@@ -4,7 +4,10 @@
#
OUTPUT_MODE=export
+DIST_DIR=dist/ui
+BASE_PATH=/ui
# Development ENV
+NEXT_PUBLIC_BASE_PATH=/ui
NEXT_PUBLIC_API_URL=http://localhost:8090
NEXT_PUBLIC_OAUTH_URI=http://localhost:9000
NEXT_PUBLIC_OAUTH_PATH=/oauth2/token
diff --git a/web/app/ui/MetalakesView.js b/web/app/ui/MetalakesView.js
deleted file mode 100644
index 26092e2ca9..0000000000
--- a/web/app/ui/MetalakesView.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2023 Datastrato Pvt Ltd.
- * This software is licensed under the Apache License version 2.
- */
-
-'use client'
-
-import { Grid, Typography } from '@mui/material'
-
-import MetalakeList from './MetalakeList'
-
-const MetalakesView = () => {
- return (
- <Grid container spacing={6}>
- <Grid item xs={12}>
- <Typography className={'twc-mb-4 twc-text-[1.375rem] twc-font-bold'}>Metalakes</Typography>
- <Typography sx={{ color: 'text.secondary' }}>
- A metalake is the top-level container for data in Gravitino. Within a metalake, Gravitino provides a 3-level
- namespace for organizing data: catalog, schemas/databases, and tables/views.
- </Typography>
- </Grid>
- <Grid item xs={12}>
- <MetalakeList />
- </Grid>
- </Grid>
- )
-}
-
-export default MetalakesView
diff --git a/web/app/ui/index/page.js b/web/app/ui/index/page.js
deleted file mode 100644
index 737fdd203a..0000000000
--- a/web/app/ui/index/page.js
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * Copyright 2024 Datastrato Pvt Ltd.
- * This software is licensed under the Apache License version 2.
- */
-
-'use client'
-
-import MetalakesView from '../MetalakesView'
-
-const UIIndexPage = () => {
- return <MetalakesView />
-}
-
-export default UIIndexPage
diff --git a/web/app/ui/metalakes/LeftContent.js b/web/app/ui/metalakes/LeftContent.js
deleted file mode 100644
index 574ec7f22f..0000000000
--- a/web/app/ui/metalakes/LeftContent.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2023 Datastrato Pvt Ltd.
- * This software is licensed under the Apache License version 2.
- */
-
-'use client'
-
-import { Box } from '@mui/material'
-
-import MetalakeTree from './MetalakeTree'
-import { useEffect, useRef, useState } from 'react'
-
-const SidebarLeft = props => {
- const treeWrapper = useRef(null)
-
- const [height, setHeight] = useState(0)
-
- useEffect(() => {
- if (treeWrapper.current) {
- const { offsetHeight } = treeWrapper.current
- setHeight(offsetHeight - 20)
- }
- }, [treeWrapper])
-
- return (
- <Box className={`twc-bg-customs-white`} sx={{ borderRight: theme => `1px solid ${theme.palette.divider}` }}>
- <Box className={`twc-w-[340px] twc-h-full round-tl-md round-bl-md twc-overflow-hidden`}>
- <Box className={'twc-px-5 twc-py-3 twc-flex twc-items-center'}></Box>
-
- <Box
- className={`twc-overflow-y-hidden`}
- sx={{ p: theme => theme.spacing(2.5, 2.5, 2.5), height: `calc(100% - 1.5rem)` }}
- ref={treeWrapper}
- >
- <MetalakeTree height={height} />
- </Box>
- </Box>
- </Box>
- )
-}
-
-export default SidebarLeft
diff --git a/web/app/ui/metalakes/MetalakeView.js b/web/app/ui/metalakes/MetalakeView.js
deleted file mode 100644
index cd7348bcfa..0000000000
--- a/web/app/ui/metalakes/MetalakeView.js
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2023 Datastrato Pvt Ltd.
- * This software is licensed under the Apache License version 2.
- */
-
-'use client'
-
-import { useEffect } from 'react'
-
-import { Box } from '@mui/material'
-
-import { useAppDispatch } from '@/lib/hooks/useStore'
-
-import LeftContent from './LeftContent'
-import RightContent from './RightContent'
-
-import {
- fetchCatalogs,
- fetchSchemas,
- fetchTables,
- getMetalakeDetails,
- getCatalogDetails,
- getSchemaDetails,
- getTableDetails,
- setSelectedNodes
-} from '@/lib/store/metalakes'
-
-const MetalakeView = props => {
- const { page, tableTitle, routeParams } = props
-
- const dispatch = useAppDispatch()
-
- useEffect(() => {
- if (JSON.stringify(routeParams) !== '{}') {
- const { metalake, catalog, schema, table } = routeParams
-
- switch (page) {
- case 'metalakes':
- dispatch(fetchCatalogs({ init: true, page, metalake }))
- dispatch(getMetalakeDetails({ metalake }))
- break
-
- case 'catalogs':
- if (catalog !== null) {
- dispatch(fetchSchemas({ init: true, page, metalake, catalog }))
- dispatch(getCatalogDetails({ metalake, catalog }))
- }
- break
-
- case 'schemas':
- if (catalog !== null && schema !== null) {
- dispatch(fetchTables({ init: true, page, metalake, catalog, schema }))
- dispatch(getSchemaDetails({ metalake, catalog, schema }))
- }
- break
-
- case 'tables':
- if (catalog !== null && schema !== null && table !== null) {
- dispatch(getTableDetails({ init: true, metalake, catalog, schema, table }))
- }
- break
-
- default:
- break
- }
- }
-
- dispatch(
- setSelectedNodes(
- routeParams.catalog
- ? [
- `{{${routeParams.metalake}}}{{${routeParams.catalog}}}${
- routeParams.schema ? `{{${routeParams.schema}}}` : ''
- }${routeParams.table ? `{{${routeParams.table}}}` : ''}`
- ]
- : []
- )
- )
-
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [routeParams])
-
- return (
- <Box className='app-metalake twc-w-full twc-h-full twc-flex twc-rounded-lg twc-overflow-auto twc-relative shadow-md'>
- <LeftContent routeParams={routeParams} />
- <RightContent tableTitle={tableTitle} routeParams={routeParams} page={page} />
- </Box>
- )
-}
-
-export default MetalakeView
diff --git a/web/app/ui/metalakes/page.js b/web/app/ui/metalakes/page.js
deleted file mode 100644
index ac73de451b..0000000000
--- a/web/app/ui/metalakes/page.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2023 Datastrato Pvt Ltd.
- * This software is licensed under the Apache License version 2.
- */
-
-'use client'
-
-import { useEffect, useState } from 'react'
-
-import { useSearchParams } from 'next/navigation'
-
-import MetalakeView from '@/app/ui/metalakes/MetalakeView'
-
-const MetalakePage = () => {
- const searchParams = useSearchParams()
-
- const [routeParams, setRouteParams] = useState({})
-
- const parameterSize = [...searchParams.keys()].length
-
- const getProps = () => {
- if (parameterSize === 1 && searchParams.get('metalake')) {
- return {
- page: 'metalakes',
- title: 'Catalogs'
- }
- } else if (parameterSize === 2 && searchParams.has('catalog')) {
- return {
- page: 'catalogs',
- title: 'Schemas'
- }
- } else if (parameterSize === 3 && searchParams.has('schema')) {
- return {
- page: 'schemas',
- title: 'Tables'
- }
- } else if (parameterSize === 4 && searchParams.has('table')) {
- return {
- page: 'tables',
- title: 'Columns'
- }
- } else {
- return {
- page: null,
- title: null
- }
- }
- }
-
- useEffect(() => {
- const takeParams = {
- metalake: searchParams.get('metalake'),
- catalog: searchParams.get('catalog'),
- schema: searchParams.get('schema'),
- table: searchParams.get('table')
- }
-
- setRouteParams(takeParams)
- }, [searchParams])
-
- return <MetalakeView page={getProps().page} tableTitle={getProps().title} routeParams={routeParams} />
-}
-
-export default MetalakePage
diff --git a/web/app/ui/metalakes/template.js b/web/app/ui/metalakes/template.js
deleted file mode 100644
index 43b1d50f63..0000000000
--- a/web/app/ui/metalakes/template.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * Copyright 2023 Datastrato Pvt Ltd.
- * This software is licensed under the Apache License version 2.
- */
-
-import { Box } from '@mui/material'
-
-const Template = ({ children }) => {
- return (
- <Box className={'metalake-template'} style={{ height: 'calc(100vh - 11rem)' }}>
- {children}
- </Box>
- )
-}
-
-export default Template
diff --git a/web/app/ui/page.js b/web/app/ui/page.js
deleted file mode 100644
index c73d0c396c..0000000000
--- a/web/app/ui/page.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright 2023 Datastrato Pvt Ltd.
- * This software is licensed under the Apache License version 2.
- */
-
-'use client'
-
-import MetalakesView from './MetalakesView'
-
-const HomePage = props => {
- return (
- <>
- <MetalakesView />
- </>
- )
-}
-
-export default HomePage
diff --git a/web/next.config.js b/web/next.config.js
index 519d747511..8b9dc0ca0f 100644
--- a/web/next.config.js
+++ b/web/next.config.js
@@ -22,10 +22,6 @@ const nextConfig = {
async rewrites() {
return {
fallback: [
- {
- source: '/',
- destination: `/ui`
- },
{
source: '/api/:path*',
destination: `${apiUrl}/api/:path*`
@@ -43,9 +39,10 @@ const nextConfig = {
}
}),
output: process.env.OUTPUT_MODE || 'standalone',
- distDir: 'dist',
+ basePath: process.env.BASE_PATH,
+ distDir: process.env.DIST_DIR,
trailingSlash: false,
- reactStrictMode: false
+ reactStrictMode: true
}
module.exports = withBundleAnalyzer(nextConfig)
diff --git a/web/package.json b/web/package.json
index 923e891bd5..67a833a874 100644
--- a/web/package.json
+++ b/web/package.json
@@ -9,7 +9,7 @@
"analyze": "env-cmd -f .env.analyze pnpm build",
"dev": "next dev --turbo",
"build": "pnpm format && next build",
- "dist": "env-cmd -f .env.static pnpm build",
+ "dist": "env-cmd -f .env.static next build",
"start": "next start",
"lint": "next lint",
"format": "prettier --write .",
diff --git a/web/app/layout.js b/web/src/app/layout.js
similarity index 75%
rename from web/app/layout.js
rename to web/src/app/layout.js
index 47b1526e80..7451d77d09 100644
--- a/web/app/layout.js
+++ b/web/src/app/layout.js
@@ -7,26 +7,23 @@ import '@/lib/styles/globals.css'
import { Suspense } from 'react'
-import { NavigationEvents } from '@/lib/layout/navigation-events'
+import { NavigationEvents } from './rootLayout/navigation-events'
import Provider from '@/lib/provider'
-import Layout from '@/lib/layout/Layout'
-
-import Loading from '@/lib/layout/Loading'
+import Loading from './rootLayout/Loading'
+import Layout from './rootLayout/Layout'
import StyledToast from '../components/StyledToast'
export const metadata = {
title: 'Gravitino',
description: 'A high-performance, geo-distributed and federated metadata lake.',
icons: {
- icon: '/icons/gravitino.svg'
+ icon: '/ui/icons/gravitino.svg'
}
}
-const RootLayout = props => {
- const { children } = props
-
+const RootLayout = ({ children }) => {
return (
<html lang='en' suppressHydrationWarning>
<body>
diff --git a/web/app/ui/login/page.js b/web/src/app/login/page.js
similarity index 100%
rename from web/app/ui/login/page.js
rename to web/src/app/login/page.js
diff --git a/web/app/ui/CreateMetalakeDialog.js b/web/src/app/metalakes/CreateMetalakeDialog.js
similarity index 100%
rename from web/app/ui/CreateMetalakeDialog.js
rename to web/src/app/metalakes/CreateMetalakeDialog.js
diff --git a/web/app/ui/TableHeader.js b/web/src/app/metalakes/TableHeader.js
similarity index 100%
rename from web/app/ui/TableHeader.js
rename to web/src/app/metalakes/TableHeader.js
diff --git a/web/src/app/metalakes/layout.js b/web/src/app/metalakes/layout.js
new file mode 100644
index 0000000000..1e5009e07f
--- /dev/null
+++ b/web/src/app/metalakes/layout.js
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2023 Datastrato Pvt Ltd.
+ * This software is licensed under the Apache License version 2.
+ */
+
+'use client'
+
+import { Grid, Typography } from '@mui/material'
+import { useSearchParams } from 'next/navigation'
+import { useEffect, useState } from 'react'
+import Metalake from './metalake/MetalakeView.js'
+
+const MetalakesView = ({ children }) => {
+ const searchParams = useSearchParams()
+
+ const [, setRouteParams] = useState({})
+
+ const metalakeName = searchParams.get('metalake')
+ const catalogName = searchParams.get('catalog')
+ const schemaName = searchParams.get('schema')
+ const tableName = searchParams.get('table')
+
+ useEffect(() => {
+ const takeParams = {
+ metalake: metalakeName,
+ catalog: catalogName,
+ schema: schemaName,
+ table: tableName
+ }
+ setRouteParams(takeParams)
+ }, [metalakeName, catalogName, schemaName, tableName])
+
+ return (
+ <>
+ {metalakeName ? (
+ <Metalake />
+ ) : (
+ <Grid container spacing={6}>
+ <Grid item xs={12}>
+ <Typography className={'twc-mb-4 twc-text-[1.375rem] twc-font-bold'}>Metalakes</Typography>
+ <Typography sx={{ color: 'text.secondary' }}>
+ A metalake is the top-level container for data in Gravitino. Within a metalake, Gravitino provides a
+ 3-level namespace for organizing data: catalog, schemas/databases, and tables/views.
+ </Typography>
+ </Grid>
+ <Grid item xs={12}>
+ {children}
+ </Grid>
+ </Grid>
+ )}
+ </>
+ )
+}
+
+export default MetalakesView
diff --git a/web/src/app/metalakes/metalake/MetalakePageLeftBar.js b/web/src/app/metalakes/metalake/MetalakePageLeftBar.js
new file mode 100644
index 0000000000..aa6975ced2
--- /dev/null
+++ b/web/src/app/metalakes/metalake/MetalakePageLeftBar.js
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2023 Datastrato Pvt Ltd.
+ * This software is licensed under the Apache License version 2.
+ */
+
+'use client'
+
+import { useEffect, useRef, useState } from 'react'
+import MetalakeTree from './MetalakeTree'
+import { Box } from '@mui/material'
+
+const MetalakePageLeftBar = () => {
+ const treeWrapper = useRef(null)
+
+ const [height, setHeight] = useState(0)
+
+ useEffect(() => {
+ if (treeWrapper.current) {
+ const { offsetHeight } = treeWrapper.current
+ setHeight(offsetHeight - 20)
+ }
+ }, [treeWrapper])
+
+ return (
+ <Box
+ className={`twc-overflow-y-hidden`}
+ sx={{ p: theme => theme.spacing(2.5, 2.5, 2.5), height: `calc(100% - 1.5rem)` }}
+ ref={treeWrapper}
+ >
+ <MetalakeTree height={height} />
+ </Box>
+ )
+}
+
+export default MetalakePageLeftBar
diff --git a/web/app/ui/metalakes/MetalakeTree.js b/web/src/app/metalakes/metalake/MetalakeTree.js
similarity index 99%
rename from web/app/ui/metalakes/MetalakeTree.js
rename to web/src/app/metalakes/metalake/MetalakeTree.js
index 1bace3f96c..bb8a4adf06 100644
--- a/web/app/ui/metalakes/MetalakeTree.js
+++ b/web/src/app/metalakes/metalake/MetalakeTree.js
@@ -3,9 +3,10 @@
* This software is licensed under the Apache License version 2.
*/
+'use client'
+
import { useEffect, useRef, useState } from 'react'
-import Link from 'next/link'
import { useRouter } from 'next/navigation'
import { IconButton, Typography } from '@mui/material'
diff --git a/web/src/app/metalakes/metalake/MetalakeView.js b/web/src/app/metalakes/metalake/MetalakeView.js
new file mode 100644
index 0000000000..d1da972a46
--- /dev/null
+++ b/web/src/app/metalakes/metalake/MetalakeView.js
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2023 Datastrato Pvt Ltd.
+ * This software is licensed under the Apache License version 2.
+ */
+
+'use client'
+
+import { useEffect } from 'react'
+
+import { Box } from '@mui/material'
+
+import { useAppDispatch } from '@/lib/hooks/useStore'
+import { useSearchParams } from 'next/navigation'
+import MetalakePageLeftBar from './MetalakePageLeftBar'
+import RightContent from './rightContent/RightContent'
+
+import {
+ fetchCatalogs,
+ fetchSchemas,
+ fetchTables,
+ getMetalakeDetails,
+ getCatalogDetails,
+ getSchemaDetails,
+ getTableDetails,
+ setSelectedNodes
+} from '@/lib/store/metalakes'
+
+const MetalakeView = () => {
+ const dispatch = useAppDispatch()
+ const searchParams = useSearchParams()
+
+ const routeParams = {
+ metalake: searchParams.get('metalake'),
+ catalog: searchParams.get('catalog'),
+ schema: searchParams.get('schema'),
+ table: searchParams.get('table')
+ }
+
+ useEffect(() => {
+ if ([...searchParams.keys()].length) {
+ const { metalake, catalog, schema, table } = routeParams
+
+ if (metalake) {
+ dispatch(fetchCatalogs({ init: true, page: 'metalakes', metalake }))
+ dispatch(getMetalakeDetails({ metalake }))
+ }
+
+ if (catalog) {
+ dispatch(fetchSchemas({ init: true, page: 'catalogs', metalake, catalog }))
+ dispatch(getCatalogDetails({ metalake, catalog }))
+ }
+
+ if (catalog && schema) {
+ dispatch(fetchTables({ init: true, page: 'schemas', metalake, catalog, schema }))
+ dispatch(getSchemaDetails({ metalake, catalog, schema }))
+ }
+
+ if (catalog && schema && table) {
+ dispatch(getTableDetails({ init: true, metalake, catalog, schema, table }))
+ }
+ }
+
+ dispatch(
+ setSelectedNodes(
+ routeParams.catalog
+ ? [
+ `{{${routeParams.metalake}}}{{${routeParams.catalog}}}${
+ routeParams.schema ? `{{${routeParams.schema}}}` : ''
+ }${routeParams.table ? `{{${routeParams.table}}}` : ''}`
+ ]
+ : []
+ )
+ )
+
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [JSON.stringify(routeParams)])
+
+ return (
+ <Box className={'metalake-template'} style={{ height: 'calc(100vh - 11rem)' }}>
+ <Box className='app-metalake twc-w-full twc-h-full twc-flex twc-rounded-lg twc-overflow-auto twc-relative shadow-md'>
+ <Box className={`twc-bg-customs-white`} sx={{ borderRight: theme => `1px solid ${theme.palette.divider}` }}>
+ <Box className={`twc-w-[340px] twc-h-full round-tl-md round-bl-md twc-overflow-hidden`}>
+ <Box className={'twc-px-5 twc-py-3 twc-flex twc-items-center'}></Box>
+ <MetalakePageLeftBar />
+ </Box>
+ </Box>
+ <RightContent />
+ </Box>
+ </Box>
+ )
+}
+
+export default MetalakeView
diff --git a/web/app/ui/metalakes/CreateCatalogDialog.js b/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js
similarity index 98%
rename from web/app/ui/metalakes/CreateCatalogDialog.js
rename to web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js
index 02a001d6c6..ecf2a43726 100644
--- a/web/app/ui/metalakes/CreateCatalogDialog.js
+++ b/web/src/app/metalakes/metalake/rightContent/CreateCatalogDialog.js
@@ -38,6 +38,7 @@ import { groupBy } from 'lodash-es'
import { genUpdates } from '@/lib/utils'
import { providers } from '@/lib/utils/initial'
import { nameRegex, keyRegex } from '@/lib/utils/regex'
+import { useSearchParams } from 'next/navigation'
const defaultValues = {
name: '',
@@ -76,8 +77,9 @@ const Transition = forwardRef(function Transition(props, ref) {
})
const CreateCatalogDialog = props => {
- const { open, setOpen, type = 'create', data = {}, routeParams } = props
- const { metalake } = routeParams
+ const { open, setOpen, type = 'create', data = {} } = props
+ const searchParams = useSearchParams()
+ const metalake = searchParams.get('metalake')
const dispatch = useAppDispatch()
diff --git a/web/app/ui/metalakes/MetalakePath.js b/web/src/app/metalakes/metalake/rightContent/MetalakePath.js
similarity index 91%
rename from web/app/ui/metalakes/MetalakePath.js
rename to web/src/app/metalakes/metalake/rightContent/MetalakePath.js
index d01129734d..23e1c95632 100644
--- a/web/app/ui/metalakes/MetalakePath.js
+++ b/web/src/app/metalakes/metalake/rightContent/MetalakePath.js
@@ -6,7 +6,7 @@
'use client'
import Link from 'next/link'
-import { useRouter, useSearchParams } from 'next/navigation'
+import { useSearchParams } from 'next/navigation'
import { Link as MUILink, Breadcrumbs, Typography, Tooltip, styled } from '@mui/material'
@@ -19,12 +19,16 @@ const Text = styled(Typography)(({ theme }) => ({
}))
const MetalakePath = props => {
- const { routeParams } = props
+ const searchParams = useSearchParams()
- const { metalake, catalog, schema, table } = routeParams
+ const routeParams = {
+ metalake: searchParams.get('metalake'),
+ catalog: searchParams.get('catalog'),
+ schema: searchParams.get('schema'),
+ table: searchParams.get('table')
+ }
- const router = useRouter()
- const searchParams = useSearchParams()
+ const { metalake, catalog, schema, table } = routeParams
const metalakeUrl = `?metalake=${metalake}`
const catalogUrl = `?metalake=${metalake}&catalog=${catalog}`
diff --git a/web/app/ui/metalakes/RightContent.js b/web/src/app/metalakes/metalake/rightContent/RightContent.js
similarity index 70%
rename from web/app/ui/metalakes/RightContent.js
rename to web/src/app/metalakes/metalake/rightContent/RightContent.js
index 8d9919b0dd..e26c192bd7 100644
--- a/web/app/ui/metalakes/RightContent.js
+++ b/web/src/app/metalakes/metalake/rightContent/RightContent.js
@@ -5,31 +5,30 @@
'use client'
-import { useState } from 'react'
-
+import { useEffect, useState } from 'react'
import Link from 'next/link'
-
import { Box, Button, IconButton } from '@mui/material'
-
import Icon from '@/components/Icon'
-
-import { useAppSelector } from '@/lib/hooks/useStore'
-
-import TabsContent from './TabsContent'
import MetalakePath from './MetalakePath'
import CreateCatalogDialog from './CreateCatalogDialog'
+import TabsContent from './tabsContent/TabsContent'
+import { useSearchParams } from 'next/navigation'
-const RightContent = props => {
- const { tableTitle, routeParams, page } = props
-
- const store = useAppSelector(state => state.metalakes)
-
+const RightContent = () => {
const [open, setOpen] = useState(false)
+ const searchParams = useSearchParams()
+ const [isShowBtn, setBtnVisiable] = useState(true)
const handleCreateCatalog = () => {
setOpen(true)
}
+ useEffect(() => {
+ const paramsSize = [...searchParams.keys()].length
+ const isMetalakePage = paramsSize == 1 && searchParams.get('metalake')
+ setBtnVisiable(isMetalakePage)
+ }, [searchParams])
+
return (
<Box className={`twc-w-0 twc-grow twc-h-full twc-bg-customs-white twc-overflow-hidden`}>
<Box
@@ -41,15 +40,15 @@ const RightContent = props => {
<Box className={`twc-flex twc-items-center`}>
<Box className={`twc-flex twc-items-center twc-justify-between`}>
<Box className={`twc-flex twc-items-center`}>
- <IconButton color='primary' component={Link} href='/' sx={{ mr: 2 }} data-refer='back-home-btn'>
+ <IconButton color='primary' component={Link} href='/metalakes' sx={{ mr: 2 }} data-refer='back-home-btn'>
<Icon icon='mdi:arrow-left' />
</IconButton>
- <MetalakePath routeParams={routeParams} />
+ <MetalakePath />
</Box>
</Box>
</Box>
- {page === 'metalakes' && (
+ {isShowBtn && (
<Box className={`twc-flex twc-items-center`}>
<Button
variant='contained'
@@ -59,13 +58,13 @@ const RightContent = props => {
>
Create Catalog
</Button>
- <CreateCatalogDialog open={open} setOpen={setOpen} routeParams={routeParams} />
+ <CreateCatalogDialog open={open} setOpen={setOpen} />
</Box>
)}
</Box>
<Box sx={{ height: 'calc(100% - 4.1rem)' }}>
- <TabsContent tableTitle={tableTitle} store={store} page={page} routeParams={routeParams} />
+ <TabsContent />
</Box>
</Box>
)
diff --git a/web/app/ui/metalakes/TabsContent.js b/web/src/app/metalakes/metalake/rightContent/tabsContent/TabsContent.js
similarity index 74%
rename from web/app/ui/metalakes/TabsContent.js
rename to web/src/app/metalakes/metalake/rightContent/tabsContent/TabsContent.js
index 69e3034b5e..72bf6b567b 100644
--- a/web/app/ui/metalakes/TabsContent.js
+++ b/web/src/app/metalakes/metalake/rightContent/tabsContent/TabsContent.js
@@ -3,6 +3,8 @@
* This software is licensed under the Apache License version 2.
*/
+'use client'
+
import { useState } from 'react'
import Box from '@mui/material/Box'
@@ -11,12 +13,12 @@ import TabContext from '@mui/lab/TabContext'
import TabList from '@mui/lab/TabList'
import TabPanel from '@mui/lab/TabPanel'
import Typography from '@mui/material/Typography'
+import { useSearchParams } from 'next/navigation'
+import TableView from './tableView/TableView'
+import DetailsView from './detailsView/DetailsView'
import Icon from '@/components/Icon'
-import TableView from './TableView'
-import DetailsView from './DetailsView'
-
const CustomTab = props => {
const { icon, label, value, ...others } = props
@@ -46,14 +48,34 @@ const CustomTabPanel = props => {
)
}
-const TabsContent = props => {
- const { tableTitle, store, page, routeParams } = props
+const TabsContent = () => {
const [tab, setTab] = useState('table')
const handleChangeTab = (event, newValue) => {
setTab(newValue)
}
+ let tableTitle = ''
+ const searchParams = useSearchParams()
+ const paramsSize = [...searchParams.keys()].length
+
+ switch (paramsSize) {
+ case 1:
+ tableTitle = 'Catalogs'
+ break
+ case 2:
+ tableTitle = 'Schemas'
+ break
+ case 3:
+ tableTitle = 'Tables'
+ break
+ case 4:
+ tableTitle = 'Columns'
+ break
+ default:
+ break
+ }
+
return (
<TabContext value={tab}>
<Box sx={{ px: 6, py: 2, borderBottom: 1, borderColor: 'divider' }}>
@@ -63,10 +85,10 @@ const TabsContent = props => {
</TabList>
</Box>
<CustomTabPanel value='table'>
- <TableView page={page} routeParams={routeParams} />
+ <TableView />
</CustomTabPanel>
<CustomTabPanel value='details'>
- <DetailsView store={store} page={page} />
+ <DetailsView />
</CustomTabPanel>
</TabContext>
)
diff --git a/web/app/ui/metalakes/DetailsView.js b/web/src/app/metalakes/metalake/rightContent/tabsContent/detailsView/DetailsView.js
similarity index 91%
rename from web/app/ui/metalakes/DetailsView.js
rename to web/src/app/metalakes/metalake/rightContent/tabsContent/detailsView/DetailsView.js
index 47ee9e1ca5..82aa6da023 100644
--- a/web/app/ui/metalakes/DetailsView.js
+++ b/web/src/app/metalakes/metalake/rightContent/tabsContent/detailsView/DetailsView.js
@@ -3,14 +3,21 @@
* This software is licensed under the Apache License version 2.
*/
+'use client'
+
import { Box, Grid, Typography, Table, TableHead, TableBody, TableRow, TableCell, TableContainer } from '@mui/material'
import EmptyText from '@/components/EmptyText'
import { formatToDateTime, isValidDate } from '@/lib/utils/date'
+import { useAppSelector } from '@/lib/hooks/useStore'
+import { useSearchParams } from 'next/navigation'
+
+const DetailsView = () => {
+ const searchParams = useSearchParams()
+ const paramsSize = [...searchParams.keys()].length
-const DetailsView = props => {
- const { store, data = {}, page } = props
+ const store = useAppSelector(state => state.metalakes)
const activatedItem = store.activatedDetails
@@ -38,7 +45,7 @@ const DetailsView = props => {
return (
<Box sx={{ p: 4, height: '100%', overflow: 'auto' }}>
<Grid container spacing={6}>
- {page && page === 'catalogs' ? (
+ {paramsSize == 2 && searchParams.hasOwnProperty('catalog') ? (
<>
<Grid item xs={12} md={6} sx={{ mb: [0, 5] }}>
<Typography variant='body2' sx={{ mb: 2 }}>
diff --git a/web/app/ui/metalakes/TableView.js b/web/src/app/metalakes/metalake/rightContent/tabsContent/tableView/TableView.js
similarity index 94%
rename from web/app/ui/metalakes/TableView.js
rename to web/src/app/metalakes/metalake/rightContent/tabsContent/tableView/TableView.js
index 35040f546c..54b84c5396 100644
--- a/web/app/ui/metalakes/TableView.js
+++ b/web/src/app/metalakes/metalake/rightContent/tabsContent/tableView/TableView.js
@@ -3,6 +3,8 @@
* This software is licensed under the Apache License version 2.
*/
+'use client'
+
import { useState, useEffect } from 'react'
import Link from 'next/link'
@@ -15,18 +17,17 @@ import {
DeleteOutlined as DeleteIcon
} from '@mui/icons-material'
-import Icon from '@/components/Icon'
-
import ColumnTypeChip from '@/components/ColumnTypeChip'
import DetailsDrawer from '@/components/DetailsDrawer'
import ConfirmDeleteDialog from '@/components/ConfirmDeleteDialog'
-import CreateCatalogDialog from './CreateCatalogDialog'
+import CreateCatalogDialog from '../../CreateCatalogDialog'
import { useAppSelector, useAppDispatch } from '@/lib/hooks/useStore'
import { updateCatalog, deleteCatalog } from '@/lib/store/metalakes'
import { to } from '@/lib/utils'
import { getCatalogDetailsApi } from '@/lib/api/catalogs'
+import { useSearchParams } from 'next/navigation'
const EmptyText = () => {
return (
@@ -36,9 +37,10 @@ const EmptyText = () => {
)
}
-const TableView = props => {
- const { page, routeParams } = props
- const { metalake, catalog } = routeParams
+const TableView = () => {
+ const searchParams = useSearchParams()
+ const paramsSize = [...searchParams.keys()].length
+ const metalake = searchParams['metalake'] || ''
const defaultPaginationConfig = { pageSize: 10, page: 0 }
const pageSizeOptions = [10, 25, 50]
@@ -361,9 +363,9 @@ const TableView = props => {
}
const checkColumns = () => {
- if (page === 'metalakes') {
+ if (paramsSize == 1 && searchParams.has('metalake')) {
return catalogsColumns
- } else if (page === 'tables') {
+ } else if (paramsSize == 4 && searchParams.has('table')) {
return tableColumns
} else {
return columns
@@ -394,7 +396,12 @@ const TableView = props => {
paginationModel={paginationModel}
onPaginationModelChange={setPaginationModel}
/>
- <DetailsDrawer openDrawer={openDrawer} setOpenDrawer={setOpenDrawer} drawerData={drawerData} page={page} />
+ <DetailsDrawer
+ openDrawer={openDrawer}
+ setOpenDrawer={setOpenDrawer}
+ drawerData={drawerData}
+ isMetalakePage={paramsSize == 1 && searchParams.hasOwnProperty('metalake')}
+ />
<ConfirmDeleteDialog
open={openConfirmDelete}
setOpen={setOpenConfirmDelete}
@@ -409,7 +416,6 @@ const TableView = props => {
updateCatalog={updateCatalog}
data={dialogData}
type={dialogType}
- routeParams={routeParams}
/>
</Box>
)
diff --git a/web/app/ui/MetalakeList.js b/web/src/app/metalakes/page.js
similarity index 98%
rename from web/app/ui/MetalakeList.js
rename to web/src/app/metalakes/page.js
index 5fa7c083d4..46c32105b8 100644
--- a/web/app/ui/MetalakeList.js
+++ b/web/src/app/metalakes/page.js
@@ -3,6 +3,8 @@
* This software is licensed under the Apache License version 2.
*/
+'use client'
+
import { useEffect, useCallback, useState, Fragment } from 'react'
import Link from 'next/link'
@@ -15,8 +17,6 @@ import {
DeleteOutlined as DeleteIcon
} from '@mui/icons-material'
-import Icon from '@/components/Icon'
-
import { useAppDispatch, useAppSelector } from '@/lib/hooks/useStore'
import { fetchMetalakes, setFilteredMetalakes, deleteMetalake, updateMetalake, resetTree } from '@/lib/store/metalakes'
@@ -126,7 +126,7 @@ const MetalakeList = () => {
<Typography
noWrap
component={Link}
- href={`/ui/metalakes?metalake=${name}`}
+ href={`/metalakes?metalake=${name}`}
onClick={() => handleClickLink()}
sx={{
fontWeight: 500,
diff --git a/web/src/app/page.js b/web/src/app/page.js
new file mode 100644
index 0000000000..d59f8b4251
--- /dev/null
+++ b/web/src/app/page.js
@@ -0,0 +1,10 @@
+/*
+ * Copyright 2023 Datastrato Pvt Ltd.
+ * This software is licensed under the Apache License version 2.
+ */
+
+'use client'
+
+export default function Home() {
+ return <></>
+}
diff --git a/web/lib/layout/AppBar.js b/web/src/app/rootLayout/AppBar.js
similarity index 88%
rename from web/lib/layout/AppBar.js
rename to web/src/app/rootLayout/AppBar.js
index 86e2f28c3c..bfa39e515d 100644
--- a/web/lib/layout/AppBar.js
+++ b/web/src/app/rootLayout/AppBar.js
@@ -13,7 +13,7 @@ import { Box, AppBar as MuiAppBar, Toolbar, Stack, Typography } from '@mui/mater
import VersionView from './VersionView'
import LogoutButton from './Logout'
-const AppBar = props => {
+const AppBar = () => {
return (
<MuiAppBar
elevation={6}
@@ -26,7 +26,12 @@ const AppBar = props => {
<Toolbar className={'navbar-content-container twc-mx-auto [@media(min-width:1440px)]:twc-max-w-[1440px]'}>
<Box className={'app-bar-content twc-w-full twc-flex twc-items-center twc-justify-between'}>
<Link href='/' className={'twc-flex twc-items-center twc-no-underline twc-mr-8'}>
- <Image src={'/icons/gravitino.svg'} width={32} height={32} alt='logo' />
+ <Image
+ src={process.env.NEXT_PUBLIC_BASE_PATH + '/icons/gravitino.svg'}
+ width={32}
+ height={32}
+ alt='logo'
+ />
<Typography
variant='h5'
className={
diff --git a/web/lib/layout/Footer.js b/web/src/app/rootLayout/Footer.js
similarity index 100%
rename from web/lib/layout/Footer.js
rename to web/src/app/rootLayout/Footer.js
diff --git a/web/lib/layout/Layout.js b/web/src/app/rootLayout/Layout.js
similarity index 100%
rename from web/lib/layout/Layout.js
rename to web/src/app/rootLayout/Layout.js
diff --git a/web/lib/layout/Loading.js b/web/src/app/rootLayout/Loading.js
similarity index 100%
rename from web/lib/layout/Loading.js
rename to web/src/app/rootLayout/Loading.js
diff --git a/web/lib/layout/Logout.js b/web/src/app/rootLayout/Logout.js
similarity index 85%
rename from web/lib/layout/Logout.js
rename to web/src/app/rootLayout/Logout.js
index 3f63e4d510..ad9c5b7863 100644
--- a/web/lib/layout/Logout.js
+++ b/web/src/app/rootLayout/Logout.js
@@ -10,8 +10,8 @@ import { useRouter } from 'next/navigation'
import { Box, IconButton } from '@mui/material'
import Icon from '@/components/Icon'
-import { useAppDispatch, useAppSelector } from '../hooks/useStore'
-import { logoutAction } from '../store/auth'
+import { useAppDispatch, useAppSelector } from '@/lib/hooks/useStore'
+import { logoutAction } from '@/lib/store/auth'
const LogoutButton = () => {
const router = useRouter()
diff --git a/web/lib/layout/MainContent.js b/web/src/app/rootLayout/MainContent.js
similarity index 100%
rename from web/lib/layout/MainContent.js
rename to web/src/app/rootLayout/MainContent.js
diff --git a/web/lib/layout/ScrollToTop.js b/web/src/app/rootLayout/ScrollToTop.js
similarity index 100%
rename from web/lib/layout/ScrollToTop.js
rename to web/src/app/rootLayout/ScrollToTop.js
diff --git a/web/lib/layout/VersionView.js b/web/src/app/rootLayout/VersionView.js
similarity index 100%
rename from web/lib/layout/VersionView.js
rename to web/src/app/rootLayout/VersionView.js
diff --git a/web/lib/layout/navigation-events.js b/web/src/app/rootLayout/navigation-events.js
similarity index 100%
rename from web/lib/layout/navigation-events.js
rename to web/src/app/rootLayout/navigation-events.js
diff --git a/web/app/template.js b/web/src/app/template.js
similarity index 100%
rename from web/app/template.js
rename to web/src/app/template.js
diff --git a/web/components/ColumnTypeChip.js b/web/src/components/ColumnTypeChip.js
similarity index 100%
rename from web/components/ColumnTypeChip.js
rename to web/src/components/ColumnTypeChip.js
diff --git a/web/components/ConfirmDeleteDialog.js b/web/src/components/ConfirmDeleteDialog.js
similarity index 100%
rename from web/components/ConfirmDeleteDialog.js
rename to web/src/components/ConfirmDeleteDialog.js
diff --git a/web/components/DetailsDrawer.js b/web/src/components/DetailsDrawer.js
similarity index 98%
rename from web/components/DetailsDrawer.js
rename to web/src/components/DetailsDrawer.js
index d267497af9..cb53c5cc80 100644
--- a/web/components/DetailsDrawer.js
+++ b/web/src/components/DetailsDrawer.js
@@ -27,7 +27,7 @@ import EmptyText from '@/components/EmptyText'
import { formatToDateTime, isValidDate } from '@/lib/utils/date'
const DetailsDrawer = props => {
- const { openDrawer, setOpenDrawer, drawerData = {}, page } = props
+ const { openDrawer, setOpenDrawer, drawerData = {}, isMetalakePage } = props
const { audit = {} } = drawerData
@@ -114,7 +114,7 @@ const DetailsDrawer = props => {
</Tooltip>
</Grid>
- {page && page === 'metalakes' ? (
+ {isMetalakePage ? (
<>
<Grid item xs={12} md={6} sx={{ mb: [0, 5] }}>
<Typography variant='body2' sx={{ mb: 2 }}>
diff --git a/web/components/EmptyText.js b/web/src/components/EmptyText.js
similarity index 100%
rename from web/components/EmptyText.js
rename to web/src/components/EmptyText.js
diff --git a/web/components/Icon.js b/web/src/components/Icon.js
similarity index 100%
rename from web/components/Icon.js
rename to web/src/components/Icon.js
diff --git a/web/components/StyledToast.js b/web/src/components/StyledToast.js
similarity index 100%
rename from web/components/StyledToast.js
rename to web/src/components/StyledToast.js
diff --git a/web/lib/api/auth/index.js b/web/src/lib/api/auth/index.js
similarity index 100%
rename from web/lib/api/auth/index.js
rename to web/src/lib/api/auth/index.js
diff --git a/web/lib/api/catalogs/index.js b/web/src/lib/api/catalogs/index.js
similarity index 100%
rename from web/lib/api/catalogs/index.js
rename to web/src/lib/api/catalogs/index.js
diff --git a/web/lib/api/metalakes/index.js b/web/src/lib/api/metalakes/index.js
similarity index 100%
rename from web/lib/api/metalakes/index.js
rename to web/src/lib/api/metalakes/index.js
diff --git a/web/lib/api/schemas/index.js b/web/src/lib/api/schemas/index.js
similarity index 100%
rename from web/lib/api/schemas/index.js
rename to web/src/lib/api/schemas/index.js
diff --git a/web/lib/api/tables/index.js b/web/src/lib/api/tables/index.js
similarity index 100%
rename from web/lib/api/tables/index.js
rename to web/src/lib/api/tables/index.js
diff --git a/web/lib/api/version/index.js b/web/src/lib/api/version/index.js
similarity index 100%
rename from web/lib/api/version/index.js
rename to web/src/lib/api/version/index.js
diff --git a/web/lib/enums/columnTypeEnum.ts b/web/src/lib/enums/columnTypeEnum.ts
similarity index 100%
rename from web/lib/enums/columnTypeEnum.ts
rename to web/src/lib/enums/columnTypeEnum.ts
diff --git a/web/lib/enums/httpEnum.ts b/web/src/lib/enums/httpEnum.ts
similarity index 100%
rename from web/lib/enums/httpEnum.ts
rename to web/src/lib/enums/httpEnum.ts
diff --git a/web/lib/hooks/useHasMounted.js b/web/src/lib/hooks/useHasMounted.js
similarity index 100%
rename from web/lib/hooks/useHasMounted.js
rename to web/src/lib/hooks/useHasMounted.js
diff --git a/web/lib/hooks/useStore.js b/web/src/lib/hooks/useStore.js
similarity index 100%
rename from web/lib/hooks/useStore.js
rename to web/src/lib/hooks/useStore.js
diff --git a/web/lib/provider/client.js b/web/src/lib/provider/client.js
similarity index 100%
rename from web/lib/provider/client.js
rename to web/src/lib/provider/client.js
diff --git a/web/lib/provider/emotion.js b/web/src/lib/provider/emotion.js
similarity index 100%
rename from web/lib/provider/emotion.js
rename to web/src/lib/provider/emotion.js
diff --git a/web/lib/provider/index.js b/web/src/lib/provider/index.js
similarity index 100%
rename from web/lib/provider/index.js
rename to web/src/lib/provider/index.js
diff --git a/web/lib/provider/session.js b/web/src/lib/provider/session.js
similarity index 94%
rename from web/lib/provider/session.js
rename to web/src/lib/provider/session.js
index a00986ade2..eb33aebe15 100644
--- a/web/lib/provider/session.js
+++ b/web/src/lib/provider/session.js
@@ -41,12 +41,14 @@ const AuthProvider = ({ children }) => {
if (authType === 'simple') {
dispatch(initialVersion())
+ router.push('/metalakes')
} else if (authType === 'oauth') {
if (token) {
dispatch(setAuthToken(token))
dispatch(initialVersion())
+ router.push('/metalakes')
} else {
- router.push('/ui/login')
+ router.push('/login')
}
}
}
diff --git a/web/lib/provider/store.js b/web/src/lib/provider/store.js
similarity index 100%
rename from web/lib/provider/store.js
rename to web/src/lib/provider/store.js
diff --git a/web/lib/provider/theme.js b/web/src/lib/provider/theme.js
similarity index 100%
rename from web/lib/provider/theme.js
rename to web/src/lib/provider/theme.js
diff --git a/web/lib/settings/index.js b/web/src/lib/settings/index.js
similarity index 100%
rename from web/lib/settings/index.js
rename to web/src/lib/settings/index.js
diff --git a/web/lib/store/auth/index.js b/web/src/lib/store/auth/index.js
similarity index 98%
rename from web/lib/store/auth/index.js
rename to web/src/lib/store/auth/index.js
index d6f5f7acd2..9500491a8f 100644
--- a/web/lib/store/auth/index.js
+++ b/web/src/lib/store/auth/index.js
@@ -70,7 +70,7 @@ export const loginAction = createAsyncThunk('auth/loginAction', async ({ params,
await dispatch(initialVersion())
- router.push('/')
+ router.push('/metalakes')
return { token: access_token, expired: expires_in }
})
@@ -79,7 +79,7 @@ export const logoutAction = createAsyncThunk('auth/logoutAction', async ({ route
localStorage.removeItem('accessToken')
localStorage.removeItem('authParams')
dispatch(setAuthToken(''))
- await router.push('/ui/login')
+ await router.push('/login')
return { token: null }
})
diff --git a/web/lib/store/index.js b/web/src/lib/store/index.js
similarity index 100%
rename from web/lib/store/index.js
rename to web/src/lib/store/index.js
diff --git a/web/lib/store/metalakes/index.js b/web/src/lib/store/metalakes/index.js
similarity index 100%
rename from web/lib/store/metalakes/index.js
rename to web/src/lib/store/metalakes/index.js
diff --git a/web/lib/store/sys/index.js b/web/src/lib/store/sys/index.js
similarity index 100%
rename from web/lib/store/sys/index.js
rename to web/src/lib/store/sys/index.js
diff --git a/web/lib/styles/globals.css b/web/src/lib/styles/globals.css
similarity index 100%
rename from web/lib/styles/globals.css
rename to web/src/lib/styles/globals.css
diff --git a/web/lib/theme/colors.js b/web/src/lib/theme/colors.js
similarity index 100%
rename from web/lib/theme/colors.js
rename to web/src/lib/theme/colors.js
diff --git a/web/lib/theme/mui.js b/web/src/lib/theme/mui.js
similarity index 100%
rename from web/lib/theme/mui.js
rename to web/src/lib/theme/mui.js
diff --git a/web/lib/theme/screens.js b/web/src/lib/theme/screens.js
similarity index 100%
rename from web/lib/theme/screens.js
rename to web/src/lib/theme/screens.js
diff --git a/web/lib/theme/tailwind.js b/web/src/lib/theme/tailwind.js
similarity index 100%
rename from web/lib/theme/tailwind.js
rename to web/src/lib/theme/tailwind.js
diff --git a/web/lib/utils/axios/Axios.ts b/web/src/lib/utils/axios/Axios.ts
similarity index 100%
rename from web/lib/utils/axios/Axios.ts
rename to web/src/lib/utils/axios/Axios.ts
diff --git a/web/lib/utils/axios/axiosCancel.ts b/web/src/lib/utils/axios/axiosCancel.ts
similarity index 100%
rename from web/lib/utils/axios/axiosCancel.ts
rename to web/src/lib/utils/axios/axiosCancel.ts
diff --git a/web/lib/utils/axios/axiosRetry.ts b/web/src/lib/utils/axios/axiosRetry.ts
similarity index 100%
rename from web/lib/utils/axios/axiosRetry.ts
rename to web/src/lib/utils/axios/axiosRetry.ts
diff --git a/web/lib/utils/axios/axiosTransform.ts b/web/src/lib/utils/axios/axiosTransform.ts
similarity index 100%
rename from web/lib/utils/axios/axiosTransform.ts
rename to web/src/lib/utils/axios/axiosTransform.ts
diff --git a/web/lib/utils/axios/checkStatus.ts b/web/src/lib/utils/axios/checkStatus.ts
similarity index 98%
rename from web/lib/utils/axios/checkStatus.ts
rename to web/src/lib/utils/axios/checkStatus.ts
index 084987392d..7dd7a0e2f1 100644
--- a/web/lib/utils/axios/checkStatus.ts
+++ b/web/src/lib/utils/axios/checkStatus.ts
@@ -44,7 +44,7 @@ export function checkStatus(status: number, msg: string, errorMessageMode: Error
localStorage.removeItem('accessToken')
localStorage.removeItem('authParams')
- window.location.href = '/ui/login'
+ window.location.href = '/'
break
case 403:
diff --git a/web/lib/utils/axios/helper.ts b/web/src/lib/utils/axios/helper.ts
similarity index 100%
rename from web/lib/utils/axios/helper.ts
rename to web/src/lib/utils/axios/helper.ts
diff --git a/web/lib/utils/axios/index.ts b/web/src/lib/utils/axios/index.ts
similarity index 100%
rename from web/lib/utils/axios/index.ts
rename to web/src/lib/utils/axios/index.ts
diff --git a/web/lib/utils/color.js b/web/src/lib/utils/color.js
similarity index 100%
rename from web/lib/utils/color.js
rename to web/src/lib/utils/color.js
diff --git a/web/lib/utils/date.js b/web/src/lib/utils/date.js
similarity index 100%
rename from web/lib/utils/date.js
rename to web/src/lib/utils/date.js
diff --git a/web/lib/utils/index.js b/web/src/lib/utils/index.js
similarity index 100%
rename from web/lib/utils/index.js
rename to web/src/lib/utils/index.js
diff --git a/web/lib/utils/initial.js b/web/src/lib/utils/initial.js
similarity index 100%
rename from web/lib/utils/initial.js
rename to web/src/lib/utils/initial.js
diff --git a/web/lib/utils/is.ts b/web/src/lib/utils/is.ts
similarity index 100%
rename from web/lib/utils/is.ts
rename to web/src/lib/utils/is.ts
diff --git a/web/lib/utils/regex.js b/web/src/lib/utils/regex.js
similarity index 100%
rename from web/lib/utils/regex.js
rename to web/src/lib/utils/regex.js
diff --git a/web/types/axios.d.ts b/web/src/types/axios.d.ts
similarity index 100%
rename from web/types/axios.d.ts
rename to web/src/types/axios.d.ts
diff --git a/web/types/global.d.ts b/web/src/types/global.d.ts
similarity index 100%
rename from web/types/global.d.ts
rename to web/src/types/global.d.ts
diff --git a/web/tailwind.config.js b/web/tailwind.config.js
index 996e5b4a08..fa347e2d24 100644
--- a/web/tailwind.config.js
+++ b/web/tailwind.config.js
@@ -3,7 +3,7 @@
* This software is licensed under the Apache License version 2.
*/
-import tailwindTheme from './lib/theme/tailwind'
+import tailwindTheme from './src/lib/theme/tailwind'
/** @type {import('tailwindcss').Config} */
const tailwindConfig = {
diff --git a/web/tsconfig.json b/web/tsconfig.json
index d6df38c1dc..50b0ae57af 100644
--- a/web/tsconfig.json
+++ b/web/tsconfig.json
@@ -2,7 +2,7 @@
"compilerOptions": {
"paths": {
"@/*": [
- "./*"
+ "./src/*"
]
},
"lib": [
@@ -29,7 +29,7 @@
},
"include": [
"next-env.d.ts",
- "dist/types/**/*.ts",
+ "dist/ui/types/**/*.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"