World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
Java ai-catalogdata-catalogdatalakefederated-querylakehousemetadatametalakemodel-catalogopendatacatalogskycomputingstratosphere
[#9996] web(UI): Add global tips to use web v2 (#9997)
Qian Xiadc8ea87c7502
diff --git a/web/web/src/app/rootLayout/Layout.js b/web/web/src/app/rootLayout/Layout.jsindex a3a73155c2..c7dce2e5c4 100644--- a/web/web/src/app/rootLayout/Layout.js+++ b/web/web/src/app/rootLayout/Layout.js@@ -19,7 +19,9 @@'use client'-import { Box, Fab } from '@mui/material'+import { useEffect, useState } from 'react'+import { Box, Fab, IconButton, Paper, Stack, Typography } from '@mui/material'+import CloseIcon from '@mui/icons-material/Close'import Icon from '@/components/Icon'@@ -34,10 +36,68 @@ const DynamicMainContent = dynamic(() => import('./MainContent'), {ssr: false})+const WEB_V2_NOTICE_DISMISSED_KEY = 'gravitino:webV2NoticeDismissed'+const Layout = ({ children, scrollToTop }) => {+ const [showNotice, setShowNotice] = useState(true)++ useEffect(() => {+ try {+ const dismissed = sessionStorage.getItem(WEB_V2_NOTICE_DISMISSED_KEY)+ if (dismissed === 'true') {+ setShowNotice(false)+ }+ } catch (error) {+ // Ignore storage errors and keep default behavior.+ }+ }, [])++ const handleDismissNotice = () => {+ setShowNotice(false)+ try {+ sessionStorage.setItem(WEB_V2_NOTICE_DISMISSED_KEY, 'true')+ } catch (error) {+ // Ignore storage errors.+ }+ }+return (<div className={'layout-wrapper twc-h-full twc-flex twc-overflow-clip'}><Box className={'layout-content-wrapper twc-flex twc-grow twc-min-h-[100vh] twc-min-w-0 twc-flex-col'}>+ {showNotice && (+ <Box+ sx={{+ position: 'fixed',+ top: 16,+ right: 16,+ zIndex: 1200,+ maxWidth: 520+ }}+ >+ <Paper variant='outlined' sx={{ p: 4, bgcolor: '#fff', boxShadow: '0 4px 12px rgba(0, 0, 0, 0.12)' }}>+ <Stack direction='row' spacing={1.5} alignItems='flex-start'>+ <Box sx={{ flex: 1 }}>+ <Typography variant='body2' component='div'>+ <Box component='span' sx={{ fontWeight: 600 }}>+ Try the new V2 Web UI.+ </Box>+ <Box component='div' sx={{ fontFamily: 'monospace', mt: 1 }}>+ # In <path-to-gravitino>/conf/gravitino-env.sh+ <br />+ GRAVITINO_USE_WEB_V2=true+ </Box>+ <Box component='div' sx={{ fontFamily: 'monospace', mt: 1 }}>+ <path-to-gravitino>/bin/gravitino.sh restart+ </Box>+ </Typography>+ </Box>+ <IconButton aria-label='close notice' size='small' onClick={handleDismissNotice}>+ <CloseIcon fontSize='small' />+ </IconButton>+ </Stack>+ </Paper>+ </Box>+ )}<BoxclassName={'app-bar-bg-blur twc-top-0 twc-z-10 twc-w-full twc-fixed twc-backdrop-saturate-200 twc-backdrop-blur-[10px] twc-bg-customs-lightBg twc-h-[0.8125rem]'