|
|
|
@ -69,8 +69,9 @@ function validateRepository(_: RuleObject, value: string): Promise<[void, void]>
|
|
|
|
return Promise.resolve();
|
|
|
|
return Promise.resolve();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const isInteger = ({ min, max }: { min?: number, max?: number }) => (
|
|
|
|
const isInteger = ({ min, max }: { min?: number; max?: number }) => (
|
|
|
|
_: RuleObject, value?: number | string,
|
|
|
|
_: RuleObject,
|
|
|
|
|
|
|
|
value?: number | string,
|
|
|
|
): Promise<void> => {
|
|
|
|
): Promise<void> => {
|
|
|
|
if (typeof value === 'undefined' || value === '') {
|
|
|
|
if (typeof value === 'undefined' || value === '') {
|
|
|
|
return Promise.resolve();
|
|
|
|
return Promise.resolve();
|
|
|
|
@ -134,17 +135,20 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
|
|
|
|
const { onSubmit } = this.props;
|
|
|
|
const { onSubmit } = this.props;
|
|
|
|
if (this.formRef.current) {
|
|
|
|
if (this.formRef.current) {
|
|
|
|
this.formRef.current.resetFields();
|
|
|
|
this.formRef.current.resetFields();
|
|
|
|
return this.formRef.current.validateFields().then((values: Store): Promise<void> => {
|
|
|
|
return this.formRef.current.validateFields().then(
|
|
|
|
const frameFilter = values.frameStep ? `step=${values.frameStep}` : undefined;
|
|
|
|
(values: Store): Promise<void> => {
|
|
|
|
const entries = Object.entries(values)
|
|
|
|
const frameFilter = values.frameStep ? `step=${values.frameStep}` : undefined;
|
|
|
|
.filter((entry: [string, unknown]): boolean => entry[0] !== frameFilter);
|
|
|
|
const entries = Object.entries(values).filter(
|
|
|
|
|
|
|
|
(entry: [string, unknown]): boolean => entry[0] !== frameFilter,
|
|
|
|
onSubmit({
|
|
|
|
);
|
|
|
|
...Object.fromEntries(entries) as any as AdvancedConfiguration,
|
|
|
|
|
|
|
|
frameFilter,
|
|
|
|
onSubmit({
|
|
|
|
});
|
|
|
|
...((Object.fromEntries(entries) as any) as AdvancedConfiguration),
|
|
|
|
return Promise.resolve();
|
|
|
|
frameFilter,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
return Promise.resolve();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return Promise.reject(new Error('Form ref is empty'));
|
|
|
|
return Promise.reject(new Error('Form ref is empty'));
|
|
|
|
@ -185,13 +189,7 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
|
|
|
|
{ validator: isInteger({ min: 5, max: 100 }) },
|
|
|
|
{ validator: isInteger({ min: 5, max: 100 }) },
|
|
|
|
]}
|
|
|
|
]}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Input
|
|
|
|
<Input size='large' type='number' min={5} max={100} suffix={<PercentageOutlined />} />
|
|
|
|
size='large'
|
|
|
|
|
|
|
|
type='number'
|
|
|
|
|
|
|
|
min={5}
|
|
|
|
|
|
|
|
max={100}
|
|
|
|
|
|
|
|
suffix={<PercentageOutlined />}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -215,11 +213,7 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
|
|
|
|
private renderSegmentSize(): JSX.Element {
|
|
|
|
private renderSegmentSize(): JSX.Element {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Tooltip title='Defines a number of frames in a segment' mouseLeaveDelay={0}>
|
|
|
|
<Tooltip title='Defines a number of frames in a segment' mouseLeaveDelay={0}>
|
|
|
|
<Form.Item
|
|
|
|
<Form.Item label='Segment size' name='segmentSize' rules={[{ validator: isInteger({ min: 1 }) }]}>
|
|
|
|
label='Segment size'
|
|
|
|
|
|
|
|
name='segmentSize'
|
|
|
|
|
|
|
|
rules={[{ validator: isInteger({ min: 1 }) }]}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<Input size='large' type='number' min={1} />
|
|
|
|
<Input size='large' type='number' min={1} />
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip>
|
|
|
|
@ -228,11 +222,7 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
|
|
|
|
|
|
|
|
|
|
|
|
private renderStartFrame(): JSX.Element {
|
|
|
|
private renderStartFrame(): JSX.Element {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Form.Item
|
|
|
|
<Form.Item label='Start frame' name='startFrame' rules={[{ validator: isInteger({ min: 0 }) }]}>
|
|
|
|
label='Start frame'
|
|
|
|
|
|
|
|
name='startFrame'
|
|
|
|
|
|
|
|
rules={[{ validator: isInteger({ min: 0 }) }]}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<Input size='large' type='number' min={0} step={1} />
|
|
|
|
<Input size='large' type='number' min={0} step={1} />
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -253,11 +243,7 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
|
|
|
|
|
|
|
|
|
|
|
|
private renderFrameStep(): JSX.Element {
|
|
|
|
private renderFrameStep(): JSX.Element {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Form.Item
|
|
|
|
<Form.Item label='Frame step' name='frameStep' rules={[{ validator: isInteger({ min: 1 }) }]}>
|
|
|
|
label='Frame step'
|
|
|
|
|
|
|
|
name='frameStep'
|
|
|
|
|
|
|
|
rules={[{ validator: isInteger({ min: 1 }) }]}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<Input size='large' type='number' min={1} step={1} />
|
|
|
|
<Input size='large' type='number' min={1} step={1} />
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
@ -286,10 +272,7 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
|
|
|
|
extra='Attach a repository to store annotations there'
|
|
|
|
extra='Attach a repository to store annotations there'
|
|
|
|
rules={[{ validator: validateRepository }]}
|
|
|
|
rules={[{ validator: validateRepository }]}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Input
|
|
|
|
<Input size='large' placeholder='e.g. https//github.com/user/repos [annotation/<anno_file_name>.zip]' />
|
|
|
|
size='large'
|
|
|
|
|
|
|
|
placeholder='e.g. https//github.com/user/repos [annotation/<anno_file_name>.zip]'
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -337,11 +320,7 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
|
|
|
|
|
|
|
|
|
|
|
|
private renderCreateTaskMethod(): JSX.Element {
|
|
|
|
private renderCreateTaskMethod(): JSX.Element {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Form.Item
|
|
|
|
<Form.Item help='Using cache to store data.' name='useCache' valuePropName='checked'>
|
|
|
|
help='Using cache to store data.'
|
|
|
|
|
|
|
|
name='useCache'
|
|
|
|
|
|
|
|
valuePropName='checked'
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<Checkbox>
|
|
|
|
<Checkbox>
|
|
|
|
<Text className='cvat-text-color'>Use cache</Text>
|
|
|
|
<Text className='cvat-text-color'>Use cache</Text>
|
|
|
|
</Checkbox>
|
|
|
|
</Checkbox>
|
|
|
|
@ -370,11 +349,7 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
mouseLeaveDelay={0}
|
|
|
|
mouseLeaveDelay={0}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Form.Item
|
|
|
|
<Form.Item label='Chunk size' name='dataChunkSize' rules={[{ validator: isInteger({ min: 1 }) }]}>
|
|
|
|
label='Chunk size'
|
|
|
|
|
|
|
|
name='dataChunkSize'
|
|
|
|
|
|
|
|
rules={[{ validator: isInteger({ min: 1 }) }]}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<Input size='large' type='number' />
|
|
|
|
<Input size='large' type='number' />
|
|
|
|
</Form.Item>
|
|
|
|
</Form.Item>
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip>
|
|
|
|
@ -387,9 +362,7 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
|
|
|
|
<Form initialValues={initialValues} ref={this.formRef} layout='vertical'>
|
|
|
|
<Form initialValues={initialValues} ref={this.formRef} layout='vertical'>
|
|
|
|
{activeFileManagerTab === 'share' ? (
|
|
|
|
{activeFileManagerTab === 'share' ? (
|
|
|
|
<Row>
|
|
|
|
<Row>
|
|
|
|
<Col>
|
|
|
|
<Col>{this.renderCopyDataChechbox()}</Col>
|
|
|
|
{ this.renderCopyDataChechbox() }
|
|
|
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
) : null}
|
|
|
|
) : null}
|
|
|
|
<Row>
|
|
|
|
<Row>
|
|
|
|
@ -398,7 +371,7 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
|
|
|
|
<Row>
|
|
|
|
<Row>
|
|
|
|
<Col>{this.renderCreateTaskMethod()}</Col>
|
|
|
|
<Col>{this.renderCreateTaskMethod()}</Col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
<Row type='flex' justify='start'>
|
|
|
|
<Row justify='start'>
|
|
|
|
<Col span={7}>{this.renderImageQuality()}</Col>
|
|
|
|
<Col span={7}>{this.renderImageQuality()}</Col>
|
|
|
|
<Col span={7} offset={1}>
|
|
|
|
<Col span={7} offset={1}>
|
|
|
|
{this.renderOverlap()}
|
|
|
|
{this.renderOverlap()}
|
|
|
|
@ -408,7 +381,7 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
|
|
<Row type='flex' justify='start'>
|
|
|
|
<Row justify='start'>
|
|
|
|
<Col span={7}>{this.renderStartFrame()}</Col>
|
|
|
|
<Col span={7}>{this.renderStartFrame()}</Col>
|
|
|
|
<Col span={7} offset={1}>
|
|
|
|
<Col span={7} offset={1}>
|
|
|
|
{this.renderStopFrame()}
|
|
|
|
{this.renderStopFrame()}
|
|
|
|
@ -418,7 +391,7 @@ class AdvancedConfigurationForm extends React.PureComponent<Props> {
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
|
|
<Row type='flex' justify='start'>
|
|
|
|
<Row justify='start'>
|
|
|
|
<Col span={7}>{this.renderChunkSize()}</Col>
|
|
|
|
<Col span={7}>{this.renderChunkSize()}</Col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
|
|
|