diff --git a/amoro-web/mock/modules/optimize.js b/amoro-web/mock/modules/optimize.js index 81207ee18e..d8f275e50e 100644 --- a/amoro-web/mock/modules/optimize.js +++ b/amoro-web/mock/modules/optimize.js @@ -37,6 +37,15 @@ export default [ result: ['container1', 'container2'] }), }, + { + url: '/mock/ams/v1/optimize/actions', + method: 'get', + response: () => ({ + code: 200, + msg: 'success', + result: ['major', 'minor', 'clean', 'idle', 'pending'] + }), + }, { url: '/mock/ams/v1/optimize/optimizerGroups/:groups/tables', method: 'get', diff --git a/amoro-web/src/services/optimize.service.ts b/amoro-web/src/services/optimize.service.ts index cd1c368078..0b44e981e6 100644 --- a/amoro-web/src/services/optimize.service.ts +++ b/amoro-web/src/services/optimize.service.ts @@ -22,6 +22,10 @@ export function getOptimizerGroups() { return request.get('ams/v1/optimize/optimizerGroups') } +export function getOptimizerAction() { + return request.get('/ams/v1/optimize/actions') +} + export function getOptimizerTableList( params: { optimizerGroup: string @@ -29,10 +33,11 @@ export function getOptimizerTableList( tableSearchInput: string page: number pageSize: number + actions: string[] }, ) { - const { optimizerGroup, dbSearchInput, tableSearchInput, page, pageSize } = params - return request.get(`ams/v1/optimize/optimizerGroups/${optimizerGroup}/tables`, { params: { dbSearchInput, tableSearchInput, page, pageSize } }) + const { optimizerGroup, dbSearchInput, tableSearchInput, page, pageSize, actions } = params + return request.get(`ams/v1/optimize/optimizerGroups/${optimizerGroup}/tables`, { params: { dbSearchInput, tableSearchInput, page, pageSize, actions } }) } export function getOptimizerResourceList( diff --git a/amoro-web/src/types/common.type.ts b/amoro-web/src/types/common.type.ts index a2da8d9dfe..049a74aeda 100644 --- a/amoro-web/src/types/common.type.ts +++ b/amoro-web/src/types/common.type.ts @@ -271,7 +271,6 @@ export interface IOptimizeTableItem { quotaOccupationDesc: string duration: number durationDesc: string - durationDisplay: string fileSizeDesc: string tableIdentifier: ITableIdentifier tableNameOnly?: string diff --git a/amoro-web/src/utils/table.ts b/amoro-web/src/utils/table.ts new file mode 100644 index 0000000000..5e44204e99 --- /dev/null +++ b/amoro-web/src/utils/table.ts @@ -0,0 +1,26 @@ +/* + * 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. + */ + +/** + * Calculate table max width + */ +export function getTableMaxWidth(columns: Array<{ width: number }>) { + return columns.reduce((pre: number, cur: { width: number }) => { + return pre + cur.width + }, 0) +} diff --git a/amoro-web/src/views/optimize/components/List.vue b/amoro-web/src/views/optimize/components/List.vue index 6dff19dd2e..2a0b599bb7 100644 --- a/amoro-web/src/views/optimize/components/List.vue +++ b/amoro-web/src/views/optimize/components/List.vue @@ -17,15 +17,16 @@ limitations under the License. / --> @@ -179,6 +193,11 @@ onMounted(() => { :placeholder="placeholder.filterTablePh" /> + + {{ t('search') }} @@ -187,18 +206,34 @@ onMounted(() => {