diff --git a/src/components/Structure/Footer.vue b/src/components/Structure/Footer.vue index 44a951b..3b6a0d0 100644 --- a/src/components/Structure/Footer.vue +++ b/src/components/Structure/Footer.vue @@ -10,9 +10,9 @@ Etat des serveurs
- CBS - XML - ITEM + CBS + XML + ITEM
@@ -36,20 +36,23 @@ diff --git a/src/service/ItemService.js b/src/service/ItemService.js index 68bfc41..50343e9 100644 --- a/src/service/ItemService.js +++ b/src/service/ItemService.js @@ -163,8 +163,11 @@ export class ItemService { return this.client.get('applicationDetails'); } - getHealthOfServices(){ - return this.client.get('applicationStatutServices') + async getHealthOfServices(){ + return this.client.get('applicationStatutServices').then(response => { + console.log(response.data) + return response.data + }) } } diff --git a/src/service/StatusService.js b/src/service/StatusService.js new file mode 100644 index 0000000..ecd690b --- /dev/null +++ b/src/service/StatusService.js @@ -0,0 +1,27 @@ +import axios from 'axios'; + +export class StatusService { + constructor() { + this.client = axios.create({ + baseURL: "https://api.uptimerobot.com/" + }); + } + + async getStatusBaseXML(){ + let data = {"api_key":"ur707639-b082a50474d1cfbe940438bc", "monitors":"782344734"} + return this.client.post(`v2/getMonitors`,data).then( + response => { + return response.data.monitors[0].status === 2; + }) + } + + async getStatusCBS(){ + let data = {"api_key":"ur707639-b082a50474d1cfbe940438bc", "monitors":"782344748"} + return this.client.post(`v2/getMonitors`,data).then( + response => { + return response.data.monitors[0].status === 2; + }) + } +} + +export default new StatusService()