def manage(centername): if sislogin(): proxhome = sget('dc') return template('manage.tpl', dcdc=proxhome) else: sset('returnpage', '/manage') redirect('/login/%s' % centername)
def createMV(centername, node): if sislogin(): proxhome = sget('dc') return template('createmv.tpl', dcdc=proxhome, node=node) else: sset('lastpage', '/node/createMV') redirect('/login/%s' % centername)
def FetchCreds(centername): datacenter = Mydb.InfoCenter(sget('db'), centername=centername) proxhome = MyDataCenter(datacenter[0]) proxhome.https_url = datacenter[1] proxhome.port = datacenter[2] username = request.forms.get('username') password = request.forms.get('password') proxhome.FetchCreds(username=username, password=password) if proxhome.creds['cookie']['PVEAuthCookie']: sset('dc', proxhome) retpage = sget('returnpage') redirect('%s/%s' % (retpage, centername))
def index(): # inicializa al base de datos, con el nombre proxdb # la base de datos es la misma para todos los centros de datos 'proxdb' proxdb = MyDataBase('easyproxmox') sset('db', proxdb) return template('main.tpl', dcdb=proxdb)