1
0
Fork 0

Add a new dashboard page.

This commit is contained in:
Jorge Gonzalez 2019-08-26 18:15:41 +02:00 committed by Ludovic Fernandez
parent 89150e1164
commit fd24b1898e
133 changed files with 17303 additions and 11112 deletions

View file

@ -0,0 +1,25 @@
import coreService from '../../_services/CoreService'
export function getOverview ({ commit }) {
commit('getOverviewRequest')
return coreService.getOverview()
.then(body => {
commit('getOverviewSuccess', body)
return body
})
.catch(error => {
commit('getOverviewFailure', error)
return Promise.reject(error)
})
}
export function getVersion ({ commit }) {
return coreService.getVersion()
.then(body => {
commit('getVersionSuccess', body)
return body
})
.catch(error => {
return Promise.reject(error)
})
}

View file

@ -0,0 +1,13 @@
// ----------------------------
// all Overview
// ----------------------------
export function allOverview (state) {
return state.allOverview
}
// ----------------------------
// Version
// ----------------------------
export function version (state) {
return state.version
}

View file

@ -0,0 +1,12 @@
import state from './state'
import * as getters from './getters'
import * as mutations from './mutations'
import * as actions from './actions'
export default {
namespaced: true,
getters,
mutations,
actions,
state
}

View file

@ -0,0 +1,25 @@
// ----------------------------
// Get Overview
// ----------------------------
export function getOverviewRequest (state) {
state.allOverview.loading = true
}
export function getOverviewSuccess (state, body) {
state.allOverview = { items: body, loading: false }
}
export function getOverviewFailure (state, error) {
state.allOverview = { error }
}
export function getOverviewClear (state) {
state.allOverview = {}
}
// ----------------------------
// Get Version
// ----------------------------
export function getVersionSuccess (state, body) {
state.version = body
}

View file

@ -0,0 +1,4 @@
export default {
allOverview: {},
version: ''
}