コード例 #1
0
ファイル: views.py プロジェクト: 0-T-0/amonone
	def get(self):
		date_from = self.get_argument('date_from', None)
		date_to = self.get_argument('date_to', None)
		daterange = self.get_argument('daterange', None)
		processes = self.get_arguments('process', None)


		 # Default 24 hours period
		day = timedelta(hours=24)
		default_to = self.now
		default_from = default_to - day

		if date_from:
			date_from = datestring_to_utc_datetime(date_from)
		else:
			date_from = default_from

		if date_to:
			date_to = datestring_to_utc_datetime(date_to)
		else:
			date_to = default_to

		date_from = datetime_to_unixtime(date_from)
		date_to = datetime_to_unixtime(date_to) 
		default_from = datetime_to_unixtime(default_from)
		default_to = datetime_to_unixtime(default_to) 

		process_data = process_model.get_process_data(processes, date_from, date_to)

		# Convert the dates to local time for display
		date_from = utc_unixtime_to_localtime(date_from)
		date_to = utc_unixtime_to_localtime(date_to)
		default_from = utc_unixtime_to_localtime(default_from)
		default_to = utc_unixtime_to_localtime(default_to)

		# Get the difference between UTC and localtime - used to display 
		# the ticks in the charts
		zone_difference = localtime_utc_timedelta()

		# Get the max date - utc, converted to localtime
		max_date = utc_now_to_localtime() 

		server = server_model.get_one()

		self.render('processes.html',	
				current_page=self.current_page,
				processes=processes,
				process_data=process_data,
				date_from=date_from,
				date_to=date_to,
				default_from=default_from,
				default_to=default_to,
				zone_difference=zone_difference,
				max_date=max_date,
				daterange=daterange,
				server=server
				)
コード例 #2
0
ファイル: views.py プロジェクト: yogaredhat/amonone
    def get(self):
        date_from = self.get_argument('date_from', None)
        date_to = self.get_argument('date_to', None)
        daterange = self.get_argument('daterange', None)
        processes = self.get_arguments('process', None)

        # Default 24 hours period
        day = timedelta(hours=24)
        default_to = self.now
        default_from = default_to - day

        if date_from:
            date_from = datestring_to_utc_datetime(date_from)
        else:
            date_from = default_from

        if date_to:
            date_to = datestring_to_utc_datetime(date_to)
        else:
            date_to = default_to

        date_from = datetime_to_unixtime(date_from)
        date_to = datetime_to_unixtime(date_to)
        default_from = datetime_to_unixtime(default_from)
        default_to = datetime_to_unixtime(default_to)

        process_data = process_model.get_process_data(processes, date_from,
                                                      date_to)

        # Convert the dates to local time for display
        date_from = utc_unixtime_to_localtime(date_from)
        date_to = utc_unixtime_to_localtime(date_to)
        default_from = utc_unixtime_to_localtime(default_from)
        default_to = utc_unixtime_to_localtime(default_to)

        # Get the difference between UTC and localtime - used to display
        # the ticks in the charts
        zone_difference = localtime_utc_timedelta()

        # Get the max date - utc, converted to localtime
        max_date = utc_now_to_localtime()

        server = server_model.get_one()

        self.render('processes.html',
                    current_page=self.current_page,
                    processes=processes,
                    process_data=process_data,
                    date_from=date_from,
                    date_to=date_to,
                    default_from=default_from,
                    default_to=default_to,
                    zone_difference=zone_difference,
                    max_date=max_date,
                    daterange=daterange,
                    server=server)
コード例 #3
0
ファイル: data.py プロジェクト: yogaredhat/amonone
	def get(self, server_id=None):
		errors =  self.session.get('errors',None)

		# Get the max date - utc, converted to localtime
		max_date = utc_now_to_localtime() 

		server = server_model.get_by_id(server_id)

		self.render('settings/data/system_cleanup.html',
				server=server,
				errors=errors,
				max_date=max_date)
コード例 #4
0
    def get(self):

        snapshot_param = self.get_argument('snapshot', None)

        snapshot = None
        if snapshot_param:
            snapshot = datestring_to_utc_datetime(snapshot_param)
            snapshot = datetime_to_unixtime(snapshot)

        system_check = dashboard_model.get_system_check(snapshot)
        process_check = dashboard_model.get_process_check(snapshot)

        # Get the max date - utc, converted to localtime
        max_date = utc_now_to_localtime()

        self.render("dashboard.html",
                    system_check=system_check,
                    process_check=process_check,
                    max_date=max_date,
                    snapshot=snapshot_param)
