generated from Leo_Ding/web-template
主机列表
This commit is contained in:
parent
fbca951282
commit
1a625fca72
@ -2,21 +2,11 @@
|
|||||||
* 权限接口
|
* 权限接口
|
||||||
*/
|
*/
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
// 获取role列表
|
// 获取主机列表
|
||||||
export const getPageList = (params) => request.basic.get('/api/v1/power-hosts', params)
|
export const getPageList = (params) => request.basic.get('/api/v1/power-hosts', params)
|
||||||
// 获取role条数据
|
// 删除主机列表
|
||||||
export const getPage = (id) => request.basic.get(`/api/v1/power-hosts/${id}`)
|
export const delHost = (id) => request.basic.delete(`/api/v1/power-hosts/${id}`)
|
||||||
// 添加role
|
// 编辑主机列表
|
||||||
export const createPage = (params) => request.basic.post('/api/v1/power-hosts', params)
|
export const updateHost = (id, params) => request.basic.put(`/api/v1/power-hosts/${id}`, params)
|
||||||
// 更新role
|
// 获取主机详情
|
||||||
export const updatePage = (id, params) => request.basic.put(`/api/v1/power-hosts/${id}`, params)
|
export const getHostDetail = (id) => request.basic.delete(`/api/v1/power-hosts//${id}`)
|
||||||
// 删除role
|
|
||||||
export const delPage = (id) => request.basic.delete(`/api/v1/power-hosts/${id}`)
|
|
||||||
//获取区域列表
|
|
||||||
export const getRegionList = (params) => request.basic.get('/api/v1/computing-power-centers/label', params)
|
|
||||||
//添加算力卡
|
|
||||||
export const createComputeCard = (params) => request.basic.post('/api/v1/computing-cards', params)
|
|
||||||
//获取算力卡列表
|
|
||||||
export const getComputeCardList = (params) => request.basic.get('/api/v1/computing-cards', params)
|
|
||||||
//删除算力卡
|
|
||||||
export const delComputeCard = (id) => request.basic.delete(`/api/v1/computing-cards/${id}`)
|
|
||||||
|
|||||||
@ -80,7 +80,7 @@ async function handleEdit(record = {}) {
|
|||||||
title: t('pages.system.role.edit'),
|
title: t('pages.system.role.edit'),
|
||||||
})
|
})
|
||||||
|
|
||||||
const { data, success } = await apis.role.getRole(record.id).catch()
|
const { data, success } = await apis.host.getHostDetail(record.id).catch()
|
||||||
if (!success) {
|
if (!success) {
|
||||||
message.error(t('component.message.error.save'))
|
message.error(t('component.message.error.save'))
|
||||||
hideModal()
|
hideModal()
|
||||||
@ -115,7 +115,7 @@ function handleOk() {
|
|||||||
})
|
})
|
||||||
break
|
break
|
||||||
case 'edit':
|
case 'edit':
|
||||||
result = await apis.banner.updateBanner(formData.value.id, params).catch(() => {
|
result = await apis.host.updateHost(formData.value.id, params).catch(() => {
|
||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
|
|||||||
@ -215,7 +215,7 @@ function handleRemove({ id }) {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
; (async () => {
|
; (async () => {
|
||||||
try {
|
try {
|
||||||
const { success } = await apis.role.delRole(id).catch(() => {
|
const { success } = await apis.host.delHost(id).catch(() => {
|
||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
if (config('http.code.success') === success) {
|
if (config('http.code.success') === success) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user