Skip to content

Commit

Permalink
[Improve] FE page minor improvement (#4021)
Browse files Browse the repository at this point in the history
* [Improve] FE page minor improvement
  • Loading branch information
wolfboys authored Sep 2, 2024
1 parent 636db87 commit 9fa1167
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ public class FlinkClusterController {

@Autowired private ServiceHelper serviceHelper;

@PostMapping("page")
public RestResponse findPage(FlinkCluster flinkCluster, RestRequest restRequest) {
IPage<FlinkCluster> flinkClusters = flinkClusterService.findPage(flinkCluster, restRequest);
return RestResponse.success(flinkClusters);
}

@PostMapping("list")
public RestResponse list(FlinkCluster flinkCluster, RestRequest restRequest) {
IPage<FlinkCluster> flinkClusters = flinkClusterService.findPage(flinkCluster, restRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Validated
@RestController
Expand All @@ -39,12 +41,18 @@ public class FlinkEnvController {

@Autowired private FlinkEnvService flinkEnvService;

@PostMapping("list")
public RestResponse list(FlinkEnv flinkEnv, RestRequest restRequest) {
@PostMapping("page")
public RestResponse findPage(FlinkEnv flinkEnv, RestRequest restRequest) {
IPage<FlinkEnv> envs = flinkEnvService.findPage(flinkEnv, restRequest);
return RestResponse.success(envs);
}

@PostMapping("list")
public RestResponse list() {
List<FlinkEnv> envs = flinkEnvService.list();
return RestResponse.success(envs);
}

@PostMapping("check")
public RestResponse check(FlinkEnv version) {
Integer checkResp = flinkEnvService.check(version);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ enum APP_API {
COPY = '/flink/app/copy',
UPLOAD = '/flink/app/upload',
K8S_START_LOG = '/flink/app/k8sStartLog',
DEPLOY = '/flink/app/deploy',
MAPPING = '/flink/app/mapping',
YARN = '/flink/app/yarn',
LIST = '/flink/app/list',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { defHttp } from '/@/utils/http/axios';
import { BasicTableParams } from '/@/api/model/baseModel';

enum FLINK_API {
PAGE = '/flink/cluster/page',
LIST = '/flink/cluster/list',
REMOTE_URL = '/flink/cluster/remoteUrl',
CREATE = '/flink/cluster/create',
Expand All @@ -31,6 +32,17 @@ enum FLINK_API {
SHUTDOWN = '/flink/cluster/shutdown',
DELETE = '/flink/cluster/delete',
}

/**
* flink cluster
* @returns Promise<FlinkEnv[]>
*/
export function pageFlinkCluster(data: BasicTableParams) {
return defHttp.post<FlinkCluster[]>({
url: FLINK_API.PAGE,
data,
});
}
/**
* flink cluster
* @returns Promise<FlinkEnv[]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { defHttp } from '/@/utils/http/axios';
import { BasicTableParams } from '/@/api/model/baseModel';

enum FLINK_API {
PAGE = '/flink/env/page',
LIST = '/flink/env/list',
CREATE = '/flink/env/create',
DELETE = '/flink/env/delete',
Expand All @@ -31,6 +32,18 @@ enum FLINK_API {
DEFAULT = '/flink/env/default',
VALIDITY = '/flink/env/validity',
}

/**
* flink environment data
* @returns Promise<FlinkEnv[]>
*/
export function pageFlinkEnv(data: BasicTableParams) {
return defHttp.post<FlinkEnv[]>({
url: FLINK_API.PAGE,
data,
});
}

/**
* flink environment data
* @returns Promise<FlinkEnv[]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export default {
add: 'Add',
success: 'successful',
fail: 'failed',
searchByUser: 'Search by username',
searchByRole: 'Search by role',
table: {
title: 'Member List',
userName: 'Search by username',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default {
searchByTeam: 'Search by team name',
table: {
title: 'Team List',
teamName: 'Team',
teamName: 'Team name',
teamNamePlaceholder: 'please enter Team Name',
description: 'Description',
descriptionMessage: 'exceeds maximum length limit of 100 characters',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export default {
add: '添加',
success: '成功',
fail: '失败',
searchByUser: '根据用户名搜索',
searchByRole: '根据角色名称搜索',
table: {
title: '成员列表',
userName: '根据用户名搜索',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
fetchClusterRemove,
fetchClusterShutdown,
fetchClusterStart,
fetchFlinkCluster,
pageFlinkCluster,
} from '/@/api/flink/setting/flinkCluster';
import { FlinkCluster } from '/@/api/flink/setting/types/flinkCluster.type';
import { useGo } from '/@/hooks/web/usePage';
Expand Down Expand Up @@ -55,7 +55,7 @@
const { t } = useI18n();
const { Swal, createMessage } = useMessage();
const [registerTable, { reload, getLoading }] = useTable({
api: fetchFlinkCluster,
api: pageFlinkCluster,
columns: [
{ dataIndex: 'clusterName', title: t('setting.flinkCluster.form.clusterName') },
{ dataIndex: 'executionMode', title: t('setting.flinkCluster.form.executionMode') },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import {
fetchValidity,
fetchDefaultSet,
fetchFlinkEnv,
pageFlinkEnv,
fetchFlinkEnvRemove,
fetchFlinkInfo,
} from '/@/api/flink/setting/flinkEnv';
Expand All @@ -44,7 +44,7 @@
const [registerModal, { openModal: openFlinkModal }] = useModal();
const [registerFlinkDraw, { openDrawer: openEnvDrawer }] = useDrawer();
const [registerTable, { reload, getDataSource }] = useTable({
api: fetchFlinkEnv,
api: pageFlinkEnv,
columns: [
{ dataIndex: 'flinkName', title: t('setting.flinkHome.flinkName') },
{ dataIndex: 'flinkHome', title: t('setting.flinkHome.flinkHome') },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
label: '',
component: 'Input',
componentProps: {
placeholder: t('system.member.table.userName'),
placeholder: t('system.member.searchByUser'),
allowClear: true,
},
colProps: { span: 5 },
Expand All @@ -102,7 +102,7 @@
label: '',
component: 'Select',
componentProps: {
placeholder: t('system.member.table.roleName'),
placeholder: t('system.member.searchByRole'),
options: unref(roleListOptions),
fieldNames: { label: 'roleName', value: 'roleName' },
allowClear: true,
Expand Down

0 comments on commit 9fa1167

Please sign in to comment.