mirror of https://github.com/apache/cloudstack.git
Merge remote-tracking branch 'apache/4.15' into main
This commit is contained in:
commit
f957457c05
|
|
@ -93,7 +93,7 @@ export const pollJobPlugin = {
|
|||
const currentPage = this.$router.currentRoute.path
|
||||
const samePage = options.originalPage === currentPage || options.originalPage.startsWith(currentPage + '/')
|
||||
if (samePage && (!action || !('isFetchData' in action) || (action.isFetchData))) {
|
||||
eventBus.$emit('async-job-complete')
|
||||
eventBus.$emit('async-job-complete', action)
|
||||
}
|
||||
successMethod(result)
|
||||
} else if (result.jobstatus === 2) {
|
||||
|
|
@ -127,7 +127,11 @@ export const pollJobPlugin = {
|
|||
status: 'failed',
|
||||
duration: 2
|
||||
})
|
||||
if (!action || !('isFetchData' in action) || (action.isFetchData)) {
|
||||
|
||||
// Ensure we refresh on the same / parent page
|
||||
const currentPage = this.$router.currentRoute.path
|
||||
const samePage = options.originalPage === currentPage || options.originalPage.startsWith(currentPage + '/')
|
||||
if (samePage && (!action || !('isFetchData' in action) || (action.isFetchData))) {
|
||||
eventBus.$emit('async-job-complete', action)
|
||||
}
|
||||
errorMethod(result)
|
||||
|
|
|
|||
|
|
@ -1021,7 +1021,9 @@ export default {
|
|||
})
|
||||
},
|
||||
pollActionCompletion (jobId, action, resourceName, resource, showLoading = true) {
|
||||
eventBus.$emit('update-job-details', jobId, resource)
|
||||
if (this.shouldNavigateBack(action)) {
|
||||
action.isFetchData = false
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
this.$pollJob({
|
||||
jobId,
|
||||
|
|
@ -1277,7 +1279,7 @@ export default {
|
|||
}
|
||||
response.then(jobId => {
|
||||
hasJobId = jobId
|
||||
if ((action.icon === 'delete' || ['archiveEvents', 'archiveAlerts', 'unmanageVirtualMachine'].includes(action.api)) && this.dataView) {
|
||||
if (this.shouldNavigateBack(action)) {
|
||||
this.$router.go(-1)
|
||||
} else {
|
||||
if (!hasJobId) {
|
||||
|
|
@ -1299,6 +1301,9 @@ export default {
|
|||
})
|
||||
})
|
||||
},
|
||||
shouldNavigateBack (action) {
|
||||
return ((action.icon === 'delete' || ['archiveEvents', 'archiveAlerts', 'unmanageVirtualMachine'].includes(action.api)) && this.dataView)
|
||||
},
|
||||
changeFilter (filter) {
|
||||
const query = Object.assign({}, this.$route.query)
|
||||
delete query.templatefilter
|
||||
|
|
|
|||
Loading…
Reference in New Issue