Beispiel #1
0
def images():
    try:
        localImages = LXDModule().listLocalImages()
        profiles = LXDModule().listProfiles()
        remoteImages = LXDModule().listRemoteImages()
        return render_template('images.html',
                               currentpage='Images',
                               localImages=localImages,
                               remoteImages=remoteImages,
                               profiles=profiles,
                               jsData={
                                   'local': json.dumps(localImages),
                                   'remote': json.dumps(remoteImages),
                               },
                               memory=memory(),
                               lxdui_current_version=VERSION)
    except:
        # TODO - log exception
        return render_template('images.html',
                               currentpage='Images',
                               localImages=[],
                               remoteImages=[],
                               profiles=[],
                               jsData={
                                   'local': json.dumps([]),
                                   'remote': json.dumps([]),
                               },
                               memory=memory(),
                               lxdui_current_version=VERSION)
Beispiel #2
0
def getProfiles():
    try:
        profiles = LXDModule().listProfiles()
    except:
        profiles = []

    return profiles
Beispiel #3
0
def getRemotePaesslerImages():
    try:
        remotePaesslerImages = LXDModule().listRemotePaesslerImages()
    except:
        remotePaesslerImages = []

    return remotePaesslerImages
Beispiel #4
0
def getLocalImages():
    try:
        localImages = LXDModule().listLocalImages()
    except:
        localImages = []

    return localImages
Beispiel #5
0
def network():
    try:
        network = LXDModule().listNetworks()
        return render_template('network.html', currentpage='Network',
                               network=network, lxdui_current_version=VERSION)
    except:
        return render_template('network.html', currentpage='Network',
                               network=[], lxdui_current_version=VERSION)
Beispiel #6
0
def storagePools():
    try:
        storagePools = LXDModule().listStoragePools()
        return render_template('storage-pools.html', currentpage='StoragePools',
                               storagePools=storagePools, lxdui_current_version=VERSION)
    except:
        return render_template('storage-pools.html', currentpage='Profiles',
                               storagePools=[], lxdui_current_version=VERSION)
Beispiel #7
0
def profile():
    try:
        profiles = LXDModule().listProfiles()
        return render_template('profiles.html', currentpage='Profiles',
                               profiles=profiles, lxdui_current_version=VERSION)
    except:
        return render_template('profiles.html', currentpage='Profiles',
                               profiles=[], lxdui_current_version=VERSION)
Beispiel #8
0
def getNightlyImages():
    try:
        nightlyImages = LXDModule().listNightlyImages()
        images = []
        for image in nightlyImages:
            images.append(image['metadata'])
        nightlyImages = images
    except:
        nightlyImages = []

    return nightlyImages
Beispiel #9
0
def container():
    try:
        containers = LXDModule().listContainers()
        result = []
        for container in containers:
            result.append(getContainerDetails(container))

        images = LXDModule().listLocalImages()
        profiles = LXDModule().listProfiles()
        return render_template('containers.html', currentpage='Containers',
                               containers=result,
                               images = images,
                               profiles = profiles,
                               memory=memory(),
                               lxdui_current_version=VERSION)
    except:
        return render_template('containers.html', currentpage='Containers',
                               containers=[],
                               images=[],
                               profiles=[],
                               memory=memory(),
                               lxdui_current_version=VERSION)
Beispiel #10
0
def containerDetails(name):
    try:
        container = LXCContainer({'name': name})
        return render_template('container-details.html', currentpage='Container Details',
                               container=container.info(),
                               profiles = getProfiles(),
                               networks = LXDModule().listNetworks(),
                               lxdui_current_version=VERSION)
    except ValueError as ex:
        return render_template('container-details.html', currentpage='Container Details',
                               container=None,
                               name=name,
                               message=ex.__str__(),
                               lxdui_current_version=VERSION)