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