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)
def getProfiles(): try: profiles = LXDModule().listProfiles() except: profiles = [] return profiles
def getRemotePaesslerImages(): try: remotePaesslerImages = LXDModule().listRemotePaesslerImages() except: remotePaesslerImages = [] return remotePaesslerImages
def getLocalImages(): try: localImages = LXDModule().listLocalImages() except: localImages = [] return localImages
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)
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)
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)
def getNightlyImages(): try: nightlyImages = LXDModule().listNightlyImages() images = [] for image in nightlyImages: images.append(image['metadata']) nightlyImages = images except: nightlyImages = [] return nightlyImages
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)
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)