コード例 #1
0
ファイル: control.py プロジェクト: lonelysoul/OnePiece
	def GET(self):
		if not base.logged():
			raise web.seeother('/')

		input = web.input()
		if not input.iid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
		if not input:
			raise web.seeother('/idclist')
		
		if input.action == 'mi':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")
			idc = models.getOneIDC(input.iid)
			city_list = models.getCityInfo()
			return render.modify_idc(idc[0], city_list)

		elif input.action == 'vi':
			idc = models.getOneIDC(input.iid)
			city_list = models.getCityInfo()
			return render.view_idc(idc[0], city_list)
		
		elif input.action == 'di':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")
			models.delIDC(input.iid)
			raise web.seeother('/idclist')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #2
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		idc_info_list = []
		all_idc_list = models.getIDCInfo()
		cid_to_city = base.cidToCity()

		#[iid,city,idcname,hostcountbyidc,hztime,contact,fun],
		one_count = []
		for i in all_idc_list:
			city = base.getCity(i.city)
			host_count = models.getHostCountByIDC(i.iid)
			one_count.append(i.iid)
			one_count.append(city)
			one_count.append(i.idcname)
			one_count.append(host_count)
			one_count.append(i.hztime)
			one_count.append(i.contact)
			idc_info_list.append(one_count)
			one_count = []
				
		if web.ctx.session.privilege == 0:
			return render.idc_list(idc_info_list)
		else:
			return render.idc_list_admin(idc_info_list)
コード例 #3
0
ファイル: control.py プロジェクト: lonelysoul/OnePiece
	def GET(self):
		if not base.logged():
			raise web.seeother('/')

		input = web.input()
		if not input.cid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
			
		if not input: raise web.seeother('/citylist') 
		if input.action == 'mc':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			city_info = models.getOneCity(input.cid)
			return render.modify_city(city_info[0])

		elif input.action == 'vc':
			city_info = models.getOneCity(input.cid)
			return render.view_city(city_info[0])
				
		elif input.action == 'dc':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			models.delCity(input.cid)
			raise web.seeother('/citylist')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #4
0
ファイル: control.py プロジェクト: lonelysoul/OnePiece
	def GET(self):
		if not base.logged():
			raise web.seeother('/')

		input = web.input()
		if not input.pid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
			
		if not input:
			raise web.seeother('/projectlist')

		if input.action == 'mp':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")
			project_info = models.getOneProject(input.pid)
			return render.modify_project(project_info)

		elif input.action == 'vp':
			project_info = models.getOneProject(input.pid)
			return render.view_project(project_info)
				
		elif input.action == 'dp':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")
			models.delProject(input.pid)
			raise web.seeother('/projectlist')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #5
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		idc_info_list = []
		all_idc_list = models.getIDCInfo()
		cid_to_city = base.cidToCity()

		#[iid,city,idcname,hostcountbyidc,hztime,contact,fun],
		one_count = []
		for i in all_idc_list:
			city = base.getCity(i.city)
			host_count = models.getHostCountByIDC(i.iid)
			one_count.append(i.iid)
			one_count.append(city)
			one_count.append(i.idcname)
			one_count.append(host_count)
			one_count.append(i.hztime)
			one_count.append(i.contact)
			idc_info_list.append(one_count)
			one_count = []
				
		if web.ctx.session.privilege == 0:
			return render.idc_list(idc_info_list)
		else:
			return render.idc_list_admin(idc_info_list)
コード例 #6
0
ファイル: control.py プロジェクト: lonelysoul/OnePiece
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		if not web.input():
			raise web.seeother('/main')

		action = web.input().action
		hid = web.input().hid
		if not hid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误');window.history.back(-1);</script>")

		host = models.getOneHost(hid)
		if action == 'mh':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			city = models.getCityInfo()
			project = models.getProjectInfo()
			idc = models.getIDCInfo()
			status = models.getStatusInfo()
			return render.modify_host(city,project,idc,status,host[0])
		elif action == 'vh':
			city = models.getCityInfo()
			project = models.getProjectInfo()
			idc = models.getIDCInfo()
			status = models.getStatusInfo()
			return render.view_host(city,project,idc,status,host[0])
		elif action == 'dh':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			models.delHost(hid)
			raise web.seeother('/main')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #7
0
ファイル: control.py プロジェクト: timoseven/SIDB
	def GET(self):
		if not base.logged():
			raise web.seeother('/')

		input = web.input()
		if not input.iid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
		if not input:
			raise web.seeother('/idclist')
		
		if input.action == 'mi':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")
			idc = models.getOneIDC(input.iid)
			city_list = models.getCityInfo()
			return render.modify_idc(idc[0], city_list)

		elif input.action == 'vi':
			idc = models.getOneIDC(input.iid)
			city_list = models.getCityInfo()
			return render.view_idc(idc[0], city_list)
		
		elif input.action == 'di':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")
			models.delIDC(input.iid)
			raise web.seeother('/idclist')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #8
0
ファイル: control.py プロジェクト: timoseven/SIDB
	def GET(self):
		if not base.logged():
			raise web.seeother('/')

		input = web.input()
		if not input.pid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
			
		if not input:
			raise web.seeother('/projectlist')

		if input.action == 'mp':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")
			project_info = models.getOneProject(input.pid)
			return render.modify_project(project_info)

		elif input.action == 'vp':
			project_info = models.getOneProject(input.pid)
			return render.view_project(project_info)
				
		elif input.action == 'dp':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")
			models.delProject(input.pid)
			raise web.seeother('/projectlist')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #9
0
ファイル: control.py プロジェクト: timoseven/SIDB
	def GET(self):
		if not base.logged():
			raise web.seeother('/')

		input = web.input()
		if not input.cid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
			
		if not input: raise web.seeother('/citylist') 
		if input.action == 'mc':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			city_info = models.getOneCity(input.cid)
			return render.modify_city(city_info[0])

		elif input.action == 'vc':
			city_info = models.getOneCity(input.cid)
			return render.view_city(city_info[0])
				
		elif input.action == 'dc':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			models.delCity(input.cid)
			raise web.seeother('/citylist')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #10
0
ファイル: register.py プロジェクト: marzim/savingxfun
 def GET(self):
     # do $:f.render() in the template
     if not logged():
         #f = self.register_form()
         return render.register(None, None)
     else:
         raise web.seeother('/')
