LauraXia123 commented on code in PR #5567:
URL: https://github.com/apache/gravitino/pull/5567#discussion_r1841520741


##########
web/web/src/app/rootLayout/AppBar.js:
##########
@@ -38,15 +38,25 @@ import {
 } from '@mui/material'
 
 import clsx from 'clsx'
+import axios from 'axios'
 
 import VersionView from './VersionView'
 import LogoutButton from './Logout'
+import GitHubInfo from './GitHubInfo'
 import { useSearchParams } from 'next/navigation'
 import { useRouter } from 'next/navigation'
 import { useAppSelector, useAppDispatch } from '@/lib/hooks/useStore'
 import { fetchMetalakes } from '@/lib/store/metalakes'
 
 const fonts = Roboto({ subsets: ['latin'], weight: ['400'], display: 'swap' })
+function checkCountMore1k(count) {
+  let newCount = count
+  if (count >= 1000) {
+    newCount = (count / 1000).toFixed(1) + 'k'

Review Comment:
   if count over 10000, 100000 or more? I suggest adding a format filter 
funtiion at `/gravitino/web/web/src/lib/utils/index.js`



##########
web/web/src/app/rootLayout/AppBar.js:
##########
@@ -56,14 +66,31 @@ const AppBar = () => {
   const [metalakes, setMetalakes] = useState([])
   const router = useRouter()
   const logoSrc = (process.env.NEXT_PUBLIC_BASE_PATH ?? '') + 
'/icons/gravitino.svg'
+  const username = 'apache'
+  const repository = 'gravitino'
+  const [githubData, setGithubData] = useState({ stars: 0, forks: 0 })
 
   useEffect(() => {
+    const fetchGitHubData = async () => {
+      try {
+        const response = await 
axios.get(`https://api.github.com/repos/${username}/${repository}`)
+        let { stargazers_count, forks_count } = response.data

Review Comment:
   In gravitino, axios have imported at 
`gravitino/web/web/src/lib/utils/axios/index.js` and export `defHttp`,.
   And all the response data are all managed. 
   I think the github star data can managed at 
`/gravitino/web/web/src/lib/store/sys/index.js`
   
   Let me know if you have any questions. 



-- 
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-unsubscr...@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to