コード例 #5
0
ファイル: views.py プロジェクト: 0-T-0/amonone
	def get(self):

		snapshot_param = self.get_argument('snapshot', None)
		
		snapshot = None
		if snapshot_param:
			snapshot = datestring_to_utc_datetime(snapshot_param)
			snapshot = datetime_to_unixtime(snapshot)


		system_check = dashboard_model.get_system_check(snapshot)
		process_check = dashboard_model.get_process_check(snapshot)

		# Get the max date - utc, converted to localtime
		max_date = utc_now_to_localtime() 

		self.render("dashboard.html",
				system_check=system_check,
				process_check=process_check,
				max_date=max_date,
				snapshot=snapshot_param
				)
コード例 #6
0
ファイル: views.py プロジェクト: eashman/amonone
    def get(self):

        date_from = self.get_argument("date_from", None)
        date_to = self.get_argument("date_to", None)
        charts = self.get_arguments("charts", None)

        daterange = self.get_argument("daterange", None)

        # Default 24 hours period
        day = timedelta(hours=24)
        default_to = self.now
        default_from = default_to - day

        if date_from:
            date_from = datestring_to_utc_datetime(date_from)
        else:
            date_from = default_from

        if date_to:
            date_to = datestring_to_utc_datetime(date_to)
        else:
            date_to = default_to

        date_from = datetime_to_unixtime(date_from)
        date_to = datetime_to_unixtime(date_to)

        checks = system_model.get_system_data(charts, date_from, date_to)

        active_charts = charts if len(charts) > 0 else checks.keys()

        first_check_date = system_model.get_first_check_date()

        default_from = datetime_to_unixtime(default_from)
        default_to = datetime_to_unixtime(default_to)

        # Convert the dates to local time for display
        first_check_date = utc_unixtime_to_localtime(first_check_date)
        date_from = utc_unixtime_to_localtime(date_from)
        date_to = utc_unixtime_to_localtime(date_to)
        default_from = utc_unixtime_to_localtime(default_from)
        default_to = utc_unixtime_to_localtime(default_to)

        # Get the max date - utc, converted to localtime
        max_date = utc_now_to_localtime()

        # Get the difference between UTC and localtime - used to display
        # the ticks in the charts
        zone_difference = localtime_utc_timedelta()

        server = server_model.get_one()

        self.render(
            "system.html",
            charts=charts,
            active_charts=active_charts,
            checks=checks,
            daterange=daterange,
            date_from=date_from,
            date_to=date_to,
            default_from=default_from,
            default_to=default_to,
            first_check_date=first_check_date,
            zone_difference=zone_difference,
            max_date=max_date,
            server=server,
        )
コード例 #7
0
    def get(self):

        date_from = self.get_argument('date_from', None)
        date_to = self.get_argument('date_to', None)
        charts = self.get_arguments('charts', None)

        daterange = self.get_argument('daterange', None)

        # Default 24 hours period
        day = timedelta(hours=24)
        default_to = self.now
        default_from = default_to - day

        if date_from:
            date_from = datestring_to_utc_datetime(date_from)
        else:
            date_from = default_from

        if date_to:
            date_to = datestring_to_utc_datetime(date_to)
        else:
            date_to = default_to

        date_from = datetime_to_unixtime(date_from)
        date_to = datetime_to_unixtime(date_to)

        checks = system_model.get_system_data(charts, date_from, date_to)

        active_charts = charts if len(charts) > 0 else checks.keys()

        first_check_date = system_model.get_first_check_date()

        default_from = datetime_to_unixtime(default_from)
        default_to = datetime_to_unixtime(default_to)

        # Convert the dates to local time for display
        first_check_date = utc_unixtime_to_localtime(first_check_date)
        date_from = utc_unixtime_to_localtime(date_from)
        date_to = utc_unixtime_to_localtime(date_to)
        default_from = utc_unixtime_to_localtime(default_from)
        default_to = utc_unixtime_to_localtime(default_to)

        # Get the max date - utc, converted to localtime
        max_date = utc_now_to_localtime()

        # Get the difference between UTC and localtime - used to display
        # the ticks in the charts
        zone_difference = localtime_utc_timedelta()

        server = server_model.get_one()

        self.render('system.html',
                    charts=charts,
                    active_charts=active_charts,
                    checks=checks,
                    daterange=daterange,
                    date_from=date_from,
                    date_to=date_to,
                    default_from=default_from,
                    default_to=default_to,
                    first_check_date=first_check_date,
                    zone_difference=zone_difference,
                    max_date=max_date,
                    server=server)