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

Handle None console type

This commit is contained in:
skyline75489 2020-07-17 20:32:06 +08:00
parent 522b95fe39
commit 0e0521c61f

View file

@ -48,9 +48,12 @@ def console(request):
if ':' in ws_host:
ws_host = re.sub(':[0-9]+', '', ws_host)
console_page = "console-" + console_type + "-" + view_type + ".html"
if console_type == 'vnc' or console_type == 'spice':
console_page = "console-" + console_type + "-" + view_type + ".html"
response = render(request, console_page, locals())
else:
if console_type is None:
console_error = f"Fail to get console. Please check the console configuration of your VM."
else:
console_error = f"Console type: {console_type} no support"
response = render(request, 'console-vnc-lite.html', locals())