1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-25 15:45:23 +00:00

Quick fix if console type not support

This commit is contained in:
retspen 2018-05-31 12:38:03 +03:00
parent b533d59e2f
commit dd2830eddb
2 changed files with 6 additions and 1 deletions

View file

@ -121,6 +121,9 @@
function log_info(msg) { function log_info(msg) {
log_message(msg,'info'); log_message(msg,'info');
} }
{% if console_error %}
log_error('{{ console_error|escapejs }}');
{% endif %}
</script> </script>
{% block foot %}{% endblock %} {% block foot %}{% endblock %}

View file

@ -16,6 +16,7 @@ def console(request):
:param request: :param request:
:return: :return:
""" """
console_error = None
if request.method == 'GET': if request.method == 'GET':
token = request.GET.get('token', '') token = request.GET.get('token', '')
@ -49,7 +50,8 @@ def console(request):
elif console_type == 'spice': elif console_type == 'spice':
response = render(request, 'console-spice.html', locals()) response = render(request, 'console-spice.html', locals())
else: else:
response = "Console type %s no support" % console_type console_error = "Console type: %s no support" % console_type
response = render(request, 'console-vnc.html', locals())
response.set_cookie('token', token) response.set_cookie('token', token)
return response return response