File tree Expand file tree Collapse file tree
plugins/shutdown/src/main/java/org/apache/cloudstack/api/command Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030import com .cloud .user .Account ;
3131
3232@ APICommand (name = ReadyForShutdownCmd .APINAME ,
33- description = "Returs the status of CloudStack, whether a shutdown has been triggered and if ready to shutdown" ,
33+ description = "Returns the status of CloudStack, whether a shutdown has been triggered and if ready to shutdown" ,
3434 since = "4.19.0" ,
3535 responseObject = ReadyForShutdownResponse .class ,
3636 requestHasSensitiveInfo = false , responseHasSensitiveInfo = false )
Original file line number Diff line number Diff line change @@ -199,7 +199,8 @@ export default {
199199 created () {
200200 this .menus = this .mainMenu .find ((item ) => item .path === ' /' ).children
201201 this .collapsed = ! this .sidebarOpened
202- setInterval (this .checkShutdown , 5000 )
202+ const readyForShutdownPollingJob = setInterval (this .checkShutdown , 5000 )
203+ this .$store .commit (' SET_READY_FOR_SHUTDOWN_POLLING_JOB' , readyForShutdownPollingJob)
203204 },
204205 mounted () {
205206 const layoutMode = this .$config .theme [' @layout-mode' ] || ' light'
Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ const getters = {
5050 twoFaIssuer : state => state . user . twoFaIssuer ,
5151 loginFlag : state => state . user . loginFlag ,
5252 allProjects : ( state ) => state . app . allProjects ,
53- customHypervisorName : state => state . user . customHypervisorName
53+ customHypervisorName : state => state . user . customHypervisorName ,
54+ readyForShutdownPollingJob : state => state . user . readyForShutdownPollingJob
5455}
5556
5657export default getters
Original file line number Diff line number Diff line change @@ -130,6 +130,9 @@ const app = {
130130 } ,
131131 SET_SHUTDOWN_TRIGGERED : ( state , shutdownTriggered ) => {
132132 state . shutdownTriggered = shutdownTriggered
133+ } ,
134+ SET_READY_FOR_SHUTDOWN_POLLING_JOB : ( state , readyForShutdownPollingJob ) => {
135+ state . readyForShutdownPollingJob = readyForShutdownPollingJob
133136 }
134137 } ,
135138 actions : {
@@ -192,6 +195,9 @@ const app = {
192195 } ,
193196 SetShutdownTriggered ( { commit } , bool ) {
194197 commit ( 'SET_SHUTDOWN_TRIGGERED' , bool )
198+ } ,
199+ SetReadyForShutdownPollingJob ( { commit } , job ) {
200+ commit ( 'SET_READY_FOR_SHUTDOWN_POLLING_JOB' , job )
195201 }
196202 }
197203}
Original file line number Diff line number Diff line change @@ -65,7 +65,8 @@ const user = {
6565 twoFaEnabled : false ,
6666 twoFaProvider : '' ,
6767 twoFaIssuer : '' ,
68- customHypervisorName : 'Custom'
68+ customHypervisorName : 'Custom' ,
69+ readyForShutdownPollingJob : ''
6970 } ,
7071
7172 mutations : {
@@ -155,6 +156,9 @@ const user = {
155156 } ,
156157 SET_CUSTOM_HYPERVISOR_NAME ( state , name ) {
157158 state . customHypervisorName = name
159+ } ,
160+ SET_READY_FOR_SHUTDOWN_POLLING_JOB : ( state , job ) => {
161+ state . readyForShutdownPollingJob = job
158162 }
159163 } ,
160164
Original file line number Diff line number Diff line change @@ -189,6 +189,9 @@ export default {
189189 }
190190 this .initForm ()
191191 if (store .getters .logoutFlag ) {
192+ if (store .getters .readyForShutdownPollingJob !== ' ' || store .getters .readyForShutdownPollingJob !== undefined ) {
193+ clearInterval (store .getters .readyForShutdownPollingJob )
194+ }
192195 sourceToken .init ()
193196 this .fetchData ()
194197 } else {
You can’t perform that action at this time.
0 commit comments