utils: introduce global API error notification (#296)

Fixes #294

Introduce a new global `this.$notifyError(error)` that takes in the `error` in a catch block and displays error notification with duration: 0, refactored to replace error handling codebase-wide.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Co-authored-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Abhishek Kumar 2020-05-08 15:26:54 +05:30 committed by Rohit Yadav
parent 74ae4a53b3
commit 5ab5adc918
77 changed files with 223 additions and 774 deletions

View File

@ -121,10 +121,7 @@ export default {
this.dedicatedAccountId = response.listdedicatedzonesresponse.dedicatedzone[0].accountid this.dedicatedAccountId = response.listdedicatedzonesresponse.dedicatedzone[0].accountid
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}) })
}, },
fetchDedicatedPods () { fetchDedicatedPods () {
@ -137,10 +134,7 @@ export default {
this.dedicatedAccountId = response.listdedicatedpodsresponse.dedicatedpod[0].accountid this.dedicatedAccountId = response.listdedicatedpodsresponse.dedicatedpod[0].accountid
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}) })
}, },
fetchDedicatedClusters () { fetchDedicatedClusters () {
@ -153,10 +147,7 @@ export default {
this.dedicatedAccountId = response.listdedicatedclustersresponse.dedicatedcluster[0].accountid this.dedicatedAccountId = response.listdedicatedclustersresponse.dedicatedcluster[0].accountid
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}) })
}, },
fetchDedicatedHosts () { fetchDedicatedHosts () {
@ -169,10 +160,7 @@ export default {
this.dedicatedAccountId = response.listdedicatedhostsresponse.dedicatedhost[0].accountid this.dedicatedAccountId = response.listdedicatedhostsresponse.dedicatedhost[0].accountid
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}) })
}, },
releaseDedidcatedZone () { releaseDedidcatedZone () {
@ -202,10 +190,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}) })
}, },
releaseDedidcatedPod () { releaseDedidcatedPod () {
@ -235,10 +220,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}) })
}, },
releaseDedidcatedCluster () { releaseDedidcatedCluster () {
@ -268,10 +250,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}) })
}, },
releaseDedidcatedHost () { releaseDedidcatedHost () {
@ -301,10 +280,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}) })
}, },
handleRelease () { handleRelease () {

View File

@ -80,12 +80,9 @@ export default {
this.domainId = this.domainsList[0].id this.domainId = this.domainsList[0].id
this.handleChangeDomain(this.domainId) this.handleChangeDomain(this.domainId)
} }
this.domainsLoading = false
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`, }).finally(() => {
description: error.response.data.errorresponse.errortext
})
this.domainsLoading = false this.domainsLoading = false
}) })
}, },
@ -98,10 +95,7 @@ export default {
this.handleChangeAccount(null) this.handleChangeAccount(null)
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}) })
}, },
handleChangeDomain (e) { handleChangeDomain (e) {

View File

@ -118,10 +118,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.dedicatedDomainModal = false this.dedicatedDomainModal = false
}) })
}, },
@ -165,10 +162,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.dedicatedDomainModal = false this.dedicatedDomainModal = false
}) })
}, },
@ -212,10 +206,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.dedicatedDomainModal = false this.dedicatedDomainModal = false
}) })
}, },
@ -259,10 +250,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.dedicatedDomainModal = false this.dedicatedDomainModal = false
}) })
}, },

View File

@ -193,10 +193,7 @@ export default {
return { name: k, value: details[k], edit: false } return { name: k, value: details[k], edit: false }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Failed to add setting',
description: error.response.headers['x-description']
})
}).finally(f => { }).finally(f => {
this.loading = false this.loading = false
this.showAddDetail = false this.showAddDetail = false

View File

@ -135,10 +135,7 @@ export default {
this.$message.success('Apply Successful') this.$message.success('Apply Successful')
this.fetchData() this.fetchData()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.formLoading = false this.formLoading = false
}) })

View File

@ -71,10 +71,7 @@ export default {
} }
this.$set(this.resource, 'vmwaredc', this.vmwaredc) this.$set(this.resource, 'vmwaredc', this.vmwaredc)
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}) })
} }
} }

View File

@ -27,11 +27,12 @@ import './core/use'
import './core/ext' import './core/ext'
import './permission' // permission control import './permission' // permission control
import './utils/filter' // global filter import './utils/filter' // global filter
import { pollJobPlugin } from './utils/plugins' import { pollJobPlugin, notifierPlugin } from './utils/plugins'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(VueAxios, router) Vue.use(VueAxios, router)
Vue.use(pollJobPlugin) Vue.use(pollJobPlugin)
Vue.use(notifierPlugin)
new Vue({ new Vue({
router, router,

View File

@ -15,6 +15,7 @@
// specific language governing permissions and limitations // specific language governing permissions and limitations
// under the License. // under the License.
import _ from 'lodash'
import { api } from '@/api' import { api } from '@/api'
import { message, notification } from 'ant-design-vue' import { message, notification } from 'ant-design-vue'
@ -77,3 +78,35 @@ export const pollJobPlugin = {
} }
} }
export const notifierPlugin = {
install (Vue) {
Vue.prototype.$notifyError = function (error) {
var msg = 'Request Failed'
var desc = ''
if (error && error.response) {
if (error.response.status) {
msg = `Request Failed (${error.response.status})`
}
if (error.message) {
desc = error.message
}
if (error.response.headers && 'x-description' in error.response.headers) {
desc = error.response.headers['x-description']
}
if (desc === '' && error.response.data) {
const responseKey = _.findKey(error.response.data, 'errortext')
if (responseKey) {
desc = error.response.data[responseKey].errortext
}
}
}
notification.error({
message: msg,
description: error && error.response && 'x-description' in error.response.headers ? error.response.headers['x-description'] : error.message,
duration: 0
})
}
}
}

View File

@ -41,7 +41,7 @@ const err = (error) => {
if (response.config && response.config.params && ['listIdps'].includes(response.config.params.command)) { if (response.config && response.config.params && ['listIdps'].includes(response.config.params.command)) {
return return
} }
notification.error({ message: 'Unauthorized', description: 'Authorization verification failed' }) notification.error({ message: 'Unauthorized', description: 'Session expired, authorization verification failed' })
if (token) { if (token) {
store.dispatch('Logout').then(() => { store.dispatch('Logout').then(() => {
setTimeout(() => { setTimeout(() => {

View File

@ -507,11 +507,7 @@ export default {
this.treeSelected = {} this.treeSelected = {}
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description'],
duration: 0
})
if ([401, 405].includes(error.response.status)) { if ([401, 405].includes(error.response.status)) {
this.$router.push({ path: '/exception/403' }) this.$router.push({ path: '/exception/403' })
@ -771,10 +767,7 @@ export default {
} }
}).catch(error => { }).catch(error => {
console.log(error) console.log(error)
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(f => { }).finally(f => {
this.closeAction() this.closeAction()
}) })

View File

@ -216,10 +216,7 @@ export default {
this.$parent.$parent.close() this.$parent.$parent.close()
this.parentFetchData() this.parentFetchData()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Failed to assign instance',
description: error.response.data.assignvirtualmachineresponse.errortext && error.response.data.assignvirtualmachineresponse.errortext
})
this.$parent.$parent.close() this.$parent.$parent.close()
this.parentFetchData() this.parentFetchData()
}) })

View File

@ -405,10 +405,7 @@ export default {
api('createKubernetesCluster', params).then(json => { api('createKubernetesCluster', params).then(json => {
this.$message.success('Successfully created Kubernetes cluster: ' + values.name) this.$message.success('Successfully created Kubernetes cluster: ' + values.name)
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.$emit('refresh-data') this.$emit('refresh-data')
this.loading = false this.loading = false

View File

@ -166,10 +166,7 @@ export default {
api('registerSSHKeyPair', params).then(json => { api('registerSSHKeyPair', params).then(json => {
this.$message.success('Successfully registered SSH key pair: ' + values.name) this.$message.success('Successfully registered SSH key pair: ' + values.name)
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.$emit('refresh-data') this.$emit('refresh-data')
this.loading = false this.loading = false
@ -186,10 +183,7 @@ export default {
}) })
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.$emit('refresh-data') this.$emit('refresh-data')
this.loading = false this.loading = false

View File

@ -946,10 +946,7 @@ export default {
} }
this.$router.back() this.$router.back()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.loading.deploy = false this.loading.deploy = false
}) })

View File

@ -422,10 +422,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.loadingNic = false this.loadingNic = false
}) })
}, },
@ -455,10 +452,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.loadingNic = false this.loadingNic = false
}) })
}, },
@ -493,10 +487,7 @@ export default {
}) })
}) })
.catch(error => { .catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.loadingNic = false this.loadingNic = false
}) })
}, },
@ -528,10 +519,7 @@ export default {
}) })
}) })
.catch(error => { .catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.loadingNic = false this.loadingNic = false
}) })
}, },
@ -568,10 +556,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.addiptovmnicresponse.errortext
})
this.loadingNic = false this.loadingNic = false
}) })
}, },
@ -602,10 +587,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.loadingNic = false this.loadingNic = false
this.fetchSecondaryIPs(this.selectedNicId) this.fetchSecondaryIPs(this.selectedNicId)
}) })

View File

@ -293,10 +293,7 @@ export default {
this.kubernetesVersion = versionObjs[0] this.kubernetesVersion = versionObjs[0]
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.versionLoading = false this.versionLoading = false
if (!this.isObjectEmpty(this.kubernetesVersion) && this.isValidValueForKey(this.kubernetesVersion, 'semanticversion')) { if (!this.isObjectEmpty(this.kubernetesVersion) && this.isValidValueForKey(this.kubernetesVersion, 'semanticversion')) {
@ -333,10 +330,7 @@ export default {
this.virtualmachines = this.virtualmachines.concat(listVms) this.virtualmachines = this.virtualmachines.concat(listVms)
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.instanceLoading = false this.instanceLoading = false
}) })
@ -363,10 +357,7 @@ export default {
this.publicIpAddress = ips[0] this.publicIpAddress = ips[0]
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.networkLoading = false this.networkLoading = false
}) })

View File

@ -173,10 +173,7 @@ export default {
api('scaleKubernetesCluster', params).then(json => { api('scaleKubernetesCluster', params).then(json => {
this.$message.success('Successfully scaled Kubernetes cluster: ' + this.resource.name) this.$message.success('Successfully scaled Kubernetes cluster: ' + this.resource.name)
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.$emit('refresh-data') this.$emit('refresh-data')
this.loading = false this.loading = false

View File

@ -149,10 +149,7 @@ export default {
api('upgradeKubernetesCluster', params).then(json => { api('upgradeKubernetesCluster', params).then(json => {
this.$message.success('Successfully upgraded Kubernetes cluster: ' + this.resource.name) this.$message.success('Successfully upgraded Kubernetes cluster: ' + this.resource.name)
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.$emit('refresh-data') this.$emit('refresh-data')
this.loading = false this.loading = false

View File

@ -164,10 +164,7 @@ export default {
} }
this.refreshSchedule() this.refreshSchedule()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.actionLoading = false this.actionLoading = false
}) })

View File

@ -274,10 +274,7 @@ export default {
this.refreshSchedule() this.refreshSchedule()
this.resetForm() this.resetForm()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.actionLoading = false this.actionLoading = false
}) })

View File

@ -198,10 +198,7 @@ export default {
this.fetchListDomains(), this.fetchListDomains(),
this.fetchListRoles() this.fetchListRoles()
]).catch(error => { ]).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.listLoading = false this.listLoading = false
this.timeZoneLoading = false this.timeZoneLoading = false
@ -319,10 +316,7 @@ export default {
this.$emit('refresh-data') this.$emit('refresh-data')
this.handleClose() this.handleClose()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
this.$emit('refresh-data') this.$emit('refresh-data')
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
@ -365,10 +359,7 @@ export default {
})) }))
} }
Promise.all(promises).catch(error => { Promise.all(promises).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}) })
}, },
onSelectChange (selectedRowKeys) { onSelectChange (selectedRowKeys) {

View File

@ -146,10 +146,7 @@ export default {
description: 'Successfully changed password for user "' + this.resource.username + '"' description: 'Successfully changed password for user "' + this.resource.username + '"'
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Error',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.$emit('refresh-data') this.$emit('refresh-data')
this.loading = false this.loading = false

View File

@ -164,10 +164,7 @@ export default {
this.dataSource = listSslResponse this.dataSource = listSslResponse
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@ -203,10 +200,7 @@ export default {
setTimeout(loading) setTimeout(loading)
// show error // show error
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}) })
}, },
onShowConfirm (row) { onShowConfirm (row) {

View File

@ -206,10 +206,7 @@ export default {
api('addKubernetesSupportedVersion', params).then(json => { api('addKubernetesSupportedVersion', params).then(json => {
this.$message.success('Successfully added Kubernetes version: ' + values.semanticversion) this.$message.success('Successfully added Kubernetes version: ' + values.semanticversion)
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.$emit('refresh-data') this.$emit('refresh-data')
this.loading = false this.loading = false

View File

@ -127,10 +127,7 @@ export default {
this.itemCount = count this.itemCount = count
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
}) })

View File

@ -334,11 +334,7 @@ export default {
description: 'Sucessfully registered ISO ' + params.name description: 'Sucessfully registered ISO ' + params.name
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message,
duration: 0
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
this.closeAction() this.closeAction()
@ -359,11 +355,7 @@ export default {
}) })
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message,
duration: 0
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })

View File

@ -873,11 +873,7 @@ export default {
description: 'Successfully registered template ' + params.name description: 'Successfully registered template ' + params.name
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message,
duration: 0
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
this.closeAction() this.closeAction()
@ -895,11 +891,7 @@ export default {
this.uploadParams = (json.postuploadtemplateresponse && json.postuploadtemplateresponse.getuploadparams) ? json.postuploadtemplateresponse.getuploadparams : '' this.uploadParams = (json.postuploadtemplateresponse && json.postuploadtemplateresponse.getuploadparams) ? json.postuploadtemplateresponse.getuploadparams : ''
this.handleUpload() this.handleUpload()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message,
duration: 0
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })

View File

@ -124,10 +124,7 @@ export default {
this.itemCount = count this.itemCount = count
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
}) })

View File

@ -131,10 +131,7 @@ export default {
api('updateKubernetesSupportedVersion', params).then(json => { api('updateKubernetesSupportedVersion', params).then(json => {
this.$message.success('Successfully updated Kubernetes supported version: ' + this.resource.name) this.$message.success('Successfully updated Kubernetes supported version: ' + this.resource.name)
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.$emit('refresh-data') this.$emit('refresh-data')
this.loading = false this.loading = false

View File

@ -254,12 +254,7 @@ export default {
}) })
}) })
.catch(error => { .catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Failed to update ' + resourceType + ' permissions',
description: this.isImageTypeIso
? error.response.data.updateisopermissions.errortext
: error.response.data.updatetemplatepermissions.errortext
})
}) })
.finally(e => { .finally(e => {
this.loading = false this.loading = false

View File

@ -534,10 +534,7 @@ export default {
description: this.$t('label.add.primary.storage') description: this.$t('label.add.primary.storage')
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
this.closeModal() this.closeModal()

View File

@ -278,10 +278,7 @@ export default {
description: this.$t('label.add.secondary.storage') description: this.$t('label.add.secondary.storage')
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
this.closeModal() this.closeModal()

View File

@ -167,10 +167,7 @@ export default {
this.zoneId = this.zonesList[0].id || null this.zoneId = this.zonesList[0].id || null
this.fetchPods() this.fetchPods()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@ -181,10 +178,7 @@ export default {
this.hypervisorsList = response.listhypervisorsresponse.hypervisor || [] this.hypervisorsList = response.listhypervisorsresponse.hypervisor || []
this.hypervisor = this.hypervisorsList[0].name || null this.hypervisor = this.hypervisorsList[0].name || null
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@ -197,10 +191,7 @@ export default {
this.podsList = response.listpodsresponse.pod || [] this.podsList = response.listpodsresponse.pod || []
this.podId = this.podsList[0].id || null this.podId = this.podsList[0].id || null
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })

View File

@ -188,10 +188,7 @@ export default {
this.zoneId = this.zonesList[0].id || null this.zoneId = this.zonesList[0].id || null
this.fetchPods() this.fetchPods()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@ -205,10 +202,7 @@ export default {
this.podId = this.podsList[0].id || null this.podId = this.podsList[0].id || null
this.fetchClusters() this.fetchClusters()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.podsList = [] this.podsList = []
this.podId = '' this.podId = ''
}).finally(() => { }).finally(() => {
@ -226,10 +220,7 @@ export default {
this.handleChangeCluster() this.handleChangeCluster()
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.listclustersresponse.errortext
})
this.clustersList = [] this.clustersList = []
this.clusterId = null this.clusterId = null
}).finally(() => { }).finally(() => {
@ -241,10 +232,7 @@ export default {
api('listHostTags').then(response => { api('listHostTags').then(response => {
this.hostTagsList = response.listhosttagsresponse.hosttag || [] this.hostTagsList = response.listhosttagsresponse.hosttag || []
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.listhosttagsresponse.errortext
})
this.hostTagsList = [] this.hostTagsList = []
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false

View File

@ -135,10 +135,7 @@ export default {
api('listHosts', { id: this.resource.id }).then(json => { api('listHosts', { id: this.resource.id }).then(json => {
this.host = json.listhostsresponse.host[0] this.host = json.listhostsresponse.host[0]
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
}) })

View File

@ -161,10 +161,7 @@ export default {
this.params = this.$store.getters.apis.createPod.params this.params = this.$store.getters.apis.createPod.params
Object.keys(this.placeholder).forEach(item => { this.returnPlaceholder(item) }) Object.keys(this.placeholder).forEach(item => { this.returnPlaceholder(item) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })

View File

@ -220,10 +220,7 @@ export default {
} }
this.formLoading = false this.formLoading = false
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.formLoading = false this.formLoading = false
}) })
}, },
@ -247,10 +244,7 @@ export default {
} }
this.formLoading = false this.formLoading = false
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.formLoading = false this.formLoading = false
}) })
}, },
@ -273,10 +267,7 @@ export default {
} }
this.formLoading = false this.formLoading = false
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.formLoading = false this.formLoading = false
}) })
}, },
@ -334,10 +325,7 @@ export default {
this.modal = false this.modal = false
this.fetchData() this.fetchData()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.dedicateguestvlanrangeresponse.errortext
})
this.modal = false this.modal = false
this.fetchData() this.fetchData()
}) })

View File

@ -220,11 +220,7 @@ export default {
} }
}).catch(error => { }).catch(error => {
console.log(error) console.log(error)
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.listpodsresponse
? error.response.data.listpodsresponse.errortext : error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.componentLoading = false this.componentLoading = false
}) })
@ -271,11 +267,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.deletemanagementnetworkiprangeresponse
? error.response.data.deletemanagementnetworkiprangeresponse.errortext : error.response.data.errorresponse.errortext
})
this.componentLoading = false this.componentLoading = false
this.fetchData() this.fetchData()
}) })
@ -319,11 +311,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.createmanagementnetworkiprangeresponse
? error.response.data.createmanagementnetworkiprangeresponse.errortext : error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.componentLoading = false this.componentLoading = false
this.fetchData() this.fetchData()

View File

@ -268,11 +268,7 @@ export default {
}).then(response => { }).then(response => {
this.items = response.listvlaniprangesresponse.vlaniprange ? response.listvlaniprangesresponse.vlaniprange : [] this.items = response.listvlaniprangesresponse.vlaniprange ? response.listvlaniprangesresponse.vlaniprange : []
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.listvlaniprangesresponse
? error.response.data.listvlaniprangesresponse.errortext : error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.componentLoading = false this.componentLoading = false
}) })
@ -289,11 +285,7 @@ export default {
this.form.setFieldsValue({ domain: this.domains[0].id }) this.form.setFieldsValue({ domain: this.domains[0].id })
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.listdomains
? error.response.data.listdomains.errortext : error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.domainsLoading = false this.domainsLoading = false
}) })
@ -312,11 +304,7 @@ export default {
domainid: this.addAccount.domain, domainid: this.addAccount.domain,
account: this.addAccount.account account: this.addAccount.account
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.dedicatepubliciprangeresponse
? error.response.data.dedicatepubliciprangeresponse.errortext : error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.addAccountModal = false this.addAccountModal = false
this.domainsLoading = false this.domainsLoading = false
@ -326,11 +314,7 @@ export default {
handleRemoveAccount (id) { handleRemoveAccount (id) {
this.componentLoading = true this.componentLoading = true
api('releasePublicIpRange', { id }).catch(error => { api('releasePublicIpRange', { id }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.releasepubliciprangeresponse
? error.response.data.releasepubliciprangeresponse.errortext : error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.fetchData() this.fetchData()
}) })
@ -364,11 +348,7 @@ export default {
message: 'Removed IP Range' message: 'Removed IP Range'
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.deletevlaniprangeresponse
? error.response.data.deletevlaniprangeresponse.errortext : error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.componentLoading = false this.componentLoading = false
this.fetchData() this.fetchData()

View File

@ -190,11 +190,7 @@ export default {
}).then(response => { }).then(response => {
this.items = response.liststoragenetworkiprangeresponse.storagenetworkiprange ? response.liststoragenetworkiprangeresponse.storagenetworkiprange : [] this.items = response.liststoragenetworkiprangeresponse.storagenetworkiprange ? response.liststoragenetworkiprangeresponse.storagenetworkiprange : []
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.liststoragenetworkiprangeresponse
? error.response.data.liststoragenetworkiprangeresponse.errortext : error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.componentLoading = false this.componentLoading = false
}) })
@ -206,11 +202,7 @@ export default {
}).then(response => { }).then(response => {
this.pods = response.listpodsresponse.pod ? response.listpodsresponse.pod : [] this.pods = response.listpodsresponse.pod ? response.listpodsresponse.pod : []
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.listpodsresponse
? error.response.data.listpodsresponse.errortext : error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.componentLoading = false this.componentLoading = false
}) })
@ -256,11 +248,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.deletestoragenetworkiprangeresponse
? error.response.data.deletestoragenetworkiprangeresponse.errortext : error.response.data.errorresponse.errortext
})
this.componentLoading = false this.componentLoading = false
this.fetchData() this.fetchData()
}) })
@ -304,11 +292,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.createstoragenetworkiprangeresponse
? error.response.data.createstoragenetworkiprangeresponse.errortext : error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.componentLoading = false this.componentLoading = false
this.fetchData() this.fetchData()

View File

@ -129,11 +129,7 @@ export default {
} }
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description'],
duration: 0
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
}) })

View File

@ -99,10 +99,7 @@ export default {
api('listTrafficTypes', { physicalnetworkid: this.resource.id }).then(json => { api('listTrafficTypes', { physicalnetworkid: this.resource.id }).then(json => {
this.traffictypes = json.listtraffictypesresponse.traffictype this.traffictypes = json.listtraffictypesresponse.traffictype
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
}) })
@ -116,10 +113,7 @@ export default {
}).then(json => { }).then(json => {
this.publicNetwork = json.listnetworksresponse.network[0] || {} this.publicNetwork = json.listnetworksresponse.network[0] || {}
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
}) })

View File

@ -102,10 +102,7 @@ export default {
api('listPhysicalNetworks', { zoneid: this.resource.id }).then(json => { api('listPhysicalNetworks', { zoneid: this.resource.id }).then(json => {
this.networks = json.listphysicalnetworksresponse.physicalnetwork || [] this.networks = json.listphysicalnetworksresponse.physicalnetwork || []
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
}) })

View File

@ -110,10 +110,7 @@ export default {
api('listSystemVms', { zoneid: this.resource.id }).then(json => { api('listSystemVms', { zoneid: this.resource.id }).then(json => {
this.vms = json.listsystemvmsresponse.systemvm || [] this.vms = json.listsystemvmsresponse.systemvm || []
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
}) })

View File

@ -73,10 +73,7 @@ export default {
this.resourcesList = response.listcapacityresponse.capacity this.resourcesList = response.listcapacityresponse.capacity
this.animatePercentVals() this.animatePercentVals()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
}) })

View File

@ -271,10 +271,7 @@ export default {
this.acls.sort((a, b) => a.number - b.number) this.acls.sort((a, b) => a.number - b.number)
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
}) })
@ -287,10 +284,7 @@ export default {
}).then(response => { }).then(response => {
this.tags = response.listtagsresponse.tag || [] this.tags = response.listtagsresponse.tag || []
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}) })
}, },
openTagsModal (acl) { openTagsModal (acl) {
@ -332,10 +326,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.deletetagsresponse.errortext
})
this.tagsLoading = false this.tagsLoading = false
}) })
}, },
@ -380,10 +371,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.createtagsresponse.errortext
})
this.tagsLoading = false this.tagsLoading = false
}) })
}) })
@ -451,10 +439,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.createnetworkaclresponse.errortext
})
this.fetchLoading = false this.fetchLoading = false
}) })
}) })
@ -487,10 +472,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.deletenetworkaclresponse.errortext
})
this.fetchLoading = false this.fetchLoading = false
}) })
}, },
@ -552,10 +534,7 @@ export default {
description: 'Successfully added new rule' description: 'Successfully added new rule'
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
this.fetchData() this.fetchData()
@ -602,10 +581,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.headers['x-description']
})
this.fetchLoading = false this.fetchLoading = false
}) })
}, },

View File

@ -409,10 +409,7 @@ export default {
}) })
this.$emit('refresh-data') this.$emit('refresh-data')
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.actionLoading = false this.actionLoading = false
this.closeAction() this.closeAction()

View File

@ -329,10 +329,7 @@ export default {
description: 'Successfully created L2 network' description: 'Successfully created L2 network'
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.$emit('refresh-data') this.$emit('refresh-data')
this.actionLoading = false this.actionLoading = false

View File

@ -652,10 +652,7 @@ export default {
}) })
this.resetForm() this.resetForm()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.$emit('refresh-data') this.$emit('refresh-data')
this.actionLoading = false this.actionLoading = false

View File

@ -199,10 +199,7 @@ export default {
catchMethod: () => this.fetchData() catchMethod: () => this.fetchData()
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.fetchData() this.fetchData()
}) })
}, },
@ -229,10 +226,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.createegressfirewallruleresponse.errortext
})
this.resetAllRules() this.resetAllRules()
this.fetchData() this.fetchData()
}) })

View File

@ -174,10 +174,7 @@ export default {
}).then(response => { }).then(response => {
this.vmsList = response.listvirtualmachinesresponse.virtualmachine this.vmsList = response.listvirtualmachinesresponse.virtualmachine
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@ -196,10 +193,7 @@ export default {
}).then(response => { }).then(response => {
this.vmsList = response.listvirtualmachinesresponse.virtualmachine || [] this.vmsList = response.listvirtualmachinesresponse.virtualmachine || []
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@ -223,10 +217,7 @@ export default {
this.selectedNic = this.nicsList[0] this.selectedNic = this.nicsList[0]
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@ -241,10 +232,7 @@ export default {
}).then(response => { }).then(response => {
this.networksList = response.listnetworksresponse.network this.networksList = response.listnetworksresponse.network
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@ -259,11 +247,7 @@ export default {
}).then(() => { }).then(() => {
this.parentFetchData() this.parentFetchData()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description'],
duration: 0
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
this.handleClose() this.handleClose()

View File

@ -213,10 +213,7 @@ export default {
this.firewallRules = response.listfirewallrulesresponse.firewallrule || [] this.firewallRules = response.listfirewallrulesresponse.firewallrule || []
this.totalCount = response.listfirewallrulesresponse.count || 0 this.totalCount = response.listfirewallrulesresponse.count || 0
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@ -235,10 +232,7 @@ export default {
catchMethod: () => this.fetchData() catchMethod: () => this.fetchData()
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.fetchData() this.fetchData()
}) })
}, },
@ -265,10 +259,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.createfirewallruleresponse.errortext
})
this.resetAllRules() this.resetAllRules()
this.fetchData() this.fetchData()
}) })
@ -301,10 +292,7 @@ export default {
}).then(response => { }).then(response => {
this.tags = response.listtagsresponse.tag this.tags = response.listtagsresponse.tag
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.closeModal() this.closeModal()
}) })
}, },
@ -339,10 +327,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.createtagsresponse.errortext
})
this.closeModal() this.closeModal()
}).finally(() => { }).finally(() => {
this.addTagLoading = false this.addTagLoading = false
@ -378,10 +363,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.deletetagsresponse.errortext
})
this.closeModal() this.closeModal()
}) })
}, },

View File

@ -267,12 +267,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: this.tabType === 'ingress'
? error.response.data.authorizesecuritygroupingressresponse.errortext
: error.response.data.authorizesecuritygroupegressresponse.errortext
})
this.parentToggleLoading() this.parentToggleLoading()
}) })
}, },
@ -304,11 +299,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: this.tabType === 'ingress' ? error.response.data.revokesecuritygroupingressresponse.errortext
: error.response.data.revokesecuritygroupegressresponse.errortext
})
this.parentToggleLoading() this.parentToggleLoading()
}) })
}, },
@ -320,10 +311,7 @@ export default {
}).then(response => { }).then(response => {
this.tags = response.listtagsresponse.tag this.tags = response.listtagsresponse.tag
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}) })
}, },
handleDeleteTag (tag) { handleDeleteTag (tag) {
@ -361,10 +349,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.deletetagsresponse.errortext
})
this.parentToggleLoading() this.parentToggleLoading()
this.tagsLoading = false this.tagsLoading = false
}) })
@ -412,10 +397,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.createtagsresponse.errortext
})
this.parentToggleLoading() this.parentToggleLoading()
this.tagsLoading = false this.tagsLoading = false
}) })

View File

@ -175,10 +175,7 @@ export default {
this.iLb.vmguestip[index] = this.nics[index][0] this.iLb.vmguestip[index] = this.nics[index][0]
this.addVmModalNicLoading = false this.addVmModalNicLoading = false
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}` || 'Error',
description: error.response.data.errorresponse.errortext || 'Error'
})
this.closeModal() this.closeModal()
}) })
}, },

