2017-06-20 04:50:31 -04:00
|
|
|
import Vue from 'vue';
|
2018-03-06 04:38:42 -05:00
|
|
|
import { convertPermissionToBoolean } from '~/lib/utils/common_utils';
|
2017-08-30 00:49:29 -04:00
|
|
|
import Dashboard from './components/dashboard.vue';
|
2017-03-20 15:54:03 -04:00
|
|
|
|
2018-02-22 01:07:58 -05:00
|
|
|
export default () => {
|
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,
|
|
|
|
hasMetrics: convertPermissionToBoolean(el.dataset.hasMetrics),
|
|
|
|
},
|
2018-02-22 01:07:58 -05:00
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|