Skip to content

Commit 7a58a58

Browse files
fixes UI
1 parent e8ab0ae commit 7a58a58

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

ui/src/components/view/ImageDeployInstanceButton.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</template>
4242

4343
<script>
44-
import { api } from '@/api'
44+
import { getAPI } from '@/api'
4545
import ResourceIcon from '@/components/view/ResourceIcon'
4646
4747
export default {
@@ -100,7 +100,7 @@ export default {
100100
this.itemCount = 0
101101
this.fetchLoading = true
102102
this.zones = []
103-
api(this.imageApi, params).then(json => {
103+
getAPI(this.imageApi, params).then(json => {
104104
const imageResponse = json?.[this.imageApi.toLowerCase() + 'response']?.[this.$route.meta.name] || []
105105
this.zones = imageResponse.map(i => ({
106106
id: i.zoneid,
@@ -122,7 +122,7 @@ export default {
122122
}
123123
const zoneids = this.zones.map(z => z.id)
124124
this.loading = true
125-
api('listZones', { showicon: true, ids: zoneids.join(',') }).then(json => {
125+
getAPI('listZones', { showicon: true, ids: zoneids.join(',') }).then(json => {
126126
this.zones = json.listzonesresponse.zone || []
127127
}).finally(() => {
128128
this.loading = false

ui/src/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import {
4444
import { VueAxios } from './utils/request'
4545
import directives from './utils/directives'
4646
import Cookies from 'js-cookie'
47-
import { api } from '@/api'
47+
import { getAPI } from '@/api'
4848
import { applyCustomGuiTheme } from './utils/guiTheme'
4949

5050
vueApp.use(VueAxios, router)
@@ -106,7 +106,7 @@ fetch('config.json?ts=' + Date.now())
106106
let domainid = null
107107

108108
if (userid !== undefined && Cookies.get('sessionkey')) {
109-
await api('listUsers', { userid: userid }).then(response => {
109+
await getAPI('listUsers', { userid: userid }).then(response => {
110110
accountid = response.listusersresponse.user[0].accountid
111111
domainid = response.listusersresponse.user[0].domainid
112112
})

ui/src/utils/guiTheme.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// under the License.
1717

1818
import { vueProps } from '@/vue-app'
19-
import { api } from '@/api'
19+
import { getAPI } from '@/api'
2020

2121
export async function applyCustomGuiTheme (accountid, domainid) {
2222
await fetch('config.json').then(response => response.json()).then(config => {
@@ -45,7 +45,7 @@ export async function applyCustomGuiTheme (accountid, domainid) {
4545
}
4646

4747
async function fetchGuiTheme (params) {
48-
return await api('listGuiThemes', params).then(response => {
48+
return await getAPI('listGuiThemes', params).then(response => {
4949
if (response.listguithemesresponse.guiThemes) {
5050
return response.listguithemesresponse.guiThemes[0]
5151
}

ui/src/views/compute/KubernetesAddNodes.vue

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

6767
<script>
6868
import { ref, reactive, toRaw } from 'vue'
69-
import { api } from '@/api'
69+
import { postAPI } from '@/api'
7070
import TooltipLabel from '@/components/widgets/TooltipLabel'
7171
7272
export default {
@@ -112,7 +112,7 @@ export default {
112112
callListVms (accountId, domainId) {
113113
return new Promise((resolve) => {
114114
this.volumes = []
115-
api('listVirtualMachines', {
115+
postAPI('listVirtualMachines', {
116116
accountId: accountId,
117117
domainId: domainId,
118118
details: 'min',
@@ -172,7 +172,7 @@ export default {
172172
},
173173
addNodesToKubernetesCluster (params) {
174174
return new Promise((resolve, reject) => {
175-
api('addNodesToKubernetesCluster', params).then(json => {
175+
postAPI('addNodesToKubernetesCluster', params).then(json => {
176176
const jobId = json.addnodestokubernetesclusterresponse.jobid
177177
return resolve(jobId)
178178
}).catch(error => {

ui/src/views/compute/KubernetesRemoveNodes.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
<script>
5656
import { ref, reactive, toRaw } from 'vue'
57-
import { api } from '@/api'
57+
import { postAPI } from '@/api'
5858
import TooltipLabel from '@/components/widgets/TooltipLabel'
5959
6060
export default {
@@ -137,7 +137,7 @@ export default {
137137
},
138138
removeNodesFromKubernetesCluster (params) {
139139
return new Promise((resolve, reject) => {
140-
api('removeNodesFromKubernetesCluster', params).then(json => {
140+
postAPI('removeNodesFromKubernetesCluster', params).then(json => {
141141
const jobId = json.removenodesfromkubernetesclusterresponse.jobid
142142
return resolve(jobId)
143143
}).catch(error => {

0 commit comments

Comments
 (0)