<%  @calendar_select_interval = 2    %>
<div class="button" onclick="stat_flextera_select_log(1)" style="width:200px;left:10px;top:10px"><%= t('.page_log') %></div>
<div class="button" onclick="stat_flextera_select_log(2)" style="width:200px;left:220px;top:10px"><%= t('.cont_log') %></div>
<div style="width:100%;height:calc(100% - 50px);position:absolute;top:50px;left:0px" >
	<%
		#	gt - Глобальная таблица
			@container=""
			@gt_structure=[]
						@gt_structure.push({:onclick => "", :row_name => t(:date), :value => "'+AddTimeZone(data.data[i].date)+'", :width => "width:200px", :filter => 'date' })
						@gt_structure.push({:onclick => "", :row_name => t(:message), :value => "'+data.data[i].message+'", :width => "", :filter => 'message' })
						

	%>
	<%= render partial: "shared/table", locals: {
		name:"logs_table",
		header:@gt_structure,
		query:"get_flextera_logs",
		action_after:0,
		time:1,
		add_params:',type:flextera_logs_selected',
		offset:50,
		first_sort:'date;DESC',
		additional_field:@container
	} %>
</div>
<script>
var flextera_logs_selected=1

function calendar_update(){
	gt_last_page_logs_table=1
	gt_build_table_logs_table(gt_last_sort_logs_table)
}

function stat_flextera_select_log(type){
	flextera_logs_selected=type
	calendar_update()
}
function AddTimeZone(date) {
	date=new Date(date)
	return '<div style="float:left">'+date.getDate()+' '+(calendar_month_names[date.getMonth()].shortname)+' '+date.getFullYear()+' <b>|</b> </div><div style="color:<%= $blue %>;float:left">'+date.getHours().add_zero()+':'+date.getMinutes().add_zero()+':'+date.getSeconds().add_zero()+'</div>'
}
</script>