From 5169942cbde9732975245b562b7c487c31776678 Mon Sep 17 00:00:00 2001 From: fuliqiang <1348994179@qq.com> Date: Wed, 11 Dec 2024 01:06:13 +0800 Subject: [PATCH 01/39] feat: init cluster --- .../src/assets/images/svg/success.svg | 29 +++++++++++++++ .../pages/cluster-manage/cluster/index.vue | 35 +++++++++++++++++-- 2 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 bigtop-manager-ui/src/assets/images/svg/success.svg diff --git a/bigtop-manager-ui/src/assets/images/svg/success.svg b/bigtop-manager-ui/src/assets/images/svg/success.svg new file mode 100644 index 000000000..c02bc2347 --- /dev/null +++ b/bigtop-manager-ui/src/assets/images/svg/success.svg @@ -0,0 +1,29 @@ + + + + + + + + \ No newline at end of file diff --git a/bigtop-manager-ui/src/pages/cluster-manage/cluster/index.vue b/bigtop-manager-ui/src/pages/cluster-manage/cluster/index.vue index d78ec09f2..58726dcba 100644 --- a/bigtop-manager-ui/src/pages/cluster-manage/cluster/index.vue +++ b/bigtop-manager-ui/src/pages/cluster-manage/cluster/index.vue @@ -21,8 +21,39 @@ - + From 0f9021cf32e3b6dd428b6b104dc30e72352793bc Mon Sep 17 00:00:00 2001 From: fuliqiang <1348994179@qq.com> Date: Thu, 12 Dec 2024 18:05:25 +0800 Subject: [PATCH 02/39] feat: add dashoard page --- bigtop-manager-ui/.env.development | 1 + .../src/components/ai-assistant/index.vue | 2 +- .../components/common/button-group/index.vue | 72 +++++++--- .../components/common/button-group/types.ts | 10 +- .../components/common/header-card/index.vue | 101 ++++++++++++++ .../src/components/common/main-card/index.vue | 64 +++++++++ .../src/components/common/main-card/types.ts | 23 ++++ .../cluster-manage/cluster/dashboard.vue | 128 ++++++++++++++++++ .../pages/cluster-manage/cluster/index.vue | 111 ++++++++++----- bigtop-manager-ui/src/types/components.d.ts | 30 ++++ 10 files changed, 487 insertions(+), 55 deletions(-) create mode 100644 bigtop-manager-ui/src/components/common/header-card/index.vue create mode 100644 bigtop-manager-ui/src/components/common/main-card/index.vue create mode 100644 bigtop-manager-ui/src/components/common/main-card/types.ts create mode 100644 bigtop-manager-ui/src/pages/cluster-manage/cluster/dashboard.vue create mode 100644 bigtop-manager-ui/src/types/components.d.ts diff --git a/bigtop-manager-ui/.env.development b/bigtop-manager-ui/.env.development index 6346532b1..67a2cdff8 100644 --- a/bigtop-manager-ui/.env.development +++ b/bigtop-manager-ui/.env.development @@ -17,5 +17,6 @@ NODE_ENV=development VITE_APP_BASE='/' VITE_APP_BASE_URL='http://localhost:8080' +# VITE_APP_BASE_URL='http://bmdebug.s7.tunnelfrp.com' VITE_APP_BASE_API='/api' VITE_GITHUB_URL='https://github.com/apache/bigtop-manager' diff --git a/bigtop-manager-ui/src/components/ai-assistant/index.vue b/bigtop-manager-ui/src/components/ai-assistant/index.vue index 871d5c13e..7b0e04963 100644 --- a/bigtop-manager-ui/src/components/ai-assistant/index.vue +++ b/bigtop-manager-ui/src/components/ai-assistant/index.vue @@ -170,7 +170,7 @@ diff --git a/bigtop-manager-ui/src/components/common/button-group/index.vue b/bigtop-manager-ui/src/components/common/button-group/index.vue index bc2b6d500..23e1b801c 100644 --- a/bigtop-manager-ui/src/components/common/button-group/index.vue +++ b/bigtop-manager-ui/src/components/common/button-group/index.vue @@ -19,7 +19,8 @@ diff --git a/bigtop-manager-ui/src/components/common/button-group/types.ts b/bigtop-manager-ui/src/components/common/button-group/types.ts index ae481660d..f2a50aff2 100644 --- a/bigtop-manager-ui/src/components/common/button-group/types.ts +++ b/bigtop-manager-ui/src/components/common/button-group/types.ts @@ -17,9 +17,15 @@ * under the License. */ +import { MenuItemProps, MenuProps } from 'ant-design-vue' + type BtnType = 'primary' | 'ghost' | 'dashed' | 'link' | 'text' | 'default' type ShapeType = 'default' | 'circle' | 'round' +export interface DropdownMenu extends MenuItemProps { + action: string + text: string +} export interface GroupItem { icon?: string tip?: string @@ -28,11 +34,13 @@ export interface GroupItem { type?: BtnType shape?: ShapeType disabled?: boolean + dropdownMenu?: DropdownMenu[] clickEvent?: (item?: GroupItem, ...args: any[]) => void + dropdownMenuClickEvent?: MenuProps['onClick'] } export interface Props { - i18n: string + i18n?: string groups: GroupItem[] groupType?: BtnType groupShape?: ShapeType diff --git a/bigtop-manager-ui/src/components/common/header-card/index.vue b/bigtop-manager-ui/src/components/common/header-card/index.vue new file mode 100644 index 000000000..71a08eb4b --- /dev/null +++ b/bigtop-manager-ui/src/components/common/header-card/index.vue @@ -0,0 +1,101 @@ + + + + + + + diff --git a/bigtop-manager-ui/src/components/common/main-card/index.vue b/bigtop-manager-ui/src/components/common/main-card/index.vue new file mode 100644 index 000000000..4329e185b --- /dev/null +++ b/bigtop-manager-ui/src/components/common/main-card/index.vue @@ -0,0 +1,64 @@ + + + + + + + diff --git a/bigtop-manager-ui/src/components/common/main-card/types.ts b/bigtop-manager-ui/src/components/common/main-card/types.ts new file mode 100644 index 000000000..abc7c4dae --- /dev/null +++ b/bigtop-manager-ui/src/components/common/main-card/types.ts @@ -0,0 +1,23 @@ +/* + * 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 + * + * https://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 interface TabItem { + key: string + title: string +} diff --git a/bigtop-manager-ui/src/pages/cluster-manage/cluster/dashboard.vue b/bigtop-manager-ui/src/pages/cluster-manage/cluster/dashboard.vue new file mode 100644 index 000000000..28aabe80a --- /dev/null +++ b/bigtop-manager-ui/src/pages/cluster-manage/cluster/dashboard.vue @@ -0,0 +1,128 @@ + + + + + + + diff --git a/bigtop-manager-ui/src/pages/cluster-manage/cluster/index.vue b/bigtop-manager-ui/src/pages/cluster-manage/cluster/index.vue index 58726dcba..581a14d69 100644 --- a/bigtop-manager-ui/src/pages/cluster-manage/cluster/index.vue +++ b/bigtop-manager-ui/src/pages/cluster-manage/cluster/index.vue @@ -17,43 +17,82 @@ ~ under the License. --> - + + + + + diff --git a/bigtop-manager-ui/src/types/components.d.ts b/bigtop-manager-ui/src/types/components.d.ts new file mode 100644 index 000000000..ff6195061 --- /dev/null +++ b/bigtop-manager-ui/src/types/components.d.ts @@ -0,0 +1,30 @@ +/* + * 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 + * + * https://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 {} + +declare module 'vue' { + export interface GlobalComponents { + HeaderCard: (typeof import('@/components/common/header-card/index.vue'))['default'] + MainCard: (typeof import('@/components/common/main-card/index.vue'))['default'] + AutoForm: (typeof import('@/components/common/auto-form/index.vue'))['default'] + ButtonGroup: (typeof import('@/components/common/button-group/index.vue'))['default'] + MarkdownView: (typeof import('@/components/common/markdown-view/index.vue'))['default'] + SvgIcon: (typeof import('@/components/common/svg-icon/index.vue'))['default'] + } +} From 7796407beaa8b00b955dc0c12fd5639f48b9739f Mon Sep 17 00:00:00 2001 From: fuliqiang <1348994179@qq.com> Date: Wed, 18 Dec 2024 18:19:18 +0800 Subject: [PATCH 03/39] feat: add chart for cluster --- .../components/common/header-card/index.vue | 1 + .../src/components/common/main-card/index.vue | 1 + .../cluster/components/category-chart.vue | 113 +++++++++ .../cluster/components/gauge-chart.vue | 134 +++++++++++ .../cluster-manage/cluster/dashboard.vue | 227 +++++++++++++----- 5 files changed, 421 insertions(+), 55 deletions(-) create mode 100644 bigtop-manager-ui/src/pages/cluster-manage/cluster/components/category-chart.vue create mode 100644 bigtop-manager-ui/src/pages/cluster-manage/cluster/components/gauge-chart.vue diff --git a/bigtop-manager-ui/src/components/common/header-card/index.vue b/bigtop-manager-ui/src/components/common/header-card/index.vue index 71a08eb4b..8f8c13614 100644 --- a/bigtop-manager-ui/src/components/common/header-card/index.vue +++ b/bigtop-manager-ui/src/components/common/header-card/index.vue @@ -74,6 +74,7 @@ diff --git a/bigtop-manager-ui/src/pages/cluster-manage/cluster/components/gauge-chart.vue b/bigtop-manager-ui/src/pages/cluster-manage/cluster/components/gauge-chart.vue new file mode 100644 index 000000000..1ce32da37 --- /dev/null +++ b/bigtop-manager-ui/src/pages/cluster-manage/cluster/components/gauge-chart.vue @@ -0,0 +1,134 @@ + + + + + + + diff --git a/bigtop-manager-ui/src/pages/cluster-manage/cluster/dashboard.vue b/bigtop-manager-ui/src/pages/cluster-manage/cluster/dashboard.vue index 28aabe80a..d5cc09c98 100644 --- a/bigtop-manager-ui/src/pages/cluster-manage/cluster/dashboard.vue +++ b/bigtop-manager-ui/src/pages/cluster-manage/cluster/dashboard.vue @@ -18,6 +18,8 @@ --> From f41518599d425ab6c191414fa85f1a6deffcba8e Mon Sep 17 00:00:00 2001 From: fuliqiang <1348994179@qq.com> Date: Thu, 19 Dec 2024 18:05:37 +0800 Subject: [PATCH 06/39] feat: Update cluster create --- .../components/common/header-card/index.vue | 30 ++++++++++--------- .../pages/cluster-manage/cluster/create.vue | 27 +++++++++++++++-- .../pages/cluster-manage/cluster/index.vue | 11 ++++++- 3 files changed, 51 insertions(+), 17 deletions(-) diff --git a/bigtop-manager-ui/src/components/common/header-card/index.vue b/bigtop-manager-ui/src/components/common/header-card/index.vue index 8f8c13614..15b6b9f51 100644 --- a/bigtop-manager-ui/src/components/common/header-card/index.vue +++ b/bigtop-manager-ui/src/components/common/header-card/index.vue @@ -53,21 +53,23 @@ @@ -75,7 +77,7 @@ .header-card { width: 100%; min-width: 389px; - height: 102px; + min-height: 102px; @include flexbox($justify: space-between, $align: center); background-color: $color-white; padding: $space-md; diff --git a/bigtop-manager-ui/src/pages/cluster-manage/cluster/create.vue b/bigtop-manager-ui/src/pages/cluster-manage/cluster/create.vue index a1f074d6b..774827d77 100644 --- a/bigtop-manager-ui/src/pages/cluster-manage/cluster/create.vue +++ b/bigtop-manager-ui/src/pages/cluster-manage/cluster/create.vue @@ -19,6 +19,7 @@ - + diff --git a/bigtop-manager-ui/src/pages/cluster-manage/cluster/index.vue b/bigtop-manager-ui/src/pages/cluster-manage/cluster/index.vue index ea7655cc5..115f72b82 100644 --- a/bigtop-manager-ui/src/pages/cluster-manage/cluster/index.vue +++ b/bigtop-manager-ui/src/pages/cluster-manage/cluster/index.vue @@ -23,6 +23,7 @@ import type { GroupItem } from '@/components/common/button-group/types' import type { TabItem } from '@/components/common/main-card/types' import Overview from './overview.vue' + import Service from './service.vue' const route = useRoute() const title = computed(() => route.params.cluster as string) @@ -79,6 +80,14 @@ } ]) + const getCompName = computed(() => { + if (activeKey.value === '1') { + return Overview + } else { + return Service + } + }) + const dropdownMenuClick: GroupItem['dropdownMenuClickEvent'] = ({ key }) => { console.log('key :>> ', key) } @@ -91,7 +100,7 @@ From 46e214c774fae499bb6b1b918b26e6c990ab6a47 Mon Sep 17 00:00:00 2001 From: fuliqiang <1348994179@qq.com> Date: Thu, 19 Dec 2024 23:43:05 +0800 Subject: [PATCH 07/39] feat: Add cluster locale --- .../src/components/common/auto-form/index.vue | 18 ++- .../src/components/common/main-card/index.vue | 27 ++-- .../src/locales/en_US/cluster.ts | 26 ++++ bigtop-manager-ui/src/locales/en_US/index.ts | 4 +- .../src/locales/zh_CN/cluster.ts | 26 ++++ bigtop-manager-ui/src/locales/zh_CN/index.ts | 4 +- .../cluster/components/cluster-base.vue | 118 ++++++++++++++++++ .../pages/cluster-manage/cluster/create.vue | 53 ++++++-- .../pages/cluster-manage/cluster/index.vue | 4 +- 9 files changed, 253 insertions(+), 27 deletions(-) create mode 100644 bigtop-manager-ui/src/locales/en_US/cluster.ts create mode 100644 bigtop-manager-ui/src/locales/zh_CN/cluster.ts create mode 100644 bigtop-manager-ui/src/pages/cluster-manage/cluster/components/cluster-base.vue diff --git a/bigtop-manager-ui/src/components/common/auto-form/index.vue b/bigtop-manager-ui/src/components/common/auto-form/index.vue index 9d924006c..399846ce7 100644 --- a/bigtop-manager-ui/src/components/common/auto-form/index.vue +++ b/bigtop-manager-ui/src/components/common/auto-form/index.vue @@ -20,13 +20,15 @@ + + + + diff --git a/bigtop-manager-ui/src/pages/cluster-manage/cluster/create.vue b/bigtop-manager-ui/src/pages/cluster-manage/cluster/create.vue index 774827d77..66316eac3 100644 --- a/bigtop-manager-ui/src/pages/cluster-manage/cluster/create.vue +++ b/bigtop-manager-ui/src/pages/cluster-manage/cluster/create.vue @@ -19,8 +19,11 @@