コード例 #11
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')

		input = web.input()
		if not input.cid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
			
		if not input: raise web.seeother('/citylist') 
		if input.action == 'mc':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			city_info = models.getOneCity(input.cid)
			return render.modify_city(city_info[0])

		elif input.action == 'vc':
			city_info = models.getOneCity(input.cid)
			return render.view_city(city_info[0])
				
		elif input.action == 'dc':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			
			# Save to history
			c = models.getOneCity(input.cid)[0]
			content = "INSERT INTO city VALUE (%s, '%s', '%s')" % (c['cid'], c['city'], c['other'])
			description = u"<b>城市:</b>"+ c['city']
			delman = web.ctx.session.username
			deltime = int(time.time())
			models.addHistory(content,description,delman,deltime)

			models.delCity(input.cid)
			raise web.seeother('/citylist')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #12
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')

		input = web.input()
		if not input.cid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
			
		if not input: raise web.seeother('/citylist') 
		if input.action == 'mc':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			city_info = models.getOneCity(input.cid)
			return render.modify_city(city_info[0])

		elif input.action == 'vc':
			city_info = models.getOneCity(input.cid)
			return render.view_city(city_info[0])
				
		elif input.action == 'dc':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			
			# Save to history
			c = models.getOneCity(input.cid)[0]
			content = "INSERT INTO city VALUE (%s, '%s', '%s')" % (c['cid'], c['city'], c['other'])
			description = u"<b>城市:</b>"+ c['city']
			delman = web.ctx.session.username
			deltime = int(time.time())
			models.addHistory(content,description,delman,deltime)

			models.delCity(input.cid)
			raise web.seeother('/citylist')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #13
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		if web.ctx.session.privilege == 0:
			return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
		history = models.getHistory()		
		history = list(history)		
		for h in history:
			ltime = time.localtime(int(h['deltime']))
			deltime = time.strftime("%Y-%m-%d %H:%M:%S",ltime)
			h['deltime'] = deltime
		
		input = web.input(action=None,hid=None)

		if not input.action:	
			return render.history(history)
		else:
			# Remove history
			if input.action == 'dh':
				models.delOneHistory(input.hid)
				raise web.seeother('/history')
			# Resotre history
			elif input.action == 'rh':
			 	if models.restoreHistory(input.hid):
					models.delOneHistory(input.hid)
					return base.code("<script language='javascript'>alert('恢复成功 !');window.location.href='/history'; </script>")
				else:
					return base.code("<script language='javascript'>alert('恢复失败,此记录可能已存在,请检查!');window.history.back(-1);</script>")
				
			else:
				return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #14
0
ファイル: control.py プロジェクト: timoseven/SIDB
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		if not web.input():
			raise web.seeother('/main')

		action = web.input().action
		hid = web.input().hid
		if not hid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误');window.history.back(-1);</script>")

		host = models.getOneHost(hid)
		if action == 'mh':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			city = models.getCityInfo()
			project = models.getProjectInfo()
			idc = models.getIDCInfo()
			status = models.getStatusInfo()
			return render.modify_host(city,project,idc,status,host[0])
		elif action == 'vh':
			city = models.getCityInfo()
			project = models.getProjectInfo()
			idc = models.getIDCInfo()
			status = models.getStatusInfo()
			return render.view_host(city,project,idc,status,host[0])
		elif action == 'dh':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			models.delHost(hid)
			raise web.seeother('/main')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #15
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		if web.ctx.session.privilege == 0:
			return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
		history = models.getHistory()		
		history = list(history)		
		for h in history:
			ltime = time.localtime(int(h['deltime']))
			deltime = time.strftime("%Y-%m-%d %H:%M:%S",ltime)
			h['deltime'] = deltime
		
		input = web.input(action=None,hid=None)

		if not input.action:	
			return render.history(history)
		else:
			# Remove history
			if input.action == 'dh':
				models.delOneHistory(input.hid)
				raise web.seeother('/history')
			# Resotre history
			elif input.action == 'rh':
			 	if models.restoreHistory(input.hid):
					models.delOneHistory(input.hid)
					return base.code("<script language='javascript'>alert('恢复成功 !');window.location.href='/history'; </script>")
				else:
					return base.code("<script language='javascript'>alert('恢复失败,此记录可能已存在,请检查!');window.history.back(-1);</script>")
				
			else:
				return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #16
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		if web.ctx.session.privilege == 0:
			return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问!');window.history.back(-1);</script>")
		else:
			return render.add_city()
コード例 #17
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		if web.ctx.session.privilege != 2:
			return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问!');window.history.back(-1);</script>")
		else:
			return render.register()
コード例 #18
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		conf = models.getConfig()
		sys_overview = models.getSysOverView()
		status_overview = models.getStatusOverView()
		
		return render.index(conf,sys_overview,status_overview)
コード例 #19
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		conf = models.getConfig()
		sys_overview = models.getSysOverView()
		status_overview = models.getStatusOverView()
		
		return render.index(conf,sys_overview,status_overview)
コード例 #20
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		city = models.getCityInfo()

		if web.ctx.session.privilege == 0:
			return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问!');window.history.back(-1);</script>")
		else:
			return render.add_idc(city)
コード例 #21
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		city = models.getCityInfo()
		project = models.getProjectInfo()
		idc = models.getIDCInfo()
		status = models.getStatusInfo()
		
		if web.ctx.session.privilege == 0:
			return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问!');window.history.back(-1);</script>")
		else:
			return render.add_host(city,project, idc, status)
コード例 #22
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		city = models.getCityInfo()
		project = models.getProjectInfo()
		idc = models.getIDCInfo()
		status = models.getStatusInfo()
		
		if web.ctx.session.privilege == 0:
			return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问!');window.history.back(-1);</script>")
		else:
			return render.add_host(city,project, idc, status)
コード例 #23
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		if self.input.action=='ms':
			server=models.getServerInfo(self.id)
			for server_info in server:
				pass
			return  render.mserver(server_info)
		elif self.input.action=='ds':
			models.delServerInfo(self.id)
			raise web.seeother('/aserver')
		else:
			pass
コード例 #24
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		else:
			input = web.input(project=None,idc=None,hc=None,page=None)
			if not input.project.isdigit() or not input.hc.isdigit():
				return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
			project = int(input.project)
			 	
			# Paging
			sysconf = models.getConfig()
			pagesize = sysconf['page']  # page_per_rows
			hostcount = int(input.hc)
			pages = int(hostcount / pagesize)	# page_count

			if (hostcount % pagesize):
				pages += 1				#page_count

			if input.page:
				if not input.project.isdigit():
					return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
				page = int(input.page)
			else:
				page = 1

			offset = pagesize * (page - 1)  # offset
			pagerows = models.getPageByProject(project, offset, pagesize)

			newhosts=[]
			for h in pagerows:
				h['project'] = base.getProject(h['project'])
				h['city'] = base.getCity(h['city'])
				h['idc'] = base.getIDC(h['idc'])
				h['statusid'] = h['status']
				h['status'] = base.getStatus(h['status'])
				newhosts.append(h)

			#page Nav
			if hostcount <= pagesize:
				page_nav = u"共 <b>%s</b> 条记录" % (hostcount)
			elif page == 1:
				page_nav = u"<a href='/projectlisthost?project=%d&hc=%d&page=%d'>下一页</a> | <a href='/projectlisthost?project=%d&hc=%d&page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (project,hostcount,page+1,project,hostcount,pages,page,pages,hostcount)
			elif page == pages:
				page_nav = u"<a href='/projectlisthost?project=%d&hc=%d&page=%d'>上一页</a> | <a href='/projectlisthost?project=%d&hc=%d&page=1'>首页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (project,hostcount,page-1,project,hostcount,page,pages,hostcount)
			else:
				page_nav = u"<a href='/projectlisthost?project=%d&hc=%d&page=%d'>下一页</a> | <a href='/projectlisthost?project=%d&hc=%d&page=%d'>上一页</a> | <a href='/projectlisthost?project=%d&hc=%d&page=1'>首页</a> | <a href='/projectlisthost?project=%d&hc=%d&page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (project,hostcount,page+1,project,hostcount,page-1,project,hostcount,project,hostcount,pages,page,pages,hostcount)
				
			if web.ctx.session.privilege == 0:
				return render.project_host_list(newhosts,pages,page,page_nav)
			else:
				return render.project_host_list_admin(newhosts,pages,page,page_nav)
