Esempio n. 1
0
	def get(self, param=None):
		server = server_model.get_by_id(param)

		alerts_model.delete_server_alerts(param)
		server_model.delete(param)
		
		self.redirect(self.reverse_url('settings_servers'))
Esempio n. 2
0
	def post(self, server_id=None):
		
		form_data = {
				"server": server_id,
				"date" : self.get_argument('date', None),         
		}

		try:
			DataCleanupForm.to_python(form_data)

			self.delete_session_key('errors')
			self.delete_session_key('form_data')
		
			# Convert to unix utc
			date = datestring_to_utc_datetime(form_data['date'])
			date = datetime_to_unixtime(date)
			
			server = server_model.get_by_id(form_data['server'])

			data_model.cleanup_process_collection(server, date)

			self.redirect(self.reverse_url('settings_data'))
		
		except InvalidForm, e:
			self.session['errors'] = e.unpack_errors()
			self.session['form_data'] = form_data
			self.redirect(self.reverse_url('cleanup_process' ,server_id))
Esempio n. 3
0
	def get(self, param=None):
		errors =  self.session.get('errors',None)
		server = server_model.get_by_id(param)
		groups = alerts_group_model.get_all()

		self.delete_session_key('errors')

		self.render('settings/servers/edit.html', 
				server=server,
				groups=groups,
				errors=errors)
Esempio n. 4
0
	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)
Esempio n. 5
0
	def get(self, server_id=None):
		server = server_model.get_by_id(server_id)
		data_model.delete_process_collection(server)

		self.redirect(self.reverse_url('settings_data'))