ui: prevent scheduling readyforshutdown job when api inaccessible (#8448)

Non-admin account may not have access to the readyForShutdown API therefore UI should not schedule the job.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2024-01-08 18:02:11 +05:30 committed by GitHub
parent a68dc0bfb5
commit 5c32a0edba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -199,8 +199,10 @@ export default {
created () {
this.menus = this.mainMenu.find((item) => item.path === '/').children
this.collapsed = !this.sidebarOpened
const readyForShutdownPollingJob = setInterval(this.checkShutdown, 5000)
this.$store.commit('SET_READY_FOR_SHUTDOWN_POLLING_JOB', readyForShutdownPollingJob)
if ('readyForShutdown' in this.$store.getters.apis) {
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'