mirror of
https://github.com/retspen/webvirtcloud
synced 2025-01-12 16:35:17 +00:00
add getvvfile for desktop viewers.(virt-viewer)
This commit is contained in:
parent
82f5fbf159
commit
45e3b00180
2 changed files with 7 additions and 1 deletions
|
@ -156,6 +156,9 @@
|
||||||
<a href="#" class="btn btn-success" id="vdi_url">{% trans "VDI" %}</a>
|
<a href="#" class="btn btn-success" id="vdi_url">{% trans "VDI" %}</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
<p>{% trans "To download console.vv file for virt-viewer." %}</p>
|
||||||
|
<a href="{% url 'instances:getvvfile' instance.id %}" class="btn btn-lg btn-success float-right">{% trans "Get console.vv" %}</a>
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -1164,7 +1164,10 @@ def getvvfile(request, pk):
|
||||||
response = HttpResponse(content='', content_type='application/x-virt-viewer', status=200, reason=None, charset='utf-8')
|
response = HttpResponse(content='', content_type='application/x-virt-viewer', status=200, reason=None, charset='utf-8')
|
||||||
response.writelines('[virt-viewer]\n')
|
response.writelines('[virt-viewer]\n')
|
||||||
response.writelines('type=' + conn.graphics_type(instance.name) + '\n')
|
response.writelines('type=' + conn.graphics_type(instance.name) + '\n')
|
||||||
response.writelines('host=' + conn.graphics_listen(instance.name) + '\n')
|
if conn.graphics_listen(instance.name) == '0.0.0.0':
|
||||||
|
response.writelines('host=' + conn.host + '\n')
|
||||||
|
else:
|
||||||
|
response.writelines('host=' + conn.graphics_listen(instance.name) + '\n')
|
||||||
response.writelines('port=' + conn.graphics_port(instance.name) + '\n')
|
response.writelines('port=' + conn.graphics_port(instance.name) + '\n')
|
||||||
response.writelines('title=' + conn.domain_name(instance.name) + '\n')
|
response.writelines('title=' + conn.domain_name(instance.name) + '\n')
|
||||||
response.writelines('password=' + conn.graphics_passwd(instance.name) + '\n')
|
response.writelines('password=' + conn.graphics_passwd(instance.name) + '\n')
|
||||||
|
|
Loading…
Reference in a new issue