Skip to content

Commit 5c32a0e

Browse files
authored
ui: prevent scheduling readyforshutdown job when api inaccessible (apache#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>
1 parent a68dc0b commit 5c32a0e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

ui/src/components/page/GlobalLayout.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,10 @@ export default {
199199
created () {
200200
this.menus = this.mainMenu.find((item) => item.path === '/').children
201201
this.collapsed = !this.sidebarOpened
202-
const readyForShutdownPollingJob = setInterval(this.checkShutdown, 5000)
203-
this.$store.commit('SET_READY_FOR_SHUTDOWN_POLLING_JOB', readyForShutdownPollingJob)
202+
if ('readyForShutdown' in this.$store.getters.apis) {
203+
const readyForShutdownPollingJob = setInterval(this.checkShutdown, 5000)
204+
this.$store.commit('SET_READY_FOR_SHUTDOWN_POLLING_JOB', readyForShutdownPollingJob)
205+
}
204206
},
205207
mounted () {
206208
const layoutMode = this.$config.theme['@layout-mode'] || 'light'

0 commit comments

Comments
 (0)