接口调试

main
陈博文 1 week ago
parent 0749208a0d
commit a2c556a404

@ -5,7 +5,7 @@
round>创建资源池</el-button>
</template>
</list-header>
<div v-loading="loading" style="min-height: 200px;">
<block-box
v-for="{ poolId, poolName, nodeNum, cpuCores, gpuNum, availableMemory, totalMemory, diskSize, nodeList }, index in list"
:key="poolId">
@ -33,7 +33,7 @@
</div>
</el-row>
</block-box>
</div>
<el-dialog @close="editId = null; input = ''; nodeSelect = []" v-model="dialogVisible"
:title="editId ? '编辑资源池' : '创建资源池'" width="1180" :before-close="handleClose">
<el-row :wrap="false" style="align-items: center;">
@ -110,6 +110,7 @@ const nodeList = ref([])
const nodeSelect = ref([])
const input = ref('')
const btnLoading = ref(false)
const loading = ref(true)
const bytesToGB = (bytes) => {
return Math.round(bytes / (1024 * 1024 * 1024));
@ -145,12 +146,14 @@ const handleOk = async () => {
nodes
})
}
console.log(res, 'res')
if (res?.code === 200) {
getList();
btnLoading.value = false;
dialogVisible.value = false;
}
btnLoading.value = false;
}
const handleCheckboxChange = (ip) => {
const index = nodeSelect.value.indexOf(ip);
if (index > -1) {
@ -165,17 +168,27 @@ const handleDelete = async (id) => {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
const res = await pollApi.delete({ pool_id: id })
if (res.code === 1) {
beforeClose: async (action, instance, done) => {
if (action === 'confirm') {
instance.confirmButtonLoading = true;
const res = await pollApi.delete({ pool_id: id });
if (res.code === 200) {
ElMessage.success('删除成功');
getList();
done(); //
}
instance.confirmButtonLoading = false; // loading
} else {
done();
}
}
})
}
const getList = async () => {
loading.value = true
const res = await pollApi.getPollList()
loading.value = false
list.value = res.data
}

Loading…
Cancel
Save