You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "LauraXia123 (via GitHub)" <gi...@apache.org> on 2026/01/20 07:17:36 UTC
[PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
LauraXia123 opened a new pull request, #9759:
URL: https://github.com/apache/gravitino/pull/9759
### What changes were proposed in this pull request?
1. web UI reconstruct by ant-design
2. Retain the old UI, which can be switched based on environment variables.
### Why are the changes needed?
Fix: #9758
### Does this PR introduce _any_ user-facing change?
N/A
### How was this patch tested?
manually
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#discussion_r2707068802
##########
web/web/src/app/catalogs/rightContent/entitiesContent/DataPreview.js:
##########
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Alert, Spin, Table } from 'antd'
+
+// import { useTablePreview } from '@/hooks'
+
+export default function DataPreview({ ...props }) {
+ const { currentMetalake, catalog, schema, table } = props.namespaces
+
+ // const { data: previewData, isInitialLoading: isLoading } = useTablePreview(
+ // {
+ // keepPreviousData: true,
+ // },
+ // { metalake: currentMetalake, catalog, schema, table } as metadataParams,
+ // currentMetalake !== '',
+ // )
+
+ const getPreviewData = (type, value) => {
+ if (typeof type === 'string') {
+ if (value === null) return 'NULL'
+ if (value === 0) return '0'
+ if (type === 'boolean' && value !== null) return value ? 'true' : 'false'
+
+ return value || '-'
+ } else {
+ const tCom = type?.type
+ switch (tCom) {
+ case 'struct':
+ return `{${Object.entries(value)
+ .map(([k, v]) => `${k}=${getPreviewData(type?.fields.find(f => f.name === k)?.type, v)}`)
+ .join(', ')}}`
+ case 'map':
+ return `{${Object.entries(value)
+ .map(([k, v]) => `${getPreviewData(type?.keyType, k)}=${getPreviewData(type?.valueType, v)}`)
+ .join(', ')}}`
+ case 'list':
+ return `[${value.map(v => getPreviewData(type?.elementType, v)).join(', ')}]`
+ default:
+ return '-'
+ }
+ }
+ }
+
+ const columns =
+ previewData?.columns?.map(col => {
+ return {
+ title: col.name,
+ dataIndex: col.name,
+ key: col.name,
+ width: 150,
+ ellipsis: true,
+ render: text => {
+ if (text === null) {
+ return 'NULL'
+ } else if (!text && col.type !== 'boolean' && Number.isNaN(text)) {
+ return '-'
+ } else if (typeof col.type === 'string') {
+ return getPreviewData(col.type, text)
+ } else if (typeof col.type === 'object') {
+ const t = col.type?.type
+ switch (t) {
+ case 'struct':
+ return `{${Object.entries(text)
+ .map(
+ ([key, value]) =>
+ `${key}=${getPreviewData(col.type?.fields.find(f => f.name === key)?.type, value)}`
+ )
+ .join(', ')}}`
+ case 'map':
+ return `{${Object.entries(text)
+ .map(
+ ([key, value]) =>
+ `${getPreviewData(col.type?.keyType, key)}=${getPreviewData(col.type?.valueType, value)}`
+ )
+ .join(', ')}}`
+ case 'list':
+ return `[${text.map(v => getPreviewData(col.type?.elementType, v)).join(', ')}]`
+ default:
+ return '-'
+ }
+ }
+ }
+ }
+ }) || []
+
+ const tableData =
+ previewData?.results?.map((col, index) => {
+ return {
+ ...col,
+ key: index
+ }
+ }) || []
+
+ return (
+ <Spin spinning={isLoading}>
+ {previewData?.statusCode === 0 && (
+ <Table
+ columns={columns}
+ dataSource={tableData}
+ style={{ maxHeight: 'calc(100vh - 28rem)' }}
+ scroll={{ y: 'calc(100vh - 34rem)' }}
+ />
+ )}
+ {previewData?.statusCode === 1 && (
+ <Alert
+ message={t('common.previewWarning', { table: `${catalog}.${schema}.${table}` })}
Review Comment:
The function `t` is not imported or defined. This appears to be a missing i18n translation function.
##########
web/web/src/app/metalakes/page.js:
##########
@@ -19,55 +19,381 @@
'use client'
-import { useCallback, useState } from 'react'
-import { Grid, Card } from '@mui/material'
-import TableHeader from './TableHeader'
-import DetailsDrawer from '@/components/DetailsDrawer'
-import CreateMetalakeDialog from './CreateMetalakeDialog'
+import { useCallback, useState, useMemo, useEffect, createContext } from 'react'
import dynamic from 'next/dynamic'
-import Loading from '@/app/rootLayout/Loading'
+import Loading from '@/components/Loading'
+import SectionContainer from '@/components/SectionContainer'
+import { useRouter } from 'next/navigation'
+import { useAppSelector, useAppDispatch } from '@/lib/hooks/useStore'
+import { Button, Dropdown, Flex, Input, Modal, Popover, Space, Spin, Table, Tooltip, Typography } from 'antd'
+import { ExclamationCircleFilled, PlusOutlined } from '@ant-design/icons'
+import { useAntdColumnResize } from 'react-antd-column-resize'
+import {
+ fetchMetalakes,
+ deleteMetalake,
+ resetTree,
+ switchMetalakeInUse,
+ resetMetalakeStore
+} from '@/lib/store/metalakes'
+import { to } from '@/lib/utils'
+import { formatToDateTime } from '@/lib/utils/date'
+import Icons from '@/components/Icons'
+import GetOwner from '@/components/GetOwner'
+import PropertiesContent from '@/components/PropertiesContent'
-const DynamicTableBody = dynamic(() => import('./TableBody'), {
- loading: () => <Loading height={'200px'} />,
+const CreateMetalakeDialog = dynamic(() => import('./CreateMetalakeDialog'), {
+ loading: () => <Loading />,
ssr: false
})
+const SetOwnerDialog = dynamic(() => import('@/components/SetOwnerDialog'), {
+ loading: () => <Loading />,
+ ssr: false
+})
+
+const ConfirmInput = dynamic(() => import('@/components/ConfirmInput'), {
+ loading: () => <Loading />,
+ ssr: false
+})
+
+const { Title, Paragraph } = Typography
+const { Search } = Input
+
const MetalakeList = () => {
- const [value, setValue] = useState('')
- const [openDrawer, setOpenDrawer] = useState(false)
- const [drawerData, setDrawerData] = useState()
- const [openDialog, setOpenDialog] = useState(false)
- const [dialogData, setDialogData] = useState({})
- const [dialogType, setDialogType] = useState('create')
+ const [open, setOpen] = useState(false)
+ const [openOwner, setOpenOwner] = useState(false)
+ const [editMetalake, setEditMetalake] = useState('')
+ const [metadataObjectFullName, setMetadataObjectFullName] = useState('')
+ const router = useRouter()
+ const [modal, contextHolder] = Modal.useModal()
+ const [search, setSearch] = useState('')
+ const [ownerRefreshKey, setOwnerRefreshKey] = useState(0)
+ const auth = useAppSelector(state => state.auth)
+ const { serviceAdmins, authUser, anthEnable } = auth
+ const dispatch = useAppDispatch()
+ const store = useAppSelector(state => state.metalakes)
+ const [tableData, setTableData] = useState([])
+
+ useEffect(() => {
+ dispatch(resetMetalakeStore())
+ dispatch(fetchMetalakes())
+ }, [dispatch])
+
+ useEffect(() => {
+ const filteredData = store.metalakes
+ .filter(i => i.name.toLowerCase().includes(search.toLowerCase()))
+ .map(i => ({ ...i, key: i.name }))
+
+ setTableData(filteredData)
+ }, [dispatch, store.metalakes, search])
+
+ const onSearchTable = e => {
+ const { value } = e.target
+ setSearch(value)
+ }
+
+ const handleCreateMetalake = () => {
+ setEditMetalake('')
+ setOpen(true)
+ }
+
+ const handleEditMetalake = metalake => {
+ setEditMetalake(metalake)
+ setOpen(true)
+ }
+
+ const handleToCatalogsPage = metalake => {
+ dispatch(resetTree())
+ router.push(`/catalogs?metalake=${metalake}&catalogType=relational`)
+ }
- const handleFilter = useCallback(val => {
- setValue(val)
- }, [])
+ const handleSetOwner = metalake => {
+ setMetadataObjectFullName(metalake)
+ setOpenOwner(true)
+ }
+
+ const handleOwnerDialogClose = (open, refresh) => {
+ setOpenOwner(open)
+ if (refresh) setOwnerRefreshKey(k => k + 1)
+ }
+
+ const propertyContent = properties => <PropertiesContent properties={properties} />
+
+ const showDeleteConfirm = (NameContext, metalake, type, isInUse = false) => {
+ let confirmInput = ''
+ let validateFn = null
+
+ const setConfirmInput = value => {
+ confirmInput = value
+ }
+
+ const registerValidate = fn => {
+ validateFn = fn
+ }
+
+ modal.confirm({
+ title: `Are you sure to delete the ${type} ${name}?`,
Review Comment:
The variable `name` is used but not defined in the function scope. This should be `metalake` based on the function signature.
```suggestion
title: `Are you sure to delete the ${type} ${metalake}?`,
```
##########
web/web/src/app/catalogs/rightContent/entitiesContent/DataPreview.js:
##########
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Alert, Spin, Table } from 'antd'
+
+// import { useTablePreview } from '@/hooks'
+
+export default function DataPreview({ ...props }) {
+ const { currentMetalake, catalog, schema, table } = props.namespaces
+
+ // const { data: previewData, isInitialLoading: isLoading } = useTablePreview(
+ // {
+ // keepPreviousData: true,
+ // },
+ // { metalake: currentMetalake, catalog, schema, table } as metadataParams,
+ // currentMetalake !== '',
+ // )
+
+ const getPreviewData = (type, value) => {
+ if (typeof type === 'string') {
+ if (value === null) return 'NULL'
+ if (value === 0) return '0'
+ if (type === 'boolean' && value !== null) return value ? 'true' : 'false'
+
+ return value || '-'
+ } else {
+ const tCom = type?.type
+ switch (tCom) {
+ case 'struct':
+ return `{${Object.entries(value)
+ .map(([k, v]) => `${k}=${getPreviewData(type?.fields.find(f => f.name === k)?.type, v)}`)
+ .join(', ')}}`
+ case 'map':
+ return `{${Object.entries(value)
+ .map(([k, v]) => `${getPreviewData(type?.keyType, k)}=${getPreviewData(type?.valueType, v)}`)
+ .join(', ')}}`
+ case 'list':
+ return `[${value.map(v => getPreviewData(type?.elementType, v)).join(', ')}]`
+ default:
+ return '-'
+ }
+ }
+ }
+
+ const columns =
+ previewData?.columns?.map(col => {
+ return {
+ title: col.name,
+ dataIndex: col.name,
+ key: col.name,
+ width: 150,
+ ellipsis: true,
+ render: text => {
+ if (text === null) {
+ return 'NULL'
+ } else if (!text && col.type !== 'boolean' && Number.isNaN(text)) {
+ return '-'
+ } else if (typeof col.type === 'string') {
+ return getPreviewData(col.type, text)
+ } else if (typeof col.type === 'object') {
+ const t = col.type?.type
+ switch (t) {
+ case 'struct':
+ return `{${Object.entries(text)
+ .map(
+ ([key, value]) =>
+ `${key}=${getPreviewData(col.type?.fields.find(f => f.name === key)?.type, value)}`
+ )
+ .join(', ')}}`
+ case 'map':
+ return `{${Object.entries(text)
+ .map(
+ ([key, value]) =>
+ `${getPreviewData(col.type?.keyType, key)}=${getPreviewData(col.type?.valueType, value)}`
+ )
+ .join(', ')}}`
+ case 'list':
+ return `[${text.map(v => getPreviewData(col.type?.elementType, v)).join(', ')}]`
+ default:
+ return '-'
+ }
+ }
+ }
+ }
+ }) || []
+
+ const tableData =
+ previewData?.results?.map((col, index) => {
+ return {
+ ...col,
+ key: index
+ }
+ }) || []
+
+ return (
+ <Spin spinning={isLoading}>
Review Comment:
The variable `isLoading` is undefined because the `useTablePreview` hook is commented out.
##########
web/web/src/app/catalogs/rightContent/entitiesContent/DataPreview.js:
##########
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Alert, Spin, Table } from 'antd'
+
+// import { useTablePreview } from '@/hooks'
+
+export default function DataPreview({ ...props }) {
+ const { currentMetalake, catalog, schema, table } = props.namespaces
+
+ // const { data: previewData, isInitialLoading: isLoading } = useTablePreview(
+ // {
+ // keepPreviousData: true,
+ // },
+ // { metalake: currentMetalake, catalog, schema, table } as metadataParams,
+ // currentMetalake !== '',
+ // )
+
+ const getPreviewData = (type, value) => {
+ if (typeof type === 'string') {
+ if (value === null) return 'NULL'
+ if (value === 0) return '0'
+ if (type === 'boolean' && value !== null) return value ? 'true' : 'false'
+
+ return value || '-'
+ } else {
+ const tCom = type?.type
+ switch (tCom) {
+ case 'struct':
+ return `{${Object.entries(value)
+ .map(([k, v]) => `${k}=${getPreviewData(type?.fields.find(f => f.name === k)?.type, v)}`)
+ .join(', ')}}`
+ case 'map':
+ return `{${Object.entries(value)
+ .map(([k, v]) => `${getPreviewData(type?.keyType, k)}=${getPreviewData(type?.valueType, v)}`)
+ .join(', ')}}`
+ case 'list':
+ return `[${value.map(v => getPreviewData(type?.elementType, v)).join(', ')}]`
+ default:
+ return '-'
+ }
+ }
+ }
+
+ const columns =
+ previewData?.columns?.map(col => {
Review Comment:
The variable `previewData` is undefined. The commented-out hook `useTablePreview` is not being used, so `previewData` will always be undefined causing runtime errors.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#discussion_r2738385963
##########
conf/gravitino.conf.template:
##########
@@ -78,6 +78,7 @@ gravitino.cache.implementation = caffeine
# Whether Gravitino enable authorization or not
gravitino.authorization.enable = false
# The admins of Gravitino service, multiple admins are spitted by comma.
+gravitino.server.visibleConfigs=gravitino.authorization.serviceAdmins
Review Comment:
If UI wanna to know some configurations, it could be put it in this configurations. It can retrive config options and display them in the ConfigServelet.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#issuecomment-3819229747
No, I don't think this is what I want. What I want is a new module compared to current web module, a new one called web-v2, this new module is totally a new module (nothing shared with existing web module), and the duplication is OK. When we deprecate the old web module, we can simply drop the folder.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "LauraXia123 (via GitHub)" <gi...@apache.org>.
LauraXia123 commented on code in PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#discussion_r2762097318
##########
bin/gravitino.sh.template:
##########
@@ -181,6 +181,31 @@ fi
addJarInDir "${GRAVITINO_HOME}/libs"
+# By default, prefer starting the legacy (old) UI war if present.
+# Users may override by setting GRAVITINO_WAR to an explicit path, or
+# set GRAVITINO_USE_WEB_V2=true to prefer the new war when both exist.
+if [[ -z "${GRAVITINO_WAR+x}" || -z "${GRAVITINO_WAR}" ]]; then
+ # Compose expected war paths based on packaged layout and version
+ WAR_V1_PATH="${GRAVITINO_HOME}/web/gravitino-web-v1.war"
Review Comment:
the latest commit have changed the v1 path name
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao merged PR #9759:
URL: https://github.com/apache/gravitino/pull/9759
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#discussion_r2762387195
##########
settings.gradle.kts:
##########
@@ -82,7 +78,7 @@ project(":spark-connector:spark-3.4").projectDir = file("spark-connector/v3.4/sp
project(":spark-connector:spark-runtime-3.4").projectDir = file("spark-connector/v3.4/spark-runtime")
project(":spark-connector:spark-3.5").projectDir = file("spark-connector/v3.5/spark")
project(":spark-connector:spark-runtime-3.5").projectDir = file("spark-connector/v3.5/spark-runtime")
-include("web:web", "web:integration-test")
+include("web:web", "web-v2:web", "web:integration-test")
Review Comment:
Shall we include "web-v2:integration-test" here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "LauraXia123 (via GitHub)" <gi...@apache.org>.
LauraXia123 commented on PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#issuecomment-3810070635
@jerryshao pls review the pr if u have time, thx.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#issuecomment-3812659403
Ideally, what I want is two different modules, like web-v1, web-v2, to separate things clearly. If we want to remove the V1 UI, we can simply remove the folder. The current implementation mixed everything together, which is hard to maintain.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "danhuawang (via GitHub)" <gi...@apache.org>.
danhuawang commented on PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#issuecomment-3804442049
I verify the fixed bugs based on this PR --passed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#discussion_r2737660399
##########
bin/gravitino.sh.template:
##########
@@ -181,6 +181,31 @@ fi
addJarInDir "${GRAVITINO_HOME}/libs"
+# By default, prefer starting the legacy (old) UI war if present.
+# Users may override by setting GRAVITINO_WAR to an explicit path, or
+# set GRAVITINO_USE_OLD_UI=false to prefer the non-old war when both exist.
+if [[ -z "${GRAVITINO_WAR+x}" || -z "${GRAVITINO_WAR}" ]]; then
+ # Compose expected war paths based on packaged layout and version
+ OLD_WAR_PATH="${GRAVITINO_HOME}/web/gravitino-web-1.1.0-old.war"
+ NEW_WAR_PATH="${GRAVITINO_HOME}/web/gravitino-web-${GRAVITINO_VERSION}.war"
Review Comment:
Ideally, we should not use old/new to differentiate the packages; we should have a version information to distinguish. I would suggest to use v1 as old UI, v2 as a new UI. Can you change all the varaibles, package name, folder names.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#discussion_r2737649368
##########
conf/gravitino.conf.template:
##########
@@ -78,6 +78,7 @@ gravitino.cache.implementation = caffeine
# Whether Gravitino enable authorization or not
gravitino.authorization.enable = false
# The admins of Gravitino service, multiple admins are spitted by comma.
+gravitino.server.visibleConfigs=gravitino.authorization.serviceAdmins
Review Comment:
@jerqi what is the usage of this configuration?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "LauraXia123 (via GitHub)" <gi...@apache.org>.
LauraXia123 commented on PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#issuecomment-3821567001
1. Actually, the current solution consists of two independent modules, which share some package management files and style configuration management while supporting both UIs. However, the final output is two separate and independent WAR packages.
2. There is also another solution: splitting them into two independent projects. If we plan to maintain multiple versions of the UI in the long term, it is recommended to switch to two independent projects.
If you need to proceed with this change, please let me know as soon as possible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "LauraXia123 (via GitHub)" <gi...@apache.org>.
LauraXia123 closed pull request #9759: [#9758] feat(UI): New UI reconstruct base main
URL: https://github.com/apache/gravitino/pull/9759
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "LauraXia123 (via GitHub)" <gi...@apache.org>.
LauraXia123 commented on code in PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#discussion_r2707097005
##########
web/web/src/app/catalogs/rightContent/entitiesContent/DataPreview.js:
##########
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Alert, Spin, Table } from 'antd'
+
+// import { useTablePreview } from '@/hooks'
+
+export default function DataPreview({ ...props }) {
+ const { currentMetalake, catalog, schema, table } = props.namespaces
+
+ // const { data: previewData, isInitialLoading: isLoading } = useTablePreview(
+ // {
+ // keepPreviousData: true,
+ // },
+ // { metalake: currentMetalake, catalog, schema, table } as metadataParams,
+ // currentMetalake !== '',
+ // )
+
+ const getPreviewData = (type, value) => {
+ if (typeof type === 'string') {
+ if (value === null) return 'NULL'
+ if (value === 0) return '0'
+ if (type === 'boolean' && value !== null) return value ? 'true' : 'false'
+
+ return value || '-'
+ } else {
+ const tCom = type?.type
+ switch (tCom) {
+ case 'struct':
+ return `{${Object.entries(value)
+ .map(([k, v]) => `${k}=${getPreviewData(type?.fields.find(f => f.name === k)?.type, v)}`)
+ .join(', ')}}`
+ case 'map':
+ return `{${Object.entries(value)
+ .map(([k, v]) => `${getPreviewData(type?.keyType, k)}=${getPreviewData(type?.valueType, v)}`)
+ .join(', ')}}`
+ case 'list':
+ return `[${value.map(v => getPreviewData(type?.elementType, v)).join(', ')}]`
+ default:
+ return '-'
+ }
+ }
+ }
+
+ const columns =
+ previewData?.columns?.map(col => {
+ return {
+ title: col.name,
+ dataIndex: col.name,
+ key: col.name,
+ width: 150,
+ ellipsis: true,
+ render: text => {
+ if (text === null) {
+ return 'NULL'
+ } else if (!text && col.type !== 'boolean' && Number.isNaN(text)) {
+ return '-'
+ } else if (typeof col.type === 'string') {
+ return getPreviewData(col.type, text)
+ } else if (typeof col.type === 'object') {
+ const t = col.type?.type
+ switch (t) {
+ case 'struct':
+ return `{${Object.entries(text)
+ .map(
+ ([key, value]) =>
+ `${key}=${getPreviewData(col.type?.fields.find(f => f.name === key)?.type, value)}`
+ )
+ .join(', ')}}`
+ case 'map':
+ return `{${Object.entries(text)
+ .map(
+ ([key, value]) =>
+ `${getPreviewData(col.type?.keyType, key)}=${getPreviewData(col.type?.valueType, value)}`
+ )
+ .join(', ')}}`
+ case 'list':
+ return `[${text.map(v => getPreviewData(col.type?.elementType, v)).join(', ')}]`
+ default:
+ return '-'
+ }
+ }
+ }
+ }
+ }) || []
+
+ const tableData =
+ previewData?.results?.map((col, index) => {
+ return {
+ ...col,
+ key: index
+ }
+ }) || []
+
+ return (
+ <Spin spinning={isLoading}>
+ {previewData?.statusCode === 0 && (
+ <Table
+ columns={columns}
+ dataSource={tableData}
+ style={{ maxHeight: 'calc(100vh - 28rem)' }}
+ scroll={{ y: 'calc(100vh - 34rem)' }}
+ />
+ )}
+ {previewData?.statusCode === 1 && (
+ <Alert
+ message={t('common.previewWarning', { table: `${catalog}.${schema}.${table}` })}
Review Comment:
need remove DataPreview component
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "LauraXia123 (via GitHub)" <gi...@apache.org>.
LauraXia123 commented on PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#issuecomment-3815372312
1. rename all the varaibles, package name from 'old ui' to 'web-v1'
2. update all readme, script content about web v1
3. rename folder `appOld` to `appV1`, `componentsOld` to `componentsV1`, If we want to remove the V1 UI, remove the two folders almost is ok.
4. The app folder is the default entry point for Next.js projects, so it was not renamed to V2. The corresponding components are UI components for V2, while the rest, such as the model layer, libs, and configs, are shared components. After deleting V1, the redundant code generated will not exceed 10%.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#discussion_r2758250597
##########
bin/gravitino.sh.template:
##########
@@ -181,6 +181,31 @@ fi
addJarInDir "${GRAVITINO_HOME}/libs"
+# By default, prefer starting the legacy (old) UI war if present.
+# Users may override by setting GRAVITINO_WAR to an explicit path, or
+# set GRAVITINO_USE_WEB_V2=true to prefer the new war when both exist.
+if [[ -z "${GRAVITINO_WAR+x}" || -z "${GRAVITINO_WAR}" ]]; then
+ # Compose expected war paths based on packaged layout and version
+ WAR_V1_PATH="${GRAVITINO_HOME}/web/gravitino-web-v1.war"
Review Comment:
Why the v1 war package doesn't have the "version" in its path?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "jerqi (via GitHub)" <gi...@apache.org>.
jerqi commented on code in PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#discussion_r2738385963
##########
conf/gravitino.conf.template:
##########
@@ -78,6 +78,7 @@ gravitino.cache.implementation = caffeine
# Whether Gravitino enable authorization or not
gravitino.authorization.enable = false
# The admins of Gravitino service, multiple admins are spitted by comma.
+gravitino.server.visibleConfigs=gravitino.authorization.serviceAdmins
Review Comment:
If UI wanna to know some configurations, it could be put it in this configurations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "LauraXia123 (via GitHub)" <gi...@apache.org>.
LauraXia123 commented on code in PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#discussion_r2739585016
##########
conf/gravitino.conf.template:
##########
@@ -78,6 +78,7 @@ gravitino.cache.implementation = caffeine
# Whether Gravitino enable authorization or not
gravitino.authorization.enable = false
# The admins of Gravitino service, multiple admins are spitted by comma.
+gravitino.server.visibleConfigs=gravitino.authorization.serviceAdmins
Review Comment:
Only serviceAdmins have privilege for 'Create Metalake', I get the info to show or hide the btn
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "LauraXia123 (via GitHub)" <gi...@apache.org>.
LauraXia123 commented on PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#issuecomment-3839247453
1. I have rescheduled web & web-v2 project
2. I have test web UI & web-v2 UI after rebuild
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#9758] feat(UI): New UI reconstruct base main [gravitino]
Posted by "LauraXia123 (via GitHub)" <gi...@apache.org>.
LauraXia123 commented on code in PR #9759:
URL: https://github.com/apache/gravitino/pull/9759#discussion_r2707113698
##########
web/web/src/app/catalogs/rightContent/entitiesContent/DataPreview.js:
##########
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Alert, Spin, Table } from 'antd'
+
+// import { useTablePreview } from '@/hooks'
+
+export default function DataPreview({ ...props }) {
+ const { currentMetalake, catalog, schema, table } = props.namespaces
+
+ // const { data: previewData, isInitialLoading: isLoading } = useTablePreview(
+ // {
+ // keepPreviousData: true,
+ // },
+ // { metalake: currentMetalake, catalog, schema, table } as metadataParams,
+ // currentMetalake !== '',
+ // )
+
+ const getPreviewData = (type, value) => {
+ if (typeof type === 'string') {
+ if (value === null) return 'NULL'
+ if (value === 0) return '0'
+ if (type === 'boolean' && value !== null) return value ? 'true' : 'false'
+
+ return value || '-'
+ } else {
+ const tCom = type?.type
+ switch (tCom) {
+ case 'struct':
+ return `{${Object.entries(value)
+ .map(([k, v]) => `${k}=${getPreviewData(type?.fields.find(f => f.name === k)?.type, v)}`)
+ .join(', ')}}`
+ case 'map':
+ return `{${Object.entries(value)
+ .map(([k, v]) => `${getPreviewData(type?.keyType, k)}=${getPreviewData(type?.valueType, v)}`)
+ .join(', ')}}`
+ case 'list':
+ return `[${value.map(v => getPreviewData(type?.elementType, v)).join(', ')}]`
+ default:
+ return '-'
+ }
+ }
+ }
+
+ const columns =
+ previewData?.columns?.map(col => {
+ return {
+ title: col.name,
+ dataIndex: col.name,
+ key: col.name,
+ width: 150,
+ ellipsis: true,
+ render: text => {
+ if (text === null) {
+ return 'NULL'
+ } else if (!text && col.type !== 'boolean' && Number.isNaN(text)) {
+ return '-'
+ } else if (typeof col.type === 'string') {
+ return getPreviewData(col.type, text)
+ } else if (typeof col.type === 'object') {
+ const t = col.type?.type
+ switch (t) {
+ case 'struct':
+ return `{${Object.entries(text)
+ .map(
+ ([key, value]) =>
+ `${key}=${getPreviewData(col.type?.fields.find(f => f.name === key)?.type, value)}`
+ )
+ .join(', ')}}`
+ case 'map':
+ return `{${Object.entries(text)
+ .map(
+ ([key, value]) =>
+ `${getPreviewData(col.type?.keyType, key)}=${getPreviewData(col.type?.valueType, value)}`
+ )
+ .join(', ')}}`
+ case 'list':
+ return `[${text.map(v => getPreviewData(col.type?.elementType, v)).join(', ')}]`
+ default:
+ return '-'
+ }
+ }
+ }
+ }
+ }) || []
+
+ const tableData =
+ previewData?.results?.map((col, index) => {
+ return {
+ ...col,
+ key: index
+ }
+ }) || []
+
+ return (
+ <Spin spinning={isLoading}>
Review Comment:
need remove DataPreview component
##########
web/web/src/app/catalogs/rightContent/entitiesContent/DataPreview.js:
##########
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Alert, Spin, Table } from 'antd'
+
+// import { useTablePreview } from '@/hooks'
+
+export default function DataPreview({ ...props }) {
+ const { currentMetalake, catalog, schema, table } = props.namespaces
+
+ // const { data: previewData, isInitialLoading: isLoading } = useTablePreview(
+ // {
+ // keepPreviousData: true,
+ // },
+ // { metalake: currentMetalake, catalog, schema, table } as metadataParams,
+ // currentMetalake !== '',
+ // )
+
+ const getPreviewData = (type, value) => {
+ if (typeof type === 'string') {
+ if (value === null) return 'NULL'
+ if (value === 0) return '0'
+ if (type === 'boolean' && value !== null) return value ? 'true' : 'false'
+
+ return value || '-'
+ } else {
+ const tCom = type?.type
+ switch (tCom) {
+ case 'struct':
+ return `{${Object.entries(value)
+ .map(([k, v]) => `${k}=${getPreviewData(type?.fields.find(f => f.name === k)?.type, v)}`)
+ .join(', ')}}`
+ case 'map':
+ return `{${Object.entries(value)
+ .map(([k, v]) => `${getPreviewData(type?.keyType, k)}=${getPreviewData(type?.valueType, v)}`)
+ .join(', ')}}`
+ case 'list':
+ return `[${value.map(v => getPreviewData(type?.elementType, v)).join(', ')}]`
+ default:
+ return '-'
+ }
+ }
+ }
+
+ const columns =
+ previewData?.columns?.map(col => {
Review Comment:
need remove DataPreview component
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org