View File

@ -466,10 +466,7 @@ export default {
} }
this.loading = false this.loading = false
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.loading = false this.loading = false
}) })
}, },
@ -483,10 +480,7 @@ export default {
}).then(response => { }).then(response => {
this.$set(rule, 'ruleInstances', response.listloadbalancerruleinstancesresponse.lbrulevmidip) this.$set(rule, 'ruleInstances', response.listloadbalancerruleinstancesresponse.lbrulevmidip)
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@ -501,10 +495,7 @@ export default {
}).then(response => { }).then(response => {
this.stickinessPolicies.push(...response.listlbstickinesspoliciesresponse.stickinesspolicies) this.stickinessPolicies.push(...response.listlbstickinesspoliciesresponse.stickinesspolicies)
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@ -543,10 +534,7 @@ export default {
this.tags = response.listtagsresponse.tag this.tags = response.listtagsresponse.tag
this.tagsModalLoading = false this.tagsModalLoading = false
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.closeModal() this.closeModal()
}) })
}, },
@ -589,10 +577,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.createtagsresponse.errortext
})
this.closeModal() this.closeModal()
}) })
}) })
@ -628,10 +613,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.deletetagsresponse.errortext
})
this.closeModal() this.closeModal()
}) })
}, },
@ -692,10 +674,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.createLBStickinessPolicy.errortext
})
this.closeModal() this.closeModal()
}) })
}, },
@ -728,10 +707,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.closeModal() this.closeModal()
}) })
}, },
@ -800,10 +776,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.fetchData() this.fetchData()
}) })
}, },
@ -847,10 +820,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.loading = false this.loading = false
this.closeModal() this.closeModal()
}) })
@ -886,10 +856,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.loading = false this.loading = false
this.closeModal() this.closeModal()
}) })
@ -931,10 +898,7 @@ export default {
}) })
this.addVmModalLoading = false this.addVmModalLoading = false
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.closeModal() this.closeModal()
}) })
}, },
@ -962,10 +926,7 @@ export default {
this.newRule.vmguestip[index] = this.nics[index][0] this.newRule.vmguestip[index] = this.nics[index][0]
this.addVmModalNicLoading = false this.addVmModalNicLoading = false
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.closeModal() this.closeModal()
}) })
}, },
@ -1042,10 +1003,7 @@ export default {
this.addVmModalVisible = false this.addVmModalVisible = false
this.handleAssignToLBRule(response.createloadbalancerruleresponse.id) this.handleAssignToLBRule(response.createloadbalancerruleresponse.id)
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.createloadbalancerruleresponse.errortext
})
this.loading = false this.loading = false
}) })

