{"version":3,"sources":["webpack:///src/components/Apis/ApiUsage.vue","webpack:///./src/components/Apis/ApiUsage.vue","webpack:///./src/components/Apis/ApiUsage.vue?57b9","webpack:///./src/components/Apis/ApiUsage.vue?b071","webpack:///./src/components/Apis/ApiUsage.vue?8966"],"names":["components","BarChart","props","apiId","type","Number","default","data","date","Date","startDate","setDate","getDate","endDate","dataLoaded","showChart","chartData","labels","datasets","options","scales","yAxes","ticks","beginAtZero","gridLines","display","xAxes","legend","responsive","maintainAspectRatio","computed","created","getApiUsage","mounted","methods","_this","self","statsProvider","format","then","response","status","dataset","i","length","d","push","NrOfCalls","label","fill","borderColor","backgroundColor","borderWidth","finally","render","_vm","_c","_self","staticClass","staticStyle","attrs","chartdata","_e","staticRenderFns","_withStripped"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA;AACA;AAEe;EACfA,UAAA;IACAC,QAAA,WAAAA,SAAA;MAAA;IAAA;EACA;EAEAC,KAAA;IACAC,KAAA;MACAC,IAAA,EAAAC,MAAA;MACAC,OAAA;IACA;EACA;EAEAC,IAAA,WAAAA,KAAA;IACA,IAAAC,IAAA,OAAAC,IAAA;IAEA;MACAC,SAAA,MAAAD,IAAA,CAAAD,IAAA,CAAAG,OAAA,CAAAH,IAAA,CAAAI,OAAA;MACAC,OAAA,MAAAJ,IAAA;MACAF,IAAA;MACAO,UAAA;MACAC,SAAA;MAEAC,SAAA;QACAC,MAAA;QACAC,QAAA;MACA;MAEAC,OAAA;QACAC,MAAA;UACAC,KAAA,GACA;YACAC,KAAA;cACAC,WAAA;YACA;YACAC,SAAA;cACAC,OAAA;YACA;UACA,EACA;UACAC,KAAA,GACA;YACAF,SAAA;cACAC,OAAA;YACA;UACA;QAEA;QACAE,MAAA;UACAF,OAAA;QACA;QACAG,UAAA;QACAC,mBAAA;MACA;IACA;EACA;EAEAC,QAAA;EAEAC,OAAA,WAAAA,QAAA;IACA,KAAAC,WAAA;EACA;EAEAC,OAAA,WAAAA,QAAA;EAEA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,CAAC,UAAU,EAAE;IACbG,WAAW,EAAE;MAAE,YAAY,EAAE;IAAQ,CAAC;IACtCC,KAAK,EAAE;MAAEC,SAAS,EAAEN,GAAG,CAACvC,SAAS;MAAEG,OAAO,EAAEoC,GAAG,CAACpC;IAAQ;EAC1D,CAAC,CAAC,GACFoC,GAAG,CAACO,EAAE,CAAC,CAAC,CACb,EACD,CACF,CAAC;AACH,CAAC;AACD,IAAIC,eAAe,GAAG,EAAE;AACxBT,MAAM,CAACU,aAAa,GAAG,IAAI;;;;;;;;;;;;;;AClB3B;AAAA;AAAA;AAAA;AAAsF;AAC3B;AACL;;;AAGtD;AAC6F;AAC7F,gBAAgB,mHAAU;AAC1B,EAAE,qFAAM;AACR,EAAE,0FAAM;AACR,EAAE,mGAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,IAAI,KAAU,EAAE,YAiBf;AACD;AACe,gF;;;;;;;;;;;;;ACtCf;AAAgS,CAAgB,0UAAG,EAAC,C;;;;;;;;;;;;;ACApT;AAAA;AAAA;AAAA;AAAA","file":"js/333.js?id=4a431ac40014e279e97d","sourcesContent":["<template>\n  <div class=\"bar-Char\">\n    <BarChart\n      v-if=\"showChart\"\n      :chartdata=\"chartData\"\n      :options=\"options\"\n      style=\"min-height: 250px;\"\n    />\n  </div>\n</template>\n\n<script>\nimport statsProvider from '@/providers/stats'\nimport { format } from 'date-fns'\n\nexport default {\n  components: {\n    BarChart: () => import('@/components/UI/Charts/BarChart'),\n  },\n\n  props: {\n    apiId: {\n      type: Number,\n      default: 0,\n    },\n  },\n\n  data() {\n    let date = new Date()\n\n    return {\n      startDate: new Date(date.setDate(date.getDate() - 30)),\n      endDate: new Date(),\n      data: null,\n      dataLoaded: false,\n      showChart: false,\n\n      chartData: {\n        labels: [],\n        datasets: [],\n      },\n\n      options: {\n        scales: {\n          yAxes: [\n            {\n              ticks: {\n                beginAtZero: true,\n              },\n              gridLines: {\n                display: true,\n              },\n            },\n          ],\n          xAxes: [\n            {\n              gridLines: {\n                display: false,\n              },\n            },\n          ],\n        },\n        legend: {\n          display: true,\n        },\n        responsive: true,\n        maintainAspectRatio: false,\n      },\n    }\n  },\n\n  computed: {},\n\n  created() {\n    this.getApiUsage()\n  },\n\n  mounted() {},\n\n  methods: {\n    getApiUsage() {\n      let self = this\n\n      statsProvider.methods\n        .getApiUsage(\n          format(self.startDate, 'yyyy-MM-dd'),\n          format(self.endDate, 'yyyy-MM-dd'),\n          self.apiId\n        )\n        .then((response) => {\n          if (response.status === 200) {\n            self.data = response.data\n\n            let labels = []\n            let dataset = []\n\n            for (let i = 0; i < self.data.length; i++) {\n              let d = self.data[i]\n\n              labels.push(format(d.Date, 'yyyy-MM-dd'))\n              dataset.push(d.NrOfCalls)\n            }\n\n            self.chartData.labels = labels\n            self.chartData.datasets.push({\n              label: 'Nr of calls',\n              data: dataset,\n              fill: false,\n              borderColor: '#209CEE',\n              backgroundColor: '#209CEE',\n              borderWidth: 1,\n            })\n\n            //self.renderChart(self.chartData, self.options)\n            this.showChart = true\n          }\n        })\n        .finally(() => {\n          this.dataLoaded = true\n        })\n    },\n  },\n}\n</script>\n\n<style></style>\n","var render = function render() {\n  var _vm = this,\n    _c = _vm._self._c\n  return _c(\n    \"div\",\n    { staticClass: \"bar-Char\" },\n    [\n      _vm.showChart\n        ? _c(\"BarChart\", {\n            staticStyle: { \"min-height\": \"250px\" },\n            attrs: { chartdata: _vm.chartData, options: _vm.options },\n          })\n        : _vm._e(),\n    ],\n    1\n  )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./ApiUsage.vue?vue&type=template&id=27f3ee06\"\nimport script from \"./ApiUsage.vue?vue&type=script&lang=js\"\nexport * from \"./ApiUsage.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  null,\n  null\n  \n)\n\n/* hot reload */\nif (module.hot) {\n  var api = require(\"/github/workspace/node_modules/vue-hot-reload-api/dist/index.js\")\n  api.install(require('vue'))\n  if (api.compatible) {\n    module.hot.accept()\n    if (!api.isRecorded('27f3ee06')) {\n      api.createRecord('27f3ee06', component.options)\n    } else {\n      api.reload('27f3ee06', component.options)\n    }\n    module.hot.accept(\"./ApiUsage.vue?vue&type=template&id=27f3ee06\", function () {\n      api.rerender('27f3ee06', {\n        render: render,\n        staticRenderFns: staticRenderFns\n      })\n    })\n  }\n}\ncomponent.options.__file = \"src/components/Apis/ApiUsage.vue\"\nexport default component.exports","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ApiUsage.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ApiUsage.vue?vue&type=script&lang=js\"","export * from \"-!../../../node_modules/cache-loader/dist/cjs.js?{\\\"cacheDirectory\\\":\\\"node_modules/.cache/vue-loader\\\",\\\"cacheIdentifier\\\":\\\"d2a26fb4-vue-loader-template\\\"}!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ApiUsage.vue?vue&type=template&id=27f3ee06\""],"sourceRoot":""}