Add a new dashboard page.
This commit is contained in:
parent
89150e1164
commit
fd24b1898e
133 changed files with 17303 additions and 11112 deletions
25
webui/src/store/core/actions.js
Normal file
25
webui/src/store/core/actions.js
Normal 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)
|
||||
})
|
||||
}
|
13
webui/src/store/core/getters.js
Normal file
13
webui/src/store/core/getters.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
// ----------------------------
|
||||
// all Overview
|
||||
// ----------------------------
|
||||
export function allOverview (state) {
|
||||
return state.allOverview
|
||||
}
|
||||
|
||||
// ----------------------------
|
||||
// Version
|
||||
// ----------------------------
|
||||
export function version (state) {
|
||||
return state.version
|
||||
}
|
12
webui/src/store/core/index.js
Normal file
12
webui/src/store/core/index.js
Normal 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
|
||||
}
|
25
webui/src/store/core/mutations.js
Normal file
25
webui/src/store/core/mutations.js
Normal 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
|
||||
}
|
4
webui/src/store/core/state.js
Normal file
4
webui/src/store/core/state.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
export default {
|
||||
allOverview: {},
|
||||
version: ''
|
||||
}
|
14
webui/src/store/entrypoints/actions.js
Normal file
14
webui/src/store/entrypoints/actions.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
import entrypointsService from '../../_services/EntrypointsService'
|
||||
|
||||
export function getAll ({ commit }) {
|
||||
commit('getAllRequest')
|
||||
return entrypointsService.getAll()
|
||||
.then(body => {
|
||||
commit('getAllSuccess', body)
|
||||
return body
|
||||
})
|
||||
.catch(error => {
|
||||
commit('getAllFailure', error)
|
||||
return Promise.reject(error)
|
||||
})
|
||||
}
|
6
webui/src/store/entrypoints/getters.js
Normal file
6
webui/src/store/entrypoints/getters.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
// ----------------------------
|
||||
// all
|
||||
// ----------------------------
|
||||
export function all (state) {
|
||||
return state.all
|
||||
}
|
12
webui/src/store/entrypoints/index.js
Normal file
12
webui/src/store/entrypoints/index.js
Normal 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
|
||||
}
|
18
webui/src/store/entrypoints/mutations.js
Normal file
18
webui/src/store/entrypoints/mutations.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
// ----------------------------
|
||||
// Get All
|
||||
// ----------------------------
|
||||
export function getAllRequest (state) {
|
||||
state.all.loading = true
|
||||
}
|
||||
|
||||
export function getAllSuccess (state, body) {
|
||||
state.all = { items: body, loading: false }
|
||||
}
|
||||
|
||||
export function getAllFailure (state, error) {
|
||||
state.all = { error }
|
||||
}
|
||||
|
||||
export function getAllClear (state) {
|
||||
state.all = {}
|
||||
}
|
4
webui/src/store/entrypoints/state.js
Normal file
4
webui/src/store/entrypoints/state.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
export default {
|
||||
all: {},
|
||||
byName: {}
|
||||
}
|
27
webui/src/store/index.js
Normal file
27
webui/src/store/index.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
|
||||
import core from './core'
|
||||
import entrypoints from './entrypoints'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
/*
|
||||
* If not building with SSR mode, you can
|
||||
* directly export the Store instantiation
|
||||
*/
|
||||
|
||||
export default function (/* { ssrContext } */) {
|
||||
const Store = new Vuex.Store({
|
||||
modules: {
|
||||
core,
|
||||
entrypoints
|
||||
},
|
||||
|
||||
// enable strict mode (adds overhead!)
|
||||
// for dev mode only
|
||||
strict: process.env.DEV
|
||||
})
|
||||
|
||||
return Store
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue