summaryrefslogtreecommitdiff
path: root/public-src/main.js
blob: 09790005ff0b0db4dc35f78a99650490c12f3825 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
define([
	'golden-layout',
	'jarmon',
	'./cfg/jarmon-proton.js',
	'./cfg/jarmon-winston.js',
	'./components/gl/jarmon-tabbed-chart-ui.js',
	'./components/gl/html.js',
], function(
	GoldenLayout,
	jarmon,
	cfgProton,
	cfgWinston,
	glJarmon,
	glHTML,
) {
	jQuery.migrateMute = true;

	// set the default plot range
	for (var i = 0; i < jarmon.timeRangeShortcuts.length; i++) {
		if (jarmon.timeRangeShortcuts[i][0] === 'last day') {
			jarmon.timeRangeShortcuts[i][2] = true;
		}
	}

	var layoutManager = new GoldenLayout({
		settings: {
		},
		content: [{
			type: 'row',
			content: [
				{
					title: 'proton',
					type: 'component',
					componentName: 'jarmon:tabbed-chart-ui',
					componentState: cfgProton,
				},
				{
					title: 'winston',
					type: 'component',
					componentName: 'jarmon:tabbed-chart-ui',
					componentState: cfgWinston,
				},
				{
					title: 'TLS',
					type: 'component',
					componentName: 'html',
					componentState: document.getElementById("tls").innerHTML,
				},
			],
		}],
	}, document.body);
	layoutManager.registerComponent('jarmon:tabbed-chart-ui', glJarmon);
	layoutManager.registerComponent('html', glHTML);

	layoutManager.init();
});