添加 Speed/updateBuild.ts
This commit is contained in:
parent
734869eb26
commit
0bd1398085
40
Speed/updateBuild.ts
Normal file
40
Speed/updateBuild.ts
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import { rawDataToAdminServer } from '@/api/admin/servers/getServer'
|
||||||
|
import http from '@/api/http'
|
||||||
|
|
||||||
|
interface UpdateServerBuildParameters {
|
||||||
|
cpu: number
|
||||||
|
memory: number
|
||||||
|
disk: number
|
||||||
|
addressIds: number[]
|
||||||
|
snapshotLimit: number | null
|
||||||
|
backupLimit: number | null
|
||||||
|
bandwidthLimit: number | null
|
||||||
|
bandwidthUsage: number
|
||||||
|
}
|
||||||
|
|
||||||
|
const updateBuild = async (
|
||||||
|
serverUuid: string,
|
||||||
|
{
|
||||||
|
addressIds,
|
||||||
|
snapshotLimit,
|
||||||
|
backupLimit,
|
||||||
|
bandwidthLimit,
|
||||||
|
bandwidthUsage,
|
||||||
|
...params
|
||||||
|
}: UpdateServerBuildParameters
|
||||||
|
) => {
|
||||||
|
const {
|
||||||
|
data: { data },
|
||||||
|
} = await http.patch(`/api/admin/servers/${serverUuid}/settings/build`, {
|
||||||
|
address_ids: addressIds,
|
||||||
|
snapshot_limit: snapshotLimit,
|
||||||
|
backup_limit: backupLimit,
|
||||||
|
bandwidth_limit: bandwidthLimit,
|
||||||
|
bandwidth_usage: bandwidthUsage,
|
||||||
|
...params,
|
||||||
|
})
|
||||||
|
|
||||||
|
return rawDataToAdminServer(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default updateBuild
|
||||||
Loading…
x
Reference in New Issue
Block a user