-
Notifications
You must be signed in to change notification settings - Fork 1.2k
UI fix api in project view #11191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI fix api in project view #11191
Changes from all commits
d58d605
70cc55d
4c55cc2
f8fa89b
1247a1b
7323321
3908815
37d9db4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -149,6 +149,15 @@ const err = (error) => { | |||||||||||||
| service.interceptors.request.use(config => { | ||||||||||||||
| source = sourceToken.getSource() | ||||||||||||||
| config.cancelToken = source.token | ||||||||||||||
|
|
||||||||||||||
| handleGetRequestParams(config) | ||||||||||||||
|
|
||||||||||||||
| handlePostRequestParams(config) | ||||||||||||||
|
|
||||||||||||||
| return config | ||||||||||||||
| }, err) | ||||||||||||||
|
|
||||||||||||||
| function handleGetRequestParams (config) { | ||||||||||||||
| if (config && config.params) { | ||||||||||||||
| config.params.response = 'json' | ||||||||||||||
| const project = vueProps.$localStorage.get(CURRENT_PROJECT) | ||||||||||||||
|
|
@@ -160,11 +169,30 @@ service.interceptors.request.use(config => { | |||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| if (config.params.ignoreproject !== undefined) { | ||||||||||||||
| config.params.ignoreproject = null | ||||||||||||||
| delete config.params.ignoreproject | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| return config | ||||||||||||||
| }, err) | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| function handlePostRequestParams (config) { | ||||||||||||||
| if (config && config.data && config.data instanceof URLSearchParams) { | ||||||||||||||
| const project = vueProps.$localStorage.get(CURRENT_PROJECT) | ||||||||||||||
| const command = config.data.get('command') | ||||||||||||||
| const hasProjectId = config.data.has('projectid') | ||||||||||||||
| const ignoreProject = config.data.has('ignoreproject') | ||||||||||||||
|
|
||||||||||||||
| if (!hasProjectId && !ignoreProject && project && project.id) { | ||||||||||||||
| if (command === 'listTags') { | ||||||||||||||
| config.data.append('projectid', '-1') | ||||||||||||||
| } else if (command !== 'assignVirtualMachine') { | ||||||||||||||
|
Comment on lines
+185
to
+187
|
||||||||||||||
| if (command === 'listTags') { | |
| config.data.append('projectid', '-1') | |
| } else if (command !== 'assignVirtualMachine') { | |
| if (command === COMMANDS.LIST_TAGS) { | |
| config.data.append('projectid', '-1') | |
| } else if (command !== COMMANDS.ASSIGN_VM) { |
vishesh92 marked this conversation as resolved.
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,7 +66,7 @@ | |
|
|
||
| <script> | ||
| import { ref, reactive, toRaw } from 'vue' | ||
| import { api } from '@/api' | ||
| import { getAPI, postAPI } from '@/api' | ||
| import TooltipLabel from '@/components/widgets/TooltipLabel' | ||
|
|
||
| export default { | ||
|
|
@@ -112,7 +112,7 @@ export default { | |
| callListVms (accountId, domainId) { | ||
| return new Promise((resolve) => { | ||
| this.volumes = [] | ||
| api('listVirtualMachines', { | ||
| getAPI('listVirtualMachines', { | ||
| accountId: accountId, | ||
| domainId: domainId, | ||
| details: 'min', | ||
|
|
@@ -172,7 +172,7 @@ export default { | |
| }, | ||
| addNodesToKubernetesCluster (params) { | ||
| return new Promise((resolve, reject) => { | ||
| api('addNodesToKubernetesCluster', params).then(json => { | ||
| postAPI('addNodesToKubernetesCluster', params).then(json => { | ||
|
||
| const jobId = json.addnodestokubernetesclusterresponse.jobid | ||
| return resolve(jobId) | ||
| }).catch(error => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,7 +54,7 @@ | |
|
|
||
| <script> | ||
| import { ref, reactive, toRaw } from 'vue' | ||
| import { api } from '@/api' | ||
| import { postAPI } from '@/api' | ||
| import TooltipLabel from '@/components/widgets/TooltipLabel' | ||
|
|
||
| export default { | ||
|
|
@@ -137,7 +137,7 @@ export default { | |
| }, | ||
| removeNodesFromKubernetesCluster (params) { | ||
| return new Promise((resolve, reject) => { | ||
| api('removeNodesFromKubernetesCluster', params).then(json => { | ||
| postAPI('removeNodesFromKubernetesCluster', params).then(json => { | ||
|
||
| const jobId = json.removenodesfromkubernetesclusterresponse.jobid | ||
| return resolve(jobId) | ||
| }).catch(error => { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.