View File

@ -299,10 +299,7 @@ export default {
this.portForwardRules = response.listportforwardingrulesresponse.portforwardingrule || [] this.portForwardRules = response.listportforwardingrulesresponse.portforwardingrule || []
this.totalCount = response.listportforwardingrulesresponse.count || 0 this.totalCount = response.listportforwardingrulesresponse.count || 0
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@ -321,10 +318,7 @@ export default {
catchMethod: () => this.fetchData() catchMethod: () => this.fetchData()
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.fetchData() this.fetchData()
}) })
}, },
@ -356,10 +350,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.createportforwardingruleresponse.errortext
})
this.closeModal() this.closeModal()
this.fetchData() this.fetchData()
}) })
@ -403,10 +394,7 @@ export default {
this.tags = response.listtagsresponse.tag this.tags = response.listtagsresponse.tag
this.tagsModalLoading = false this.tagsModalLoading = false
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.closeModal() this.closeModal()
}) })
}, },
@ -441,10 +429,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.createtagsresponse.errortext
})
this.closeModal() this.closeModal()
}) })
}, },
@ -479,10 +464,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.deletetagsresponse.errortext
})
this.closeModal() this.closeModal()
}) })
}, },
@ -500,10 +482,7 @@ export default {
this.vms = response.listvirtualmachinesresponse.virtualmachine this.vms = response.listvirtualmachinesresponse.virtualmachine
this.addVmModalLoading = false this.addVmModalLoading = false
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.closeModal() this.closeModal()
}) })
}, },
@ -523,10 +502,7 @@ export default {
this.addVmModalNicLoading = false this.addVmModalNicLoading = false
}).catch(error => { }).catch(error => {
console.log(error) console.log(error)
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.closeModal() this.closeModal()
}) })
}, },

View File

@ -128,11 +128,7 @@ export default {
api('listRouters', params).then(json => { api('listRouters', params).then(json => {
this.routers = json.listroutersresponse.router || [] this.routers = json.listroutersresponse.router || []
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description'],
duration: 0
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
}) })

View File

@ -115,10 +115,7 @@ export default {
api('listStaticRoutes', { gatewayid: this.resource.id }).then(json => { api('listStaticRoutes', { gatewayid: this.resource.id }).then(json => {
this.routes = json.liststaticroutesresponse.staticroute this.routes = json.liststaticroutesresponse.staticroute
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.componentLoading = false this.componentLoading = false
}) })
@ -156,10 +153,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.headers['x-description']
})
this.fetchData() this.fetchData()
this.componentLoading = false this.componentLoading = false
}) })
@ -193,10 +187,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.headers['x-description']
})
this.fetchData() this.fetchData()
this.componentLoading = false this.componentLoading = false
}) })
@ -209,10 +200,7 @@ export default {
}).then(response => { }).then(response => {
this.tags = response.listtagsresponse.tag this.tags = response.listtagsresponse.tag
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}) })
}, },
handleDeleteTag (tag) { handleDeleteTag (tag) {
@ -243,10 +231,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.deletetagsresponse.errortext
})
this.tagsLoading = false this.tagsLoading = false
}) })
}, },
@ -286,10 +271,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.createtagsresponse.errortext
})
this.tagsLoading = false this.tagsLoading = false
}) })
}) })

