blob: 85aae6f53c467d5bfe321e8bf2eb0bd0ec8f3b33 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
import Vue from 'vue';
import { darkModeEnabled } from '~/lib/utils/color_utils';
import { setUrlParams } from '~/lib/utils/url_utility';
export function getFrameSrc(url) {
return `${setUrlParams({ theme: darkModeEnabled() ? 'dark' : 'light' }, url)}&kiosk=inline-embed`;
}
const mountVueComponent = (element) => {
const url = [element.dataset.frameUrl];
return new Vue({
el: element,
render(h) {
return h('iframe', {
style: {
height: '366px',
width: '768px',
},
attrs: {
src: getFrameSrc(url),
frameBorder: '0',
},
});
},
});
};
export default function renderObservability(elements) {
elements.forEach((element) => {
mountVueComponent(element);
});
}
|