Display online packages in setup-apps
This commit is contained in:
parent
07a195ab05
commit
ac69aebf4e
@ -4,9 +4,9 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from . import config
|
|
||||||
from . import tools
|
from . import tools
|
||||||
from . import validator
|
from . import validator
|
||||||
|
from .config import Config
|
||||||
|
|
||||||
VERSION = '0.0.1'
|
VERSION = '0.0.1'
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ subjectAltName=DNS:{domain},DNS:*.{domain}"
|
|||||||
class VMMgr:
|
class VMMgr:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# Load JSON configuration
|
# Load JSON configuration
|
||||||
self.conf = config.Config()
|
self.conf = Config()
|
||||||
self.domain = self.conf['host']['domain']
|
self.domain = self.conf['host']['domain']
|
||||||
self.port = self.conf['host']['port']
|
self.port = self.conf['host']['port']
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ from cryptography.hazmat.primitives import hashes
|
|||||||
from cryptography.hazmat.primitives.asymmetric import ec
|
from cryptography.hazmat.primitives.asymmetric import ec
|
||||||
from cryptography.hazmat.primitives.serialization import load_pem_public_key
|
from cryptography.hazmat.primitives.serialization import load_pem_public_key
|
||||||
|
|
||||||
from . import config
|
from .config import Config
|
||||||
|
|
||||||
PUB_FILE = '/srv/vm/packages.pub'
|
PUB_FILE = '/srv/vm/packages.pub'
|
||||||
LXC_ROOT = '/var/lib/lxc'
|
LXC_ROOT = '/var/lib/lxc'
|
||||||
@ -22,7 +22,7 @@ LXC_ROOT = '/var/lib/lxc'
|
|||||||
class PackageManager:
|
class PackageManager:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# Load JSON configuration
|
# Load JSON configuration
|
||||||
self.conf = config.Config()
|
self.conf = Config()
|
||||||
self.repo_url = self.conf['host']['repo']
|
self.repo_url = self.conf['host']['repo']
|
||||||
self.online_packages = {}
|
self.online_packages = {}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ from jinja2 import Environment, FileSystemLoader
|
|||||||
|
|
||||||
from . import VMMgr, CERT_PUB_FILE
|
from . import VMMgr, CERT_PUB_FILE
|
||||||
from . import tools
|
from . import tools
|
||||||
|
from .pkgmgr import PackageManager
|
||||||
from .validator import InvalidValueException
|
from .validator import InvalidValueException
|
||||||
from .wsgilang import WSGILang
|
from .wsgilang import WSGILang
|
||||||
from .wsgisession import WSGISession
|
from .wsgisession import WSGISession
|
||||||
@ -135,7 +136,9 @@ class WSGIApp(object):
|
|||||||
|
|
||||||
def setup_apps_view(self, request):
|
def setup_apps_view(self, request):
|
||||||
# Application manager view.
|
# Application manager view.
|
||||||
return self.render_template('setup-apps.html', request)
|
pkgmgr = PackageManager()
|
||||||
|
pkgmgr.fetch_online_packages()
|
||||||
|
return self.render_template('setup-apps.html', request, online_packages=pkgmgr.online_packages)
|
||||||
|
|
||||||
def update_host_action(self, request):
|
def update_host_action(self, request):
|
||||||
# Update domain and port, then restart nginx
|
# Update domain and port, then restart nginx
|
||||||
|
@ -56,6 +56,31 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="setup-box">
|
||||||
|
<h2>Správce balíků</h2>
|
||||||
|
<p>Vyberte které aplikace mají být nainstalovány nebo aktualizovány z distribučního serveru.</p>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td>Aplikace</td>
|
||||||
|
<td>Nainstalována</td>
|
||||||
|
<td>Stav</td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for pkg in online_packages|sort %}
|
||||||
|
{% if 'title' in online_packages[pkg] %}
|
||||||
|
<tr data-app="{{ pkg }}">
|
||||||
|
<td>{{ online_packages[pkg]['title'] }}</td>
|
||||||
|
<td class="center"><input type="checkbox" class="pkg-installed"{% if pkg in conf['packages'] %} checked{% endif %}></td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="setup-box">
|
<div class="setup-box">
|
||||||
<h2>Správce virtuálního stroje</h2>
|
<h2>Správce virtuálního stroje</h2>
|
||||||
<p>Změna hesla k šifrovanému diskovému oddílu a administračnímu rozhraní.</p>
|
<p>Změna hesla k šifrovanému diskovému oddílu a administračnímu rozhraní.</p>
|
||||||
|
Loading…
Reference in New Issue
Block a user