示例#1
0
def manage(centername):
    if sislogin():
        proxhome = sget('dc')
        return template('manage.tpl', dcdc=proxhome)
    else:
        sset('returnpage', '/manage')
        redirect('/login/%s' % centername)
示例#2
0
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)
示例#3
0
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))
示例#4
0
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)