maxgui/src/store/monitor.js
/**
         * @param {Object} payload payload object
         * @param {String} payload.id Name of the monitor
         * @param {Array} payload.servers servers array
         * @param {Function} payload.callback callback function after successfully updated
         */
@param {Object} payload payload object
@param {String} payload.id Name of the monitor
@param {Array} payload.servers servers array
@param {Function} payload.callback callback function after successfully updated
@param { Object } payload payload object @param { String } payload . id Name of the monitor @param { Array } payload . servers servers array @param { Function } payload . callback callback function after successfully updated
async updateMonitorRelationship({ commit }, payload) {
            try {
                let res
                let message
                res = await this.vue.$axios.patch(`/monitors/${payload.id}/relationships/servers`, {
                    data: payload.servers,
                })
                message = [`Servers relationships of ${payload.id} is updated`]
                if (res.status === 204) {
                    commit(
                        'SET_SNACK_BAR_MESSAGE',
                        {
                            text: message,
                            type: 'success',
                        },
                        { root: true }
                    )
                    if (this.vue.$help.isFunction(payload.callback)) await payload.callback()
                }
            } catch (e) {
                const logger = this.vue.$logger('store-monitor-updateMonitorRelationship')
                logger.error(e)
            }
        }
async updateMonitorRelationship ( { commit } , payload ) { try { let res let message res = await this . vue . $axios . patch ( ` ${ payload . id } ` , { data : payload . servers , } ) message = [ ` ${ payload . id } ` ] if ( res . status === 204 ) { commit ( 'SET_SNACK_BAR_MESSAGE' , { text : message , type : 'success' , } , { root : true } ) if ( this . vue . $help . isFunction ( payload . callback ) ) await payload . callback ( ) } } catch ( e ) { const logger = this . vue . $logger ( 'store-monitor-updateMonitorRelationship' ) logger . error ( e ) } }
@param {Object} payload payload object
 @param {String} payload.id Name of the monitor
 @param {Array} payload.servers servers array
 @param {Function} payload.callback callback function after successfully updated
@param { Object } payload payload object @param { String } payload . id Name of the monitor @param { Array } payload . servers servers array @param { Function } payload . callback callback function after successfully updated
// response ok