1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Additional changes

This commit is contained in:
Bandic007 2018-09-27 11:54:11 +03:00
parent e44e01cad4
commit 40738d7920
17 changed files with 289 additions and 19 deletions

View file

@ -233,7 +233,7 @@
</li>
<li>
<label for="noVNC_setting_host">Host:</label>
<input id="noVNC_setting_host" value="{{ ws_host }}"/>
<input id="noVNC_setting_host" value="{{ ws_host }}{{ ws_path }}"/>
</li>
<li>
<label for="noVNC_setting_port">Port:</label>
@ -332,4 +332,4 @@
<source src="{% static "js/novnc/app/sounds/bell.oga" %}" type="audio/ogg">
<source src="{% static "js/novnc/app/sounds/bell.mp3" %}" type="audio/mpeg">
</audio>
{% endblock %}
{% endblock %}

View file

@ -220,6 +220,7 @@
//var port = WebUtil.getConfigVar('port', window.location.port);
var host = '{{ ws_host }}';
var port = '{{ ws_port }}';
var wspath = '{{ ws_path }}';
// if port == 80 (or 443) then it won't be present and should be
// set manually
@ -263,7 +264,7 @@
url = 'ws';
}
url += '://' + host;
url += '://' + host + wspath;
if(port) {
url += ':' + port;
}

View file

@ -7,6 +7,8 @@ from instances.models import Instance
from vrtManager.instance import wvmInstance
from webvirtcloud.settings import WS_PORT
from webvirtcloud.settings import WS_PUBLIC_HOST
from webvirtcloud.settings import WS_PUBLIC_PORT
from webvirtcloud.settings import WS_PUBLIC_PATH
from libvirt import libvirtError
@ -40,8 +42,9 @@ def console(request):
console_websocket_port = None
console_passwd = None
ws_port = console_websocket_port if console_websocket_port else WS_PORT
ws_port = console_websocket_port if console_websocket_port else WS_PUBLIC_PORT
ws_host = WS_PUBLIC_HOST if WS_PUBLIC_HOST else request.get_host()
ws_path = WS_PUBLIC_PATH if WS_PUBLIC_PATH else '/'
if ':' in ws_host:
ws_host = re.sub(':[0-9]+', '', ws_host)