コード例 #25
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')

		user_list = models.getUserInfo()
		#username,privi,phone,email,logintime,loginip
		for user_info in user_list:
			if user_info['lastlogin'] != '':
				ltime = time.localtime(int(user_info['lastlogin']))
				lastlogin = time.strftime("%Y-%m-%d %H:%M:%S",ltime)
			else:
				lastlogin = ''
			user_info['lastlogin'] = lastlogin
		return  render.muser(user_info)
コード例 #26
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		else:
			# Paging
			sysconf = models.getConfig()
			pagesize = sysconf['page']  # page_per_rows
			hostcount = models.allHosts()  # host_count
			para = web.input(page=None,action=None)	
			pages = int(hostcount / pagesize)	# page_count

			if (hostcount % pagesize):
				pages += 1				#page_count

			if para.page:
				if not para.page.isdigit():
					return base.code("<script language='javascript'>alert('参数错误');window.history.back(-1);</script>")
				page = int(para.page)
			else:
				page = 1

			offset = pagesize * (page - 1)  # offset
			
			if para.action:
				pagerows = models.getPageByLastModify(offset, pagesize)
			else:
				pagerows = models.getPage(offset, pagesize)

			newhosts=[]
			for h in pagerows:
				h['project'] = base.getProject(h['project'])
				h['city'] = base.getCity(h['city'])
				h['idc'] = base.getIDC(h['idc'])
				h['statusid'] = h['status']
				h['status'] = base.getStatus(h['status'])
				newhosts.append(h)
			#page Nav
			if hostcount <= pagesize:
				page_nav = u"共 <b>%s</b> 条记录" % (hostcount)
			elif page == 1:
				page_nav = u"<a href='/main?page=%d'>下一页</a> | <a href='/main?page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (page+1,pages,page,pages,hostcount)
			elif page == pages:
				page_nav = u"<a href='/main?page=%d'>上一页</a> | <a href='/main?page=1'>首页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (page-1, page, pages,hostcount)
			else:
				page_nav = u"<a href='/main?page=%d'>下一页</a> | <a href='/main?page=%d'>上一页</a> | <a href='/main?page=1'>首页</a> | <a href='/main?page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (page+1,page-1,pages,page,pages,hostcount)
				
			if web.ctx.session.privilege == 0:
				return render.main(newhosts,pages,page,page_nav)
			else:
				return render.main_admin(newhosts,pages,page,page_nav)
コード例 #27
0
ファイル: control.py プロジェクト: huayes/python
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		else:
			# Paging
			sysconf = models.getConfig()
			pagesize = sysconf['page']  # page_per_rows
			hostcount = models.allHosts()  # host_count
			para = web.input(page=None,action=None)	
			pages = int(hostcount / pagesize)	# page_count

			if (hostcount % pagesize):
				pages += 1				#page_count

			if para.page:
				if not para.page.isdigit():
					return base.code("<script language='javascript'>alert('参数错误');window.history.back(-1);</script>")
				page = int(para.page)
			else:
				page = 1

			offset = pagesize * (page - 1)  # offset
			
			if para.action:
				pagerows = models.getPageByLastModify(offset, pagesize)
			else:
				pagerows = models.getPage(offset, pagesize)

			newhosts=[]
			for h in pagerows:
				h['project'] = base.getProject(h['project'])
				h['city'] = base.getCity(h['city'])
				h['idc'] = base.getIDC(h['idc'])
				h['status'] = base.getStatus(h['status'])
				newhosts.append(h)

			#page Nav
			if hostcount <= pagesize:
				page_nav = u"共 <b>%s</b> 条记录" % (hostcount)
			elif page == 1:
				page_nav = u"<a href='/main?page=%d'>下一页</a> | <a href='/main?page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (page+1,pages,page,pages,hostcount)
			elif page == pages:
				page_nav = u"<a href='/main?page=%d'>上一页</a> | <a href='/main?page=1'>首页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (page-1, page, pages,hostcount)
			else:
				page_nav = u"<a href='/main?page=%d'>下一页</a> | <a href='/main?page=%d'>上一页</a> | <a href='/main?page=1'>首页</a> | <a href='/main?page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (page+1,page-1,pages,page,pages,hostcount)
				
			if web.ctx.session.privilege == 0:
				return render.main(newhosts,pages,page,page_nav)
			else:
				return render.main_admin(newhosts,pages,page,page_nav)
コード例 #28
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		else:
			input = web.input(project=None,idc=None,hc=None,page=None)
			if not input.project.isdigit() or not input.hc.isdigit():
				return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
			project = int(input.project)
			 	
			# Paging
			sysconf = models.getConfig()
			pagesize = sysconf['page']  # page_per_rows
			hostcount = int(input.hc)
			pages = int(hostcount / pagesize)	# page_count

			if (hostcount % pagesize):
				pages += 1				#page_count

			if input.page:
				if not input.project.isdigit():
					return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
				page = int(input.page)
			else:
				page = 1

			offset = pagesize * (page - 1)  # offset
			pagerows = models.getPageByProject(project, offset, pagesize)

			newhosts=[]
			for h in pagerows:
				h['project'] = base.getProject(h['project'])
				h['city'] = base.getCity(h['city'])
				h['idc'] = base.getIDC(h['idc'])
				h['status'] = base.getStatus(h['status'])
				newhosts.append(h)

			#page Nav
			if hostcount <= pagesize:
				page_nav = u"共 <b>%s</b> 条记录" % (hostcount)
			elif page == 1:
				page_nav = u"<a href='/projectlisthost?project=%d&hc=%d&page=%d'>下一页</a> | <a href='/projectlisthost?project=%d&hc=%d&page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (project,hostcount,page+1,project,hostcount,pages,page,pages,hostcount)
			elif page == pages:
				page_nav = u"<a href='/projectlisthost?project=%d&hc=%d&page=%d'>上一页</a> | <a href='/projectlisthost?project=%d&hc=%d&page=1'>首页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (project,hostcount,page-1,project,hostcount,page,pages,hostcount)
			else:
				page_nav = u"<a href='/projectlisthost?project=%d&hc=%d&page=%d'>下一页</a> | <a href='/projectlisthost?project=%d&hc=%d&page=%d'>上一页</a> | <a href='/projectlisthost?project=%d&hc=%d&page=1'>首页</a> | <a href='/projectlisthost?project=%d&hc=%d&page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (project,hostcount,page+1,project,hostcount,page-1,project,hostcount,project,hostcount,pages,page,pages,hostcount)
				
			if web.ctx.session.privilege == 0:
				return render.project_host_list(newhosts,pages,page,page_nav)
			else:
				return render.project_host_list_admin(newhosts,pages,page,page_nav)
