update repo action + fixes

This commit is contained in:
Disassembler 2018-10-27 12:49:22 +02:00
parent 94048ba2fe
commit 38524e70af
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
3 changed files with 15 additions and 2 deletions

View File

@ -29,6 +29,7 @@ class PackageManager:
def fetch_online_packages(self): def fetch_online_packages(self):
# Fetches and verifies online packages. Can raise InvalidSignature # Fetches and verifies online packages. Can raise InvalidSignature
self.online_packages = {}
packages = self.get_repo_resource('packages').content packages = self.get_repo_resource('packages').content
packages_sig = self.get_repo_resource('packages.sig').content packages_sig = self.get_repo_resource('packages.sig').content
with open(PUB_FILE, 'rb') as f: with open(PUB_FILE, 'rb') as f:

View File

@ -75,6 +75,7 @@ class WSGIApp(object):
Rule('/verify-http', endpoint='verify_http_action', defaults={'proto': 'http'}), Rule('/verify-http', endpoint='verify_http_action', defaults={'proto': 'http'}),
Rule('/update-cert', endpoint='update_cert_action'), Rule('/update-cert', endpoint='update_cert_action'),
Rule('/update-common', endpoint='update_common_action'), Rule('/update-common', endpoint='update_common_action'),
Rule('/update-repo', endpoint='update_repo_action'),
Rule('/update-app-visibility', endpoint='update_app_visibility_action'), Rule('/update-app-visibility', endpoint='update_app_visibility_action'),
Rule('/update-app-autostart', endpoint='update_app_autostart_action'), Rule('/update-app-autostart', endpoint='update_app_autostart_action'),
Rule('/start-app', endpoint='start_app_action'), Rule('/start-app', endpoint='start_app_action'),
@ -236,6 +237,17 @@ class WSGIApp(object):
return self.render_json({'error': request.session.lang.malformed_request()}) return self.render_json({'error': request.session.lang.malformed_request()})
return self.render_json({'ok': request.session.lang.common_updated()}) return self.render_json({'ok': request.session.lang.common_updated()})
def update_repo_action(self, request):
# Update repository URL and credentials
try:
self.conf['repo']['url'] = request.form['repourl']
self.conf['repo']['user'] = request.form['repousername']
self.conf['repo']['pwd'] = request.form['repopassword']
self.conf.save()
except:
pass
return redirect('/setup-apps')
def update_app_visibility_action(self, request): def update_app_visibility_action(self, request):
# Update application visibility on portal page # Update application visibility on portal page
try: try:

View File

@ -167,7 +167,7 @@ function install_app(ev) {
function uninstall_app(ev) { function uninstall_app(ev) {
var app = $(ev.target).closest('tr').children().first().text() var app = $(ev.target).closest('tr').children().first().text()
if (confirm('Opravdu chcete tuto odinstalovat aplikaci '+app+'?')) { if (confirm('Opravdu chcete odinstalovat aplikaci '+app+'?')) {
return _do_app('uninstall', ev); return _do_app('uninstall', ev);
} }
return false; return false;
@ -184,7 +184,7 @@ function check_progress() {
if (value < 100) { if (value < 100) {
progress.text(parseInt(value)); progress.text(parseInt(value));
} else { } else {
td.text('Instaluje se') td.html('<span id="install-progress">Instaluje se</span>')
} }
} else { } else {
tr.replaceWith(data.ok); tr.replaceWith(data.ok);