fix: fix the abort of upload
1. Fix the `canToken` to `cancelToken` 2. Show abort button if it's not modal form Change-Id: I24f5b1632e68baaa04d9f0ed7e11ebc74f48e1bb
This commit is contained in:
parent
c6f4c9117e
commit
159aa00875
@ -474,7 +474,7 @@ export default class BaseForm extends React.Component {
|
|||||||
getUploadRequestConf = () => {
|
getUploadRequestConf = () => {
|
||||||
return {
|
return {
|
||||||
onUploadProgress: this.onUploadProgress,
|
onUploadProgress: this.onUploadProgress,
|
||||||
canToken: this.cancelToken,
|
cancelToken: this.cancelToken,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -637,6 +637,17 @@ export default class BaseForm extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderAbortButton() {
|
||||||
|
if (!this.isSubmitting || this.isModal) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<Button className={styles.cancel} onClick={this.onClickCancel}>
|
||||||
|
{t('Abort Upload')}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
renderSubmittingTip() {
|
renderSubmittingTip() {
|
||||||
if (!this.hasRequestCancelCallback) {
|
if (!this.hasRequestCancelCallback) {
|
||||||
return;
|
return;
|
||||||
@ -648,6 +659,7 @@ export default class BaseForm extends React.Component {
|
|||||||
<div className={styles['progress-wrapper']}>
|
<div className={styles['progress-wrapper']}>
|
||||||
<Progress percent={percent} size="small" />
|
<Progress percent={percent} size="small" />
|
||||||
</div>
|
</div>
|
||||||
|
{this.renderAbortButton()}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
"ARM Architecture": "ARM Architecture",
|
"ARM Architecture": "ARM Architecture",
|
||||||
"Abandon Stack": "Abandon Stack",
|
"Abandon Stack": "Abandon Stack",
|
||||||
"Abandoning this stack will preserve the resources deployed by the stack.": "Abandoning this stack will preserve the resources deployed by the stack.",
|
"Abandoning this stack will preserve the resources deployed by the stack.": "Abandoning this stack will preserve the resources deployed by the stack.",
|
||||||
|
"Abort Upload": "Abort Upload",
|
||||||
"Accept Volume Transfer": "Accept Volume Transfer",
|
"Accept Volume Transfer": "Accept Volume Transfer",
|
||||||
"Access Control": "Access Control",
|
"Access Control": "Access Control",
|
||||||
"Access Key": "Access Key",
|
"Access Key": "Access Key",
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
"ARM Architecture": "ARM架构",
|
"ARM Architecture": "ARM架构",
|
||||||
"Abandon Stack": "废弃堆栈",
|
"Abandon Stack": "废弃堆栈",
|
||||||
"Abandoning this stack will preserve the resources deployed by the stack.": "废弃此堆栈将保留堆栈部署的资源。",
|
"Abandoning this stack will preserve the resources deployed by the stack.": "废弃此堆栈将保留堆栈部署的资源。",
|
||||||
|
"Abort Upload": "取消上传",
|
||||||
"Accept Volume Transfer": "接受云硬盘转让",
|
"Accept Volume Transfer": "接受云硬盘转让",
|
||||||
"Access Control": "访问控制",
|
"Access Control": "访问控制",
|
||||||
"Access Key": "访问密钥",
|
"Access Key": "访问密钥",
|
||||||
|
Loading…
Reference in New Issue
Block a user