コード例 #29
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		if not web.input():
			raise web.seeother('/main')

		action = web.input().action
		hid = web.input().hid
		if not hid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误');window.history.back(-1);</script>")

		host = models.getOneHost(hid)
		if action == 'mh':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			city = models.getCityInfo()
			project = models.getProjectInfo()
			idc = models.getIDCInfo()
			status = models.getStatusInfo()
			return render.modify_host(city,project,idc,status,host[0])
		elif action == 'vh':
			city = models.getCityInfo()
			project = models.getProjectInfo()
			idc = models.getIDCInfo()
			status = models.getStatusInfo()
			host_list = list(host)
			t = host_list[0]['modifytime']
			ltime = time.localtime(int(t))
			modifytime = time.strftime("%Y-%m-%d %H:%M:%S",ltime)
			host_list[0]['modifytime'] = modifytime
			
			return render.view_host(city,project,idc,status,host_list[0])
		elif action == 'dh':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			
			# Save to history
			h = models.getOneHost(hid)[0]
			content = "INSERT INTO hosts VALUES (%s,'%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')" % (h['hid'],h['hostname'],h['city'],h['project'],h['idc'],h['port'],h['addr1_ip'],h['addr1_netmask'],h['addr1_gateway'],h['addr1_line'],h['addr2_ip'],h['addr2_netmask'],h['addr2_gateway'],h['addr2_line'],h['addr3_ip'],h['addr3_netmask'],h['addr3_gateway'],h['addr3_gateway'],h['memory'],h['cpu'],h['disk'],h['buytime'],h['servicetime'],h['hardwareinfo'],h['bandwidth'],h['uses'],h['status'],h['company'],h['os'],h['other'],h['jointime'],h['modifytime'],h['modifyman'])
			description = u"<b>主机标识:</b>%s<br><b>地址:</b>%s/%s/%s<br><b>用途:</b>%s" % (h['hostname'],h['addr1_ip'],h['addr2_ip'],h['addr3_ip'],h['uses'])
			delman = web.ctx.session.username
			deltime = int(time.time())
			models.addHistory(content,description,delman,deltime)

			models.delHost(hid)
			return base.code("<script language='javascript'>location.replace(document.referrer)</script>")
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #30
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		else:
			input = web.input(cid=None,iid=None,hc=None,page=None)
			cid = int(input.cid)
			iid = int(input.iid)
			 	
			# Paging
			sysconf = models.getConfig()
			pagesize = sysconf['page']  # page_per_rows
			hostcount = int(input.hc)
			pages = int(hostcount / pagesize)	# page_count

			if (hostcount % pagesize):
				pages += 1				#page_count

			if input.page:
				page = int(input.page)
			else:
				page = 1

			offset = pagesize * (page - 1)  # offset
			pagerows = models.getPageByIDC(iid,offset,pagesize)

			newhosts=[]
			for h in pagerows:
				h['project'] = base.getProject(h['project'])
				h['city'] = base.getCity(h['city'])
				h['idc'] = base.getIDC(h['idc'])
				h['statusid'] = h['status']
				h['status'] = base.getStatus(h['status'])
				newhosts.append(h)

			#page Nav
			if hostcount <= pagesize:
				page_nav = u"共 <b>%s</b> 条记录" % (hostcount)
			elif page == 1:
				page_nav = u"<a href='/cihl?cid=%d&iid=%d&hc=%d&page=%d'>下一页</a> | <a href='/cihl?cid=%d&iid=%d&hc=%d&page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (cid,iid,hostcount,page+1,cid,iid,hostcount,pages,page,pages,hostcount)
			elif page == pages:
				page_nav = u"<a href='/cihl?cid=%d&iid=%d&hc=%d&page=%d'>上一页</a> | <a href='/cihl?cid=%d&iid=%d&hc=%d&page=1'>首页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (cid,iid,hostcount,page-1,cid,iid,hostcount,page,pages,hostcount)
			else:
				page_nav = u"<a href='/cihl?cid=%d&iid=%d&hc=%d&page=%d'>下一页</a> | <a href='/cihl?cid=%d&iid=%d&hc=%d&page=%d'>上一页</a> | <a href='/cihl?cid=%d&iid=%d&hc=%d&page=1'>首页</a> | <a href='/cihl?cid=%d&iid=%d&hc=%d&page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (cid,iid,hostcount,page+1,cid,iid,hostcount,page-1,cid,iid,hostcount,cid,iid,hostcount,pages,page,pages,hostcount)
				
			if web.ctx.session.privilege == 0:
				return render.city_idc_host_list(newhosts,pages,page,page_nav)
			else:
				return render.city_idc_host_list_admin(newhosts,pages,page,page_nav)
コード例 #31
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		if not web.input():
			raise web.seeother('/main')

		action = web.input().action
		hid = web.input().hid
		if not hid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误');window.history.back(-1);</script>")

		host = models.getOneHost(hid)
		if action == 'mh':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			city = models.getCityInfo()
			project = models.getProjectInfo()
			idc = models.getIDCInfo()
			status = models.getStatusInfo()
			return render.modify_host(city,project,idc,status,host[0])
		elif action == 'vh':
			city = models.getCityInfo()
			project = models.getProjectInfo()
			idc = models.getIDCInfo()
			status = models.getStatusInfo()
			host_list = list(host)
			t = host_list[0]['modifytime']
			ltime = time.localtime(int(t))
			modifytime = time.strftime("%Y-%m-%d %H:%M:%S",ltime)
			host_list[0]['modifytime'] = modifytime
			
			return render.view_host(city,project,idc,status,host_list[0])
		elif action == 'dh':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			
			# Save to history
			h = models.getOneHost(hid)[0]
			content = "INSERT INTO hosts VALUES (%s,'%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')" % (h['hid'],h['hostname'],h['city'],h['project'],h['idc'],h['port'],h['addr1_ip'],h['addr1_netmask'],h['addr1_gateway'],h['addr1_line'],h['addr2_ip'],h['addr2_netmask'],h['addr2_gateway'],h['addr2_line'],h['addr3_ip'],h['addr3_netmask'],h['addr3_gateway'],h['addr3_gateway'],h['memory'],h['cpu'],h['disk'],h['buytime'],h['servicetime'],h['hardwareinfo'],h['bandwidth'],h['uses'],h['status'],h['company'],h['os'],h['other'],h['jointime'],h['modifytime'],h['modifyman'])
			description = u"<b>主机标识:</b>%s<br><b>地址:</b>%s/%s/%s<br><b>用途:</b>%s" % (h['hostname'],h['addr1_ip'],h['addr2_ip'],h['addr3_ip'],h['uses'])
			delman = web.ctx.session.username
			deltime = int(time.time())
			models.addHistory(content,description,delman,deltime)

			models.delHost(hid)
			raise web.seeother('/main')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #32
0
 def GET(self,page=1):
     if not base.logged():
         raise web.seeother('/')
     else:
         page = int(page)
         perpage = 10
         offset = (page-1) * perpage
         todos = db.select(tb, order='finished asc, id asc',offset=offset,limit=perpage)
         postcount = db.query('select count(*) as count from todo')[0]
         pages = postcount.count / perpage
         if postcount.count % perpage > 0:
             pages += 1
         if page > pages:
             raise web.seeother('/main')
         else:
             return render.index(config=config,todos=todos,pages=pages)
コード例 #33
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self,p='1'):
		if not base.logged():
			raise web.seeother('/')
		p=int(p)
		input = web.input()
		if input:
			p=int(input.p.strip())
		server_list = models.getServerList(p)
		server_list_info=[]
		for i in server_list:
			server_list_info.append(i)
		page_list=models.get_page(p)
		page_list_info=[]
		for j in page_list:
			page_list_info.append(j)
		return  render.aserver(server_list_info,page_list_info)
