Merge "fix: fix the abort of upload"

This commit is contained in:
Zuul 2022-08-22 10:41:25 +00:00 committed by Gerrit Code Review
commit 0775c02b67
3 changed files with 15 additions and 1 deletions

View File

@ -474,7 +474,7 @@ export default class BaseForm extends React.Component {
getUploadRequestConf = () => {
return {
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() {
if (!this.hasRequestCancelCallback) {
return;
@ -648,6 +659,7 @@ export default class BaseForm extends React.Component {
<div className={styles['progress-wrapper']}>
<Progress percent={percent} size="small" />
</div>
{this.renderAbortButton()}
</div>
);
}

View File

@ -42,6 +42,7 @@
"ARM Architecture": "ARM Architecture",
"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": "Abort Upload",
"Accept Volume Transfer": "Accept Volume Transfer",
"Access Control": "Access Control",
"Access Key": "Access Key",

View File

@ -42,6 +42,7 @@
"ARM Architecture": "ARM架构",
"Abandon Stack": "废弃堆栈",
"Abandoning this stack will preserve the resources deployed by the stack.": "废弃此堆栈将保留堆栈部署的资源。",
"Abort Upload": "取消上传",
"Accept Volume Transfer": "接受云硬盘转让",
"Access Control": "访问控制",
"Access Key": "访问密钥",