summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-11-22 18:17:43 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-11-22 18:17:43 +0000
commit48b65bb0ef5b7e70229491464bf69d910c27ed63 (patch)
tree397b9f5d18d6be5cc9b10c0bd201783a9f86c872 /app
parent0c972f56b8193c173fffeccf1c9080c0682071e2 (diff)
parente67373007997ea61167a08d69008caed6e2d6c8e (diff)
downloadgitlab-ce-48b65bb0ef5b7e70229491464bf69d910c27ed63.tar.gz
Merge branch 'jivl-replace-vue-resource-prometheus-dashboard' into 'master'
Replace vue-resource for axios in the Prometheus Dashboard See merge request gitlab-org/gitlab-ce!15547
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/monitoring/services/monitoring_service.js13
1 files changed, 5 insertions, 8 deletions
diff --git a/app/assets/javascripts/monitoring/services/monitoring_service.js b/app/assets/javascripts/monitoring/services/monitoring_service.js
index fed884d5c94..e230a06cd8c 100644
--- a/app/assets/javascripts/monitoring/services/monitoring_service.js
+++ b/app/assets/javascripts/monitoring/services/monitoring_service.js
@@ -1,10 +1,7 @@
-import Vue from 'vue';
-import VueResource from 'vue-resource';
+import axios from '../../lib/utils/axios_utils';
import statusCodes from '../../lib/utils/http_status';
import { backOff } from '../../lib/utils/common_utils';
-Vue.use(VueResource);
-
const MAX_REQUESTS = 3;
function backOffRequest(makeRequestCallback) {
@@ -32,8 +29,8 @@ export default class MonitoringService {
}
getGraphsData() {
- return backOffRequest(() => Vue.http.get(this.metricsEndpoint))
- .then(resp => resp.json())
+ return backOffRequest(() => axios.get(this.metricsEndpoint))
+ .then(resp => resp.data)
.then((response) => {
if (!response || !response.data) {
throw new Error('Unexpected metrics data response from prometheus endpoint');
@@ -43,8 +40,8 @@ export default class MonitoringService {
}
getDeploymentData() {
- return backOffRequest(() => Vue.http.get(this.deploymentEndpoint))
- .then(resp => resp.json())
+ return backOffRequest(() => axios.get(this.deploymentEndpoint))
+ .then(resp => resp.data)
.then((response) => {
if (!response || !response.deployments) {
throw new Error('Unexpected deployment data response from prometheus endpoint');