コード例 #34
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		else:
			input = web.input(cid=None,iid=None,hc=None,page=None)
			cid = int(input.cid)
			iid = int(input.iid)
			 	
			# Paging
			sysconf = models.getConfig()
			pagesize = sysconf['page']  # page_per_rows
			hostcount = int(input.hc)
			pages = int(hostcount / pagesize)	# page_count

			if (hostcount % pagesize):
				pages += 1				#page_count

			if input.page:
				page = int(input.page)
			else:
				page = 1

			offset = pagesize * (page - 1)  # offset
			pagerows = models.getPageByIDC(iid,offset,pagesize)

			newhosts=[]
			for h in pagerows:
				h['project'] = base.getProject(h['project'])
				h['city'] = base.getCity(h['city'])
				h['idc'] = base.getIDC(h['idc'])
				h['status'] = base.getStatus(h['status'])
				newhosts.append(h)

			#page Nav
			if hostcount <= pagesize:
				page_nav = u"共 <b>%s</b> 条记录" % (hostcount)
			elif page == 1:
				page_nav = u"<a href='/cihl?cid=%d&iid=%d&hc=%d&page=%d'>下一页</a> | <a href='/cihl?cid=%d&iid=%d&hc=%d&page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (cid,iid,hostcount,page+1,cid,iid,hostcount,pages,page,pages,hostcount)
			elif page == pages:
				page_nav = u"<a href='/cihl?cid=%d&iid=%d&hc=%d&page=%d'>上一页</a> | <a href='/cihl?cid=%d&iid=%d&hc=%d&page=1'>首页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (cid,iid,hostcount,page-1,cid,iid,hostcount,page,pages,hostcount)
			else:
				page_nav = u"<a href='/cihl?cid=%d&iid=%d&hc=%d&page=%d'>下一页</a> | <a href='/cihl?cid=%d&iid=%d&hc=%d&page=%d'>上一页</a> | <a href='/cihl?cid=%d&iid=%d&hc=%d&page=1'>首页</a> | <a href='/cihl?cid=%d&iid=%d&hc=%d&page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (cid,iid,hostcount,page+1,cid,iid,hostcount,page-1,cid,iid,hostcount,cid,iid,hostcount,pages,page,pages,hostcount)
				
			if web.ctx.session.privilege == 0:
				return render.city_idc_host_list(newhosts,pages,page,page_nav)
			else:
				return render.city_idc_host_list_admin(newhosts,pages,page,page_nav)
コード例 #35
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')

		user_list = models.getUserList()	
		#username,privi,phone,email,logintime,loginip
		user_info_list = []
		for u in user_list:
			if u['lastlogin'] != '':
				ltime = time.localtime(int(u['lastlogin']))	
				lastlogin = time.strftime("%Y-%m-%d %H:%M:%S",ltime)
			else:
				lastlogin = ''
			u['lastlogin'] = lastlogin
			user_info_list.append(u)

		if web.ctx.session.privilege == 2:
			return  render.user_list_admin(user_info_list)
		else:
			return  render.user_list(user_info_list)
コード例 #36
0
ファイル: control.py プロジェクト: lonelysoul/OnePiece
	def GET(self):
		if not base.logged():
			raise web.seeother('/')

		user_list = models.getUserList()	
		#username,privi,phone,email,logintime,loginip
		user_info_list = []
		for u in user_list:
			if u['lastlogin'] != '':
				ltime = time.localtime(int(u['lastlogin']))	
				lastlogin = time.strftime("%Y-%m-%d %H:%M:%S",ltime)
			else:
				lastlogin = ''
			u['lastlogin'] = lastlogin
			user_info_list.append(u)

		if web.ctx.session.privilege == 2:
			return  render.user_list_admin(user_info_list)
		else:
			return  render.user_list(user_info_list)
コード例 #37
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		city_host_count = []
		city_list = models.getCityInfo();
		#return city_list[0]
		one_count = []
		for c in city_list:
			host_count = models.getHostCountByCity(c.cid)	
			idc_count = models.getIDCCountByCity(c.cid)
			one_count.append(c.cid)
			one_count.append(c.city)
			one_count.append(idc_count)
			one_count.append(host_count)
			city_host_count.append(one_count)
			one_count = []
			
		if web.ctx.session.privilege == 0:
			return render.city_list(city_host_count)
		else:
			return render.city_list_admin(city_host_count)
コード例 #38
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		city_host_count = []
		city_list = models.getCityInfo();
		#return city_list[0]
		one_count = []
		for c in city_list:
			host_count = models.getHostCountByCity(c.cid)	
			idc_count = models.getIDCCountByCity(c.cid)
			one_count.append(c.cid)
			one_count.append(c.city)
			one_count.append(idc_count)
			one_count.append(host_count)
			city_host_count.append(one_count)
			one_count = []
			
		if web.ctx.session.privilege == 0:
			return render.city_list(city_host_count)
		else:
			return render.city_list_admin(city_host_count)
コード例 #39
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		
		input = web.input()
		if input.action == "vu":
			user_info = models.getUserInfoByUID(input.uid)
			return render.view_user(user_info)
		elif input.action == "mu":
			if web.ctx.session.privilege == 2:
				user_info = models.getUserInfoByUID(input.uid)
				return render.modify_user_admin(user_info)
			else:
				user_info = models.getUserInfoByUID(web.ctx.session.uid)
				return render.modify_user(user_info)
		elif input.action == 'du':
			if web.ctx.session.privilege != 2:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			models.delUserByUID(input.uid)
			raise web.seeother('/userlist')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #40
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		project_info_list = []
		all_project_list = models.getProjectInfo();
		one_count = []
	
		#[pid,project,idc,hostcount]
		for p in all_project_list:
			host_count = models.getHostCountByProject(p.pid)
			idc_count = models.getIDCCountByProject(p.pid)
			one_count.append(p.pid)
			one_count.append(p.project)
			one_count.append(idc_count)
			one_count.append(host_count)
			project_info_list.append(one_count)
			one_count = []
		
		if web.ctx.session.privilege == 0:
			return render.project_list(project_info_list)
		else:
			return render.project_list_admin(project_info_list)
コード例 #41
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		project_info_list = []
		all_project_list = models.getProjectInfo();
		one_count = []
	
		#[pid,project,idc,hostcount]
		for p in all_project_list:
			host_count = models.getHostCountByProject(p.pid)
			idc_count = models.getIDCCountByProject(p.pid)
			one_count.append(p.pid)
			one_count.append(p.project)
			one_count.append(idc_count)
			one_count.append(host_count)
			project_info_list.append(one_count)
			one_count = []
		
		if web.ctx.session.privilege == 0:
			return render.project_list(project_info_list)
		else:
			return render.project_list_admin(project_info_list)
