2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 09:13:49 +08:00

feat: alova.js替换axios

This commit is contained in:
耗子
2025-02-09 04:42:44 +08:00
parent a07c50b3f5
commit 23e215b009
14 changed files with 233 additions and 568 deletions

View File

@@ -82,31 +82,28 @@ const removeVolumeRow = (index: number) => {
createModel.volumes.splice(index, 1)
}
const getNetworks = async () => {
const { data } = await container.networkList(1, 1000)
networks.value = data.items.map((item: any) => {
return {
label: item.name,
value: item.id
const getNetworks = () => {
useRequest(container.networkList(1, 1000)).onSuccess(({ data }) => {
networks.value = data.items.map((item: any) => {
return {
label: item.name,
value: item.id
}
})
if (networks.value.length > 0) {
createModel.network = networks.value[0].value
}
})
if (networks.value.length > 0) {
createModel.network = networks.value[0].value
}
}
const handleSubmit = () => {
doSubmit.value = true
container
.containerCreate(createModel)
.then(() => {
useRequest(container.containerCreate(createModel))
.onSuccess(() => {
window.$message.success('创建成功')
handleClose()
})
.catch(() => {
window.$message.error('创建失败')
})
.finally(() => {
.onComplete(() => {
doSubmit.value = false
})
}