summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/observability/index.js
blob: cd342ebee3edcba7c9e97840217304cacfd4bd93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import Vue from 'vue';
import VueRouter from 'vue-router';

import ObservabilityApp from './components/observability_app.vue';

Vue.use(VueRouter);

export default () => {
  const el = document.getElementById('js-observability-app');

  if (!el) return false;

  const router = new VueRouter({
    mode: 'history',
  });

  return new Vue({
    el,
    router,
    render(h) {
      return h(ObservabilityApp, {
        props: {
          observabilityIframeSrc: el.dataset.observabilityIframeSrc,
        },
      });
    },
  });
};