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 = () => { 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>
); );
} }

View File

@ -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",

View File

@ -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": "访问密钥",