summaryrefslogtreecommitdiff
path: root/public-src/components/gl/jarmon-tabbed-chart-ui.js
blob: ac449d89f13170217195227f60f34adba17cbd08 (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
define([], function() {
	return function(container, state) {
		container.getElement().html(''+
			'<div class="jarmon">'+
			'	<div class="chart-container">'+
			'		<h2 class="title"></h2>'+
			'		<form>'+
			'			<input name="chart_edit" value="Edit" type="button" />'+
			'			<input name="chart_delete" value="Delete" type="button" />'+
			'		</form>'+
			'		<div class="error"></div>'+
			'		<div class="chart"></div>'+
			'		<div class="graph-legend"></div>'+
			'	</div>'+
			'	<div class="chartRangeControl">'+
			'		<form>'+
			'			<div class="range-inputs">'+
			'				<input name="from" type="datetime-local" step="1" />'+
			'				<input name="to" type="datetime-local" step="1" />'+
			'				<select name="shortcuts" title="Time range shortcuts - click to select an alternative time range" ></select>'+
			'				<select name="tzoffset" title="Timezone offset - click to choose a custom timezone offset" ></select>'+
			'				<input name="action" value="Update" type="button"'+
			'				       title="Graph update - click to update all graphs" />'+
			'			</div>'+
			'			<div class="range-preview"'+
			'			     title="Time range preview - click and drag to select a custom timerange" ></div>'+
			'		</form>'+
			'	</div>'+
			'	<div class="tabbed-chart-interface"></div>'+
			'</div>'+
			'');
		var chartTemplate = container.getElement().find(".chart-container").remove();

		container.on('open', function() {
			jarmon.buildTabbedChartUi(
				chartTemplate,
				state.chartRecipes,
				container.getElement().find('.tabbed-chart-interface'),
				state.tabRecipes,
				container.getElement().find('.chartRangeControl')
			)
		});
	};
});