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