From e12b78942265c610c6054027b0cd8513964ee330 Mon Sep 17 00:00:00 2001 From: labbomb <739955946@qq.com> Date: Fri, 15 Sep 2023 13:13:47 +0800 Subject: [PATCH] [Feature] Introduce Layout (#41) --- paimon-web-ui-new/index.html | 4 +- paimon-web-ui-new/package.json | 1 + paimon-web-ui-new/pnpm-lock.yaml | 7 ++ paimon-web-ui-new/public/favicon.ico | Bin 4286 -> 0 bytes paimon-web-ui-new/public/favicon_blue.svg | 16 ++++ paimon-web-ui-new/src/App.tsx | 1 + paimon-web-ui-new/src/api/request.ts | 8 +- paimon-web-ui-new/src/assets/styles/main.scss | 28 +++++++ .../content/components/menubar/index.tsx | 67 ++++++++++++++++ .../content/components/toolbar/index.tsx | 74 ++++++++++++++++++ .../components/topbar/index.module.scss | 53 +++++++++++++ .../content/components/topbar/index.tsx | 47 +++++++++++ .../src/layouts/content/index.module.scss | 21 +++++ .../src/layouts/content/index.tsx | 39 +++++++++ paimon-web-ui-new/src/locales/en/index.ts | 4 +- .../src/locales/en/modules/layout.ts | 25 ++++++ paimon-web-ui-new/src/locales/zh/index.ts | 4 +- .../src/locales/zh/modules/layout.ts | 25 ++++++ .../src/locales/zh/modules/login.ts | 2 +- paimon-web-ui-new/src/main.ts | 1 + paimon-web-ui-new/src/router/index.ts | 2 +- .../{HomePage.tsx => homepage/index.tsx} | 8 +- paimon-web-ui-new/src/views/login/index.tsx | 2 +- paimon-web-ui-new/src/views/login/use-form.ts | 5 +- 24 files changed, 426 insertions(+), 18 deletions(-) delete mode 100644 paimon-web-ui-new/public/favicon.ico create mode 100644 paimon-web-ui-new/public/favicon_blue.svg create mode 100644 paimon-web-ui-new/src/assets/styles/main.scss create mode 100644 paimon-web-ui-new/src/layouts/content/components/menubar/index.tsx create mode 100644 paimon-web-ui-new/src/layouts/content/components/toolbar/index.tsx create mode 100644 paimon-web-ui-new/src/layouts/content/components/topbar/index.module.scss create mode 100644 paimon-web-ui-new/src/layouts/content/components/topbar/index.tsx create mode 100644 paimon-web-ui-new/src/layouts/content/index.module.scss create mode 100644 paimon-web-ui-new/src/layouts/content/index.tsx create mode 100644 paimon-web-ui-new/src/locales/en/modules/layout.ts create mode 100644 paimon-web-ui-new/src/locales/zh/modules/layout.ts rename paimon-web-ui-new/src/views/{HomePage.tsx => homepage/index.tsx} (70%) diff --git a/paimon-web-ui-new/index.html b/paimon-web-ui-new/index.html index 4b4c9d2d4..dd2ddbac9 100644 --- a/paimon-web-ui-new/index.html +++ b/paimon-web-ui-new/index.html @@ -21,9 +21,9 @@ - + - Vite App + Apache Paimon
diff --git a/paimon-web-ui-new/package.json b/paimon-web-ui-new/package.json index 29e4422ea..c5a1f4e30 100644 --- a/paimon-web-ui-new/package.json +++ b/paimon-web-ui-new/package.json @@ -26,6 +26,7 @@ "@tsconfig/node18": "^18.2.2", "@types/node": "^18.17.15", "@varlet/axle": "^0.1.2", + "@vicons/ionicons5": "^0.12.0", "@vitejs/plugin-vue": "^4.3.4", "@vitejs/plugin-vue-jsx": "^3.0.2", "@vue/eslint-config-prettier": "^8.0.0", diff --git a/paimon-web-ui-new/pnpm-lock.yaml b/paimon-web-ui-new/pnpm-lock.yaml index 0ed4a8cf2..05a47af95 100644 --- a/paimon-web-ui-new/pnpm-lock.yaml +++ b/paimon-web-ui-new/pnpm-lock.yaml @@ -58,6 +58,9 @@ devDependencies: '@varlet/axle': specifier: ^0.1.2 version: 0.1.2 + '@vicons/ionicons5': + specifier: ^0.12.0 + version: 0.12.0 '@vitejs/plugin-vue': specifier: ^4.3.4 version: 4.3.4(vite@4.4.9)(vue@3.3.4) @@ -992,6 +995,10 @@ packages: resolution: {integrity: sha512-Tu4LIaEwIflyUrDzIViM2spluwSP7cNxJyoM+0XD2/h0abI1H86M6NsO5tBRF3R3740ITgJ4GzEHimOYNfbmMQ==} dev: true + /@vicons/ionicons5@0.12.0: + resolution: {integrity: sha512-Iy1EUVRpX0WWxeu1VIReR1zsZLMc4fqpt223czR+Rpnrwu7pt46nbnC2ycO7ItI/uqDLJxnbcMC7FujKs9IfFA==} + dev: true + /@vitejs/plugin-vue-jsx@3.0.2(vite@4.4.9)(vue@3.3.4): resolution: {integrity: sha512-obF26P2Z4Ogy3cPp07B4VaW6rpiu0ue4OT2Y15UxT5BZZ76haUY9guOsZV3uWh/I6xc+VeiW+ZVabRE82FyzWw==} engines: {node: ^14.18.0 || >=16.0.0} diff --git a/paimon-web-ui-new/public/favicon.ico b/paimon-web-ui-new/public/favicon.ico deleted file mode 100644 index df36fcfb72584e00488330b560ebcf34a41c64c2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4286 zcmds*O-Phc6o&64GDVCEQHxsW(p4>LW*W<827=Unuo8sGpRux(DN@jWP-e29Wl%wj zY84_aq9}^Am9-cWTD5GGEo#+5Fi2wX_P*bo+xO!)p*7B;iKlbFd(U~_d(U?#hLj56 zPhFkj-|A6~Qk#@g^#D^U0XT1cu=c-vu1+SElX9NR;kzAUV(q0|dl0|%h|dI$%VICy zJnu2^L*Te9JrJMGh%-P79CL0}dq92RGU6gI{v2~|)p}sG5x0U*z<8U;Ij*hB9z?ei z@g6Xq-pDoPl=MANPiR7%172VA%r)kevtV-_5H*QJKFmd;8yA$98zCxBZYXTNZ#QFk2(TX0;Y2dt&WitL#$96|gJY=3xX zpCoi|YNzgO3R`f@IiEeSmKrPSf#h#Qd<$%Ej^RIeeYfsxhPMOG`S`Pz8q``=511zm zAm)MX5AV^5xIWPyEu7u>qYs?pn$I4nL9J!=K=SGlKLXpE<5x+2cDTXq?brj?n6sp= zphe9;_JHf40^9~}9i08r{XM$7HB!`{Ys~TK0kx<}ZQng`UPvH*11|q7&l9?@FQz;8 zx!=3<4seY*%=OlbCbcae?5^V_}*K>Uo6ZWV8mTyE^B=DKy7-sdLYkR5Z?paTgK-zyIkKjIcpyO z{+uIt&YSa_$QnN_@t~L014dyK(fOOo+W*MIxbA6Ndgr=Y!f#Tokqv}n<7-9qfHkc3 z=>a|HWqcX8fzQCT=dqVbogRq!-S>H%yA{1w#2Pn;=e>JiEj7Hl;zdt-2f+j2%DeVD zsW0Ab)ZK@0cIW%W7z}H{&~yGhn~D;aiP4=;m-HCo`BEI+Kd6 z={Xwx{TKxD#iCLfl2vQGDitKtN>z|-AdCN|$jTFDg0m3O`WLD4_s#$S diff --git a/paimon-web-ui-new/public/favicon_blue.svg b/paimon-web-ui-new/public/favicon_blue.svg new file mode 100644 index 000000000..73c311a67 --- /dev/null +++ b/paimon-web-ui-new/public/favicon_blue.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/paimon-web-ui-new/src/App.tsx b/paimon-web-ui-new/src/App.tsx index a7119a6e3..96768c73c 100644 --- a/paimon-web-ui-new/src/App.tsx +++ b/paimon-web-ui-new/src/App.tsx @@ -45,6 +45,7 @@ export default defineComponent({ theme-overrides={this.themeOverrides} locale={this.locale === 'en' ? enUS : zhCN} date-locale={this.locale === 'en' ? dateEnUS : dateZhCN} + style={{ width: '100%', height: '100vh' }} > diff --git a/paimon-web-ui-new/src/api/request.ts b/paimon-web-ui-new/src/api/request.ts index 0e19da805..72cbbfc21 100644 --- a/paimon-web-ui-new/src/api/request.ts +++ b/paimon-web-ui-new/src/api/request.ts @@ -45,12 +45,12 @@ axle.axios.interceptors.request.use( axle.axios.interceptors.response.use( (response) => { - const { code, message } = response.data + const { code, msg } = response.data - if (code !== 200 && message) { + if (code !== 200 && msg) { // do something there + return Promise.reject(response.data) } - return response.data }, (error) => { @@ -104,4 +104,4 @@ class HttpRequest { } } -export default new HttpRequest() \ No newline at end of file +export default new HttpRequest() diff --git a/paimon-web-ui-new/src/assets/styles/main.scss b/paimon-web-ui-new/src/assets/styles/main.scss new file mode 100644 index 000000000..d7ba02fff --- /dev/null +++ b/paimon-web-ui-new/src/assets/styles/main.scss @@ -0,0 +1,28 @@ +/* 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. */ + +html, body { + margin: 0; + padding: 0; +} + +* { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} diff --git a/paimon-web-ui-new/src/layouts/content/components/menubar/index.tsx b/paimon-web-ui-new/src/layouts/content/components/menubar/index.tsx new file mode 100644 index 000000000..cb1034eb5 --- /dev/null +++ b/paimon-web-ui-new/src/layouts/content/components/menubar/index.tsx @@ -0,0 +1,67 @@ +/* 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 i18n from '@/locales' +import { useConfigStore } from '@/store/config' + +export default defineComponent({ + name: 'MenuBar', + setup() { + const configStore = useConfigStore() + + const menuOptions = ref([] as any[]) + + watch( + () => configStore.getCurrentLocale, + () => { + menuOptions.value = [ + { + label: i18n.global.t('layout.playground'), + key: 'playground', + }, + { + label: i18n.global.t('layout.metadata'), + key: 'metadata', + }, + { + label: i18n.global.t('layout.cdc_ingestion'), + key: 'cdc_ingestion', + }, + { + label: i18n.global.t('layout.system'), + key: 'system', + }, + ] + }, + { immediate: true } + ) + + return { + activeKey: ref('playground'), + menuOptions + } + }, + render () { + return ( + + ) + } +}) diff --git a/paimon-web-ui-new/src/layouts/content/components/toolbar/index.tsx b/paimon-web-ui-new/src/layouts/content/components/toolbar/index.tsx new file mode 100644 index 000000000..0925a43da --- /dev/null +++ b/paimon-web-ui-new/src/layouts/content/components/toolbar/index.tsx @@ -0,0 +1,74 @@ +/* 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 i18n from '@/locales' +import { useConfigStore } from '@/store/config' +import { LogoGithub, Moon, SunnyOutline, Language, PersonCircleOutline } from '@vicons/ionicons5' + +export default defineComponent({ + name: 'ToolBar', + setup() { + const handleLink = () => { + window.open('https://github.com/apache/incubator-paimon-webui') + } + + const configStore = useConfigStore() + const handleTheme = () => { + configStore.setCurrentTheme( + configStore.getCurrentTheme === 'light' ? 'dark' : 'light' + ) + } + + const handleLanguage = () => { + configStore.setCurrentLocale(configStore.getCurrentLocale === 'zh' ? 'en' : 'zh') + i18n.global.locale.value = configStore.getCurrentLocale === 'zh' ? 'en' : 'zh' + } + + return { + handleLink, + handleTheme, + handleLanguage, + configStore, + active: ref(false) + } + }, + render () { + return ( + + ( + + { + this.configStore.getCurrentTheme === 'light' ? : + } + + ) + }} + > + {i18n.global.t('layout.' + String(this.configStore.getCurrentTheme === 'light' ? 'dark' : 'light'))} + + + + + + + + + ) + } +}) diff --git a/paimon-web-ui-new/src/layouts/content/components/topbar/index.module.scss b/paimon-web-ui-new/src/layouts/content/components/topbar/index.module.scss new file mode 100644 index 000000000..df88bd054 --- /dev/null +++ b/paimon-web-ui-new/src/layouts/content/components/topbar/index.module.scss @@ -0,0 +1,53 @@ +/* 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. */ + +.container { + display: flex; + width: 100%; + height: 100%; + + .logo-bar { + display: flex; + align-items: center; + padding-left: 10px; + width: 300px; + height: 100%; + font-size: 18px; + font-weight: 600; + .logo { + display: flex; + align-items: center; + img { + width: 50px; + height: 50px; + } + } + } + + .menu-bar { + display: flex; + align-items: center; + } + + .toolbar { + display: flex; + align-items: center; + justify-content: flex-end; + flex: 1; + padding-right: 20px; + } +} diff --git a/paimon-web-ui-new/src/layouts/content/components/topbar/index.tsx b/paimon-web-ui-new/src/layouts/content/components/topbar/index.tsx new file mode 100644 index 000000000..4024b1ed8 --- /dev/null +++ b/paimon-web-ui-new/src/layouts/content/components/topbar/index.tsx @@ -0,0 +1,47 @@ +/* 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 styles from './index.module.scss' +import logoImage from '@/assets/logo.svg' +import MenuBar from '../menubar' +import ToolBar from '../toolbar' + +export default defineComponent({ + name: 'TopBar', + setup() { + }, + render () { + return ( +
+
+ +
+ logo-image +
+
Apache Paimon
+
+
+
+ +
+
+ +
+
+ ) + } +}) diff --git a/paimon-web-ui-new/src/layouts/content/index.module.scss b/paimon-web-ui-new/src/layouts/content/index.module.scss new file mode 100644 index 000000000..c812bffd5 --- /dev/null +++ b/paimon-web-ui-new/src/layouts/content/index.module.scss @@ -0,0 +1,21 @@ +/* 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. */ + +.container { + width: 100%; + height: 100%; +} diff --git a/paimon-web-ui-new/src/layouts/content/index.tsx b/paimon-web-ui-new/src/layouts/content/index.tsx new file mode 100644 index 000000000..65ecd61fd --- /dev/null +++ b/paimon-web-ui-new/src/layouts/content/index.tsx @@ -0,0 +1,39 @@ +/* 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 NavBar from './components/topbar' +import styles from './index.module.scss' + +export default defineComponent({ + name: 'ContentPage', + setup() { + }, + render() { + return ( +
+ + + + + + + + +
+ ) + } +}) diff --git a/paimon-web-ui-new/src/locales/en/index.ts b/paimon-web-ui-new/src/locales/en/index.ts index 12cbef875..08e479fc0 100644 --- a/paimon-web-ui-new/src/locales/en/index.ts +++ b/paimon-web-ui-new/src/locales/en/index.ts @@ -15,8 +15,10 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +import layout from './modules/layout' import login from './modules/login' export default { - login + login, + layout } \ No newline at end of file diff --git a/paimon-web-ui-new/src/locales/en/modules/layout.ts b/paimon-web-ui-new/src/locales/en/modules/layout.ts new file mode 100644 index 000000000..31d6e66bd --- /dev/null +++ b/paimon-web-ui-new/src/locales/en/modules/layout.ts @@ -0,0 +1,25 @@ +/* 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. */ + +export default { + playground: 'Playground', + metadata: 'MetaData', + cdc_ingestion: 'CDC Ingestion', + system: 'System', + light: 'Light', + dark: 'Dark' +} diff --git a/paimon-web-ui-new/src/locales/zh/index.ts b/paimon-web-ui-new/src/locales/zh/index.ts index 12cbef875..08e479fc0 100644 --- a/paimon-web-ui-new/src/locales/zh/index.ts +++ b/paimon-web-ui-new/src/locales/zh/index.ts @@ -15,8 +15,10 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +import layout from './modules/layout' import login from './modules/login' export default { - login + login, + layout } \ No newline at end of file diff --git a/paimon-web-ui-new/src/locales/zh/modules/layout.ts b/paimon-web-ui-new/src/locales/zh/modules/layout.ts new file mode 100644 index 000000000..313b4d3cb --- /dev/null +++ b/paimon-web-ui-new/src/locales/zh/modules/layout.ts @@ -0,0 +1,25 @@ +/* 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. */ + +export default { + playground: '查询控制台', + metadata: '元数据管理', + cdc_ingestion: 'CDC 集成', + system: '系统管理', + light: '浅色', + dark: '暗色' +} diff --git a/paimon-web-ui-new/src/locales/zh/modules/login.ts b/paimon-web-ui-new/src/locales/zh/modules/login.ts index 38b5f3e1b..48f04afe2 100644 --- a/paimon-web-ui-new/src/locales/zh/modules/login.ts +++ b/paimon-web-ui-new/src/locales/zh/modules/login.ts @@ -23,4 +23,4 @@ export default { password_tips: '请输入密码', light: '浅色', dark: '暗色' -} \ No newline at end of file +} diff --git a/paimon-web-ui-new/src/main.ts b/paimon-web-ui-new/src/main.ts index 3fb07b3af..82a46d970 100644 --- a/paimon-web-ui-new/src/main.ts +++ b/paimon-web-ui-new/src/main.ts @@ -23,6 +23,7 @@ import router from './router' import naive from 'naive-ui' import i18n from './locales' import { Setting } from './config' +import '@/assets/styles/main.scss' const app = createApp(App) const pinia = createPinia() diff --git a/paimon-web-ui-new/src/router/index.ts b/paimon-web-ui-new/src/router/index.ts index 0ab49869b..c55aaae0e 100644 --- a/paimon-web-ui-new/src/router/index.ts +++ b/paimon-web-ui-new/src/router/index.ts @@ -26,7 +26,7 @@ const router = createRouter({ // route level code-splitting // this generates a separate chunk (About.[hash].js) for this route // which is lazy-loaded when the route is visited. - component: () => import('../views/HomePage') + component: () => import('../layouts/content') }, { path: '/login', diff --git a/paimon-web-ui-new/src/views/HomePage.tsx b/paimon-web-ui-new/src/views/homepage/index.tsx similarity index 70% rename from paimon-web-ui-new/src/views/HomePage.tsx rename to paimon-web-ui-new/src/views/homepage/index.tsx index 799eadf82..11292ebec 100644 --- a/paimon-web-ui-new/src/views/HomePage.tsx +++ b/paimon-web-ui-new/src/views/homepage/index.tsx @@ -26,12 +26,8 @@ export default defineComponent({ }, render() { return ( -
-
- Your Company -

Welcome to Paimon

-
-
+
+
Request Test
diff --git a/paimon-web-ui-new/src/views/login/index.tsx b/paimon-web-ui-new/src/views/login/index.tsx index ce096089d..82ceff188 100644 --- a/paimon-web-ui-new/src/views/login/index.tsx +++ b/paimon-web-ui-new/src/views/login/index.tsx @@ -114,4 +114,4 @@ export default defineComponent({ } -}) \ No newline at end of file +}) diff --git a/paimon-web-ui-new/src/views/login/use-form.ts b/paimon-web-ui-new/src/views/login/use-form.ts index 550fd2164..f5f729887 100644 --- a/paimon-web-ui-new/src/views/login/use-form.ts +++ b/paimon-web-ui-new/src/views/login/use-form.ts @@ -17,8 +17,10 @@ under the License. */ import { onLogin } from '@/api' import type { FormValidationError } from 'naive-ui' +import type { Router } from 'vue-router' export function useForm() { + const router: Router = useRouter() const [userInfo, onSubmit] = onLogin() const state = reactive({ @@ -41,6 +43,7 @@ export function useForm() { } }) console.log(userInfo) + router.push({ path: '/' }) } }) } @@ -49,4 +52,4 @@ export function useForm() { state, handleLogin } -} \ No newline at end of file +}