87 lines
2.1 KiB
JavaScript
87 lines
2.1 KiB
JavaScript
|
/**
|
||
|
* Created by HaijunZhang on 2019/7/23.
|
||
|
*/
|
||
|
import { request } from '@cmp/cmp-element'
|
||
|
import { wrapperParams } from 'utils'
|
||
|
|
||
|
const baseUrl = '/sms/v1/portal'
|
||
|
export function getPanel() {
|
||
|
return request.get(`${baseUrl}/panels`, {
|
||
|
params: { module: 'COP' }
|
||
|
})
|
||
|
}
|
||
|
export function savePanel(params) {
|
||
|
return request.patch(`${baseUrl}/panels`, wrapperParams(params))
|
||
|
}
|
||
|
export function resetPanel(module = 'cop') {
|
||
|
return request.put(`${baseUrl}/panels/${module}/reset`)
|
||
|
}
|
||
|
export function getPool() {
|
||
|
return request.get(`${baseUrl}/elementpools`, {
|
||
|
params: { module: 'COP' }
|
||
|
})
|
||
|
}
|
||
|
export function getConfig(params) {
|
||
|
return request.get(`${baseUrl}/elements`, {
|
||
|
params: wrapperParams(params)
|
||
|
})
|
||
|
}
|
||
|
export function getPlatformStats(params) {
|
||
|
return request.get('/cmp/v1/portal/platform/stats', {
|
||
|
params: wrapperParams(params)
|
||
|
})
|
||
|
}
|
||
|
export function getVendorStats(params) {
|
||
|
return request.get('/cmp/v1/portal/vendor/stats', {
|
||
|
params: wrapperParams(params)
|
||
|
})
|
||
|
}
|
||
|
export function getTaskStats(params) {
|
||
|
return request.get('/cop/v1/tasks/stats', {
|
||
|
params
|
||
|
})
|
||
|
}
|
||
|
export function getVmServiceTrend(params) {
|
||
|
return request.get('/cos/v1/portal/platform/statisticsOfComputer', {
|
||
|
params: wrapperParams(params)
|
||
|
})
|
||
|
}
|
||
|
export function getCharge(params) {
|
||
|
return request.get('/cmc/portal/charge/stats', {
|
||
|
params: wrapperParams(params)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export function getAlarmCount(params) {
|
||
|
return request.get('/cms/v1/alarms/chart', {
|
||
|
params
|
||
|
})
|
||
|
}
|
||
|
export function conditionBill(params) {
|
||
|
return request.get('/cos/v1/bills/condition', {
|
||
|
params: {
|
||
|
condition: JSON.stringify(params)
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
export function getOrderCount() {
|
||
|
return request.get('/cos/v1/soa/orders/count')
|
||
|
}
|
||
|
|
||
|
export function getOrderDashboard(params) {
|
||
|
return request.get('/cos/v1/soa/orders/dashboard', {
|
||
|
params
|
||
|
})
|
||
|
}
|
||
|
export function getResourceCountByDc(dcId) {
|
||
|
return request.get('/cmp/v1/dcs/resource/count', {
|
||
|
params: { dcId }
|
||
|
})
|
||
|
}
|
||
|
export function getSystemCount() {
|
||
|
return request.get('/sms/v1/system/count')
|
||
|
}
|
||
|
export function getTodoCount() {
|
||
|
return request.get('/cos/v1/soa/todo/count')
|
||
|
}
|