Exemplo n.º 1
0
def home():
    '''
    home page function
    '''
    if 'logged_in' in session:
        return render_template('index.html', containers=lxc.ls(), dist=lwp.check_ubuntu(), templates=lwp.get_templates_list())
    return render_template('login.html')
Exemplo n.º 2
0
def home():
    """
    home page function
    """
    listx = lxc.listx()
    containers_all = []

    for status in ('RUNNING', 'FROZEN', 'STOPPED'):
        containers_by_status = []

        for container in listx[status]:
            container_info = {
                'name': container,
                'settings': lwp.get_container_settings(container, status),
                'memusg': 0,
                'bucket': get_bucket_token(container)
            }

            containers_by_status.append(container_info)
        containers_all.append({
            'status': status.lower(),
            'containers': containers_by_status
        })

    return render_template('index.html',
                           containers=lxc.ls(),
                           containers_all=containers_all,
                           dist=lwp.check_ubuntu(),
                           host=socket.gethostname(),
                           templates=lwp.get_templates_list(),
                           storage_repos=storage_repos,
                           auth=AUTH)
Exemplo n.º 3
0
def home():
    '''
    home page function
    '''

    if 'logged_in' in session:
        listx = lxc.listx()
        containers_all = []

        for status in ['RUNNING', 'FROZEN', 'STOPPED']:
            containers_by_status = []

            for container in listx[status]:
                containers_by_status.append({
                    'name': container,
                    'memusg': lwp.memory_usage(container),
                    'settings': lwp.get_container_settings(container)
                })
            containers_all.append({
                'status': status.lower(),
                'containers': containers_by_status
            })

        return render_template('index.html', containers=lxc.ls(),
                               containers_all=containers_all,
                               dist=lwp.check_ubuntu(),
                               templates=lwp.get_templates_list())
    return render_template('login.html')
Exemplo n.º 4
0
def home():
    '''
    home page function
    '''
    if 'logged_in' in session:

        listx = lxc.listx()
        containers_all = []

        for status in ['RUNNING', 'FROZEN', 'STOPPED']:
            containers_by_status = []

            for container in listx[status]:
                containers_by_status.append({
                    'name':
                    container,
                    'memusg':
                    lwp.memory_usage(container),
                    'settings':
                    lwp.get_container_settings(container)
                })
            containers_all.append({
                'status': status.lower(),
                'containers': containers_by_status
            })

        return render_template('index.html',
                               containers=lxc.ls(),
                               containers_all=containers_all,
                               dist=lwp.check_ubuntu(),
                               templates=lwp.get_templates_list())
    return render_template('login.html')
Exemplo n.º 5
0
def home():
    '''
    home page function
    '''
    if 'logged_in' in session:
        containers = lxc.list_containers(as_object=True)
        listx = {'RUNNING': [], 'FROZEN': [], 'STOPPED': []}
        for container in containers:
            listx[container.state].append(container)
        containers_all = []

        for status in ['RUNNING', 'FROZEN', 'STOPPED']:
            containers_by_status = []

            for container in listx[status]:
                ips = list()
                if status == 'RUNNING':
                    ips = container.get_ips()
                containers_by_status.append({
                    'name': container.name,
                    'ips': ips,
                    'memusg': lwp.memory_usage(container),
                    'settings': lwp.get_container_settings(container)
                })
            containers_all.append({
                'status': status.lower(),
                'containers': containers_by_status
            })

        return render_template('index.html', containers=lxc.list_containers(),
                               containers_all=containers_all,
                               dist=lwp.check_ubuntu(),
                               templates=lwp.get_templates_list())
    return render_template('login.html')
Exemplo n.º 6
0
def home():
    '''
    home page function
    '''
    if 'logged_in' in session:
        return render_template('index.html',
                               containers=lxc.ls(),
                               dist=lwp.check_ubuntu(),
                               templates=lwp.get_templates_list())
    return render_template('login.html')
Exemplo n.º 7
0
def home():
    '''
    home page function
    '''
    if 'logged_in' in session:
        return render_template('index.html',
                               containers=lxc.ls(),
                               dist=lwp.check_ubuntu(),
                               lvm=lwp.host_lvm_usage(vgname=config.get('overview', 'lvmvg')),
                               templates=lwp.get_templates_list())
    return render_template('login.html')
Exemplo n.º 8
0
def home():
    '''
    home page function
    '''
    listx = lxc.listx()
    containers_all = []

    for status in ['RUNNING', 'FROZEN', 'STOPPED']:
        containers_by_status = []

        for container in listx[status]:
            containers_by_status.append({
                'name': container,
                'memusg': lwp.memory_usage(container),
                'settings': lwp.get_container_settings(container),
                'ipv4': lxc.get_ipv4(container),
                'bucket': get_bucket_token(container)
            })
        containers_all.append({
            'status': status.lower(),
            'containers': containers_by_status
        })

    return render_template('index.html', containers=lxc.ls(), containers_all=containers_all, dist=lwp.check_ubuntu(), host=socket.gethostname(), templates=lwp.get_templates_list(), storage_repos=storage_repos, auth=AUTH)
Exemplo n.º 9
0
def home():
    if 'logged_in' in session:
        containers_all = []
        listx = lxc.listx()
        sorted_list = listx['RUNNING'] + listx['FROZEN'] + listx['STOPPED']
        for container in sorted_list:
            status = lxc.info(container)['state']
            containers_all.append({'status':status, 'name':container, 'memusg':lwp.memory_usage(container), 'settings':lwp.get_container_settings(container)})
        return render_template('index.html', containers=lwp.ls(), containers_all=containers_all, dist=lwp.check_ubuntu(), templates=lwp.get_templates_list())
    return render_template('login.html')