maxgui/src/store/index.js
/**
         * User will be logged out if maxscale is restarted or maxgui is updated
         * This action checks if an update is available.
         * It should be dispatched on public route when routing occurs
         */
User will be logged out if maxscale is restarted or maxgui is updated
This action checks if an update is available.
It should be dispatched on public route when routing occurs
User will be logged out if maxscale is restarted or maxgui is updated This action checks if an update is available . It should be dispatched on public route when routing occurs
async checkingForUpdate({ commit }) {
            refreshAxiosToken()
            const logger = this.vue.$logger('index-store')
            const res = await this.vue.$axios.get(`/`)
            logger.info('Checking for update')
            const resDoc = new DOMParser().parseFromString(res.data, 'text/html')
            const newCommitId = resDoc.getElementsByName('commitId')[0].content
            const currentAppCommitId = document
                .getElementsByName('commitId')[0]
                .getAttribute('content')
            logger.info('MaxGUI commit id:', currentAppCommitId)
            logger.info('MaxGUI new commit id:', newCommitId)
            if (currentAppCommitId !== newCommitId) {
                commit('SET_UPDATE_AVAILABILITY', true)
                logger.info('New version is available')
            }
        }
async checkingForUpdate ( { commit } ) { refreshAxiosToken ( ) const logger = this . vue . $logger ( 'index-store' ) const res = await this . vue . $axios . get ( ` ` ) logger . info ( 'Checking for update' ) const resDoc = new DOMParser ( ) . parseFromString ( res . data , 'text/html' ) const newCommitId = resDoc . getElementsByName ( 'commitId' ) [ 0 ] . content const currentAppCommitId = document . getElementsByName ( 'commitId' ) [ 0 ] . getAttribute ( 'content' ) logger . info ( 'MaxGUI commit id:' , currentAppCommitId ) logger . info ( 'MaxGUI new commit id:' , newCommitId ) if ( currentAppCommitId !== newCommitId ) { commit ( 'SET_UPDATE_AVAILABILITY' , true ) logger . info ( 'New version is available' ) } }
User will be logged out if maxscale is restarted or maxgui is updated
 This action checks if an update is available.
User will be logged out if maxscale is restarted or maxgui is updated This action checks if an update is available .