diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-11-22 19:33:53 +0300 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-11-22 19:52:14 +0300 |
commit | e67373007997ea61167a08d69008caed6e2d6c8e (patch) | |
tree | d7b7ab5a5420df12a392a561ad68f1f8914853a5 /app/assets/javascripts/monitoring | |
parent | 6da130c2952494c8c773a65d795ad2261d291e53 (diff) |
Replaced vue-resource for axios in the prometheus dashboard
Diffstat (limited to 'app/assets/javascripts/monitoring')
-rw-r--r-- | app/assets/javascripts/monitoring/services/monitoring_service.js | 13 |
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'); |