View File

@ -408,10 +408,7 @@ export default {
this.privateGateways = json.listprivategatewaysresponse.privategateway this.privateGateways = json.listprivategatewaysresponse.privategateway
this.itemCounts.privateGateways = json.listprivategatewaysresponse.count this.itemCounts.privateGateways = json.listprivategatewaysresponse.count
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
}) })
@ -424,10 +421,7 @@ export default {
}).then(json => { }).then(json => {
this.vpnGateways = json.listvpngatewaysresponse.vpngateway ? json.listvpngatewaysresponse.vpngateway : [] this.vpnGateways = json.listvpngatewaysresponse.vpngateway ? json.listvpngatewaysresponse.vpngateway : []
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
}) })
@ -443,10 +437,7 @@ export default {
this.vpnConnections = json.listvpnconnectionsresponse.vpnconnection this.vpnConnections = json.listvpnconnectionsresponse.vpnconnection
this.itemCounts.vpnConnections = json.listvpnconnectionsresponse.count this.itemCounts.vpnConnections = json.listvpnconnectionsresponse.count
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
}) })
@ -467,10 +458,7 @@ export default {
}) })
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
}) })
@ -485,10 +473,7 @@ export default {
}) })
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.modals.gatewayLoading = false this.modals.gatewayLoading = false
}) })
@ -503,10 +488,7 @@ export default {
}) })
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.modals.vpnConnectionLoading = false this.modals.vpnConnectionLoading = false
}) })
@ -576,10 +558,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.modals.gatewayLoading = false this.modals.gatewayLoading = false
this.modals.gateway = false this.modals.gateway = false
@ -626,10 +605,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchVpnConnections() this.fetchVpnConnections()
this.fetchLoading = false this.fetchLoading = false
@ -671,10 +647,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
this.fetchAclList() this.fetchAclList()
@ -707,10 +680,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
this.handleFetchData() this.handleFetchData()

