From 791013a86eac03901619baee71c17b136425c60b Mon Sep 17 00:00:00 2001 From: Florian Symanowski Date: Tue, 10 Sep 2019 02:16:30 +0200 Subject: [PATCH] Make the api url for development configurable via env file (#33) Make the api url for development configurable via env file Signed-off-by: Rohit Yadav --- ui/.env.local | 1 + ui/README.md | 4 ++++ ui/src/components/CloudMonkey/Resource.vue | 3 +-- ui/src/components/tools/HeaderNotice.vue | 9 ++++----- ui/src/components/tools/TranslationMenu.vue | 4 +++- ui/vue.config.js | 2 +- 6 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 ui/.env.local diff --git a/ui/.env.local b/ui/.env.local new file mode 100644 index 00000000000..55d2b97214d --- /dev/null +++ b/ui/.env.local @@ -0,0 +1 @@ +API_URL=http://localhost:8080/client/api diff --git a/ui/README.md b/ui/README.md index 5380f9821e1..09d413f4cae 100644 --- a/ui/README.md +++ b/ui/README.md @@ -34,6 +34,10 @@ Fix issues and vulnerabilities: npm audit +Override the default CloudStack API URL: + + Change the `API_URL` in the `.env.local` file + ## History The project was created by Rohit Yadav over several weekends during late 2018. diff --git a/ui/src/components/CloudMonkey/Resource.vue b/ui/src/components/CloudMonkey/Resource.vue index cf87984f41e..cb964bde8dd 100644 --- a/ui/src/components/CloudMonkey/Resource.vue +++ b/ui/src/components/CloudMonkey/Resource.vue @@ -280,7 +280,6 @@ import DataView from '@/components/widgets/DataView' import InstanceView from '@/components/widgets/InstanceView' import Status from '@/components/widgets/Status' import { mixinDevice } from '@/utils/mixin.js' -import { constants } from 'crypto'; export default { name: 'Resource', @@ -558,7 +557,7 @@ export default { if (obj.includes('response')) { for (const res in json[obj]) { if (res === 'jobid') { - this.$store.dispatch('AddAsyncJob', { 'title': this.currentAction.label, 'jobid': json[obj][res], 'description': this.resource.name, 'status': 'progress'}) + this.$store.dispatch('AddAsyncJob', { 'title': this.currentAction.label, 'jobid': json[obj][res], 'description': this.resource.name, 'status': 'progress' }) break } } diff --git a/ui/src/components/tools/HeaderNotice.vue b/ui/src/components/tools/HeaderNotice.vue index db1b8a6ee46..abae245d3bb 100644 --- a/ui/src/components/tools/HeaderNotice.vue +++ b/ui/src/components/tools/HeaderNotice.vue @@ -34,7 +34,6 @@