Skip to content

Commit

Permalink
refactor docs and fix some bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzm0809 committed Dec 27, 2023
1 parent 6ba0014 commit 817b11d
Show file tree
Hide file tree
Showing 42 changed files with 171 additions and 3,825 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,8 @@ Thanks to [JetBrains](https://www.jetbrains.com/?from=dlink) for providing a fre

Please refer to the [LICENSE](https://github.com/DataLinkDC/dinky/blob/dev/LICENSE) document.

# Contributors

<a href="https://github.com/DataLinkDC/dinky/graphs/contributors">
<img src="https://contrib.rocks/image?repo=DataLinkDC/dinky" />
</a>
8 changes: 7 additions & 1 deletion README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,10 @@ Dinky 是一个 `开箱即用` 、`易扩展` ,以 `Apache Flink` 为基础,

## 版权

请参考 [LICENSE](https://github.com/DataLinkDC/dinky/blob/dev/LICENSE) 文件。
请参考 [LICENSE](https://github.com/DataLinkDC/dinky/blob/dev/LICENSE) 文件。

# 贡献者

<a href="https://github.com/DataLinkDC/dinky/graphs/contributors">
<img src="https://contrib.rocks/image?repo=DataLinkDC/dinky" />
</a>
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@

import StatusTag from '@/components/JobTags/StatusTag';
import { JobProps } from '@/pages/DevOps/JobDetail/data';
import { parseByteStr, parseMilliSecondStr, parseNumStr } from '@/utils/function';
import {
formatTimestampToYYYYMMDDHHMMSS,
parseByteStr,
parseMilliSecondStr,
parseNumStr
} from '@/utils/function';
import { l } from '@/utils/intl';
import { ProCard, ProColumns, ProTable } from '@ant-design/pro-components';
import { Typography } from 'antd';
import dayjs from "dayjs";

const { Link } = Typography;

Expand All @@ -32,8 +38,10 @@ export type VerticesTableListItem = {
metrics: any;
parallelism: number;
startTime?: number;
'start-time'?: number;
duration?: number;
endTime?: number;
'end-time'?: number;
tasks: any;
};

Expand Down Expand Up @@ -101,15 +109,14 @@ const FlinkTable = (props: JobProps): JSX.Element => {
},
{
title: l('global.table.startTime'),
dataIndex: 'startTime',
valueType: 'dateTime'
render: (dom, entity) => {
return entity.startTime === -1 || entity['start-time'] === -1 ? '-' : formatTimestampToYYYYMMDDHHMMSS(entity['start-time'] as number) || formatTimestampToYYYYMMDDHHMMSS(entity.startTime as number);
}
},
{
title: l('global.table.endTime'),
dataIndex: 'endTime',
valueType: 'dateTime',
render: (dom, entity) => {
return entity.endTime === -1 ? '-' : entity.endTime;
return entity.endTime === -1 || entity['end-time'] === -1 ? '-' : formatTimestampToYYYYMMDDHHMMSS(entity['end-time'] as number) || formatTimestampToYYYYMMDDHHMMSS(entity.startTime as number);
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const JobDesc = (props: JobProps) => {

<Descriptions.Item label={l('devops.jobinfo.config.RestartStrategy')}>
<Tag color='blue' title={'Restart Strategy'}>
{jobDetail?.jobDataDto?.config?.executionConfig?.restartStrategy}
{jobDetail?.jobDataDto?.config["execution-config"]["restart-strategy"]}
</Tag>
</Descriptions.Item>

Expand All @@ -109,13 +109,13 @@ const JobDesc = (props: JobProps) => {
</Descriptions.Item>

<Descriptions.Item label={l('devops.jobinfo.config.useSqlFragment')}>
{jobDetail?.history?.configJson?.useSqlFragment
{jobDetail?.history?.configJson?.fragment
? l('button.enable')
: l('button.disable')}
</Descriptions.Item>

<Descriptions.Item label={l('devops.jobinfo.config.execmode')}>
{jobDetail?.history?.configJson?.useBatchModel
{jobDetail?.history?.configJson?.batchModel
? l('global.table.execmode.batch')
: l('global.table.execmode.streaming')}
</Descriptions.Item>
Expand All @@ -125,7 +125,7 @@ const JobDesc = (props: JobProps) => {
</Descriptions.Item>

<Descriptions.Item label={l('devops.jobinfo.config.JobParallelism')}>
{jobDetail?.jobDataDto?.config?.executionConfig?.jobParallelism}
{jobDetail?.jobDataDto?.config["execution-config"]["job-parallelism"]}
</Descriptions.Item>

<Descriptions.Item label={l('global.table.useTime')}>
Expand All @@ -137,7 +137,7 @@ const JobDesc = (props: JobProps) => {
</Descriptions.Item>

<Descriptions.Item label={l('devops.jobinfo.config.savePointPath')} span={2}>
{jobDetail?.history?.configJson.savePointPath}
{jobDetail?.history?.configJson?.configJson['state.savepoints.dir'] ?? '-'}
</Descriptions.Item>
</Descriptions>
</ProCard>
Expand Down
2 changes: 1 addition & 1 deletion dinky-web/src/pages/DevOps/JobDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const JobDetail = (props: any) => {
pollingInterval: 3000
});

const jobInfoDetail: Jobs.JobInfoDetail = data;
const jobInfoDetail = data as Jobs.JobInfoDetail;

const [tabKey, setTabKey] = useState<string>(OperatorEnum.JOB_BASE_INFO);

Expand Down
72 changes: 67 additions & 5 deletions dinky-web/src/types/DevOps/data.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { BaseBeanColumns } from '@/types/Public/data';
import { Alert } from '@/types/RegCenter/data.d';
import {Alert, Cluster} from '@/types/RegCenter/data.d';

/**
* about flink job
Expand Down Expand Up @@ -48,6 +48,63 @@ declare namespace Jobs {
useBatchModel: string;
};

export type ExecutorSetting = {
type: string;
host: string;
port: number;
useBatchModel: boolean;
checkpoint: string;
parallelism: number;
useSqlFragment: boolean;
useStatementSet: boolean;
savePointPath: string;
jobName: string;
config: Map<string, string>;
variables: Map<string, string>;
jarFiles: [];
jobManagerAddress: string;
plan: boolean;
remote: boolean;
validParallelism: boolean;
validJobName: boolean;
validHost: boolean;
validPort: boolean;
validConfig: boolean;
validVariables: boolean;
validJarFiles: boolean;
};

export type JobConfigJsonInfo = {
type: string;
checkpoint: string;
savePointStrategy: string;
savePointPath: string;
parallelism: number;
clusterId: number;
clusterConfigurationId: number;
step: number;
configJson: {
'state.savepoints.dir': string;
};
useResult: boolean;
useChangeLog: boolean;
useAutoCancel: boolean;
useRemote: boolean;
address: string;
taskId: number;
jarFiles: [];
pyFiles: [];
jobName: string;
fragment: boolean;
statementSet: boolean;
batchModel: boolean;
maxRowNum: number;
gatewayConfig: any;
variables: Map<string, string>;
executorSetting: ExecutorSetting;
};


export type History = {
id: number;
tenantId: number;
Expand All @@ -61,7 +118,7 @@ declare namespace Jobs {
type: string;
error: string;
result: string;
configJson: JobConfig;
configJson: JobConfigJsonInfo;
startTime: string;
endTime: string;
taskId: number;
Expand Down Expand Up @@ -166,13 +223,18 @@ declare namespace Jobs {
jid: string;
name: string;
executionConfig: ExecutionConfig;
'execution-config': ExecutionConfig;
};
export type ExecutionConfig = {
executionMode: string;
'execution-mode': string;
restartStrategy: string;
'restart-strategy': string;
jobParallelism: number;
objectReuse: boolean;
'job-parallelism': number;
'object-reuse': boolean;
userConfig: any;
'user-config': any;
};

export type JobDataDtoItem = {
Expand All @@ -191,8 +253,8 @@ declare namespace Jobs {
export type JobInfoDetail = {
id: number;
instance: JobInstance;
clusterInstance: any;
clusterConfiguration: any;
clusterInstance: Cluster.Instance;
clusterConfiguration: Cluster.Config;
history: History;
jobDataDto: JobDataDtoItem;
jobManagerConfiguration: any;
Expand Down
8 changes: 7 additions & 1 deletion dinky-web/src/utils/function.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import { l } from '@/utils/intl';
import { Monaco } from '@monaco-editor/react';
import dayjs from 'dayjs';
import cookies from 'js-cookie';
import { trim } from 'lodash';
import { editor, KeyCode, KeyMod } from 'monaco-editor';
import path from 'path';
import { format } from 'sql-formatter';
Expand Down Expand Up @@ -619,6 +618,13 @@ export const formatDateToYYYYMMDDHHMMSS = (date: Date) => {
return dayjs(date).format(DATETIME_FORMAT);
};

export const formatTimestampToYYYYMMDDHHMMSS = (timestamp: number) => {
if (timestamp == null) {
return '-';
}
return dayjs(timestamp).format(DATETIME_FORMAT);
};

export const parseDateStringToDate = (dateString: Date) => {
return dayjs(dateString).toDate();
};
Loading

0 comments on commit 817b11d

Please sign in to comment.