tionStatsParameters(view.Parameters):register(self):.optional(laquo;timeline_typeraquo;, str, default= hour raquo ;, save=True) .optional ( from_year raquo ;, int, save=True) .optional ( from_month raquo ;, int, save=True) .optional ( from_day raquo ;, int , save=True) .optional ( from_hour raquo ;, int, save=True) .optional ( from_min raquo ;, int, save=True) .optional ( to_year raquo ;, int, save=True) .optional ( to_month raquo ;, int, save=True) .optional ( to_day raquo ;, int, save=True) .optional ( to_hour raquo ;, int, save=True) .optional ( to_min raquo ;, int, save =True) .optional ( filter raquo ;, str, save=True) .optional ( idmef_filter raquo ;, str) .optional ( apply raquo ;, str) _processTimeCriteria (self):=time.time () ._ period_end =time.localtime (now) self.parameters [ timeline_type ] == hour :. dataset [ timeline_hour_selected ]= selected=" selected " ._ period_start=time.localtime ( now - 3600) self.parameters [ timeline_type ] == day :. dataset [ timeline_day_selected ]= selected=" selected " =time.localtime (now - 24 * 3600 ) ._ period_start=time.localtime (now - 24 * 3600) self.parameters [ timeline_type ] == month :. dataset [ timeline_month_selected ]= selected=" selected " =list (time.localtime (now)) [1] -=1._period_start=time.localtime (time.mktime (tm)) :. dataset [ timeline_custom_selected ]= selected=" selected " raquo ; ._ period_start=time.struct_time ((self.parameters [ from_year ], self.parameters [ from_month ] ,. parameters [ from_day ], self.parameters [ from_hour ] ,. parameters [ from_min ], 0, 0, 0, - 1)) ._ period_end=time.struct_time ((self.parameters [ to_year ], self.parameters [ to_month ] ,. parameters [ to_day ], self.parameters [ to_hour ] ,. parameters [ to_min ], 0, 0, 0, - 1)). dataset [ from_year ]=%. 4d % Self._period_start.tm_year.dataset [ from_month ]=%. 2d % Self._period_start.tm_mon.dataset [ from_day ]=%. 2d % Self._period_start.tm_mday.dataset [ from_hour ]=%. 2d % Self._period_start.tm_hour.dataset [ from_min ]=%. 2d % Self._period_start.tm_min.dataset [ to_year ]=%. 4d % Self._period_end.tm_year.dataset [ to_month ]=%. 2d % Self._period_end.tm_mon.dataset [ to_day ]=%. 2d % Self._period_end.tm_mday.dataset [ to_hour ]=%. 2d % Self._period_end.tm_hour.dataset [ to_min ]=%. 2d % Self._period_end.tm_min=[ alert.create_time gt;=% d-% d-% d% d:% d:% d amp; amp; alert.create_time lt; % d-% d-% d% d:% d:% d %
(self._period_start.tm_year, self._period_start.tm_mon, self._period_start.tm_mday, ._ period_start.tm_hour, self._period_start.tm_min, self._period_start.tm_sec, ._ period_end.tm_year, self._period_end.tm_mon, self._period_end.tm_mday, ._ period_end.tm_hour, self._period_end.tm_min, self._period_end.tm_sec)] criteria_setTimelineZoom (self, base_parameters, start, end):
# tm=time.localtime (start) _parameters [ from_year ]=start.year_parameters [ from_month ]=start.month_parameters [ from_day ]=start.day_parameters [ laquo ; from_hour ]=start.hour_parameters [ from_min ]=start.minute
# tm=time.localtime (end) _parameters [ to_year ]=end.year_parameters [ to_month ]=end.month_parameters [ to_day ]=end.day_parameters [ laquo ; to_hour ]=end.hour_parameters [ to_min ]=end.minute