コード例 #42
0
ファイル: control.py プロジェクト: lonelysoul/OnePiece
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		
		input = web.input()
		if input.action == "vu":
			user_info = models.getUserInfoByUID(input.uid)
			return render.view_user(user_info)
		elif input.action == "mu":
			if web.ctx.session.privilege == 2:
				user_info = models.getUserInfoByUID(input.uid)
				return render.modify_user_admin(user_info)
			else:
				user_info = models.getUserInfoByUID(web.ctx.session.uid)
				return render.modify_user(user_info)
		elif input.action == 'du':
			if web.ctx.session.privilege != 2:
				return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")
			models.delUserByUID(input.uid)
			raise web.seeother('/userlist')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #43
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')

		input = web.input()
		if not input.iid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
		if not input:
			raise web.seeother('/idclist')
		
		if input.action == 'mi':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")
			idc = models.getOneIDC(input.iid)
			city_list = models.getCityInfo()
			return render.modify_idc(idc[0], city_list)

		elif input.action == 'vi':
			idc = models.getOneIDC(input.iid)
			city_list = models.getCityInfo()
			return render.view_idc(idc[0], city_list)
		
		elif input.action == 'di':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")
			
			# Save to history
			i = models.getOneIDC(input.iid)[0]
			content = "INSERT INTO idc VALUE (%s,%s,'%s','%s',%s,'%s')" % (i['iid'], i['city'],i['idcname'],i['contact'],i['hztime'], i['other'])
			description = u"<b>IDC:</b>%s<br><b>备注:</b>%s" % (i['idcname'],i['other'])
			delman = web.ctx.session.username
			deltime = int(time.time())
			models.addHistory(content,description,delman,deltime)

			models.delIDC(input.iid)
			raise web.seeother('/idclist')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #44
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')

		input = web.input()
		if not input.iid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
		if not input:
			raise web.seeother('/idclist')
		
		if input.action == 'mi':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")
			idc = models.getOneIDC(input.iid)
			city_list = models.getCityInfo()
			return render.modify_idc(idc[0], city_list)

		elif input.action == 'vi':
			idc = models.getOneIDC(input.iid)
			city_list = models.getCityInfo()
			return render.view_idc(idc[0], city_list)
		
		elif input.action == 'di':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")
			
			# Save to history
			i = models.getOneIDC(input.iid)[0]
			content = "INSERT INTO idc VALUE (%s,%s,'%s','%s',%s,'%s')" % (i['iid'], i['city'],i['idcname'],i['contact'],i['hztime'], i['other'])
			description = u"<b>IDC:</b>%s<br><b>备注:</b>%s" % (i['idcname'],i['other'])
			delman = web.ctx.session.username
			deltime = int(time.time())
			models.addHistory(content,description,delman,deltime)

			models.delIDC(input.iid)
			raise web.seeother('/idclist')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #45
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')

		input = web.input()
		if not input.pid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
			
		if not input:
			raise web.seeother('/projectlist')

		if input.action == 'mp':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")
			project_info = models.getOneProject(input.pid)
			return render.modify_project(project_info)

		elif input.action == 'vp':
			project_info = models.getOneProject(input.pid)
			return render.view_project(project_info)
				
		elif input.action == 'dp':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")

			# Save to history
			p = models.getOneProject(input.pid)
			content = "INSERT INTO project VALUE (%s, '%s', '%s')" % (p['pid'], p['project'], p['other'])
			description = u"<b>项目:</b>"+ p['project']
			delman = web.ctx.session.username
			deltime = int(time.time())
			models.addHistory(content,description,delman,deltime)
			
			models.delProject(input.pid)
			raise web.seeother('/projectlist')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #46
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')

		input = web.input()
		if not input.pid.isdigit():
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
			
		if not input:
			raise web.seeother('/projectlist')

		if input.action == 'mp':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")
			project_info = models.getOneProject(input.pid)
			return render.modify_project(project_info)

		elif input.action == 'vp':
			project_info = models.getOneProject(input.pid)
			return render.view_project(project_info)
				
		elif input.action == 'dp':
			if web.ctx.session.privilege == 0:
				return base.code("<script language='javascript'>alert('您没有足够的权限,决绝访问 !');window.history.back(-1);</script>")

			# Save to history
			p = models.getOneProject(input.pid)
			content = "INSERT INTO project VALUE (%s, '%s', '%s')" % (p['pid'], p['project'], p['other'])
			description = u"<b>项目:</b>"+ p['project']
			delman = web.ctx.session.username
			deltime = int(time.time())
			models.addHistory(content,description,delman,deltime)
			
			models.delProject(input.pid)
			raise web.seeother('/projectlist')
		else:
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")
コード例 #47
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		
		if not web.input():
			raise web.seeother('/projectlist')

		if not web.input().project.isdigit():
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")

		pid = int(web.input().project)
		idc_dict = models.getIDCInfoByProject(pid)
		projects_dict = base.pidToProject()

		# Get idc list by project id
		project_idc_list = []
		#{pid,iid,idcname,hostcount by pid and iid}
		one_idc_dict = {}
		for i in idc_dict:
			iid = i['idc']
			idc_info = models.getOneIDC(iid)
			if not idc_info:
				idc_info.idcname = 'Unknown'
			else:
				idc_info = idc_info[0]
				
			hostcount = models.getHostCountByPidAndIid(pid,iid)

			one_idc_dict['pid'] = pid
			one_idc_dict['iid'] = iid
			one_idc_dict['idcname'] = idc_info.idcname
			one_idc_dict['hostcount'] = hostcount
			project_idc_list.append(one_idc_dict)
			one_idc_dict = {}

		return render.project_idc_list(project_idc_list, projects_dict[pid])
コード例 #48
0
ファイル: todo.py プロジェクト: vTNT/fail2ban-ansible-webby
 def GET(self,page=1,statustype='ban'):
     if not base.logged():
         raise web.seeother('/')
     else:
         page = int(page)
         perpage = 10
         current_page = page
         page_status = statustype
         offset = (page-1) * perpage
         if statustype == 'fail' :
             todos = db.select(tb, where="action='unban' and status = 1",order='time asc, id asc',offset=offset,limit=perpage,vars=locals())
             sql = 'select * from atta where action="unban" and status = 1' 
         else:
             todos = db.select(tb, where='action=$statustype and status = 0',order='time asc, id asc',offset=offset,limit=perpage,vars=locals())
             sql = 'select * from atta where action="%s" and status = 0' % statustype
         postcount = len(db.query(sql))
         pages = postcount / perpage
         print page,pages,postcount
         if postcount % perpage > 0:
             pages += 1
         if page > pages:
             raise web.seeother('/main')
         else:
             return render.index(config=config,todos=todos,pages=pages,current_page=current_page,statustype=statustype,page_status=page_status)
コード例 #49
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		
		if not web.input():
			raise web.seeother('/projectlist')
		cid = int(web.input().city)
		idc_dict = models.getIDCInfoByCity(cid)
		citys_dict = base.cidToCity()

		city_idc_list = []
		#{cid,iid,idcname,hostcount by cid and iid}
		one_idc_dict = {}
		for i in idc_dict:
			hostcount = models.getHostCountByCidAndIid(cid,i.iid)

			one_idc_dict['cid'] = cid
			one_idc_dict['iid'] = i.iid
			one_idc_dict['idcname'] = i.idcname
			one_idc_dict['hostcount'] = hostcount
			city_idc_list.append(one_idc_dict)
			one_idc_dict = {}

		return render.city_idc_list(city_idc_list, citys_dict[cid])
コード例 #50
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		
		if not web.input():
			raise web.seeother('/projectlist')
		cid = int(web.input().city)
		idc_dict = models.getIDCInfoByCity(cid)
		citys_dict = base.cidToCity()

		city_idc_list = []
		#{cid,iid,idcname,hostcount by cid and iid}
		one_idc_dict = {}
		for i in idc_dict:
			hostcount = models.getHostCountByCidAndIid(cid,i.iid)

			one_idc_dict['cid'] = cid
			one_idc_dict['iid'] = i.iid
			one_idc_dict['idcname'] = i.idcname
			one_idc_dict['hostcount'] = hostcount
			city_idc_list.append(one_idc_dict)
			one_idc_dict = {}

		return render.city_idc_list(city_idc_list, citys_dict[cid])
