340340</template >
341341
342342<script >
343- import { api } from ' @/api'
343+ import { getAPI , postAPI } from ' @/api'
344344import { genericCompare } from ' @/utils/sort.js'
345345import Status from ' @/components/widgets/Status'
346346import { EditOutlined , DeleteOutlined , PlayCircleOutlined , PauseCircleOutlined } from ' @ant-design/icons-vue'
@@ -439,7 +439,7 @@ export default {
439439 } else if (this .resourceType === ' VirtualMachine' ) {
440440 params .virtualmachineid = this .resource .id
441441 }
442- api (' listGpuDevices' , params).then (json => {
442+ getAPI (' listGpuDevices' , params).then (json => {
443443 const devices = json? .listgpudevicesresponse ? .gpudevice || []
444444 this .items = this .buildGpuTree (devices)
445445 }).catch (error => {
@@ -597,7 +597,7 @@ export default {
597597 bulkManageGpuDevices () {
598598 if (! this .validateBulkOperation ()) return
599599
600- api (' manageGpuDevice' , {
600+ getAPI (' manageGpuDevice' , {
601601 ids: this .selectedGpuDeviceIds .join (' ,' )
602602 }).then (() => {
603603 this .handleBulkOperationSuccess (' message.success.manage.gpu.devices' , this .selectedGpuDeviceIds .length )
@@ -608,7 +608,7 @@ export default {
608608 bulkUnmanageGpuDevices () {
609609 if (! this .validateBulkOperation ()) return
610610
611- api (' unmanageGpuDevice' , {
611+ getAPI (' unmanageGpuDevice' , {
612612 ids: this .selectedGpuDeviceIds .join (' ,' )
613613 }).then (() => {
614614 this .handleBulkOperationSuccess (' message.success.unmanage.gpu.devices' , this .selectedGpuDeviceIds .length )
@@ -617,7 +617,7 @@ export default {
617617 })
618618 },
619619 manageGpuDevice (record ) {
620- api (' manageGpuDevice' , {
620+ getAPI (' manageGpuDevice' , {
621621 ids: record .id
622622 }).then (() => {
623623 this .$notification .success ({
@@ -630,7 +630,7 @@ export default {
630630 })
631631 },
632632 unmanageGpuDevice (record ) {
633- api (' unmanageGpuDevice' , {
633+ getAPI (' unmanageGpuDevice' , {
634634 ids: record .id
635635 }).then (() => {
636636 this .$notification .success ({
@@ -737,7 +737,7 @@ export default {
737737 },
738738 fetchGpuCards () {
739739 this .loadingGpuCards = true
740- api (' listGpuCards' ).then (json => {
740+ getAPI (' listGpuCards' ).then (json => {
741741 this .gpuCards = json? .listgpucardsresponse ? .gpucard || []
742742 this .generateUpdateFormFields () // Refresh form fields with new data
743743 }).catch (error => {
@@ -752,7 +752,7 @@ export default {
752752 if (gpucardid) {
753753 params .gpucardid = gpucardid
754754 }
755- api (' listVgpuProfiles' , params).then (json => {
755+ getAPI (' listVgpuProfiles' , params).then (json => {
756756 this .vgpuProfiles = json? .listvgpuprofilesresponse ? .vgpuprofile || []
757757 this .generateUpdateFormFields () // Refresh form fields with new data
758758 }).catch (error => {
@@ -766,7 +766,7 @@ export default {
766766 return
767767 }
768768 this .loadingParentDevices = true
769- api (' listGpuDevices' , { hostid: this .resource .id }).then (json => {
769+ getAPI (' listGpuDevices' , { hostid: this .resource .id }).then (json => {
770770 const devices = json? .listgpudevicesresponse ? .gpudevice || []
771771 // Only include devices that can be parent devices (not virtual GPU devices)
772772 this .parentGpuDevices = devices .filter (device => ! device .parentgpudeviceid )
@@ -785,7 +785,6 @@ export default {
785785 vgpuprofileid: record .vgpuprofileid ,
786786 type: record .type ,
787787 numanode: record .numanode ,
788- pciroot: record .pciroot ,
789788 parentgpudeviceid: record .parentgpudeviceid
790789 }
791790 this .fetchGpuCards ()
@@ -817,14 +816,11 @@ export default {
817816 if (this .gpuDeviceForm .numanode ) {
818817 params .numanode = this .gpuDeviceForm .numanode
819818 }
820- if (this .gpuDeviceForm .pciroot ) {
821- params .pciroot = this .gpuDeviceForm .pciroot
822- }
823819 if (this .gpuDeviceForm .parentgpudeviceid ) {
824820 params .parentgpudeviceid = this .gpuDeviceForm .parentgpudeviceid
825821 }
826822
827- api (' updateGpuDevice' , params).then (() => {
823+ postAPI (' updateGpuDevice' , params).then (() => {
828824 this .$notification .success ({
829825 message: this .$t (' label.success' ),
830826 description: this .$t (' message.success.update.gpu.device' )
@@ -843,7 +839,7 @@ export default {
843839 this .deleteGpuDevices (this .selectedGpuDeviceIds , ' message.success.delete.gpu.devices' )
844840 },
845841 deleteGpuDevices (deviceIds , successMessageKey ) {
846- api (' deleteGpuDevice' , {
842+ postAPI (' deleteGpuDevice' , {
847843 ids: deviceIds .join (' ,' )
848844 }).then (() => {
849845 this .$notification .success ({
0 commit comments