diff --git a/src/components/Form/index.jsx b/src/components/Form/index.jsx index b06fb289..8802e542 100644 --- a/src/components/Form/index.jsx +++ b/src/components/Form/index.jsx @@ -265,10 +265,40 @@ export default class BaseForm extends React.Component { this.updateSumbitting(false); !this.isModal && this.routing.push(this.listUrl); this.response = response; - this.showNotice && Notify.success(this.successText); if (callback && isFunction(callback)) { callback(true, false); } + if (response instanceof Array) { + const instanceNameArr = this.instanceName.split(', '); + const failedNames = response + .map((it, idx) => { + if (it.status === 'rejected') { + return { + reason: it.reason, + name: instanceNameArr[idx], + }; + } + return null; + }) + .filter((it) => !!it); + if (failedNames.length !== 0) { + failedNames.forEach((it) => { + const { response: { data } = {} } = it.reason; + this.showNotice && + Notify.errorWithDetail( + data, + t('Unable to {action}, instance: {name}.', { + action: this.name.toLowerCase(), + name: it.name, + }) + ); + }); + } else { + this.showNotice && Notify.success(this.successText); + } + } else { + this.showNotice && Notify.success(this.successText); + } }, (err = {}) => { this.updateSumbitting(false); diff --git a/src/pages/storage/containers/Volume/actions/Create/index.jsx b/src/pages/storage/containers/Volume/actions/Create/index.jsx index e2dda3e3..ac79bdcf 100644 --- a/src/pages/storage/containers/Volume/actions/Create/index.jsx +++ b/src/pages/storage/containers/Volume/actions/Create/index.jsx @@ -568,7 +568,7 @@ export default class Create extends FormAction { if (count === 1) { return this.volumeStore.create(volume); } - return Promise.all( + return Promise.allSettled( new Array(count).fill(count).map((_, index) => { const body = { ...volume,