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-4371: Add cluster management page #179

Merged
merged 71 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 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
432f1c1
fix: bug fixed
FU-design Feb 11, 2025
000ac1e
feat: Add service store
FU-design Feb 11, 2025
406475c
feat: Add request util
FU-design Feb 12, 2025
29201ff
feat: Add task log page
FU-design Feb 12, 2025
df45d09
Add filtersParams to handle filters for use-base-table
FU-design Feb 12, 2025
4e8be95
feat: Add job component
FU-design Feb 13, 2025
678541b
feat: Add view log in cluster creation page
FU-design Feb 13, 2025
2ce229d
feat: Add I18n of overview
FU-design Feb 13, 2025
3da07fb
fix: Add null and undefined checks to processData function
FU-design Feb 14, 2025
e01e0cf
Reslove merge conflicts
FU-design Feb 14, 2025
10c85d0
feat: Rename logs-view to log-view
FU-design Feb 14, 2025
373bb62
feat: Remove sse file
FU-design Feb 14, 2025
f7e260e
feat: Update I18n of common and job
FU-design Feb 14, 2025
2a15d15
feat: Update getTaskLog to use streaming
FU-design Feb 14, 2025
86e38a6
feat: Update I18n of overview
FU-design Feb 14, 2025
aec5aa3
feat: Update locales
FU-design Feb 17, 2025
b5d92a0
feat: Add placeholder of agent path and ssh port
FU-design Feb 17, 2025
a9a5286
style: Change style
FU-design Feb 17, 2025
6f80a17
feat: Update I18n of overview
FU-design Feb 17, 2025
bfe07aa
feat: Update filter-form component
FU-design Feb 17, 2025
bbfc904
feat: Change i18n about cluster management
FU-design Feb 17, 2025
a4b18f8
feat: Remove temporary files
FU-design Feb 17, 2025
676219f
feat: Add service user list api on user of cluster management
FU-design Feb 17, 2025
a2e43df
feat: Update empty status of overview
FU-design Feb 18, 2025
a12d60f
style: style fixed
FU-design Feb 18, 2025
ddf4b94
feat: Add cluster management access interface
FU-design Feb 19, 2025
c772543
feat: Stop polling jobs when response is in error
FU-design Feb 19, 2025
fb26326
feat: Add loading state to cluster details page
FU-design Feb 19, 2025
a99610f
Merge remote-tracking branch 'origin/main' into bigtop-ui-feature
FU-design Feb 19, 2025
736da23
fix: Typescript error fixed
FU-design Feb 19, 2025
9f803f0
feat: Implement progress status display for job list
FU-design Feb 19, 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
13 changes: 11 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,10 @@
*/

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

export const getCluster = (id: number): Promise<ClusterVO[]> => {
export const getCluster = (id: number): Promise<ClusterVO> => {
return request({
method: 'get',
url: `/clusters/${id}`
Expand All @@ -41,3 +42,11 @@ export const getClusterList = (): Promise<ClusterVO[]> => {
url: '/clusters'
})
}

export const getUserListOfService = (id: number, params: ListParams): Promise<PageVO<ServiceUserVO[]>> => {
return request({
method: 'get',
url: `/clusters/${id}/services/users`,
params
})
}
12 changes: 11 additions & 1 deletion bigtop-manager-ui/src/api/cluster/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@

export type UpdateClusterParam = { name: string; desc: string }

export type ClusterStatusType = 1 | 2 | 3

export interface ClusterVO {
createUser?: string
desc?: string
displayName?: string
id?: number
name?: string
rootDir?: string
status?: number
status?: ClusterStatusType
totalDisk?: number
totalHost?: number
totalMemory?: number
Expand All @@ -35,3 +37,11 @@ export interface ClusterVO {
type?: number
userGroup?: string
}

export interface ServiceUserVO {
desc?: string
displayName?: string
user?: string
userGroup?: string
[property: string]: any
}
12 changes: 6 additions & 6 deletions bigtop-manager-ui/src/api/command/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
export interface CommandRequest {
clusterCommand?: ClusterCommandReq
clusterId?: number
command: Command
commandLevel: CommandLevel
command: keyof typeof Command
commandLevel: keyof typeof CommandLevel
componentCommands?: ComponentCommandReq[]
customCommand?: string
hostCommands?: HostCommandReq[]
Expand Down Expand Up @@ -70,10 +70,10 @@ export enum Command {
}

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

export interface ComponentCommandReq {
Expand Down
7 changes: 4 additions & 3 deletions bigtop-manager-ui/src/api/hosts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
*/

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

export const getHosts = (): Promise<HostVOList> => {
export const getHosts = (params?: HostListParams): Promise<HostVOList> => {
return request({
method: 'get',
url: '/hosts'
url: '/hosts',
params
})
}

Expand Down
20 changes: 19 additions & 1 deletion bigtop-manager-ui/src/api/hosts/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ export interface HostVO {
[property: string]: any
}

export interface HostListParams {
clusterId?: number
hostname?: string
ipv4?: string
orderBy?: string
pageNum?: number
pageSize?: number
sort?: string
status?: number
}

export interface HostParams {
agentDir?: string
authType?: number | string // '1-password,2-key,3-no_auth',
Expand All @@ -77,8 +88,15 @@ export interface InstalledStatusVO {
}

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

export enum BaseStatus {
'INSTALLING',
'SUCCESS',
'FAILED',
'UNKNOW'
}
70 changes: 40 additions & 30 deletions bigtop-manager-ui/src/api/job/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,47 +16,57 @@
* specific language governing permissions and limitations
* under the License.
*/
import request from '@/api/request.ts'
import type { JobParams, JobList, TaskLogParams, TaskParams, JobVO, StageVO, TaskVO } from './types'
import type {
JobParams,
JobList,
TaskLogParams,
JobVO,
JobListParams,
TaskListParams,
StageListParams,
StageList,
TaskList,
LogsRes
} from './types'
import type { ListParams } from '../types'
import { get, post } from '../request-util'
import axios, { type AxiosProgressEvent, type CancelTokenSource } from 'axios'
import request from '../request'

export const retryJob = (pathParams: JobParams): Promise<JobVO> => {
return request({
method: 'post',
url: `/clusters/${pathParams.clusterId}/jobs/${pathParams.jobId}/retry`
})
export const retryJob = (pathParams: JobParams) => {
return post<JobVO>(`/clusters/${pathParams.clusterId}/jobs/${pathParams.jobId}/retry`)
}

export const getJobList = (clusterId: number): Promise<JobList> => {
return request({
method: 'get',
url: `/clusters/${clusterId}/jobs`
})
export const getJobDetails = (pathParams: JobParams) => {
return get<JobVO>(`/clusters/${pathParams.clusterId}/jobs/${pathParams.jobId}`)
}

export const getJobDetails = (pathParams: JobParams): Promise<JobVO> => {
return request({
method: 'get',
url: `/clusters/${pathParams.clusterId}/jobs/${pathParams.jobId}`
})
export const getJobList = (pathParams: JobListParams, params: ListParams) => {
return get<JobList>(`/clusters/${pathParams.clusterId}/jobs`, params)
}

export const getStageList = (pathParams: JobParams): Promise<StageVO[]> => {
return request({
method: 'get',
url: `/clusters/${pathParams.clusterId}/jobs/${pathParams.jobId}/stages`
})
export const getStageList = (pathParams: StageListParams, params: ListParams) => {
return get<StageList>(`/clusters/${pathParams.clusterId}/jobs/${pathParams.jobId}/stages`, params)
}

export const getTaskList = (pathParams: TaskParams): Promise<TaskVO[]> => {
return request({
method: 'get',
url: `/clusters/${pathParams.clusterId}/jobs/${pathParams.jobId}/stages/${pathParams.stageId}/tasks`
})
export const getTaskList = (pathParams: TaskListParams, params: ListParams) => {
return get<TaskList>(
`/clusters/${pathParams.clusterId}/jobs/${pathParams.jobId}/stages/${pathParams.stageId}/tasks`,
params
)
}

export const getTaskLog = (pathParams: TaskLogParams): Promise<string[]> => {
return request({
export const getTaskLog = (pathParams: TaskLogParams, func: Function): LogsRes => {
const source: CancelTokenSource = axios.CancelToken.source()

const promise = request({
method: 'get',
url: `/clusters/${pathParams.clusterId}/jobs/${pathParams.jobId}/stages/${pathParams.stageId}/tasks/${pathParams.taskId}/log`
url: `/clusters/${pathParams.clusterId}/jobs/${pathParams.jobId}/stages/${pathParams.stageId}/tasks/${pathParams.taskId}/log`,
responseType: 'stream',
timeout: 0,
cancelToken: source.token,
onDownloadProgress: (progressEvent: AxiosProgressEvent) => func(progressEvent)
})

return { promise, cancel: source.cancel }
}
20 changes: 12 additions & 8 deletions bigtop-manager-ui/src/api/job/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,21 @@
*/

import type { PageVO } from '@/api/types'
import { JobState } from '@/enums/state'

export type JobList = PageVO<JobVO>
export type StageList = PageVO<StageVO>
export type TaskList = PageVO<TaskVO>

export type JobParams = { clusterId: number; jobId: number }
export type TaskParams = JobParams & { stageId: number }
export type TaskLogParams = TaskParams & { taskId: number }

export type StateType = keyof typeof State
export type StateType = keyof typeof JobState

export enum State {
'Pending' = 'pending',
'Processing' = 'processing',
'Successful' = 'successful',
'Failed' = 'failed',
'Canceled' = 'canceled'
}
export type JobListParams = { clusterId: number }
export type StageListParams = JobParams
export type TaskListParams = TaskParams

export interface JobVO {
createTime?: string
Expand Down Expand Up @@ -65,3 +64,8 @@ export interface TaskVO {
updateTime?: string
[property: string]: any
}

export interface LogsRes {
promise: Promise<any>
cancel: () => void
}
11 changes: 5 additions & 6 deletions bigtop-manager-ui/src/api/request-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,22 @@
* specific language governing permissions and limitations
* under the License.
*/
import type { ResponseEntity } from './types'
import request from './request'
import { AxiosRequestConfig } from 'axios'

const get = <T>(url: string, config?: AxiosRequestConfig): Promise<ResponseEntity<T>> => {
return request.get(url, config)
const get = <T, U = any>(url: string, params?: U, config?: AxiosRequestConfig): Promise<T> => {
return request.get(url, { ...config, params })
}

const post = <T, U = any>(url: string, data?: U, config?: AxiosRequestConfig): Promise<ResponseEntity<T>> => {
const post = <T, U = any>(url: string, data?: U, config?: AxiosRequestConfig): Promise<T> => {
return request.post(url, data, config)
}

const put = <T, U = any>(url: string, data: U, config?: AxiosRequestConfig): Promise<ResponseEntity<T>> => {
const put = <T, U = any>(url: string, data: U, config?: AxiosRequestConfig): Promise<T> => {
return request.put(url, data, config)
}

const del = <T>(url: string, config?: AxiosRequestConfig): Promise<ResponseEntity<T>> => {
const del = <T>(url: string, config?: AxiosRequestConfig): Promise<T> => {
return request.delete(url, config)
}

Expand Down
70 changes: 24 additions & 46 deletions bigtop-manager-ui/src/api/service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,73 +17,51 @@
* under the License.
*/

import type { ListParams } from '../types'
import type {
ServiceParams,
ServiceVO,
ServiceConfig,
ServiceConfigSnapshot,
ServiceList,
SnapshotData,
SnapshotRecovery
SnapshotRecovery,
ServiceListParams
} from './types'
import request from '@/api/request.ts'
import { get, post, del } from '@/api/request-util'

export const getServiceList = (clusterId: number): Promise<ServiceList> => {
return request({
method: 'get',
url: `/clusters/${clusterId}/services`
})
export const getServiceList = (clusterId: number, params?: ListParams & ServiceListParams) => {
return get<ServiceList>(`/clusters/${clusterId}/services`, params)
}

export const getService = (params: ServiceParams): Promise<ServiceVO> => {
return request({
method: 'get',
url: `/clusters/${params.clusterId}/services/${params.id}`
})
export const getService = (pathParams: ServiceParams) => {
return get<ServiceVO>(`/clusters/${pathParams.clusterId}/services/${pathParams.id}`)
}

export const getServiceConfigs = (params: ServiceParams): Promise<ServiceConfig[]> => {
return request({
method: 'get',
url: `/clusters/${params.clusterId}/services/${params.id}/configs`
})
export const getServiceConfigs = (pathParams: ServiceParams) => {
return get<ServiceConfig[]>(`/clusters/${pathParams.clusterId}/services/${pathParams.id}/configs`)
}

export const updateServiceConfigs = (params: ServiceParams, data: ServiceConfig): Promise<ServiceConfig[]> => {
return request({
method: 'post',
url: `/clusters/${params.clusterId}/services/${params.id}/configs`,
data
})
export const updateServiceConfigs = (pathParams: ServiceParams, data: ServiceConfig) => {
return post<ServiceConfig[]>(`/clusters/${pathParams.clusterId}/services/${pathParams.id}/configs`, data)
}

export const getServiceConfigSnapshotsList = (params: ServiceParams): Promise<ServiceConfigSnapshot[]> => {
return request({
method: 'get',
url: `/clusters/${params.clusterId}/services/${params.id}/config-snapshots`
})
export const getServiceConfigSnapshotsList = (pathParams: ServiceParams) => {
return get<ServiceConfigSnapshot[]>(`/clusters/${pathParams.clusterId}/services/${pathParams.id}/config-snapshots`)
}

export const takeServiceConfigSnapshot = (
params: ServiceParams,
data: SnapshotData
): Promise<ServiceConfigSnapshot> => {
return request({
method: 'post',
url: `/clusters/${params.clusterId}/services/${params.id}/config-snapshots`,
export const takeServiceConfigSnapshot = (pathParams: ServiceParams, data: SnapshotData) => {
return post<ServiceConfigSnapshot>(
`/clusters/${pathParams.clusterId}/services/${pathParams.id}/config-snapshots`,
data
})
)
}

export const recoveryServiceConfigSnapshot = (params: SnapshotRecovery): Promise<ServiceConfig[]> => {
return request({
method: 'post',
url: `/clusters/${params.clusterId}/services/${params.id}/config-snapshots/${params.snapshotId}`
})
export const recoveryServiceConfigSnapshot = (pathParams: SnapshotRecovery): Promise<ServiceConfig[]> => {
return post<ServiceConfig[]>(
`/clusters/${pathParams.clusterId}/services/${pathParams.id}/config-snapshots/${pathParams.snapshotId}`
)
}
export const deleteServiceConfigSnapshot = (params: SnapshotRecovery): Promise<boolean> => {
return request({
method: 'delete',
url: `/clusters/${params.clusterId}/services/${params.id}/config-snapshots/${params.snapshotId}`
})
export const deleteServiceConfigSnapshot = (pathParams: SnapshotRecovery): Promise<boolean> => {
return del(`/clusters/${pathParams.clusterId}/services/${pathParams.id}/config-snapshots/${pathParams.snapshotId}`)
}
Loading
Loading