mirror of https://github.com/apache/cloudstack.git
Fix the poll for the API ReadyForShutdown even after logout (#8004)
This commit is contained in:
parent
3694667f50
commit
285387105f
|
|
@ -30,7 +30,7 @@ import org.apache.log4j.Logger;
|
|||
import com.cloud.user.Account;
|
||||
|
||||
@APICommand(name = ReadyForShutdownCmd.APINAME,
|
||||
description = "Returs the status of CloudStack, whether a shutdown has been triggered and if ready to shutdown",
|
||||
description = "Returns the status of CloudStack, whether a shutdown has been triggered and if ready to shutdown",
|
||||
since = "4.19.0",
|
||||
responseObject = ReadyForShutdownResponse.class,
|
||||
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
|
||||
|
|
|
|||
|
|
@ -199,7 +199,8 @@ export default {
|
|||
created () {
|
||||
this.menus = this.mainMenu.find((item) => item.path === '/').children
|
||||
this.collapsed = !this.sidebarOpened
|
||||
setInterval(this.checkShutdown, 5000)
|
||||
const readyForShutdownPollingJob = setInterval(this.checkShutdown, 5000)
|
||||
this.$store.commit('SET_READY_FOR_SHUTDOWN_POLLING_JOB', readyForShutdownPollingJob)
|
||||
},
|
||||
mounted () {
|
||||
const layoutMode = this.$config.theme['@layout-mode'] || 'light'
|
||||
|
|
|
|||
|
|
@ -50,7 +50,8 @@ const getters = {
|
|||
twoFaIssuer: state => state.user.twoFaIssuer,
|
||||
loginFlag: state => state.user.loginFlag,
|
||||
allProjects: (state) => state.app.allProjects,
|
||||
customHypervisorName: state => state.user.customHypervisorName
|
||||
customHypervisorName: state => state.user.customHypervisorName,
|
||||
readyForShutdownPollingJob: state => state.user.readyForShutdownPollingJob
|
||||
}
|
||||
|
||||
export default getters
|
||||
|
|
|
|||
|
|
@ -130,6 +130,9 @@ const app = {
|
|||
},
|
||||
SET_SHUTDOWN_TRIGGERED: (state, shutdownTriggered) => {
|
||||
state.shutdownTriggered = shutdownTriggered
|
||||
},
|
||||
SET_READY_FOR_SHUTDOWN_POLLING_JOB: (state, readyForShutdownPollingJob) => {
|
||||
state.readyForShutdownPollingJob = readyForShutdownPollingJob
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
|
@ -192,6 +195,9 @@ const app = {
|
|||
},
|
||||
SetShutdownTriggered ({ commit }, bool) {
|
||||
commit('SET_SHUTDOWN_TRIGGERED', bool)
|
||||
},
|
||||
SetReadyForShutdownPollingJob ({ commit }, job) {
|
||||
commit('SET_READY_FOR_SHUTDOWN_POLLING_JOB', job)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,8 @@ const user = {
|
|||
twoFaEnabled: false,
|
||||
twoFaProvider: '',
|
||||
twoFaIssuer: '',
|
||||
customHypervisorName: 'Custom'
|
||||
customHypervisorName: 'Custom',
|
||||
readyForShutdownPollingJob: ''
|
||||
},
|
||||
|
||||
mutations: {
|
||||
|
|
@ -155,6 +156,9 @@ const user = {
|
|||
},
|
||||
SET_CUSTOM_HYPERVISOR_NAME (state, name) {
|
||||
state.customHypervisorName = name
|
||||
},
|
||||
SET_READY_FOR_SHUTDOWN_POLLING_JOB: (state, job) => {
|
||||
state.readyForShutdownPollingJob = job
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -189,6 +189,9 @@ export default {
|
|||
}
|
||||
this.initForm()
|
||||
if (store.getters.logoutFlag) {
|
||||
if (store.getters.readyForShutdownPollingJob !== '' || store.getters.readyForShutdownPollingJob !== undefined) {
|
||||
clearInterval(store.getters.readyForShutdownPollingJob)
|
||||
}
|
||||
sourceToken.init()
|
||||
this.fetchData()
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue