Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIGTOP-4358: Add cluster creation page #174

Merged
merged 42 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
5169942
feat: init cluster
FU-design Dec 10, 2024
0f9021c
feat: add dashoard page
FU-design Dec 12, 2024
7796407
feat: add chart for cluster
FU-design Dec 18, 2024
0c33612
feat: Add overview page for Cluster
FU-design Dec 19, 2024
6492e17
feat: Add service for Cluster
FU-design Dec 19, 2024
f415185
feat: Update cluster create
FU-design Dec 19, 2024
46e214c
feat: Add cluster locale
FU-design Dec 19, 2024
7715b1f
feat: Add host-chonfig page
FU-design Dec 20, 2024
d02d256
feat: Add check-workflow page
FU-design Dec 20, 2024
3f2bd7b
feat: Add set-source page
FU-design Dec 20, 2024
e0df4a9
feat: Update set-source page
FU-design Dec 22, 2024
4707a21
feat: Update set-source page
FU-design Dec 23, 2024
35547d0
feat: Update set-source page
FU-design Dec 23, 2024
1f6766d
feat: Add service page
FU-design Dec 23, 2024
573d437
feat: Add pang images
FU-design Dec 26, 2024
41c7fee
feat: Add common component is status-dot
FU-design Dec 26, 2024
6688356
feat: add tab for cluster of home
FU-design Dec 27, 2024
9756e28
feat: rename task to job
FU-design Dec 27, 2024
3c335ff
feat: add api about cluster
FU-design Dec 30, 2024
6d5e944
feat: update api about Cluster
FU-design Dec 31, 2024
d0b3c5c
feat: update api about Cluster
FU-design Dec 31, 2024
d5cc432
Merge remote-tracking branch 'origin/main' into bigtop-ui-feature
FU-design Jan 14, 2025
04173ed
refactor: refact style of service card
FU-design Jan 15, 2025
249c8ca
feat: update search-form component
FU-design Jan 15, 2025
428eb7a
feat: rename search-form to filter-form
FU-design Jan 16, 2025
1bc9ecf
feat: add deepseek png
FU-design Feb 6, 2025
fff235b
feat: add cluster unavailable message
FU-design Feb 6, 2025
804c8d1
feat: add stack store
FU-design Feb 7, 2025
aaa34ea
feat: Complete the creation of the cluster
FU-design Feb 9, 2025
011ea1d
Merge remote-tracking branch 'origin/main' into bigtop-ui-feature
FU-design Feb 9, 2025
7515f8e
feat: Update api of jobs
FU-design Feb 10, 2025
8fa772f
feat: Update job details display page for new clusters
FU-design Feb 10, 2025
907a2d6
feat: Update cluster menu display in sidebar
FU-design Feb 10, 2025
4e14e81
feat: Add status of cluster menu in sidebar
FU-design Feb 10, 2025
8eecfbd
Merge remote-tracking branch 'origin/main' into bigtop-ui-feature
FU-design Feb 10, 2025
1a2ccd7
feat: Resolve typescript error
FU-design Feb 10, 2025
152c700
feat: Resolve ut error
FU-design Feb 10, 2025
845968d
fix: bug fixed
FU-design Feb 10, 2025
5e182ab
fix: bug fixed
FU-design Feb 11, 2025
74c944c
fix: bug fixed
FU-design Feb 11, 2025
bd44e72
fix: bug fixed
FU-design Feb 11, 2025
a7a796e
fix: bug fixed
FU-design Feb 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions bigtop-manager-ui/src/api/cluster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,24 @@
*/

import request from '@/api/request.ts'
import { ClusterVO } from '@/api/cluster/types.ts'
import type { ClusterVO, UpdateClusterParam } from './types'

export const getClusters = (): Promise<ClusterVO[]> => {
export const getCluster = (id: number): Promise<ClusterVO[]> => {
return request({
method: 'get',
url: `/clusters/${id}`
})
}

export const updateCluster = (id: number, data: UpdateClusterParam) => {
return request({
method: 'put',
url: `/clusters/${id}`,
data
})
}

export const getClusterList = (): Promise<ClusterVO[]> => {
return request({
method: 'get',
url: '/clusters'
Expand Down
37 changes: 15 additions & 22 deletions bigtop-manager-ui/src/api/cluster/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,21 @@
* under the License.
*/

export interface ClusterReq {
clusterName: string
clusterType: number
stackName: string
stackVersion: string
repoInfoList: RepoReq[]
hostnames: string[]
}
export type UpdateClusterParam = { name: string; desc: string }

export interface ClusterVO {
id: number
clusterName: string
clusterType: number
stackName: string
stackVersion: string
selected: boolean
}

export interface RepoReq {
repoId: string
repoName: string
baseUrl: string
os: string
arch: string
createUser?: string
desc?: string
displayName?: string
id?: number
name?: string
rootDir?: string
status?: number
totalDisk?: number
totalHost?: number
totalMemory?: number
totalProcessor?: number
totalService?: number
type?: number
userGroup?: string
}
4 changes: 2 additions & 2 deletions bigtop-manager-ui/src/api/command/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
*/

import request from '@/api/request.ts'
import { CommandVO } from '@/api/command/types.ts'
import { CommandRequest, CommandVO } from '@/api/command/types.ts'

export const execCommand = (data: any): Promise<CommandVO> => {
export const execCommand = (data: CommandRequest): Promise<CommandVO> => {
return request({
method: 'post',
url: '/command',
Expand Down
120 changes: 118 additions & 2 deletions bigtop-manager-ui/src/api/command/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,123 @@
* under the License.
*/

export interface CommandRequest {
clusterCommand?: ClusterCommandReq
clusterId?: number
command: Command
commandLevel: CommandLevel
componentCommands?: ComponentCommandReq[]
customCommand?: string
hostCommands?: HostCommandReq[]
serviceCommands?: ServiceCommandReq[]
[property: string]: any
}

export interface ClusterCommandReq {
desc?: string
displayName: string
hosts: HostReq[]
name: string
rootDir?: string
type: number
userGroup?: string
[property: string]: any
}

export interface HostReq {
agentDir?: string
authType?: number | string
clusterId?: number
desc?: string
grpcPort?: number
hostnames?: string[]
sshKeyFilename?: string
sshKeyPassword?: string
sshKeyString?: string
sshPassword?: string
sshPort?: number
sshUser?: string
[property: string]: any
}

export enum Command {
Add = 'Add',
Check = 'Check',
Configure = 'Configure',
Custom = 'Custom',
Init = 'Init',
Prepare = 'Prepare',
Restart = 'Restart',
Start = 'Start',
Status = 'Status',
Stop = 'Stop'
}

export enum CommandLevel {
Cluster = 'cluster',
Component = 'component',
Host = 'host',
Service = 'service'
}

export interface ComponentCommandReq {
componentName: string
hostnames: string[]
[property: string]: any
}

export interface HostCommandReq {
agentDir?: string
authType?: number
clusterId?: number
desc?: string
grpcPort?: number
hostnames?: string[]
sshKeyFilename?: string
sshKeyPassword?: string
sshKeyString?: string
sshPassword?: string
sshPort?: number
sshUser?: string
[property: string]: any
}

export interface ServiceCommandReq {
componentHosts: ComponentHostReq[]
configs: ServiceConfigReq[]
serviceName: string
[property: string]: any
}

export interface ComponentHostReq {
componentName: string
hostnames: string[]
[property: string]: any
}

export interface ServiceConfigReq {
id?: number
name?: string
properties?: PropertyReq[]
[property: string]: any
}

export interface PropertyReq {
attrs?: AttrsReq
desc?: string
displayName?: string
name: string
value?: string
[property: string]: any
}

export interface AttrsReq {
type?: string
[property: string]: any
}

export interface CommandVO {
id: number
state: string
id?: number
state?: string
[property: string]: any
}
10 changes: 0 additions & 10 deletions bigtop-manager-ui/src/api/component/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,3 @@
* specific language governing permissions and limitations
* under the License.
*/

import { HostComponentVO } from '@/api/component/types.ts'
import request from '@/api/request.ts'

export const getHostComponents = (clusterId: number): Promise<HostComponentVO[]> => {
return request({
method: 'get',
url: '/clusters/' + clusterId + '/host-components'
})
}
46 changes: 23 additions & 23 deletions bigtop-manager-ui/src/api/component/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,30 @@
* under the License.
*/

import { MaintainState } from '@/enums/state'

/**
* ComponentVO
*/
export interface ComponentVO {
id: number
componentName: string
displayName: string
category: string
serviceName: string
clusterName: string
cardinality: string
cardinality?: string
category?: string
displayName?: string
hostname?: string
id?: number
name?: string
quickLink?: QuickLinkVO
serviceDisplayName?: string
serviceId?: number
serviceName?: string
stack?: string
status?: number
[property: string]: any
}

export interface ServiceComponentVO {
serviceName: string
components: ComponentVO[]
}

export interface HostComponentVO {
id: number
componentName: string
displayName: string
category: string
serviceName: string
clusterName: string
hostname: string
state: MaintainState
/**
* QuickLinkVO
*/
export interface QuickLinkVO {
displayName?: string
url?: string
[property: string]: any
}
29 changes: 26 additions & 3 deletions bigtop-manager-ui/src/api/hosts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,34 @@
*/

import request from '@/api/request.ts'
import { HostVO } from '@/api/hosts/types.ts'
import { HostParams, HostVO, HostVOList, InstalledStatusVO } from '@/api/hosts/types.ts'

export const getHosts = (clusterId: number): Promise<HostVO[]> => {
export const getHosts = (): Promise<HostVOList> => {
return request({
method: 'get',
url: '/clusters/' + clusterId + '/hosts'
url: '/hosts'
})
}

export const addHost = (data: HostParams): Promise<HostVO> => {
return request({
method: 'post',
url: '/hosts',
data
})
}

export const installDependencies = (data: HostParams) => {
return request({
method: 'post',
url: '/hosts/install-dependencies',
data
})
}

export const getInstalledStatus = (): Promise<InstalledStatusVO[]> => {
return request({
method: 'get',
url: '/hosts/installed-status'
})
}
75 changes: 63 additions & 12 deletions bigtop-manager-ui/src/api/hosts/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,68 @@
* under the License.
*/

import type { PageVO } from '@/api/types'

export type HostVOList = PageVO<HostVO>

/**
* HostVO
*/
export interface HostVO {
id: number
clusterName: string
hostname: string
ipv4: string
arch: string
os: string
availableProcessors: string
freeMemorySize: string
totalMemorySize: string
state: string
freeDisk: string
totalDisk: string
agentDir?: string
arch?: string
authType?: number
availableProcessors?: number
clusterDisplayName?: string
clusterName?: string
componentNum?: number
desc?: string
errInfo?: string
freeDisk?: number
freeMemorySize?: number
grpcPort?: number
hostname?: string
id?: number
ipv4?: string
ipv6?: string
os?: string
sshKeyFilename?: string
sshKeyPassword?: string
sshKeyString?: string
sshPassword?: string
sshPort?: number
sshUser?: string
status?: number
totalDisk?: number
totalMemorySize?: number
[property: string]: any
}

export interface HostParams {
agentDir?: string
authType?: number | string // '1-password,2-key,3-no_auth',
clusterId?: number
desc?: string
grpcPort?: number
hostnames?: string[]
sshKeyFilename?: string
sshKeyPassword?: string
sshKeyString?: string
sshPassword?: string
sshPort?: number
sshUser?: string
[property: string]: any
}

export interface InstalledStatusVO {
hostname?: string
message?: string
status?: Status
}

export enum Status {
Failed = 'FAILED',
Installing = 'INSTALLING',
Success = 'SUCCESS',
Unknown = 'UNKNOW'
}
Loading
Loading