WebUI: add udp pages

This commit is contained in:
Matthieu Hostache
2020-02-26 11:12:06 +01:00
committed by GitHub
parent 336dd1d5ba
commit 7a5d2a3bd9
23 changed files with 842 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ function getAllRouters (params) {
.then(response => {
const { data = [], headers } = response
const total = getTotal(headers, params)
console.log('Success -> HttpService -> getAllRouters', response.data)
console.log('Success -> TcpService -> getAllRouters', response.data)
return { data, total }
})
}
@@ -16,7 +16,7 @@ function getAllRouters (params) {
function getRouterByName (name) {
return APP.api.get(`${apiBase}/routers/${name}`)
.then(body => {
console.log('Success -> HttpService -> getRouterByName', body.data)
console.log('Success -> TcpService -> getRouterByName', body.data)
return body.data
})
}
@@ -26,7 +26,7 @@ function getAllServices (params) {
.then(response => {
const { data = [], headers } = response
const total = getTotal(headers, params)
console.log('Success -> HttpService -> getAllServices', response.data)
console.log('Success -> TcpService -> getAllServices', response.data)
return { data, total }
})
}
@@ -34,7 +34,7 @@ function getAllServices (params) {
function getServiceByName (name) {
return APP.api.get(`${apiBase}/services/${name}`)
.then(body => {
console.log('Success -> HttpService -> getServiceByName', body.data)
console.log('Success -> TcpService -> getServiceByName', body.data)
return body.data
})
}

View File

@@ -0,0 +1,47 @@
import { APP } from '../_helpers/APP'
import { getTotal } from './utils'
const apiBase = '/udp'
function getAllRouters (params) {
return APP.api.get(`${apiBase}/routers?search=${params.query}&status=${params.status}&per_page=${params.limit}&page=${params.page}`)
.then(response => {
const { data = [], headers } = response
const total = getTotal(headers, params)
console.log('Success -> UdpService -> getAllRouters', response.data)
return { data, total }
})
}
function getRouterByName (name) {
return APP.api.get(`${apiBase}/routers/${name}`)
.then(body => {
console.log('Success -> UdpService -> getRouterByName', body.data)
return body.data
})
}
function getAllServices (params) {
return APP.api.get(`${apiBase}/services?search=${params.query}&status=${params.status}&per_page=${params.limit}&page=${params.page}`)
.then(response => {
const { data = [], headers } = response
const total = getTotal(headers, params)
console.log('Success -> UdpService -> getAllServices', response.data)
return { data, total }
})
}
function getServiceByName (name) {
return APP.api.get(`${apiBase}/services/${name}`)
.then(body => {
console.log('Success -> UdpService -> getServiceByName', body.data)
return body.data
})
}
export default {
getAllRouters,
getRouterByName,
getAllServices,
getServiceByName
}