View File

@ -366,11 +366,7 @@ export default {
}) })
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description'],
duration: 0
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
this.modalLoading = false this.modalLoading = false
@ -392,11 +388,7 @@ export default {
}) })
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description'],
duration: 0
})
}).finally(() => { }).finally(() => {
this.fetchLoading = false this.fetchLoading = false
this.modalLoading = false this.modalLoading = false
@ -474,11 +466,7 @@ export default {
}) })
this.fetchData() this.fetchData()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description'],
duration: 0
})
}).finally(() => { }).finally(() => {
this.fetchData() this.fetchData()
}) })

View File

@ -94,10 +94,7 @@ export default {
? response.listremoteaccessvpnsresponse.remoteaccessvpn[0] : null ? response.listremoteaccessvpnsresponse.remoteaccessvpn[0] : null
}).catch(error => { }).catch(error => {
console.log(error) console.log(error)
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}) })
}, },
handleCreateVpn () { handleCreateVpn () {
@ -137,11 +134,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.createremoteaccessvpnresponse
? error.response.data.createremoteaccessvpnresponse.errortext : error.response.data.errorresponse.errortext
})
this.fetchData() this.fetchData()
this.parentFetchData() this.parentFetchData()
this.parentToggleLoading() this.parentToggleLoading()
@ -177,11 +170,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.deleteremoteaccessvpnresponse
? error.response.data.deleteremoteaccessvpnresponse.errortext : error.response.data.errorresponse.errortext
})
this.fetchData() this.fetchData()
this.parentFetchData() this.parentFetchData()
this.parentToggleLoading() this.parentToggleLoading()

View File

@ -833,10 +833,7 @@ export default {
api('createServiceOffering', params).then(json => { api('createServiceOffering', params).then(json => {
this.$message.success((this.isSystem ? 'Service offering created: ' : 'Compute offering created: ') + values.name) this.$message.success((this.isSystem ? 'Service offering created: ' : 'Compute offering created: ') + values.name)
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
this.$emit('refresh-data') this.$emit('refresh-data')

View File

@ -495,10 +495,7 @@ export default {
api('createDiskOffering', params).then(json => { api('createDiskOffering', params).then(json => {
this.$message.success(this.$t('message.disk.offering.created', { name: values.name })) this.$message.success(this.$t('message.disk.offering.created', { name: values.name }))
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
this.$emit('refresh-data') this.$emit('refresh-data')

View File

@ -838,10 +838,7 @@ export default {
api('createNetworkOffering', params).then(json => { api('createNetworkOffering', params).then(json => {
this.$message.success('Network offering created: ' + values.name) this.$message.success('Network offering created: ' + values.name)
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
this.$emit('refresh-data') this.$emit('refresh-data')

View File

@ -368,10 +368,7 @@ export default {
api('createVPCOffering', params).then(json => { api('createVPCOffering', params).then(json => {
this.$message.success('VPC offering created: ' + values.name) this.$message.success('VPC offering created: ' + values.name)
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
this.$emit('refresh-data') this.$emit('refresh-data')

View File

@ -105,10 +105,7 @@ export default {
this.zones.opts = json.listzonesresponse.zone || [] this.zones.opts = json.listzonesresponse.zone || []
this.$forceUpdate() this.$forceUpdate()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(f => { }).finally(f => {
this.zones.loading = false this.zones.loading = false
}) })
@ -123,10 +120,7 @@ export default {
this.externals.opts = json.listbackupproviderofferingsresponse.backupoffering || [] this.externals.opts = json.listbackupproviderofferingsresponse.backupoffering || []
this.$forceUpdate() this.$forceUpdate()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(f => { }).finally(f => {
this.externals.loading = false this.externals.loading = false
}) })
@ -170,10 +164,7 @@ export default {
}) })
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(f => { }).finally(f => {
this.loading = false this.loading = false
}) })

View File

@ -285,10 +285,7 @@ export default {
description: this.$t('label.action.update.offering.access') description: this.$t('label.action.update.offering.access')
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
this.closeAction() this.closeAction()

View File

@ -44,16 +44,13 @@ export default {
}, },
methods: { methods: {
doSso () { doSso () {
this.showError = false
api('cloudianSsoLogin').then(json => { api('cloudianSsoLogin').then(json => {
const url = json.cloudianssologinresponse.cloudianssologin.url const url = json.cloudianssologinresponse.cloudianssologin.url
const cmcWindow = window.open(url, 'CMCWindow') const cmcWindow = window.open(url, 'CMCWindow')
cmcWindow.focus() cmcWindow.focus()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Single-Sign-On Failed',
description: error.response.headers['x-description'] || 'Request Failed',
duration: 0
})
this.showError = true this.showError = true
}) })
} }

View File

@ -144,10 +144,7 @@ export default {
this.itemCount = itemCount this.itemCount = itemCount
this.dataSource = listProjectAccount this.dataSource = listProjectAccount
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@ -178,10 +175,7 @@ export default {
} }
}).catch(error => { }).catch(error => {
// show error // show error
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
setTimeout(loading, 1000) setTimeout(loading, 1000)
}) })
@ -217,10 +211,7 @@ export default {
} }
}).catch(error => { }).catch(error => {
// show error // show error
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
setTimeout(loading, 1000) setTimeout(loading, 1000)
}) })

View File

@ -80,10 +80,7 @@ export default {
this.checkForAddAsyncJob(json, title, description) this.checkForAddAsyncJob(json, title, description)
this.$emit('close-action') this.$emit('close-action')
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.$emit('refresh-data') this.$emit('refresh-data')
this.loading = false this.loading = false

View File

@ -179,10 +179,7 @@ export default {
this.dataSource = listProjectInvitations this.dataSource = listProjectInvitations
this.itemCount = itemCount this.itemCount = itemCount
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
}) })
@ -237,10 +234,7 @@ export default {
} }
}).catch(error => { }).catch(error => {
// show error // show error
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: error.response.headers['x-description']
})
}).finally(() => { }).finally(() => {
setTimeout(loading, 1000) setTimeout(loading, 1000)
}) })

