Beispiel #1
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')
Beispiel #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)
Beispiel #3
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.name_distro(),
                           host=socket.gethostname(), templates=lwp.get_templates_list(), storage_repos=storage_repos,
                           auth=AUTH)
Beispiel #4
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')
Beispiel #5
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')
Beispiel #6
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})
        clonable_containers = listx["STOPPED"]

    return render_template(
        "index.html",
        containers=lxc.ls(),
        containers_all=containers_all,
        dist=lwp.name_distro(),
        host=socket.gethostname(),
        templates=lwp.get_templates_list(),
        storage_repos=storage_repos,
        auth=AUTH,
        clonable_containers=clonable_containers,
    )
Beispiel #7
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')
Beispiel #8
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')
def home():
    '''
    home page function
    '''
    if 'logged_in' in session:
        if config.has_option('overview', 'lvmvg'):
            lvm = lwp.host_lvm_usage(vgname=config.get('overview', 'lvmvg'))
        else:
            lvm = lwp.host_lvm_usage()
        tmpppath = None
        if config.has_option('templates', 'precreated'):
            tmpppath = config.get('templates', 'precreated')
        return render_template('index.html',
                               containers=lxc.ls(),
                               dist=lwp.check_system_version(),
                               system_version=lwp.check_system_version(True),
                               lvm=lvm,
                               templates=lwp.get_templates_list(),
                               templatesPrecreated=lwp.get_templates_precreated_list(tmpppath))
    return render_template('login.html')
Beispiel #10
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')
Beispiel #11
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)
Beispiel #12
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')
Beispiel #13
0
 def get(self):
     return {'templates': lwp.get_templates_list()}, 200