コード例 #51
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		
		if not web.input():
			raise web.seeother('/projectlist')

		if not web.input().project.isdigit():
			return base.code("<script language='javascript'>alert('参数错误 !');window.history.back(-1);</script>")

		pid = int(web.input().project)
		idc_dict = models.getIDCInfoByProject(pid)
		projects_dict = base.pidToProject()

		# Get idc list by project id
		project_idc_list = []
		#{pid,iid,idcname,hostcount by pid and iid}
		one_idc_dict = {}
		for i in idc_dict:
			iid = i['idc']
			idc_info = models.getOneIDC(iid)
			if not idc_info:
				idc_info.idcname = 'Unknown'
			else:
				idc_info = idc_info[0]
				
			hostcount = models.getHostCountByPidAndIid(pid,iid)

			one_idc_dict['pid'] = pid
			one_idc_dict['iid'] = iid
			one_idc_dict['idcname'] = idc_info.idcname
			one_idc_dict['hostcount'] = hostcount
			project_idc_list.append(one_idc_dict)
			one_idc_dict = {}

		return render.project_idc_list(project_idc_list, projects_dict[pid])
コード例 #52
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		
		input = web.input(page=None)	
		# Paging
		sysconf = models.getConfig()
		pagesize = sysconf['page']  # page_per_rows
		input.word = input.word.replace("'","\\'")
		
		if input.ops == '1':
			hostcount = models.getHostCountBySearch('hostname',input.word)
		elif input.ops == '2':
			hostcount = models.getHostCountBySearchIp(input.word)
		elif input.ops == '5':
			hostcount = models.getHostCountBySearch('port',input.word)
		elif input.ops == '6':
			hostcount = models.getHostCountBySearch('status',input.word)
		elif input.ops == '7':
			hostcount = models.getHostCountBySearch('bandwidth',input.word)
		elif input.ops == '8':
			hostcount = models.getHostCountBySearch('uses',input.word)
		elif input.ops == '9':
			hostcount = models.getHostCountBySearch('os',input.word)
		elif input.ops == '10':
			hostcount = models.getHostCountBySearch('company',input.word)
		elif input.ops == '11':
			hostcount = models.getHostCountBySearch('hardwareinfo',input.word)
		elif input.ops == '12':
			hostcount = models.getHostCountBySearch('other',input.word)
		elif input.ops == '13':
			hostcount = models.getHostCountBySearch('modifyman',input.word)
		
		pages = int(hostcount / pagesize)	# page_count

		if (hostcount % pagesize):
			pages += 1				#page_count

		if input.page:
			page = int(input.page)
		else:
			page = 1

		offset = pagesize * (page - 1)  # offset

		if input.ops == '1':
			pagerows = models.getPageBySearch('hostname',input.word,str(offset),str(pagesize))
		elif input.ops == '2':
			pagerows = models.getPageBySearchIp(input.word,str(offset),str(pagesize))
		elif input.ops == '5':
			pagerows = models.getPageBySearch('port',input.word,str(offset),str(pagesize))
		elif input.ops == '6':
			pagerows = models.getPageBySearch('status',input.word,str(offset),str(pagesize))
		elif input.ops == '7':
			pagerows = models.getPageBySearch('bandwidth',input.word,str(offset),str(pagesize))
		elif input.ops == '8':
			pagerows = models.getPageBySearch('uses',input.word,str(offset),str(pagesize))
		elif input.ops == '9':
			pagerows = models.getPageBySearch('os',input.word,str(offset),str(pagesize))
		elif input.ops == '10':
			pagerows = models.getPageBySearch('company',input.word,str(offset),str(pagesize))
		elif input.ops == '11':
			pagerows = models.getPageBySearch('hardwareinfo',input.word,str(offset),str(pagesize))
		elif input.ops == '12':
			pagerows = models.getPageBySearch('other',input.word,str(offset),str(pagesize))
		elif input.ops == '13':
			pagerows = models.getPageBySearch('modifyman',input.word,str(offset),str(pagesize))

		newhosts=[]
		for h in pagerows:
			h['project'] = base.getProject(h['project'])
			h['city'] = base.getCity(h['city'])
			h['idc'] = base.getIDC(h['idc'])
			h['status'] = base.getStatus(h['status'])
			newhosts.append(h)
		
		ops = int(input.ops)

		#page Nav
		if hostcount <= pagesize:
			page_nav = u"共 <b>%s</b> 条记录" % (hostcount)
		elif page == 1:
			page_nav = u"<a href='/search?ops=%d&word=%s&page=%d'>下一页</a> | <a href='/search?ops=%d&word=%s&page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (ops,input.word,page+1,ops,input.word,pages,page,pages,hostcount)
		elif page == pages:
			page_nav = u"<a href='/search?ops=%d&word=%s&page=%d'>上一页</a> | <a href='/search?ops=%d&word=%s&page=1'>首页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (ops,input.word,page-1,ops,input.word,page,pages,hostcount)
		else:
			page_nav = u"<a href='/search?ops=%d&word=%s&page=%d'>下一页</a> | <a href='/search?ops=%d&word=%s&page=%d'>上一页</a> | <a href='/search?ops=%d&word=%s&page=1'>首页</a> | <a href='/search?ops=%d&word=%s&page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (ops,input.word,page+1,ops,input.word,page-1,ops,input.word,ops,input.word,pages,page,pages,hostcount)

		if web.ctx.session.privilege == 0:
			return render.main(newhosts,pages,page,page_nav)
		else:
			return render.main_admin(newhosts,pages,page,page_nav)
	
		if input.ops == '1':
			result = models.searchHostName(input.content)
			return result
