Example #1
0
	def statDhcpHandler(self, **kwargs):
		self.msg = []
		refresh_time = kwargs['time']
		stat_dhcp_lan_jcfg = xte_stat_dhcp_lan.get()
		tmp = controller.lookup.get_template("stat_dhcp.mako")
		if stat_dhcp_lan_jcfg[0]: 
			return tmp.render(stat_dhcp_args = stat_dhcp_lan_jcfg[1],
				dhcp_caption = self.caption,
				time = refresh_time,
				msg_list = self.msg)
		else:
			self.addMsg(str(stat_dhcp_lan_jcfg[1]))
			return tmp.render(stat_dhcp_args = {},
				dhcp_caption = self.caption,
				time = refresh_time,
				msg_list = self.msg)
Example #2
0
	def index(self):
		self.msg = []
		try:
			stat_dhcp_lan_jcfg = xte_stat_dhcp_lan.get()
			tmp = controller.lookup.get_template("stat_dhcp.mako")
			if stat_dhcp_lan_jcfg[0]: 
				return tmp.render(stat_dhcp_args = stat_dhcp_lan_jcfg[1],
					dhcp_caption = self.caption,
					time = "0",
					msg_list = self.msg)
			else:
				self.addMsg(str(stat_dhcp_lan_jcfg[1]))
				return tmp.render(stat_dhcp_args = {},
					dhcp_caption = self.caption,
					time = "0",
					msg_list = self.msg)
		except:
			exceptions.html_error_template().render()