maxgui/src/store/server.js
/**
         *  Generate data schema for total connections of each server
         */
Generate data schema for total connections of each server
Generate data schema for total connections of each server
genDataSets({ commit, state }) {
            const { all_servers } = state
            const { genLineStreamDataset } = this.vue.$help
            if (all_servers.length) {
                let dataSets = []
                all_servers.forEach((server, i) => {
                    const {
                        id,
                        attributes: { statistics: { connections = null } = {} } = {},
                    } = server
                    if (connections !== null) {
                        const dataset = genLineStreamDataset({
                            label: `Server ID - ${id}`,
                            value: connections,
                            colorIndex: i,
                            id,
                        })
                        dataSets.push(dataset)
                    }
                })
                commit('SET_SERVER_CONNECTIONS_DATASETS', dataSets)
            }
        }
genDataSets ( { commit , state } ) { const { all_servers } = state const { genLineStreamDataset } = this . vue . $help if ( all_servers . length ) { let dataSets = [ ] all_servers . forEach ( ( server , i ) => { const { id , attributes : { statistics : { connections = null } = { } } = { } , } = server if ( connections !== null ) { const dataset = genLineStreamDataset ( { label : ` ${ id } ` , value : connections , colorIndex : i , id , } ) dataSets . push ( dataset ) } } ) commit ( 'SET_SERVER_CONNECTIONS_DATASETS' , dataSets ) } }
Generate data schema for total connections of each server
Generate data schema for total connections of each server