Add more pages in the WebUI
This commit is contained in:
parent
2b828765e3
commit
fcc1109e76
82 changed files with 5005 additions and 249 deletions
79
webui/src/store/http/actions.js
Normal file
79
webui/src/store/http/actions.js
Normal file
|
@ -0,0 +1,79 @@
|
|||
import HttpService from '../../_services/HttpService'
|
||||
|
||||
export function getAllRouters ({ commit }, params) {
|
||||
commit('getAllRoutersRequest')
|
||||
return HttpService.getAllRouters(params)
|
||||
.then(body => {
|
||||
commit('getAllRoutersSuccess', body)
|
||||
return body
|
||||
})
|
||||
.catch(error => {
|
||||
commit('getAllRoutersFailure', error)
|
||||
return Promise.reject(error)
|
||||
})
|
||||
}
|
||||
|
||||
export function getRouterByName ({ commit }, name) {
|
||||
commit('getRouterByNameRequest')
|
||||
return HttpService.getRouterByName(name)
|
||||
.then(body => {
|
||||
commit('getRouterByNameSuccess', body)
|
||||
return body
|
||||
})
|
||||
.catch(error => {
|
||||
commit('getRouterByNameFailure', error)
|
||||
return Promise.reject(error)
|
||||
})
|
||||
}
|
||||
|
||||
export function getAllServices ({ commit }, params) {
|
||||
commit('getAllServicesRequest')
|
||||
return HttpService.getAllServices(params)
|
||||
.then(body => {
|
||||
commit('getAllServicesSuccess', body)
|
||||
return body
|
||||
})
|
||||
.catch(error => {
|
||||
commit('getAllServicesFailure', error)
|
||||
return Promise.reject(error)
|
||||
})
|
||||
}
|
||||
|
||||
export function getServiceByName ({ commit }, name) {
|
||||
commit('getServiceByNameRequest')
|
||||
return HttpService.getServiceByName(name)
|
||||
.then(body => {
|
||||
commit('getServiceByNameSuccess', body)
|
||||
return body
|
||||
})
|
||||
.catch(error => {
|
||||
commit('getServiceByNameFailure', error)
|
||||
return Promise.reject(error)
|
||||
})
|
||||
}
|
||||
|
||||
export function getAllMiddlewares ({ commit }, params) {
|
||||
commit('getAllMiddlewaresRequest')
|
||||
return HttpService.getAllMiddlewares(params)
|
||||
.then(body => {
|
||||
commit('getAllMiddlewaresSuccess', body)
|
||||
return body
|
||||
})
|
||||
.catch(error => {
|
||||
commit('getAllMiddlewaresFailure', error)
|
||||
return Promise.reject(error)
|
||||
})
|
||||
}
|
||||
|
||||
export function getMiddlewareByName ({ commit }, name) {
|
||||
commit('getMiddlewareByNameRequest')
|
||||
return HttpService.getMiddlewareByName(name)
|
||||
.then(body => {
|
||||
commit('getMiddlewareByNameSuccess', body)
|
||||
return body
|
||||
})
|
||||
.catch(error => {
|
||||
commit('getMiddlewareByNameFailure', error)
|
||||
return Promise.reject(error)
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue