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';
|
2017-08-30 04:49:29 +00:00
|
|
|
import Dashboard from './components/dashboard.vue';
|
2017-03-20 19:54:03 +00:00
|
|
|
|
2018-02-22 06:07:58 +00:00
|
|
|
export default () => {
|
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,
|
|
|
|
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),
|
2018-03-06 09:38:42 +00:00
|
|
|
},
|
2018-02-22 06:07:58 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|