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

[refactor/queue][taier-ui]move queueConfig from rightbar to create config #795

Merged
merged 1 commit into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added taier-ui/public/images/OceanBase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 40 additions & 1 deletion taier-ui/src/components/scaffolds/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import {
FLINK_VERSION_TYPE,
PythonVersionKind,
} from '@/constant';
import { Button, Empty, Form, Input, Radio, Select } from 'antd';
import { Button, Empty, Form, Input, Radio, Select, Spin } from 'antd';
import { syncModeHelp, syncTaskHelp } from '../helpDoc/docs';
import FolderPicker from '../folderPicker';
import resourceManagerTree from '@/services/resourceManagerService';
import { dataSourceService, taskRenderService } from '@/services';
import { useEffect, useState } from 'react';
import { IDataSourceProps } from '@/interface';
import molecule from '@dtinsight/molecule';
import api from '@/api';

interface ICreateFormProps {
disabled?: boolean;
Expand Down Expand Up @@ -243,6 +244,43 @@ const DataSource = () => {
);
};

const QueueConfig = () => {
const [resourceList, setResourceList] = useState<string[]>([]);
const [fetching, setFetching] = useState(false);

useEffect(() => {
setFetching(true);
api.getResourceByTenant({})
.then((res) => {
if (res.code === 1) {
setResourceList(res.data.queues?.map((q: any) => q.queueName));
}
})
.finally(() => {
setFetching(false);
});
}, []);

return (
<Form.Item label="YARN 队列" name="queueName">
<Select
placeholder="请选择 YARN 队列"
getPopupContainer={(node) => node.parentNode}
options={resourceList.map((r) => ({ label: r, value: r }))}
showSearch
optionFilterProp="label"
notFoundContent={
fetching ? (
<Spin spinning={fetching} />
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)
}
/>
</Form.Item>
);
};

/**
* key 值为服务端字段名,value 为组件名
*/
Expand All @@ -255,4 +293,5 @@ export default {
exeArgs: ExeArgs,
pythonVersion: PythonVersion,
datasource: DataSource,
queue: QueueConfig,
} as Record<string, (...args: any[]) => JSX.Element>;
1 change: 0 additions & 1 deletion taier-ui/src/components/task/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ const Create = connect(

if (formFields) {
formFields.taskProperties.formField?.forEach((field) => {
console.log('field;', field);
// 特殊处理
if (field === 'syncModel') {
form.setFieldsValue({
Expand Down
2 changes: 2 additions & 0 deletions taier-ui/src/constant/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ export enum TASK_TYPE_ENUM {
FLINK = 11,
PYTHON = 12,
SHELL = 13,
CLICKHOUSE = 26
}

/**
Expand Down Expand Up @@ -528,6 +529,7 @@ export const DATA_SOURCE_TEXT: Partial<{ [key in DATA_SOURCE_ENUM]: string }> =
[DATA_SOURCE_ENUM.KAFKA_HUAWEI]: 'Kafka_huawei',
[DATA_SOURCE_ENUM.HBASE_HUAWEI]: 'Hbase_huawei',
[DATA_SOURCE_ENUM.KAFKA_CONFLUENT]: 'Confluent',
[DATA_SOURCE_ENUM.DorisRestful]: 'Doris(http)',
};

/**
Expand Down
5 changes: 1 addition & 4 deletions taier-ui/src/pages/dataSource/add.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import Version from './version';
import SelectSource from './selectSource';
import InfoConfig from './InfoConfig';
import type { IDataSourceProps } from '@/interface';
import type { DATA_SOURCE_ENUM} from '@/constant';
import type { DATA_SOURCE_ENUM } from '@/constant';
import './add.scss';

const { Step } = Steps;
Expand Down Expand Up @@ -230,9 +230,6 @@ export default function Add({ record, onSubmit }: IAddProps) {
message.success('连接成功');
}
})
.catch(() => {
message.error('测试连通性请求超时');
})
.finally(() => {
setLoading(false);
setSubmitBtnStatus(false);
Expand Down
55 changes: 0 additions & 55 deletions taier-ui/src/pages/rightBar/queueConfig.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions taier-ui/src/services/rightBarService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { singleton } from 'tsyringe';
import { RightBarKind } from '@/interface';
import { taskRenderService } from '.';
import TaskConfig from '@/pages/rightBar/taskConfig';
import QueueConfig from '@/pages/rightBar/queueConfig';

interface IRightBarService {
/**
Expand Down Expand Up @@ -189,8 +188,6 @@ export default class RightBarService extends Component<IRightbarState> implement
return this.withForm(<FlinkResultPanel key="result" current={current} />);
case RightBarKind.FLINKSQL_DIMENSION:
return this.withForm(<FlinkDimensionPanel key="dimension" current={current} />);
case RightBarKind.QUEUE:
return <QueueConfig current={current} />;
default:
return null;
}
Expand Down