コード例 #53
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		if web.ctx.session.privilege != 2:
			return base.code("<script language='javascript'>alert('您没有足够的权限,拒绝访问 !');window.history.back(-1);</script>")

		all_hosts = models.getAllHosts()
		new_hosts=[]
		for h in all_hosts:
			h['project'] = base.getProject(h['project'])
			h['city'] = base.getCity(h['city'])
			h['idc'] = base.getIDC(h['idc'])
			h['status'] = base.getStatus(h['status'])
			new_hosts.append(h)
		
		# Export host data
		wbk = xlwt.Workbook(encoding='utf-8')
		style = xlwt.XFStyle()
		style2 = xlwt.XFStyle()
		font = xlwt.Font()
		font2 = xlwt.Font()
		font2.bold = True
		font.name = 'SimSum'
		style.alignment.wrap=1
		style.font = font
		style2.font = font2
		sheet = wbk.add_sheet('hosts')
		
		# Define excel header names
		sheet.write(0,0,'主机标识', style2)
		sheet.write(0,1,'所属项目', style2)
		sheet.write(0,2,'所在城市', style2)
		sheet.write(0,3,'所在IDC', style2)
		sheet.write(0,4,'地址一', style2)
		sheet.write(0,5,'地址二', style2)
		sheet.write(0,6,'地址三', style2)
		sheet.write(0,7,'登录端口', style2)
		sheet.write(0,8,'所属公司', style2)
		sheet.write(0,9,'带宽', style2)
		sheet.write(0,10,'用途', style2)
		sheet.write(0,11,'状态', style2)
		sheet.write(0,12,'操作系统', style2)
		sheet.write(0,13,'内存(GB)', style2)
		sheet.write(0,14,'CPU(核心)', style2)
		sheet.write(0,15,'磁盘(GB)', style2)
		sheet.write(0,16,'购买时间', style2)
		sheet.write(0,17,'质保时间', style2)
		sheet.write(0,18,'硬件详细信息', style2)
		sheet.write(0,19,'备注', style2)

		# Start export
		row = 1
		for  i in new_hosts:
			sheet.write(row,0,i['hostname'])
			sheet.write(row,1,i['project'])
			sheet.write(row,2,i['city'])
			sheet.write(row,3,i['idc'])
			sheet.col(4).width = 0x0d00 + 3000
			sheet.col(5).width = 0x0d00 + 3000
			sheet.col(6).width = 0x0d00 + 3000
			sheet.write(row,4,'IP:'+i['addr1_ip']+'\nNETMASK:'+i['addr1_netmask']+'\nGATEWAY:'+i['addr1_gateway']+'\nLINE:'+i['addr1_line'], style)
			sheet.write(row,5,'IP:'+i['addr2_ip']+'\nNETMASK:'+i['addr2_netmask']+'\nGATEWAY:'+i['addr2_gateway']+'\nLINE:'+i['addr2_line'], style)
			sheet.write(row,6,'IP:'+i['addr3_ip']+'\nNETMASK:'+i['addr3_netmask']+'\nGATEWAY:'+i['addr3_gateway']+'\nLINE:'+i['addr3_line'], style)
			sheet.write(row,7,i['port'])
			sheet.write(row,8,i['company'])
			sheet.write(row,9,i['bandwidth'])
			sheet.write(row,10,i['uses'])
			sheet.write(row,11,i['status'])
			sheet.write(row,12,i['os'])
			sheet.write(row,13,i['memory'])
			sheet.write(row,14,i['cpu'])
			sheet.write(row,15,i['disk'])
			sheet.write(row,16,i['buytime'])
			sheet.write(row,17,i['servicetime'])
			sheet.write(row,18,i['hardwareinfo'])
			sheet.write(row,19,i['other'])
			row += 1
	
		wbk.save('download/hosts.xls')
		file = 'hosts.xls'
		return base.DownLoad(file)
コード例 #54
0
ファイル: control.py プロジェクト: leafcutter-ant/Python-1
	def GET(self):
		if not base.logged():
			raise web.seeother('/')
		
		input = web.input(page=None)	
		# Paging
		sysconf = models.getConfig()
		pagesize = sysconf['page']  # page_per_rows
		input.word = input.word.replace("'","\\'")
		
		if input.ops == '1':
			hostcount = models.getHostCountBySearch('hostname',input.word)
		elif input.ops == '2':
			hostcount = models.getHostCountBySearchIp(input.word)
		elif input.ops == '5':
			hostcount = models.getHostCountBySearch('port',input.word)
		elif input.ops == '6':
			hostcount = models.getHostCountBySearch('status',input.word)
		elif input.ops == '7':
			hostcount = models.getHostCountBySearch('bandwidth',input.word)
		elif input.ops == '8':
			hostcount = models.getHostCountBySearch('uses',input.word)
		elif input.ops == '9':
			hostcount = models.getHostCountBySearch('os',input.word)
		elif input.ops == '10':
			hostcount = models.getHostCountBySearch('company',input.word)
		elif input.ops == '11':
			hostcount = models.getHostCountBySearch('hardwareinfo',input.word)
		elif input.ops == '12':
			hostcount = models.getHostCountBySearch('other',input.word)
		elif input.ops == '13':
			hostcount = models.getHostCountBySearch('modifyman',input.word)
		
		pages = int(hostcount / pagesize)	# page_count

		if (hostcount % pagesize):
			pages += 1				#page_count

		if input.page:
			page = int(input.page)
		else:
			page = 1

		offset = pagesize * (page - 1)  # offset

		if input.ops == '1':
			pagerows = models.getPageBySearch('hostname',input.word,str(offset),str(pagesize))
		elif input.ops == '2':
			pagerows = models.getPageBySearchIp(input.word,str(offset),str(pagesize))
		elif input.ops == '5':
			pagerows = models.getPageBySearch('port',input.word,str(offset),str(pagesize))
		elif input.ops == '6':
			pagerows = models.getPageBySearch('status',input.word,str(offset),str(pagesize))
		elif input.ops == '7':
			pagerows = models.getPageBySearch('bandwidth',input.word,str(offset),str(pagesize))
		elif input.ops == '8':
			pagerows = models.getPageBySearch('uses',input.word,str(offset),str(pagesize))
		elif input.ops == '9':
			pagerows = models.getPageBySearch('os',input.word,str(offset),str(pagesize))
		elif input.ops == '10':
			pagerows = models.getPageBySearch('company',input.word,str(offset),str(pagesize))
		elif input.ops == '11':
			pagerows = models.getPageBySearch('hardwareinfo',input.word,str(offset),str(pagesize))
		elif input.ops == '12':
			pagerows = models.getPageBySearch('other',input.word,str(offset),str(pagesize))
		elif input.ops == '13':
			pagerows = models.getPageBySearch('modifyman',input.word,str(offset),str(pagesize))

		newhosts=[]
		for h in pagerows:
			h['project'] = base.getProject(h['project'])
			h['city'] = base.getCity(h['city'])
			h['idc'] = base.getIDC(h['idc'])
			h['statusid'] = h['status']
			h['status'] = base.getStatus(h['status'])
			newhosts.append(h)
		
		ops = int(input.ops)

		#page Nav
		if hostcount <= pagesize:
			page_nav = u"共 <b>%s</b> 条记录" % (hostcount)
		elif page == 1:
			page_nav = u"<a href='/search?ops=%d&word=%s&page=%d'>下一页</a> | <a href='/search?ops=%d&word=%s&page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (ops,input.word,page+1,ops,input.word,pages,page,pages,hostcount)
		elif page == pages:
			page_nav = u"<a href='/search?ops=%d&word=%s&page=%d'>上一页</a> | <a href='/search?ops=%d&word=%s&page=1'>首页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (ops,input.word,page-1,ops,input.word,page,pages,hostcount)
		else:
			page_nav = u"<a href='/search?ops=%d&word=%s&page=%d'>下一页</a> | <a href='/search?ops=%d&word=%s&page=%d'>上一页</a> | <a href='/search?ops=%d&word=%s&page=1'>首页</a> | <a href='/search?ops=%d&word=%s&page=%d'>尾页</a> | (%d / %d) , 共 <b>%d</b> 条记录" % (ops,input.word,page+1,ops,input.word,page-1,ops,input.word,ops,input.word,pages,page,pages,hostcount)

		if web.ctx.session.privilege == 0:
			return render.main(newhosts,pages,page,page_nav)
		else:
			return render.main_admin(newhosts,pages,page,page_nav)
	
		if input.ops == '1':
			result = models.searchHostName(input.content)
			return result
コード例 #55
0
 def GET(self):
     """Login page"""
     if not logged():
         return render.login("")
     else:
         raise web.seeother('/')
コード例 #56
0
 def GET(self):
     if base.logged():
         raise web.seeother('/main')
     else:
         return render.login()
コード例 #57
0
ファイル: control.py プロジェクト: myisam/Lmos
	def GET(self):
		if base.logged():
			raise web.seeother('/main')
		else:
			return render_plain.login("Welcome")