mirror of
https://github.com/retspen/webvirtcloud
synced 2024-11-01 03:54:15 +00:00
Merge pull request #357 from catborise/master
fixes and getvvfile download option
This commit is contained in:
commit
2fe1f1c73a
4 changed files with 26 additions and 2 deletions
18
appsettings/migrations/0005_auto_20200911_1233.py
Normal file
18
appsettings/migrations/0005_auto_20200911_1233.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.2.14 on 2020-09-11 12:33
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('appsettings', '0004_auto_20200716_0637'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='appsettings',
|
||||
name='choices',
|
||||
field=models.CharField(max_length=70, verbose_name='choices'),
|
||||
),
|
||||
]
|
|
@ -9,5 +9,5 @@ class AppSettings(models.Model):
|
|||
name = models.CharField(_('name'), max_length=25, null=False)
|
||||
key = models.CharField(_('key'), db_index=True, max_length=50, unique=True)
|
||||
value = models.CharField(_('value'), max_length=25)
|
||||
choices = models.CharField(_('choices'), max_length=50)
|
||||
choices = models.CharField(_('choices'), max_length=70)
|
||||
description = models.CharField(_('description'), max_length=100, null=True)
|
||||
|
|
|
@ -156,6 +156,9 @@
|
|||
<a href="#" class="btn btn-success" id="vdi_url">{% trans "VDI" %}</a>
|
||||
</span>
|
||||
</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>
|
||||
{% 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.writelines('[virt-viewer]\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('title=' + conn.domain_name(instance.name) + '\n')
|
||||
response.writelines('password=' + conn.graphics_passwd(instance.name) + '\n')
|
||||
|
|
Loading…
Reference in a new issue