View File

@ -144,10 +144,7 @@ export default {
catchMessage: 'Error encountered while fetching async job result' catchMessage: 'Error encountered while fetching async job result'
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
this.$emit('refresh-data') this.$emit('refresh-data')

View File

@ -370,10 +370,7 @@ export default {
}) })
this.resetForm() this.resetForm()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.actionLoading = false this.actionLoading = false
}) })

View File

@ -91,10 +91,7 @@ export default {
this.storagePools = response.findstoragepoolsformigrationresponse.storagepool || [] this.storagePools = response.findstoragepoolsformigrationresponse.storagepool || []
this.selectedStoragePool = this.storagePools[0].id || '' this.selectedStoragePool = this.storagePools[0].id || ''
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.closeModal() this.closeModal()
}) })
} else { } else {
@ -104,10 +101,7 @@ export default {
this.storagePools = response.liststoragepoolsresponse.storagepool || [] this.storagePools = response.liststoragepoolsresponse.storagepool || []
this.selectedStoragePool = this.storagePools[0].id || '' this.selectedStoragePool = this.storagePools[0].id || ''
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.closeModal() this.closeModal()
}) })
} }
@ -119,10 +113,7 @@ export default {
this.diskOfferings = response.listdiskofferingsresponse.diskoffering this.diskOfferings = response.listdiskofferingsresponse.diskoffering
this.selectedDiskOffering = this.diskOfferings[0].id this.selectedDiskOffering = this.diskOfferings[0].id
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.closeModal() this.closeModal()
}) })
}, },
@ -158,10 +149,7 @@ export default {
} }
}) })
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: `Error ${error.response.status}`,
description: error.response.data.errorresponse.errortext
})
this.closeModal() this.closeModal()
}) })
} }

View File

@ -101,10 +101,7 @@ export default {
this.virtualMachineOptions.opts = json.listvirtualmachinesresponse.virtualmachine || [] this.virtualMachineOptions.opts = json.listvirtualmachinesresponse.virtualmachine || []
this.$forceUpdate() this.$forceUpdate()
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.virtualMachineOptions.loading = false this.virtualMachineOptions.loading = false
}) })
@ -162,10 +159,7 @@ export default {
}) })
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.actionLoading = false this.actionLoading = false
}) })

View File

@ -170,10 +170,7 @@ export default {
this.$emit('refresh') this.$emit('refresh')
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}).finally(() => { }).finally(() => {
this.actionLoading = false this.actionLoading = false
}) })

View File

@ -183,10 +183,7 @@ export default {
}) })
} }
}).catch(error => { }).catch(error => {
this.$notification.error({ this.$notifyError(error)
message: 'Request Failed',
description: (error.response && error.response.headers && error.response.headers['x-description']) || error.message
})
}) })
}) })
}, },