2017-06-20 08:50:31 +00:00
|
|
|
import Vue from 'vue';
|
2018-11-21 15:13:04 +00:00
|
|
|
import { parseBoolean } from '~/lib/utils/common_utils';
|
2019-04-23 13:35:39 +00:00
|
|
|
import Dashboard from 'ee_else_ce/monitoring/components/dashboard.vue';
|
2019-05-27 22:30:36 +00:00
|
|
|
import store from './stores';
|
2017-03-20 19:54:03 +00:00
|
|
|
|
2019-04-16 03:51:17 +00:00
|
|
|
export default (props = {}) => {
|
2018-03-06 07:25:19 +00:00
|
|
|
const el = document.getElementById('prometheus-graphs');
|
2018-02-22 06:07:58 +00:00
|
|
|
|
|
|
|
if (el && el.dataset) {
|
|
|
|
// eslint-disable-next-line no-new
|
|
|
|
new Vue({
|
|
|
|
el,
|
2019-05-27 22:30:36 +00:00
|
|
|
store,
|
2018-02-22 06:07:58 +00:00
|
|
|
render(createElement) {
|
|
|
|
return createElement(Dashboard, {
|
2018-03-06 09:38:42 +00:00
|
|
|
props: {
|
|
|
|
...el.dataset,
|
2018-11-21 15:13:04 +00:00
|
|
|
hasMetrics: parseBoolean(el.dataset.hasMetrics),
|
2019-04-02 20:02:29 +00:00
|
|
|
showTimeWindowDropdown: gon.features.metricsTimeWindow,
|
2019-04-16 03:51:17 +00:00
|
|
|
...props,
|
2018-03-06 09:38:42 +00:00
|
|
|
},
|
2018-02-22 06:07:58 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|