You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "hdygxsj (via GitHub)" <gi...@apache.org> on 2023/12/08 17:33:15 UTC

[PR] [Feature][UI] Add sided bar for the front-end [incubator-paimon-webui]

hdygxsj opened a new pull request, #115:
URL: https://github.com/apache/incubator-paimon-webui/pull/115

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
   
   ### Purpose
   Add sided bar for the front-end
   <img width="1728" alt="image" src="https://github.com/apache/incubator-paimon-webui/assets/35210666/8b0ea67d-4e15-4bcc-9130-9639d43cebc2">
   
   
   ### Tests
   
   <!-- List UT and IT cases to verify this change -->
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   
   <!-- Does this change introduce a new feature -->
   


-- 
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: issues-unsubscribe@paimon.apache.org

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


Re: [PR] [Feature][UI] Add sided bar for the front-end [incubator-paimon-webui]

Posted by "zhangmo8 (via GitHub)" <gi...@apache.org>.
zhangmo8 commented on code in PR #115:
URL: https://github.com/apache/incubator-paimon-webui/pull/115#discussion_r1421419574


##########
paimon-web-ui-new/src/layouts/content/components/sidebar/index.tsx:
##########
@@ -0,0 +1,63 @@
+/* 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 { defineComponent, ref, type PropType } from 'vue'
+import {  useRouter } from 'vue-router'
+import type { Router } from 'vue-router'
+
+const Sidebar = defineComponent({
+  name: 'Sidebar',
+  props: {
+    sideMenuOptions: {
+      type: Array as PropType<any>,

Review Comment:
   ```suggestion
         type: Array as PropType<MenuOption>,
   ```



##########
paimon-web-ui-new/src/layouts/content/components/menubar/index.tsx:
##########
@@ -20,40 +20,15 @@ import { RouterLink } from "vue-router"
 import type { NavBar } from "@/store/config/type"
 
 export default defineComponent({
+  props:{
+    menuOptions: {
+      type: Array as PropType<any>,

Review Comment:
   please use the naive Menu component Type
   ```suggestion
         type: Array as PropType<MenuOption>,
   ```



##########
paimon-web-ui-new/src/layouts/content/components/topbar/index.tsx:
##########
@@ -21,6 +21,12 @@ import MenuBar from '../menubar'
 import ToolBar from '../toolbar'
 
 export default defineComponent({
+  props:{
+    headerMenuOptions: {
+      type: Array as PropType<any>,

Review Comment:
   ```suggestion
         type: Array as PropType<MenuOption>,
   ```



##########
paimon-web-ui-new/src/api/models/login/index.ts:
##########
@@ -16,7 +16,7 @@ specific language governing permissions and limitations
 under the License. */
 
 import httpRequest from '../../request'
-import type ResponseOptions from '@/api/types'
+import type {ResponseOptions} from '@/api/types'

Review Comment:
   code indentation
   ```suggestion
   import type { ResponseOptions } from '@/api/types'
   ```



##########
paimon-web-ui-new/src/layouts/content/index.tsx:
##########
@@ -17,21 +17,47 @@ under the License. */
 
 import NavBar from './components/topbar'
 import styles from './index.module.scss'
+import SideBar from './components/sidebar'
+import { useData } from './use-data'
+import { useConfigStore } from '@/store/config'
 
 export default defineComponent({
   name: 'ContentPage',
   setup() {
+    const configStore = useConfigStore()
+    const route = useRoute()
+    const { menuOptions, state } = useData()
+    const getSideOption = (state: any) => {
+      const activeNavKey = configStore.getCurrentNavActive
+      state.sideMenuOptions = menuOptions.value.filter((m: any) => m.key === activeNavKey)[0]?.sideMenuOptions || []

Review Comment:
   replace `filter` to `find`



-- 
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: issues-unsubscribe@paimon.apache.org

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


Re: [PR] [Feature][UI] Add sided bar for the front-end [incubator-paimon-webui]

Posted by "s7monk (via GitHub)" <gi...@apache.org>.
s7monk commented on PR #115:
URL: https://github.com/apache/incubator-paimon-webui/pull/115#issuecomment-1848221609

   ![image](https://github.com/apache/incubator-paimon-webui/assets/34889415/865006e5-5a35-468e-b0e1-b31446176411)
   @hdygxsj Thank you for your contribution,I think the header navigation can be done without icons, which will make it look more concise.


-- 
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: issues-unsubscribe@paimon.apache.org

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


Re: [PR] [Feature][UI] Add sided bar for the front-end [incubator-paimon-webui]

Posted by "lq-c (via GitHub)" <gi...@apache.org>.
lq-c commented on code in PR #115:
URL: https://github.com/apache/incubator-paimon-webui/pull/115#discussion_r1421709949


##########
paimon-web-ui-new/vite.config.ts:
##########
@@ -29,7 +29,7 @@ export default defineConfig({
   server: {
     proxy: {
       '/api': {
-        target: 'http://47.94.247.86:10088',
+        target: 'http://127.0.0.1:10088',

Review Comment:
   This configuration does not need to be submitted



##########
paimon-web-ui-new/src/layouts/content/index.tsx:
##########
@@ -17,21 +17,47 @@ under the License. */
 
 import NavBar from './components/topbar'
 import styles from './index.module.scss'
+import SideBar from './components/sidebar'
+import { useData } from './use-data'
+import { useConfigStore } from '@/store/config'
 
 export default defineComponent({
   name: 'ContentPage',
   setup() {
+    const configStore = useConfigStore()
+    const route = useRoute()
+    const { menuOptions, state } = useData()
+    const getSideOption = (state: any) => {
+      const activeNavKey = configStore.getCurrentNavActive
+      state.sideMenuOptions = menuOptions.value.find((m: any) => m.key === activeNavKey)?.sideMenuOptions || []
+      state.isShowSided = state.sideMenuOptions && state.sideMenuOptions.length > 0

Review Comment:
   ```suggestion
         state.isShowSided = state.sideMenuOptions && state.sideMenuOptions.length
   ```



-- 
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: issues-unsubscribe@paimon.apache.org

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


Re: [PR] [Feature][UI] Add sided bar for the front-end [incubator-paimon-webui]

Posted by "hdygxsj (via GitHub)" <gi...@apache.org>.
hdygxsj commented on code in PR #115:
URL: https://github.com/apache/incubator-paimon-webui/pull/115#discussion_r1421421834


##########
paimon-web-ui-new/src/layouts/content/components/topbar/index.tsx:
##########
@@ -21,6 +21,12 @@ import MenuBar from '../menubar'
 import ToolBar from '../toolbar'
 
 export default defineComponent({
+  props:{
+    headerMenuOptions: {
+      type: Array as PropType<any>,

Review Comment:
   done



-- 
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: issues-unsubscribe@paimon.apache.org

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


Re: [PR] [Feature] Support sided bar [incubator-paimon-webui]

Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas merged PR #115:
URL: https://github.com/apache/incubator-paimon-webui/pull/115


-- 
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: issues-unsubscribe@paimon.apache.org

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