Skip to content

Commit f20d940

Browse files
committed
fixup
1 parent 8083a48 commit f20d940

File tree

7 files changed

+26
-34
lines changed

7 files changed

+26
-34
lines changed

ui/public/locales/en.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1764,7 +1764,6 @@
17641764
"label.payload": "Payload",
17651765
"label.payloadurl": "Payload URL",
17661766
"label.pcidevice": "GPU",
1767-
"label.pciroot": "PCI root",
17681767
"label.peername": "Management Server",
17691768
"label.peermsid": "Management Server Node ID",
17701769
"label.peerrunid": "Process Timestamp",

ui/src/components/view/GPUDevicesTab.vue

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@
340340
</template>
341341

342342
<script>
343-
import { api } from '@/api'
343+
import { getAPI, postAPI } from '@/api'
344344
import { genericCompare } from '@/utils/sort.js'
345345
import Status from '@/components/widgets/Status'
346346
import { 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({

ui/src/components/view/GPUSummaryTab.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</template>
6363

6464
<script>
65-
import { api } from '@/api'
65+
import { getAPI } from '@/api'
6666
6767
export default {
6868
name: 'GPUSummaryTab',
@@ -114,7 +114,7 @@ export default {
114114
params.virtualmachineid = this.resource.id
115115
}
116116
117-
api('listGpuDevices', params).then(json => {
117+
getAPI('listGpuDevices', params).then(json => {
118118
const devices = json?.listgpudevicesresponse?.gpudevice || []
119119
this.summaryData = this.buildSummaryData(devices)
120120
}).catch(error => {

ui/src/components/view/GPUTab.vue

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
</template>
141141

142142
<script>
143-
import { api } from '@/api'
143+
import { getAPI, postAPI } from '@/api'
144144
import GPUSummaryTab from '@/components/view/GPUSummaryTab'
145145
import GPUDevicesTab from '@/components/view/GPUDevicesTab'
146146
@@ -193,7 +193,7 @@ export default {
193193
return
194194
}
195195
196-
api('discoverGpuDevices', {
196+
getAPI('discoverGpuDevices', {
197197
id: this.resource.id
198198
}).then(() => {
199199
this.$notification.success({
@@ -293,7 +293,7 @@ export default {
293293
},
294294
fetchGpuCards () {
295295
this.loadingGpuCards = true
296-
api('listGpuCards').then(json => {
296+
getAPI('listGpuCards').then(json => {
297297
this.gpuCards = json?.listgpucardsresponse?.gpucard || []
298298
this.generateFormFields() // Refresh form fields with new data
299299
}).catch(error => {
@@ -308,7 +308,7 @@ export default {
308308
if (gpucardid) {
309309
params.gpucardid = gpucardid
310310
}
311-
api('listVgpuProfiles', params).then(json => {
311+
getAPI('listVgpuProfiles', params).then(json => {
312312
this.vgpuProfiles = json?.listvgpuprofilesresponse?.vgpuprofile || []
313313
this.generateFormFields() // Refresh form fields with new data
314314
}).catch(error => {
@@ -322,7 +322,7 @@ export default {
322322
return
323323
}
324324
this.loadingParentDevices = true
325-
api('listGpuDevices', { hostid: this.resource.id }).then(json => {
325+
getAPI('listGpuDevices', { hostid: this.resource.id }).then(json => {
326326
const devices = json?.listgpudevicesresponse?.gpudevice || []
327327
// Only include devices that can be parent devices (not virtual GPU devices)
328328
this.parentGpuDevices = devices.filter(device => !device.parentgpudeviceid)
@@ -369,14 +369,11 @@ export default {
369369
if (this.gpuDeviceForm.numanode) {
370370
params.numanode = this.gpuDeviceForm.numanode
371371
}
372-
if (this.gpuDeviceForm.pciroot) {
373-
params.pciroot = this.gpuDeviceForm.pciroot
374-
}
375372
if (this.gpuDeviceForm.parentgpudeviceid) {
376373
params.parentgpudeviceid = this.gpuDeviceForm.parentgpudeviceid
377374
}
378375
379-
api('createGpuDevice', params).then(() => {
376+
postAPI('createGpuDevice', params).then(() => {
380377
this.$notification.success({
381378
message: this.$t('label.success'),
382379
description: this.$t('message.success.add.gpu.device')

ui/src/components/view/SearchView.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,7 @@ export default {
14211421
},
14221422
fetchGpuCards (searchKeyword) {
14231423
return new Promise((resolve, reject) => {
1424-
api('listGpuCards', { keyword: searchKeyword }).then(json => {
1424+
getAPI('listGpuCards', { keyword: searchKeyword }).then(json => {
14251425
const gpuCards = json.listgpucardsresponse.gpucard
14261426
resolve({
14271427
type: 'gpucardid',
@@ -1441,7 +1441,7 @@ export default {
14411441
params.gpucardid = this.form.gpucardid
14421442
}
14431443
1444-
api('listVgpuProfiles', params).then(json => {
1444+
getAPI('listVgpuProfiles', params).then(json => {
14451445
const vgpuProfiles = json.listvgpuprofilesresponse.vgpuprofile
14461446
resolve({
14471447
type: 'vgpuprofileid',

ui/src/components/view/VgpuProfilesTab.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108

109109
<script>
110110
import { reactive, toRaw } from 'vue'
111-
import { api } from '@/api'
111+
import { getAPI, postAPI } from '@/api'
112112
import { genericCompare } from '@/utils/sort.js'
113113
import ListView from '@/components/view/ListView'
114114
@@ -186,7 +186,7 @@ export default {
186186
params.description = formRaw.description
187187
}
188188
189-
api('createVgpuProfile', params).then(response => {
189+
postAPI('createVgpuProfile', params).then(response => {
190190
this.$message.success(this.$t('message.success.create.vgpu.profile'))
191191
this.closeModal()
192192
this.fetchData()
@@ -227,7 +227,7 @@ export default {
227227
}
228228
},
229229
fetchVgpuProfiles () {
230-
api('listVgpuProfiles', {
230+
getAPI('listVgpuProfiles', {
231231
gpucardid: this.resource.id
232232
}).then(res => {
233233
this.items = res?.listvgpuprofilesresponse?.vgpuprofile || []

ui/src/views/offering/AddComputeOffering.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ export default {
845845
},
846846
fetchGPUCards () {
847847
this.gpuCardLoading = true
848-
api('listGpuCards', {
848+
getAPI('listGpuCards', {
849849
}).then(json => {
850850
this.gpuCards = json.listgpucardsresponse.gpucard || []
851851
// Add a "None" option at the beginning
@@ -1001,7 +1001,7 @@ export default {
10011001
fetchVgpuProfiles (gpuCardId) {
10021002
this.vgpuProfileLoading = true
10031003
this.vgpuProfiles = []
1004-
api('listVgpuProfiles', {
1004+
getAPI('listVgpuProfiles', {
10051005
gpucardid: gpuCardId
10061006
}).then(json => {
10071007
this.vgpuProfiles = json.listvgpuprofilesresponse.vgpuprofile || []

0 commit comments

Comments
 (0)