gitlab-org--gitlab-foss/app/assets/javascripts/monitoring/monitoring_bundle.js
Jose Ivan Vargas 218dd51239 Migrate the monitoring dashboard store to vuex
This changes the monitoring javascript store from
an object based to a vuex one
2019-05-27 22:30:36 +00:00

26 lines
696 B
JavaScript

import Vue from 'vue';
import { parseBoolean } from '~/lib/utils/common_utils';
import Dashboard from 'ee_else_ce/monitoring/components/dashboard.vue';
import store from './stores';
export default (props = {}) => {
const el = document.getElementById('prometheus-graphs');
if (el && el.dataset) {
// eslint-disable-next-line no-new
new Vue({
el,
store,
render(createElement) {
return createElement(Dashboard, {
props: {
...el.dataset,
hasMetrics: parseBoolean(el.dataset.hasMetrics),
showTimeWindowDropdown: gon.features.metricsTimeWindow,
...props,
},
});
},
});
}
};